From 0d9abc81a7dd9e628445472b478fa23926f71216 Mon Sep 17 00:00:00 2001
From: lishuai <260038442@qq.com>
Date: 星期四, 14 十二月 2023 14:39:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/parks/EventParkDataRequest.java | 6
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java | 80 ++++
server/dmvisit_service/src/main/java/com/doumee/dao/business/model/UserAction.java | 66 ++++
db/business.user_action.permissions.sql | 6
server/dmvisit_admin/src/main/java/com/doumee/api/UserActionController.java | 90 +++++
src/main/java/com/doumee/dao/business/model/UserAction.java | 66 ++++
server/db/business.user_action.permissions.sql | 6
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java | 139 ++++++++
src/main/java/com/doumee/dao/business/UserActionMapper.java | 12
coderd.json | 12
server/dmvisit_service/src/main/java/com/doumee/service/business/UserActionService.java | 97 ++++++
server/dmvisit_service/src/main/java/com/doumee/dao/business/CarEventMapper.java | 3
server/dmvisit_service/src/main/java/com/doumee/dao/business/model/CarEvent.java | 6
src/main/java/com/doumee/api/business/UserActionController.java | 90 +++++
server/dmvisit_service/src/main/java/com/doumee/dao/business/UserActionMapper.java | 12
src/main/java/com/doumee/service/business/UserActionService.java | 97 ++++++
src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java | 139 ++++++++
17 files changed, 921 insertions(+), 6 deletions(-)
diff --git a/coderd.json b/coderd.json
index 9e26dfe..93bc26c 100644
--- a/coderd.json
+++ b/coderd.json
@@ -1 +1,11 @@
-{}
\ No newline at end of file
+{
+ "project": 6594,
+ "template": {
+ "alias": "eva",
+ "command": "interface",
+ "versionNo": "v2.2.7",
+ "option": {
+ "resources": "user_action"
+ }
+ }
+}
\ No newline at end of file
diff --git a/db/business.user_action.permissions.sql b/db/business.user_action.permissions.sql
new file mode 100644
index 0000000..1121907
--- /dev/null
+++ b/db/business.user_action.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:create', '鏂板缓浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:delete', '鍒犻櫎浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:update', '淇敼浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:query', '鏌ヨ浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:exportExcel', '瀵煎嚭浜哄憳鎿嶄綔璁板綍鏃ュ織(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.user_action.permissions.sql b/server/db/business.user_action.permissions.sql
new file mode 100644
index 0000000..1121907
--- /dev/null
+++ b/server/db/business.user_action.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:create', '鏂板缓浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:delete', '鍒犻櫎浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:update', '淇敼浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:query', '鏌ヨ浜哄憳鎿嶄綔璁板綍鏃ュ織', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:exportExcel', '瀵煎嚭浜哄憳鎿嶄綔璁板綍鏃ュ織(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/dmvisit_admin/src/main/java/com/doumee/api/UserActionController.java b/server/dmvisit_admin/src/main/java/com/doumee/api/UserActionController.java
new file mode 100644
index 0000000..f063a5a
--- /dev/null
+++ b/server/dmvisit_admin/src/main/java/com/doumee/api/UserActionController.java
@@ -0,0 +1,90 @@
+package com.doumee.api;
+
+import com.doumee.api.BaseController;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.dao.business.model.UserAction;
+import com.doumee.service.business.UserActionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:57
+ */
+@Api(tags = "浜哄憳鎿嶄綔璁板綍鏃ュ織")
+@RestController
+@RequestMapping("/business/userAction")
+public class UserActionController extends BaseController {
+
+ @Autowired
+ private UserActionService userActionService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @RequiresPermissions("business:useraction:create")
+ public ApiResponse create(@RequestBody UserAction userAction) {
+ return ApiResponse.success(userActionService.create(userAction));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @RequiresPermissions("business:useraction:delete")
+ public ApiResponse deleteById(@PathVariable Integer id) {
+ userActionService.deleteById(id);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @RequiresPermissions("business:useraction:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ userActionService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @RequiresPermissions("business:useraction:update")
+ public ApiResponse updateById(@RequestBody UserAction userAction) {
+ userActionService.updateById(userAction);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @RequiresPermissions("business:useraction:query")
+ public ApiResponse<PageData<UserAction>> findPage (@RequestBody PageWrap<UserAction> pageWrap) {
+ return ApiResponse.success(userActionService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @RequiresPermissions("business:useraction:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<UserAction> pageWrap, HttpServletResponse response) {
+ ExcelExporter.build(UserAction.class).export(userActionService.findPage(pageWrap).getRecords(), "浜哄憳鎿嶄綔璁板綍鏃ュ織", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @RequiresPermissions("business:useraction:query")
+ public ApiResponse findById(@PathVariable Integer id) {
+ return ApiResponse.success(userActionService.findById(id));
+ }
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/parks/EventParkDataRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/parks/EventParkDataRequest.java
index 13da555..6e7d72e 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/parks/EventParkDataRequest.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/parks/EventParkDataRequest.java
@@ -2,9 +2,13 @@
import lombok.Data;
+import java.math.BigDecimal;
+
@Data
public class EventParkDataRequest {
private Integer alarmCar ;// Number 鏄惁榛戝悕鍗曟爣璇嗭紙1-榛戝悕鍗� 0-闈為粦鍚嶅崟锛� 鍚�
+
+ private String carAttributeName ;// String 杞﹁締灞炴�у悕绉� 鍚� 64
private String cardNo ;// String 鍗″彿 鍚� 16
private Integer eventCmd;// Number 浜嬩欢鍙� 鏄� 1:鍘嬬嚎浜嬩欢2:涓婁紶鍥剧墖3:鍏ュ満4:鍑哄満5:杞︾墝鐭6:鍥剧墖閲嶄紶
private String eventIndex;// String 浜嬩欢缂栧彿 鏄� 64
@@ -16,7 +20,7 @@
private String parkName ;// String 鍋滆溅搴撳悕绉� 鏄� 64
private EventParkPicRequest picUrl ;//Object 鍚�
private String svrIndex;// String 鍥剧墖鏈嶅姟鍣ㄧ紪鍙� 鍚� 32
- private Integer plateBelieve ;//Number 杞︾墝缃俊搴� 鏄� 鍙栧�艰寖鍥达細0鈥�100
+ private BigDecimal plateBelieve ;//Number 杞︾墝缃俊搴� 鏄� 鍙栧�艰寖鍥达細0鈥�100
private Integer plateColor ;//Number 杞︾墝棰滆壊 鏄� 鍙傝闄勫綍A.15 杞︾墝棰滆壊
private String plateNo ;//String 杞︾墝鍙� 鏄� 32
private Integer plateType;// Number 杞︾墝绫诲瀷 鏄� 鍙傝闄勫綍A.14 杞︾墝绫诲瀷
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/CarEventMapper.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/CarEventMapper.java
index f3f07e0..f502dbe 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/CarEventMapper.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/CarEventMapper.java
@@ -3,10 +3,13 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.CarEvent;
+import java.util.List;
+
/**
* @author 姹熻箘韫�
* @date 2023/11/30 15:33
*/
public interface CarEventMapper extends BaseMapper<CarEvent> {
+ void insertBatchSomeColumn(List<CarEvent> list);
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/UserActionMapper.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/UserActionMapper.java
new file mode 100644
index 0000000..f5d61e0
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/UserActionMapper.java
@@ -0,0 +1,12 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.UserAction;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:57
+ */
+public interface UserActionMapper extends BaseMapper<UserAction> {
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/CarEvent.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/CarEvent.java
index f229bba..8ea4fb6 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/CarEvent.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/CarEvent.java
@@ -71,7 +71,7 @@
@ApiModelProperty(value = "浜嬩欢绫诲瀷")
@ExcelColumn(name="浜嬩欢绫诲瀷")
- private String eventType;
+ private Integer eventType;
@ApiModelProperty(value = "浜嬩欢绫诲瀷鍚嶇О")
@TableField(exist = false)
@@ -83,7 +83,7 @@
@ApiModelProperty(value = "鑴夊啿瓒呮椂鏃堕棿")
@ExcelColumn(name="鑴夊啿瓒呮椂鏃堕棿")
- private String timeout;
+ private Integer timeout;
@ApiModelProperty(value = "浜嬩欢鍙戠敓鏃堕棿锛堣澶囨椂闂�")
@ExcelColumn(name="浜嬩欢鍙戠敓鏃堕棿锛堣澶囨椂闂�")
@@ -163,7 +163,7 @@
@ApiModelProperty(value = "杞︾墝棰滆壊")
@ExcelColumn(name="杞︾墝棰滆壊")
- private String plateColor;
+ private Integer plateColor;
@ApiModelProperty(value = "杞︾墝缃俊搴�", example = "1")
@ExcelColumn(name="杞︾墝缃俊搴�")
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/UserAction.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/UserAction.java
new file mode 100644
index 0000000..b322539
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/UserAction.java
@@ -0,0 +1,66 @@
+package com.doumee.dao.business.model;
+
+import com.doumee.core.annotation.excel.ExcelColumn;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+
+/**
+ * 浜哄憳鎿嶄綔璁板綍鏃ュ織
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:57
+ */
+@Data
+@ApiModel("浜哄憳鎿嶄綔璁板綍鏃ュ織")
+@TableName("`user_action`")
+public class UserAction {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "绫诲瀷 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎", example = "1")
+ @ExcelColumn(name="绫诲瀷 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎")
+ private Integer type;
+
+ @ApiModelProperty(value = "浜哄憳鎿嶄綔璁板綍鏃ュ織")
+ @ExcelColumn(name="浜哄憳鎿嶄綔璁板綍鏃ュ織")
+ private String memberId;
+
+ @ApiModelProperty(value = "鎿嶄綔鍓嶇姸鎬� 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎", example = "1")
+ @ExcelColumn(name="鎿嶄綔鍓嶇姸鎬� 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎")
+ private Integer beforeStatus;
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/UserActionService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/UserActionService.java
new file mode 100644
index 0000000..c2dc56f
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/UserActionService.java
@@ -0,0 +1,97 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.UserAction;
+import java.util.List;
+
+/**
+ * 浜哄憳鎿嶄綔璁板綍鏃ュ織Service瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:57
+ */
+public interface UserActionService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(UserAction userAction);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ */
+ void delete(UserAction userAction);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ */
+ void updateById(UserAction userAction);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param userActions 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<UserAction> userActions);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return UserAction
+ */
+ UserAction findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return UserAction
+ */
+ UserAction findOne(UserAction userAction);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return List<UserAction>
+ */
+ List<UserAction> findList(UserAction userAction);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<UserAction>
+ */
+ PageData<UserAction> findPage(PageWrap<UserAction> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(UserAction userAction);
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java
new file mode 100644
index 0000000..9069152
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java
@@ -0,0 +1,139 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.UserActionMapper;
+import com.doumee.dao.business.model.UserAction;
+import com.doumee.service.business.UserActionService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+/**
+ * 浜哄憳鎿嶄綔璁板綍鏃ュ織Service瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:57
+ */
+@Service
+public class UserActionServiceImpl implements UserActionService {
+
+ @Autowired
+ private UserActionMapper userActionMapper;
+
+ @Override
+ public Integer create(UserAction userAction) {
+ userActionMapper.insert(userAction);
+ return userAction.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ userActionMapper.deleteById(id);
+ }
+
+ @Override
+ public void delete(UserAction userAction) {
+ UpdateWrapper<UserAction> deleteWrapper = new UpdateWrapper<>(userAction);
+ userActionMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ userActionMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(UserAction userAction) {
+ userActionMapper.updateById(userAction);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<UserAction> userActions) {
+ if (CollectionUtils.isEmpty(userActions)) {
+ return;
+ }
+ for (UserAction userAction: userActions) {
+ this.updateById(userAction);
+ }
+ }
+
+ @Override
+ public UserAction findById(Integer id) {
+ return userActionMapper.selectById(id);
+ }
+
+ @Override
+ public UserAction findOne(UserAction userAction) {
+ QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction);
+ return userActionMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<UserAction> findList(UserAction userAction) {
+ QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction);
+ return userActionMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<UserAction> findPage(PageWrap<UserAction> pageWrap) {
+ IPage<UserAction> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ QueryWrapper<UserAction> queryWrapper = new QueryWrapper<>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ if (pageWrap.getModel().getId() != null) {
+ queryWrapper.lambda().eq(UserAction::getId, pageWrap.getModel().getId());
+ }
+ if (pageWrap.getModel().getCreator() != null) {
+ queryWrapper.lambda().eq(UserAction::getCreator, pageWrap.getModel().getCreator());
+ }
+ if (pageWrap.getModel().getCreateDate() != null) {
+ queryWrapper.lambda().ge(UserAction::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
+ queryWrapper.lambda().le(UserAction::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
+ }
+ if (pageWrap.getModel().getEditor() != null) {
+ queryWrapper.lambda().eq(UserAction::getEditor, pageWrap.getModel().getEditor());
+ }
+ if (pageWrap.getModel().getEditDate() != null) {
+ queryWrapper.lambda().ge(UserAction::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
+ queryWrapper.lambda().le(UserAction::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
+ }
+ if (pageWrap.getModel().getIsdeleted() != null) {
+ queryWrapper.lambda().eq(UserAction::getIsdeleted, pageWrap.getModel().getIsdeleted());
+ }
+ if (pageWrap.getModel().getRemark() != null) {
+ queryWrapper.lambda().eq(UserAction::getRemark, pageWrap.getModel().getRemark());
+ }
+ if (pageWrap.getModel().getType() != null) {
+ queryWrapper.lambda().eq(UserAction::getType, pageWrap.getModel().getType());
+ }
+ if (pageWrap.getModel().getMemberId() != null) {
+ queryWrapper.lambda().eq(UserAction::getMemberId, pageWrap.getModel().getMemberId());
+ }
+ if (pageWrap.getModel().getBeforeStatus() != null) {
+ queryWrapper.lambda().eq(UserAction::getBeforeStatus, pageWrap.getModel().getBeforeStatus());
+ }
+ for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+ if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+ queryWrapper.orderByDesc(sortData.getProperty());
+ } else {
+ queryWrapper.orderByAsc(sortData.getProperty());
+ }
+ }
+ return PageData.from(userActionMapper.selectPage(page, queryWrapper));
+ }
+
+ @Override
+ public long count(UserAction userAction) {
+ QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction);
+ return userActionMapper.selectCount(wrapper);
+ }
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index 2ca62e8..c8884e4 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -8,6 +8,7 @@
import com.doumee.core.haikang.model.param.request.event.acs.EventAcsInfoRequest;
import com.doumee.core.haikang.model.param.request.event.acs.EventAcsRequest;
import com.doumee.core.haikang.model.param.request.event.acs.EventDeviceDataRequest;
+import com.doumee.core.haikang.model.param.request.event.parks.EventParkInfoRequest;
import com.doumee.core.haikang.model.param.request.event.parks.EventParkRequest;
import com.doumee.core.haikang.model.param.request.event.visit.EventVisitDataRequest;
import com.doumee.core.haikang.model.param.request.event.visit.EventVisitInfoRequest;
@@ -399,7 +400,23 @@
String result = null;
log.info("銆愭捣搴峰仠杞﹀満浜嬩欢鎺ㄩ�併��========寮�濮�=========锛歕n"+JSONObject.toJSONString(param));
try {
-
+ if(param == null || param.getParams() == null || param.getParams().getEvents()==null){
+ return null;
+ }
+ //闂ㄧ浜嬩欢闆嗗悎
+ List<EventParkInfoRequest> events = param.getParams().getEvents();
+ List<CarEvent> list = new ArrayList<>();
+ for(EventParkInfoRequest request : events){
+ if(request.getData() ==null ||StringUtils.isBlank(request.getData().getPlateNo())){
+ continue;
+ }
+ //灏佽浜嬩欢淇℃伅琛ㄥ璞�
+ list.add(getParkEventModelByRequest(request));
+ }
+ if(list.size()>0){
+ //鎻掑叆闂ㄧ璁板綍
+ carEventMapper.insertBatchSomeColumn(list);
+ }
log.error("銆愭捣搴峰仠杞﹀満浜嬩欢鎺ㄩ�併��========鎴愬姛=======");
}catch (Exception e){
@@ -409,6 +426,67 @@
return null;
}
+ /**
+ * 鏍规嵁鎺ㄩ�佹暟鎹皝瑁呭仠杞︿簨浠跺璞′俊鎭�
+ * @param request
+ * @return
+ */
+ private CarEvent getParkEventModelByRequest(EventParkInfoRequest request) {
+ CarEvent event = new CarEvent();
+ event.setIsdeleted(Constants.ZERO);
+ event.setCreateDate(DateUtil.getISO8601DateByStr(request.getHappenTime()));
+ event.setVehicleType(request.getData().getVehicleType());
+ event.setVehicleColor(request.getData().getVehicleColor());
+ event.setVehicleClass(request.getData().getVehicleClass());
+ event.setTimestr(request.getData().getTime());
+ event.setTimeout(request.getTimeout());
+ event.setSvrIndex(request.getSrcIndex());
+ event.setSubModel(request.getData().getSubModel());
+ event.setSubLogo(request.getData().getSubLogo());
+ event.setStatus(request.getStatus());
+ event.setSrcType(request.getSrcType());
+ event.setSrcParentIndex(request.getSrcParentIndex());
+ event.setSrcName(request.getSrcName());
+ event.setSrcIndex(request.getSrcIndex());
+ event.setRoadwayType(request.getData().getRoadwayType());
+ event.setRoadwayName(request.getData().getRoadwayName());
+ event.setRoadwayIndex(request.getData().getRoadwayIndex());
+ event.setPlateType(request.getData().getPlateType());
+ event.setTimeout(request.getTimeout());
+ event.setPlateNos(request.getData().getPlateNo());
+ event.setPlateColor(request.getData().getPlateColor());
+ event.setPlateBelieve(request.getData().getPlateBelieve());
+ event.setParkName(request.getData().getParkName());
+ event.setParkIndex(request.getData().getParkIndex());
+ event.setMainLogo(request.getData().getMainLogo());
+ event.setInoutType(request.getData().getInoutType());
+ event.setHappenTime(request.getHappenTime());
+ event.setGateName(request.getData().getGateName());
+ event.setGateIndex(request.getData().getGateIndex());
+ event.setEventType(request.getEventType());
+ event.setEventIndex(request.getData().getEventIndex());
+ event.setEventCmd(request.getData().getEventCmd());
+ event.setCardNo(request.getData().getCardNo());
+ event.setCarAttributeName(request.getData().getCarAttributeName());
+ if(request.getData().getInResult()!=null && request.getData().getInResult().getRlsResult() !=null ){
+ //鏀捐鏂瑰紡
+ event.setReleaseWay(request.getData().getInResult().getRlsResult().getReleaseWay());
+ event.setReleaseAuth(request.getData().getInResult().getRlsResult().getReleaseAuth());
+ event.setReleaseReason(request.getData().getInResult().getRlsResult().getReleaseReason());
+ event.setReleaseResult(request.getData().getInResult().getRlsResult().getReleaseResult());
+ event.setReleaseResultEx(request.getData().getInResult().getRlsResult().getReleaseResultEx());
+ }
+
+ if(request.getData().getPicUrl()!=null){
+ //杞﹁締鍜屽拰杞︾墝鐓х墖
+ event.setVehiclePicUrl(getHkImgUrl(request.getData().getPicUrl().getVehiclePicUrl()));
+ event.setPlatePicUrl(getHkImgUrl(request.getData().getPicUrl().getPlatePicUrl()));
+ }
+
+ return event;
+
+ }
+
private void saveInterfaceLog(Object param, String path,String result) {
InterfaceLog hkMonitoryLogDO=new InterfaceLog();
hkMonitoryLogDO.setType(1);
diff --git a/src/main/java/com/doumee/api/business/UserActionController.java b/src/main/java/com/doumee/api/business/UserActionController.java
new file mode 100644
index 0000000..da861e5
--- /dev/null
+++ b/src/main/java/com/doumee/api/business/UserActionController.java
@@ -0,0 +1,90 @@
+package com.doumee.api.business;
+
+import com.doumee.api.BaseController;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.dao.business.model.UserAction;
+import com.doumee.service.business.UserActionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:55
+ */
+@Api(tags = "浜哄憳鎿嶄綔璁板綍鏃ュ織")
+@RestController
+@RequestMapping("/business/userAction")
+public class UserActionController extends BaseController {
+
+ @Autowired
+ private UserActionService userActionService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @RequiresPermissions("business:useraction:create")
+ public ApiResponse create(@RequestBody UserAction userAction) {
+ return ApiResponse.success(userActionService.create(userAction));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @RequiresPermissions("business:useraction:delete")
+ public ApiResponse deleteById(@PathVariable Integer id) {
+ userActionService.deleteById(id);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @RequiresPermissions("business:useraction:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ userActionService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @RequiresPermissions("business:useraction:update")
+ public ApiResponse updateById(@RequestBody UserAction userAction) {
+ userActionService.updateById(userAction);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @RequiresPermissions("business:useraction:query")
+ public ApiResponse<PageData<UserAction>> findPage (@RequestBody PageWrap<UserAction> pageWrap) {
+ return ApiResponse.success(userActionService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @RequiresPermissions("business:useraction:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<UserAction> pageWrap, HttpServletResponse response) {
+ ExcelExporter.build(UserAction.class).export(userActionService.findPage(pageWrap).getRecords(), "浜哄憳鎿嶄綔璁板綍鏃ュ織", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @RequiresPermissions("business:useraction:query")
+ public ApiResponse findById(@PathVariable Integer id) {
+ return ApiResponse.success(userActionService.findById(id));
+ }
+}
diff --git a/src/main/java/com/doumee/dao/business/UserActionMapper.java b/src/main/java/com/doumee/dao/business/UserActionMapper.java
new file mode 100644
index 0000000..0345734
--- /dev/null
+++ b/src/main/java/com/doumee/dao/business/UserActionMapper.java
@@ -0,0 +1,12 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.UserAction;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:55
+ */
+public interface UserActionMapper extends BaseMapper<UserAction> {
+
+}
diff --git a/src/main/java/com/doumee/dao/business/model/UserAction.java b/src/main/java/com/doumee/dao/business/model/UserAction.java
new file mode 100644
index 0000000..cbb4fc1
--- /dev/null
+++ b/src/main/java/com/doumee/dao/business/model/UserAction.java
@@ -0,0 +1,66 @@
+package com.doumee.dao.business.model;
+
+import com.doumee.core.annotation.excel.ExcelColumn;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+
+/**
+ * 浜哄憳鎿嶄綔璁板綍鏃ュ織
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:55
+ */
+@Data
+@ApiModel("浜哄憳鎿嶄綔璁板綍鏃ュ織")
+@TableName("`user_action`")
+public class UserAction {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "绫诲瀷 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎", example = "1")
+ @ExcelColumn(name="绫诲瀷 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎")
+ private Integer type;
+
+ @ApiModelProperty(value = "浜哄憳鎿嶄綔璁板綍鏃ュ織")
+ @ExcelColumn(name="浜哄憳鎿嶄綔璁板綍鏃ュ織")
+ private String memberId;
+
+ @ApiModelProperty(value = "鎿嶄綔鍓嶇姸鎬� 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎", example = "1")
+ @ExcelColumn(name="鎿嶄綔鍓嶇姸鎬� 0瑙e喕 1鍐荤粨 2鎷夐粦 3鎭㈠ 4璁句负鎷滆浜� 5鍙栨秷鎷滆浜� 6璁句负楂樼骇瀹℃壒浜� 7鍙栨秷楂樼骇瀹℃壒浜� 8鎵嬪姩绂诲満 9鍒犻櫎")
+ private Integer beforeStatus;
+
+}
diff --git a/src/main/java/com/doumee/service/business/UserActionService.java b/src/main/java/com/doumee/service/business/UserActionService.java
new file mode 100644
index 0000000..355ee27
--- /dev/null
+++ b/src/main/java/com/doumee/service/business/UserActionService.java
@@ -0,0 +1,97 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.UserAction;
+import java.util.List;
+
+/**
+ * 浜哄憳鎿嶄綔璁板綍鏃ュ織Service瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:55
+ */
+public interface UserActionService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(UserAction userAction);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ */
+ void delete(UserAction userAction);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ */
+ void updateById(UserAction userAction);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param userActions 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<UserAction> userActions);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return UserAction
+ */
+ UserAction findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return UserAction
+ */
+ UserAction findOne(UserAction userAction);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return List<UserAction>
+ */
+ List<UserAction> findList(UserAction userAction);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<UserAction>
+ */
+ PageData<UserAction> findPage(PageWrap<UserAction> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param userAction 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(UserAction userAction);
+}
diff --git a/src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java b/src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java
new file mode 100644
index 0000000..fc2e4af
--- /dev/null
+++ b/src/main/java/com/doumee/service/business/impl/UserActionServiceImpl.java
@@ -0,0 +1,139 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.UserActionMapper;
+import com.doumee.dao.business.model.UserAction;
+import com.doumee.service.business.UserActionService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+/**
+ * 浜哄憳鎿嶄綔璁板綍鏃ュ織Service瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2023/12/14 13:55
+ */
+@Service
+public class UserActionServiceImpl implements UserActionService {
+
+ @Autowired
+ private UserActionMapper userActionMapper;
+
+ @Override
+ public Integer create(UserAction userAction) {
+ userActionMapper.insert(userAction);
+ return userAction.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ userActionMapper.deleteById(id);
+ }
+
+ @Override
+ public void delete(UserAction userAction) {
+ UpdateWrapper<UserAction> deleteWrapper = new UpdateWrapper<>(userAction);
+ userActionMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ userActionMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(UserAction userAction) {
+ userActionMapper.updateById(userAction);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<UserAction> userActions) {
+ if (CollectionUtils.isEmpty(userActions)) {
+ return;
+ }
+ for (UserAction userAction: userActions) {
+ this.updateById(userAction);
+ }
+ }
+
+ @Override
+ public UserAction findById(Integer id) {
+ return userActionMapper.selectById(id);
+ }
+
+ @Override
+ public UserAction findOne(UserAction userAction) {
+ QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction);
+ return userActionMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<UserAction> findList(UserAction userAction) {
+ QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction);
+ return userActionMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<UserAction> findPage(PageWrap<UserAction> pageWrap) {
+ IPage<UserAction> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ QueryWrapper<UserAction> queryWrapper = new QueryWrapper<>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ if (pageWrap.getModel().getId() != null) {
+ queryWrapper.lambda().eq(UserAction::getId, pageWrap.getModel().getId());
+ }
+ if (pageWrap.getModel().getCreator() != null) {
+ queryWrapper.lambda().eq(UserAction::getCreator, pageWrap.getModel().getCreator());
+ }
+ if (pageWrap.getModel().getCreateDate() != null) {
+ queryWrapper.lambda().ge(UserAction::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
+ queryWrapper.lambda().le(UserAction::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
+ }
+ if (pageWrap.getModel().getEditor() != null) {
+ queryWrapper.lambda().eq(UserAction::getEditor, pageWrap.getModel().getEditor());
+ }
+ if (pageWrap.getModel().getEditDate() != null) {
+ queryWrapper.lambda().ge(UserAction::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
+ queryWrapper.lambda().le(UserAction::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
+ }
+ if (pageWrap.getModel().getIsdeleted() != null) {
+ queryWrapper.lambda().eq(UserAction::getIsdeleted, pageWrap.getModel().getIsdeleted());
+ }
+ if (pageWrap.getModel().getRemark() != null) {
+ queryWrapper.lambda().eq(UserAction::getRemark, pageWrap.getModel().getRemark());
+ }
+ if (pageWrap.getModel().getType() != null) {
+ queryWrapper.lambda().eq(UserAction::getType, pageWrap.getModel().getType());
+ }
+ if (pageWrap.getModel().getMemberId() != null) {
+ queryWrapper.lambda().eq(UserAction::getMemberId, pageWrap.getModel().getMemberId());
+ }
+ if (pageWrap.getModel().getBeforeStatus() != null) {
+ queryWrapper.lambda().eq(UserAction::getBeforeStatus, pageWrap.getModel().getBeforeStatus());
+ }
+ for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+ if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+ queryWrapper.orderByDesc(sortData.getProperty());
+ } else {
+ queryWrapper.orderByAsc(sortData.getProperty());
+ }
+ }
+ return PageData.from(userActionMapper.selectPage(page, queryWrapper));
+ }
+
+ @Override
+ public long count(UserAction userAction) {
+ QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction);
+ return userActionMapper.selectCount(wrapper);
+ }
+}
--
Gitblit v1.9.3