7 Revīzijas f189e33240 ... 3c7b215d29

Autors SHA1 Ziņojums Datums
  lin.liu 3c7b215d29 隐患检查 1 nedēļu atpakaļ
  lin.liu 9252db73fa 我的检查 1 nedēļu atpakaļ
  lin.liu c91234dddd 查询隐患检查单 1 nedēļu atpakaļ
  lin.liu 171b619e60 提交和查询隐患检查 1 nedēļu atpakaļ
  lin.liu d70a69ba51 修改数据库 1 nedēļu atpakaļ
  lin.liu 3f7972a5bc 隐患检查 1 nedēļu atpakaļ
  lin.liu b7ed105a5b 隐患检查 1 nedēļu atpakaļ
74 mainītis faili ar 1231 papildinājumiem un 621 dzēšanām
  1. 6 0
      secure-producting-business/pom.xml
  2. 32 29
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRecordController.java
  3. 10 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/CheckRecordPO.java
  4. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/QuartzTaskErrorPO.java
  5. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/QuartzTaskInfoPO.java
  6. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/QuartzTaskRecordPO.java
  7. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/StatisticsUserLoginPO.java
  8. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/SysTotalStatisticsPO.java
  9. 30 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/bo/GridCheckFormBo.java
  10. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/QuartzTaskErrorVO.java
  11. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/QuartzTaskInfoVO.java
  12. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/QuartzTaskRecordVO.java
  13. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/StatisticsUserLoginVO.java
  14. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/SysTotalStatisticsVO.java
  15. 3 7
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkrecord/ReqCreateCheckRecord.java
  16. 2 6
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkrecorditem/ReqCreateCheckRecordItem.java
  17. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskerror/ReqCreateQuartzTaskError.java
  18. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskerror/ReqModifyQuartzTaskError.java
  19. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskinfo/ReqCreateQuartzTaskInfo.java
  20. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskinfo/ReqModifyQuartzTaskInfo.java
  21. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskinfo/ReqRunTaskRightNow.java
  22. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskrecord/ReqCreateQuartzTaskRecord.java
  23. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskrecord/ReqModifyQuartzTaskRecord.java
  24. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/statisticsuserlogin/ReqCreateStatisticsUserLogin.java
  25. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/statisticsuserlogin/ReqModifyStatisticsUserLogin.java
  26. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/systotalstatistics/ReqCreateSysTotalStatistics.java
  27. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/systotalstatistics/ReqModifySysTotalStatistics.java
  28. 2 6
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResListGrid4User.java
  29. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/statistics/ResNearMonthUserLogin.java
  30. 13 3
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchCheckRecord.java
  31. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchQuartzTaskError.java
  32. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchQuartzTaskInfo.java
  33. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchQuartzTaskRecord.java
  34. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchStatisticsUserCount.java
  35. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchStatisticsUserLogin.java
  36. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchSysTotalStatistics.java
  37. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/QuartzTaskErrorMapper.java
  38. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/QuartzTaskInfoMapper.java
  39. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/QuartzTaskRecordMapper.java
  40. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/StatisticsUserLoginMapper.java
  41. 2 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/SysTotalStatisticsMapper.java
  42. 34 16
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRecordMapperImpl.java
  43. 14 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/GridPersonMapperImpl.java
  44. 4 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/QuartzTaskErrorMapperImpl.java
  45. 4 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/QuartzTaskInfoMapperImpl.java
  46. 4 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/QuartzTaskRecordMapperImpl.java
  47. 4 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/StatisticsUserLoginMapperImpl.java
  48. 4 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/SysTotalStatisticsMapperImpl.java
  49. 27 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/quartz/QuartzExecutor.java
  50. 4 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/quartz/QuartzMainJobFactory.java
  51. 225 136
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckRecordService.java
  52. 17 17
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/QuartzService.java
  53. 7 7
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/StatisticsService.java
  54. 4 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/UserStatisticsService.java
  55. 13 13
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/PagerResult.java
  56. 11 4
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/ECheckFormStatus.java
  57. 3 0
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/ECheckResult.java
  58. 0 69
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/EPatrolPlanState.java
  59. 0 71
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/EPatrolResult.java
  60. 20 24
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/ERectifyStatus.java
  61. 0 67
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/EVisitingApplyState.java
  62. 3 3
      secure-producting-host/src/main/java/com/customs/cq/datacenter/host/web/controller/statistics/StatisticsController.java
  63. 9 9
      secure-producting-host/src/main/java/com/customs/cq/datacenter/host/web/controller/system/QuartzController.java
  64. 1 1
      secure-producting-host/src/test/java/com/customs/cq/datacenter/host/GenCodeRun.java
  65. 1 1
      secure-producting-host/src/test/java/com/customs/cq/datacenter/host/UserStatisticsTest.java
  66. 0 6
      secure-producting-system/pom.xml
  67. 15 1
      secure-producting-system/src/main/java/com/customs/cq/datacenter/system/service/SysLoginService.java
  68. 18 0
      secure-producting-vue/src/api/form/DangerCheckRecord.js
  69. 7 1
      secure-producting-vue/src/router/index.js
  70. 562 0
      secure-producting-vue/src/views/check/DangerCheckRecordMine.vue
  71. 51 35
      secure-producting-vue/src/views/form/DangerCheckRecord.vue
  72. 11 4
      secure-producting-vue/src/views/grid/components/MyGridAndCheck.vue
  73. 11 10
      secure-producting-vue/src/views/grid/components/SubmitDangerCheck.vue
  74. 2 0
      sql/20240814.sql

+ 6 - 0
secure-producting-business/pom.xml

@@ -24,5 +24,11 @@
             <artifactId>secure-producting-system</artifactId>
         </dependency>
         <!--==================================== 项目自身模块 - end ====================================-->
+
+        <!--quartz依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 32 - 29
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRecordController.java

@@ -24,20 +24,23 @@ package com.customs.cq.datacenter.business.controller;
 
 import com.customs.cq.datacenter.business.domain.vo.CheckRecordVO;
 import com.customs.cq.datacenter.business.entity.request.checkrecord.ReqCreateCheckRecord;
-import com.customs.cq.datacenter.business.entity.request.checkrecord.ReqModifyCheckRecord;
 import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
 import com.customs.cq.datacenter.business.service.CheckRecordService;
 import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.PagerResult;
 import com.customs.cq.datacenter.common.core.controller.BasicController;
+import com.customs.cq.datacenter.common.core.domain.model.LoginUser;
+import com.customs.cq.datacenter.common.enums.EResultCode;
+import com.customs.cq.datacenter.common.exception.ServiceException;
+import com.customs.cq.datacenter.common.helper.LoginHelper;
 import com.customs.cq.datacenter.common.model.ReqListId;
-import com.customs.cq.datacenter.common.utils.ParameterUtil;
 import com.customs.cq.datacenter.common.validator.ParameterValidateResult;
 import com.customs.cq.datacenter.common.validator.ParameterValidator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Objects;
 
 /**
  * 2010.隐患检查记录
@@ -56,7 +59,7 @@ public class CheckRecordController extends BasicController {
      * @author lin.liu
      */
     @PostMapping(value = "submit")
-    public ExecutedResult<Long> submit(@RequestBody ReqCreateCheckRecord request) {
+    public ExecutedResult<String> submit(@RequestBody ReqCreateCheckRecord request) {
         //#region 参数验证
         ParameterValidator validator = new ParameterValidator()
                 // 非空
@@ -69,31 +72,7 @@ public class CheckRecordController extends BasicController {
             return failed(result.getErrorMsg());
         }
         //#endregion
-        return this.service.create(request);
-    }
-
-    /**
-     * 编辑[隐患检查记录]
-     * @author lin.liu
-     * @description 编辑[隐患检查记录]
-     */
-    @PostMapping(value = "modify")
-    public ExecutedResult<String> modify(@RequestBody ReqModifyCheckRecord request) {
-        //#region 参数验证
-        ParameterValidator validator = new ParameterValidator()
-                // 必须大于0
-                .addGreater(ParameterUtil.named("[隐患检查记录]id"), request.getId(), 0L)
-                // 非空
-                //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName())
-                // 限制最大长度
-                //.addLengthMax(ParameterUtil.named("名称"), request.getName(), Constants.LENGTH_MAX50)
-                ;
-        ParameterValidateResult result = validator.validate();
-        if (result.getIsFiled()) {
-            return failed(result.getErrorMsg());
-        }
-        //#endregion
-        return this.service.modify(request);
+        return this.service.submit(request);
     }
 
     /**
@@ -123,6 +102,30 @@ public class CheckRecordController extends BasicController {
      */
     @PostMapping(value = "search")
     public ExecutedResult<PagerResult<CheckRecordVO>> search(@RequestBody SearchCheckRecord request) {
-        return this.service.search(request);
+        return this.service.search(request, Boolean.FALSE);
+    }
+
+    /**
+     * 我的隐患检查
+     * @author lin.liu
+     */
+    @PostMapping(value = "listMine")
+    public ExecutedResult<PagerResult<CheckRecordVO>> listMine(@RequestBody SearchCheckRecord request) {
+        LoginUser loginUser = LoginHelper.getLoginUser();
+        if (Objects.isNull(loginUser)) {
+            throw new ServiceException("尚未登陆.", EResultCode.UNAUTHORIZED.getCode());
+        }
+        // 指定用户查询
+        request.setCheckPerson(loginUser.getUserId().toString());
+        return this.service.search(request, Boolean.FALSE);
+    }
+
+    /**
+     * 我的隐患检查(网格管理员)
+     * @author lin.liu
+     */
+    @PostMapping(value = "listAdminMine")
+    public ExecutedResult<PagerResult<CheckRecordVO>> listAdminMine(@RequestBody SearchCheckRecord request) {
+        return this.service.search(request, Boolean.TRUE);
     }
 }

+ 10 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/CheckRecordPO.java

@@ -91,6 +91,11 @@ public class CheckRecordPO {
 	 */
 	@TableField(value = "CHECK_PERSON")
 	private String checkPerson;
+	/**
+	 * 检查人员名称
+	 */
+	@TableField(value = "CHECK_PERSON_NAME")
+	private String checkPersonName;
 	/**
 	 * 联系方式
 	 */
@@ -136,6 +141,11 @@ public class CheckRecordPO {
 	 */
 	@TableField(value = "STATUS")
 	private Integer status;
+	/**
+	 * 备注
+	 */
+	@TableField(value = "REMARK")
+	private String remark;
 	/**
 	 * 数据创建时间
 	 */

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/QuartzTaskErrorPO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/QuartzTaskErrorPO.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain;
+package com.customs.cq.datacenter.business.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/QuartzTaskInfoPO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/QuartzTaskInfoPO.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain;
+package com.customs.cq.datacenter.business.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/QuartzTaskRecordPO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/QuartzTaskRecordPO.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain;
+package com.customs.cq.datacenter.business.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/StatisticsUserLoginPO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/StatisticsUserLoginPO.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain;
+package com.customs.cq.datacenter.business.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/SysTotalStatisticsPO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/SysTotalStatisticsPO.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain;
+package com.customs.cq.datacenter.business.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 30 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/bo/GridCheckFormBo.java

@@ -0,0 +1,30 @@
+package com.customs.cq.datacenter.business.domain.bo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+@Data
+public class GridCheckFormBo {
+    /**
+     * 主键
+     */
+    @TableId
+    @TableField(value = "ID")
+    private Long id;
+    /**
+     * 所属网格
+     */
+    @TableField(value = "GRID_ID")
+    private Long gridId;
+    /**
+     * 数据创建时间
+     */
+    @TableField(value = "CREATE_TIME")
+    private Long createTime;
+    /**
+     * 状态 ECheckFormStatus
+     */
+    @TableField(value = "STATUS")
+    private Integer status;
+}

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/vo/QuartzTaskErrorVO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/QuartzTaskErrorVO.java

@@ -20,12 +20,12 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain.vo;
+package com.customs.cq.datacenter.business.domain.vo;
 
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.core.vo.BasicVO;
-import com.customs.cq.datacenter.system.domain.QuartzTaskErrorPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskErrorPO;
 import lombok.Data;
 
 import java.util.Objects;

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/vo/QuartzTaskInfoVO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/QuartzTaskInfoVO.java

@@ -20,12 +20,12 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain.vo;
+package com.customs.cq.datacenter.business.domain.vo;
 
 import com.customs.cq.datacenter.common.core.vo.BasicVO;
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
-import com.customs.cq.datacenter.system.domain.QuartzTaskInfoPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskInfoPO;
 import lombok.Data;
 
 import java.util.Objects;

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/vo/QuartzTaskRecordVO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/QuartzTaskRecordVO.java

@@ -20,13 +20,13 @@
  * #                  神兽保佑
  * #                  永无BUG!
  */
-package com.customs.cq.datacenter.system.domain.vo;
+package com.customs.cq.datacenter.business.domain.vo;
 
 import com.customs.cq.datacenter.common.core.vo.BasicVO;
 import com.customs.cq.datacenter.common.enums.EHandleStatus;
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
-import com.customs.cq.datacenter.system.domain.QuartzTaskRecordPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskRecordPO;
 import lombok.Data;
 
 import java.util.Objects;

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/vo/StatisticsUserLoginVO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/StatisticsUserLoginVO.java

@@ -20,12 +20,12 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain.vo;
+package com.customs.cq.datacenter.business.domain.vo;
 
 import com.customs.cq.datacenter.common.core.vo.BasicVO;
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
-import com.customs.cq.datacenter.system.domain.StatisticsUserLoginPO;
+import com.customs.cq.datacenter.business.domain.StatisticsUserLoginPO;
 import lombok.Data;
 
 import java.util.Objects;

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/domain/vo/SysTotalStatisticsVO.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/SysTotalStatisticsVO.java

@@ -20,12 +20,12 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.domain.vo;
+package com.customs.cq.datacenter.business.domain.vo;
 
 import com.customs.cq.datacenter.common.core.vo.BasicVO;
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
-import com.customs.cq.datacenter.system.domain.SysTotalStatisticsPO;
+import com.customs.cq.datacenter.business.domain.SysTotalStatisticsPO;
 import lombok.Data;
 
 import java.util.Objects;

+ 3 - 7
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkrecord/ReqCreateCheckRecord.java

@@ -35,13 +35,9 @@ import java.util.List;
 @Data
 public class ReqCreateCheckRecord {
 	/**
-	 * 所属网格
+	 * 检查记录id
 	 */
-	private Long gridId;
-	/**
-	 * 所属检查表
-	 */
-	private Long checkFormId;
+	private Long id;
 	/**
 	 * 关区代码
 	 */
@@ -53,7 +49,7 @@ public class ReqCreateCheckRecord {
 	/**
 	 * 检查人员
 	 */
-	private String checkPerson;
+	private String checkPersonName;
 	/**
 	 * 联系方式
 	 */

+ 2 - 6
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkrecorditem/ReqCreateCheckRecordItem.java

@@ -33,13 +33,9 @@ import java.time.LocalDate;
 @Data
 public class ReqCreateCheckRecordItem {
 	/**
-	 * 所属检查表
+	 * 检查项id
 	 */
-	private Long checkFormId;
-	/**
-	 * 检查项
-	 */
-	private String itemName;
+	private Long id;
 	/**
 	 * 检查结果 ECheckResult
 	 */

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/quartztaskerror/ReqCreateQuartzTaskError.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskerror/ReqCreateQuartzTaskError.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.quartztaskerror;
+package com.customs.cq.datacenter.business.entity.request.quartztaskerror;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/quartztaskerror/ReqModifyQuartzTaskError.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskerror/ReqModifyQuartzTaskError.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.quartztaskerror;
+package com.customs.cq.datacenter.business.entity.request.quartztaskerror;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/quartztaskinfo/ReqCreateQuartzTaskInfo.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskinfo/ReqCreateQuartzTaskInfo.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.quartztaskinfo;
+package com.customs.cq.datacenter.business.entity.request.quartztaskinfo;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/quartztaskinfo/ReqModifyQuartzTaskInfo.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskinfo/ReqModifyQuartzTaskInfo.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.quartztaskinfo;
+package com.customs.cq.datacenter.business.entity.request.quartztaskinfo;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/quartztaskinfo/ReqRunTaskRightNow.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskinfo/ReqRunTaskRightNow.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.request.quartztaskinfo;
+package com.customs.cq.datacenter.business.entity.request.quartztaskinfo;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/quartztaskrecord/ReqCreateQuartzTaskRecord.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskrecord/ReqCreateQuartzTaskRecord.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.quartztaskrecord;
+package com.customs.cq.datacenter.business.entity.request.quartztaskrecord;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/quartztaskrecord/ReqModifyQuartzTaskRecord.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/quartztaskrecord/ReqModifyQuartzTaskRecord.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.quartztaskrecord;
+package com.customs.cq.datacenter.business.entity.request.quartztaskrecord;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/statisticsuserlogin/ReqCreateStatisticsUserLogin.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/statisticsuserlogin/ReqCreateStatisticsUserLogin.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.statisticsuserlogin;
+package com.customs.cq.datacenter.business.entity.request.statisticsuserlogin;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/statisticsuserlogin/ReqModifyStatisticsUserLogin.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/statisticsuserlogin/ReqModifyStatisticsUserLogin.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.statisticsuserlogin;
+package com.customs.cq.datacenter.business.entity.request.statisticsuserlogin;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/systotalstatistics/ReqCreateSysTotalStatistics.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/systotalstatistics/ReqCreateSysTotalStatistics.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.systotalstatistics;
+package com.customs.cq.datacenter.business.entity.request.systotalstatistics;
 
 import lombok.Data;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/request/systotalstatistics/ReqModifySysTotalStatistics.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/systotalstatistics/ReqModifySysTotalStatistics.java

@@ -20,7 +20,7 @@
 #                  神兽保佑
 #                  永无BUG!
 */
-package com.customs.cq.datacenter.system.entity.request.systotalstatistics;
+package com.customs.cq.datacenter.business.entity.request.systotalstatistics;
 
 import lombok.Data;
 

+ 2 - 6
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResListGrid4User.java

@@ -1,5 +1,6 @@
 package com.customs.cq.datacenter.business.entity.response.check;
 
+import com.customs.cq.datacenter.common.enums.ECheckFormStatus;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
 import lombok.Data;
 
@@ -14,11 +15,6 @@ public class ResListGrid4User {
     private Integer checkStatus;
 
     public String getCheckStatusTxt() {
-        EYesOrNo status = EYesOrNo.getByValue(this.getCheckStatus());
-        String txt = "未填报";
-        if (Objects.equals(this.checkStatus, EYesOrNo.YES.getValue())) {
-            txt = "已填报";
-        }
-        return txt;
+        return ECheckFormStatus.getByValue(this.getCheckStatus()).getDesc();
     }
 }

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/response/statistics/ResNearMonthUserLogin.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/statistics/ResNearMonthUserLogin.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.response.statistics;
+package com.customs.cq.datacenter.business.entity.response.statistics;
 
 import lombok.Data;
 

+ 13 - 3
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchCheckRecord.java

@@ -12,6 +12,16 @@ import java.util.List;
  */
 @Data
 public class SearchCheckRecord extends SearchBasicDTO {
+	/**
+	 * 检查人员
+	 * @ignore
+	 */
+	private String checkPerson;
+	/**
+	 * 网格列表
+	 * @ignore
+	 */
+	private List<Long> listGridId;
 	/**
 	 * 检查单号
 	 */
@@ -27,7 +37,7 @@ public class SearchCheckRecord extends SearchBasicDTO {
 	/**
 	 * 所属部门
 	 */
-	private List<String> listDepartment;
+	private List<Long> listDepartment;
 	/**
 	 * 关区代码
 	 */
@@ -47,9 +57,9 @@ public class SearchCheckRecord extends SearchBasicDTO {
 	 */
 	private Long checkTimeEnd;
 	/**
-	 * 检查人员
+	 * 检查人员名称
 	 */
-	private String checkPerson;
+	private String checkPersonName;
 	/**
 	 * 是否有隐患 EYesOrNo
 	 */

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/search/SearchQuartzTaskError.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchQuartzTaskError.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.search;
+package com.customs.cq.datacenter.business.entity.search;
 
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/search/SearchQuartzTaskInfo.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchQuartzTaskInfo.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.search;
+package com.customs.cq.datacenter.business.entity.search;
 
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 import lombok.Data;

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/search/SearchQuartzTaskRecord.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchQuartzTaskRecord.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.search;
+package com.customs.cq.datacenter.business.entity.search;
 
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 import lombok.Data;

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/search/SearchStatisticsUserCount.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchStatisticsUserCount.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.search;
+package com.customs.cq.datacenter.business.entity.search;
 
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/search/SearchStatisticsUserLogin.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchStatisticsUserLogin.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.search;
+package com.customs.cq.datacenter.business.entity.search;
 
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 

+ 1 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/entity/search/SearchSysTotalStatistics.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchSysTotalStatistics.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.entity.search;
+package com.customs.cq.datacenter.business.entity.search;
 
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/QuartzTaskErrorMapper.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/QuartzTaskErrorMapper.java

@@ -1,7 +1,7 @@
-package com.customs.cq.datacenter.system.mapper;
+package com.customs.cq.datacenter.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.customs.cq.datacenter.system.domain.QuartzTaskErrorPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskErrorPO;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/QuartzTaskInfoMapper.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/QuartzTaskInfoMapper.java

@@ -1,7 +1,7 @@
-package com.customs.cq.datacenter.system.mapper;
+package com.customs.cq.datacenter.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.customs.cq.datacenter.system.domain.QuartzTaskInfoPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskInfoPO;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/QuartzTaskRecordMapper.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/QuartzTaskRecordMapper.java

@@ -1,7 +1,7 @@
-package com.customs.cq.datacenter.system.mapper;
+package com.customs.cq.datacenter.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.customs.cq.datacenter.system.domain.QuartzTaskRecordPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskRecordPO;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/StatisticsUserLoginMapper.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/StatisticsUserLoginMapper.java

@@ -1,7 +1,7 @@
-package com.customs.cq.datacenter.system.mapper;
+package com.customs.cq.datacenter.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.customs.cq.datacenter.system.domain.StatisticsUserLoginPO;
+import com.customs.cq.datacenter.business.domain.StatisticsUserLoginPO;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 2
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/SysTotalStatisticsMapper.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/SysTotalStatisticsMapper.java

@@ -1,7 +1,7 @@
-package com.customs.cq.datacenter.system.mapper;
+package com.customs.cq.datacenter.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.customs.cq.datacenter.system.domain.SysTotalStatisticsPO;
+import com.customs.cq.datacenter.business.domain.SysTotalStatisticsPO;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 34 - 16
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRecordMapperImpl.java

@@ -1,24 +1,29 @@
 package com.customs.cq.datacenter.business.mapper.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.customs.cq.datacenter.business.domain.GridPersonPO;
+import com.customs.cq.datacenter.business.domain.bo.GridCheckFormBo;
+import com.customs.cq.datacenter.common.constant.Constants;
 import com.customs.cq.datacenter.common.enums.EOrderBy;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
-import com.customs.cq.datacenter.common.utils.ListUtil;
-import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
-import com.customs.cq.datacenter.common.utils.NumericUtil;
+import com.customs.cq.datacenter.common.utils.*;
 import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
-import com.customs.cq.datacenter.common.utils.StringUtil;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import org.springframework.boot.json.GsonJsonParser;
 import org.springframework.stereotype.Repository;
 import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
 import com.customs.cq.datacenter.business.domain.CheckRecordPO;
 import com.customs.cq.datacenter.business.mapper.CheckRecordMapper;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -68,13 +73,7 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
         queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListDangerCategory()), CheckRecordPO::getDangerCategory, search.getListDangerCategory());
         // 所属部门
         queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListDepartment()), CheckRecordPO::getDepartment, search.getListDepartment());
-        if (ListUtil.isNotNullOrEmpty(search.getListDepartment())) {
-            queryWrapper.and(q -> {
-                for (String dept : search.getListDepartment()) {
-                    q.or().like(CheckRecordPO::getDepartment, "#" + dept + "#");
-                }
-            });
-        }
+
         // 关区代码
         queryWrapper.like(StringUtil.isNotNullOrEmpty(search.getCustoms()), CheckRecordPO::getCustoms, search.getCustoms());
         // 检查时间-起始
@@ -82,9 +81,11 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
         // 检查时间-截止
         queryWrapper.le(NumericUtil.tryParseLong(search.getCheckTimeEnd()).compareTo(0L) > 0, CheckRecordPO::getCheckTime, search.getCheckTimeEnd());
         // 检查人员
-        queryWrapper.like(StringUtil.isNotNullOrEmpty(search.getCheckPerson()), CheckRecordPO::getCheckPerson, search.getCheckPerson());
+        queryWrapper.eq(StringUtil.isNotNullOrEmpty(search.getCheckPerson()), CheckRecordPO::getCheckPerson, search.getCheckPerson());
+        // 检查人员名称
+        queryWrapper.like(StringUtil.isNotNullOrEmpty(search.getCheckPersonName()), CheckRecordPO::getCheckPersonName, search.getCheckPersonName());
         // 是否有隐患
-        queryWrapper.eq(NumericUtil.tryParseInt(search.getHasDanger()).compareTo(0) > 0, CheckRecordPO::getHasDanger, search.getHasDanger());
+        queryWrapper.eq(NumericUtil.tryParseInt(search.getHasDanger()).compareTo(0) > -1, CheckRecordPO::getHasDanger, search.getHasDanger());
 
         // 排序处理
         if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) {
@@ -130,13 +131,30 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
         return mapper.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper);
     }
 
-    public List<Long> checkToday4Grid(List<Long> listGridId) {
+    public List<GridCheckFormBo> checkToday4Grid(List<Long> listGridId) {
+        List<String> listColumn = new ArrayList<>();
+        listColumn.add("ID");
+        listColumn.add("GRID_ID");
+        listColumn.add("CREATE_TIME");
+        listColumn.add("STATUS");
+
         LambdaQueryWrapper<CheckRecordPO> where = super.getQuery();
-        where.select(CheckRecordPO.class, c -> c.getColumn().equals("GRID_ID"));
+        where.select(CheckRecordPO.class, c -> listColumn.contains(c.getColumn()));
         where.in(CheckRecordPO::getGridId, listGridId);
 
         Long today = LocalDateTimeUtil.getTimeStamp(LocalDateTimeUtil.todayFirst()).getTime();
         where.gt(CheckRecordPO::getCreateTime, today);
-        return mapper.selectMaps(where).stream().map(c -> NumericUtil.tryParseLong(c.get("GRID_ID"))).collect(Collectors.toList());
+        List<Object> list = mapper.selectObjs(where);
+        return BeanUtil.copyToList(list, GridCheckFormBo.class);
+    }
+
+    public Long checkDate4Grid(Long gridId, String dateStr) {
+        LambdaQueryWrapper<CheckRecordPO> where = super.getQuery();
+        where.select(CheckRecordPO.class, c -> c.getColumn().equals("GRID_ID"));
+        where.eq(CheckRecordPO::getGridId, gridId);
+
+        Long date = LocalDateTimeUtil.getTimeStamp(dateStr, Constants.STR_DATE).getTime();
+        where.gt(CheckRecordPO::getCreateTime, date);
+        return mapper.selectCount(where);
     }
 }

+ 14 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/GridPersonMapperImpl.java

@@ -119,4 +119,18 @@ public class GridPersonMapperImpl extends BasicMapper<GridPersonPO> {
         where.eq(GridPersonPO::getUserGuid, userGuid);
         return mapper.selectMaps(where).stream().map(c -> NumericUtil.tryParseLong(c.get("GRID_ID"))).collect(Collectors.toList());
     }
+
+    public List<Long> listGrid4AdminUser(String userGuid) {
+        LambdaQueryWrapper<GridPersonPO> where = super.getQuery();
+        where.select(GridPersonPO.class, c -> c.getColumn().equals("GRID_ID"));
+        where.eq(GridPersonPO::getUserGuid, userGuid);
+        where.eq(GridPersonPO::getIsAdmin, EYesOrNo.YES.getValue());
+        return mapper.selectMaps(where).stream().map(c -> NumericUtil.tryParseLong(c.get("GRID_ID"))).collect(Collectors.toList());
+    }
+
+    public List<GridPersonPO> listGridInfo4User(String userGuid) {
+        LambdaQueryWrapper<GridPersonPO> where = super.getQuery();
+        where.eq(GridPersonPO::getUserGuid, userGuid);
+        return mapper.selectList(where);
+    }
 }

+ 4 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/impl/QuartzTaskErrorMapperImpl.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/QuartzTaskErrorMapperImpl.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.mapper.impl;
+package com.customs.cq.datacenter.business.mapper.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,11 +8,11 @@ import com.customs.cq.datacenter.common.enums.EYesOrNo;
 import com.customs.cq.datacenter.common.utils.ListUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
-import com.customs.cq.datacenter.system.domain.QuartzTaskErrorPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskErrorPO;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
-import com.customs.cq.datacenter.system.entity.search.SearchQuartzTaskError;
-import com.customs.cq.datacenter.system.mapper.QuartzTaskErrorMapper;
+import com.customs.cq.datacenter.business.entity.search.SearchQuartzTaskError;
+import com.customs.cq.datacenter.business.mapper.QuartzTaskErrorMapper;
 import org.springframework.stereotype.Repository;
 
 /**

+ 4 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/impl/QuartzTaskInfoMapperImpl.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/QuartzTaskInfoMapperImpl.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.mapper.impl;
+package com.customs.cq.datacenter.business.mapper.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -9,11 +9,11 @@ import com.customs.cq.datacenter.common.utils.ListUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.utils.StringUtil;
 import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
-import com.customs.cq.datacenter.system.domain.QuartzTaskInfoPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskInfoPO;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
-import com.customs.cq.datacenter.system.entity.search.SearchQuartzTaskInfo;
-import com.customs.cq.datacenter.system.mapper.QuartzTaskInfoMapper;
+import com.customs.cq.datacenter.business.entity.search.SearchQuartzTaskInfo;
+import com.customs.cq.datacenter.business.mapper.QuartzTaskInfoMapper;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;

+ 4 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/impl/QuartzTaskRecordMapperImpl.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/QuartzTaskRecordMapperImpl.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.mapper.impl;
+package com.customs.cq.datacenter.business.mapper.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -9,11 +9,11 @@ import com.customs.cq.datacenter.common.utils.ListUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.utils.StringUtil;
 import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
-import com.customs.cq.datacenter.system.domain.QuartzTaskRecordPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskRecordPO;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
-import com.customs.cq.datacenter.system.entity.search.SearchQuartzTaskRecord;
-import com.customs.cq.datacenter.system.mapper.QuartzTaskRecordMapper;
+import com.customs.cq.datacenter.business.entity.search.SearchQuartzTaskRecord;
+import com.customs.cq.datacenter.business.mapper.QuartzTaskRecordMapper;
 import org.springframework.stereotype.Repository;
 
 /**

+ 4 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/impl/StatisticsUserLoginMapperImpl.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/StatisticsUserLoginMapperImpl.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.mapper.impl;
+package com.customs.cq.datacenter.business.mapper.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,11 +8,11 @@ import com.customs.cq.datacenter.common.enums.EYesOrNo;
 import com.customs.cq.datacenter.common.utils.ListUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
-import com.customs.cq.datacenter.system.domain.StatisticsUserLoginPO;
+import com.customs.cq.datacenter.business.domain.StatisticsUserLoginPO;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
-import com.customs.cq.datacenter.system.entity.search.SearchStatisticsUserLogin;
-import com.customs.cq.datacenter.system.mapper.StatisticsUserLoginMapper;
+import com.customs.cq.datacenter.business.entity.search.SearchStatisticsUserLogin;
+import com.customs.cq.datacenter.business.mapper.StatisticsUserLoginMapper;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;

+ 4 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/mapper/impl/SysTotalStatisticsMapperImpl.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/SysTotalStatisticsMapperImpl.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.mapper.impl;
+package com.customs.cq.datacenter.business.mapper.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,11 +8,11 @@ import com.customs.cq.datacenter.common.enums.EYesOrNo;
 import com.customs.cq.datacenter.common.utils.ListUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
-import com.customs.cq.datacenter.system.domain.SysTotalStatisticsPO;
+import com.customs.cq.datacenter.business.domain.SysTotalStatisticsPO;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
-import com.customs.cq.datacenter.system.entity.search.SearchSysTotalStatistics;
-import com.customs.cq.datacenter.system.mapper.SysTotalStatisticsMapper;
+import com.customs.cq.datacenter.business.entity.search.SearchSysTotalStatistics;
+import com.customs.cq.datacenter.business.mapper.SysTotalStatisticsMapper;
 import org.springframework.stereotype.Repository;
 
 /**

+ 27 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/quartz/QuartzExecutor.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/quartz/QuartzExecutor.java

@@ -1,13 +1,14 @@
-package com.customs.cq.datacenter.system.quartz;
+package com.customs.cq.datacenter.business.quartz;
 
+import com.customs.cq.datacenter.business.service.CheckRecordService;
 import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.constant.Constants;
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.utils.StringUtil;
-import com.customs.cq.datacenter.system.mapper.impl.QuartzTaskErrorMapperImpl;
-import com.customs.cq.datacenter.system.mapper.impl.QuartzTaskRecordMapperImpl;
-import com.customs.cq.datacenter.system.service.impl.UserStatisticsService;
+import com.customs.cq.datacenter.business.mapper.impl.QuartzTaskErrorMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.QuartzTaskRecordMapperImpl;
+import com.customs.cq.datacenter.business.service.UserStatisticsService;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
@@ -31,6 +32,8 @@ public class QuartzExecutor {
 
     @Autowired
     private UserStatisticsService userStatisticsService;
+    @Autowired
+    private CheckRecordService checkRecordService;
 
     /**
      * 执行job
@@ -92,4 +95,24 @@ public class QuartzExecutor {
             return ExecutedResult.failed(e.toString());
         }
     }
+
+    /***
+     * job执行器-每日生成待检记录
+     * @param jobParameter 执行参数
+     */
+    public ExecutedResult<String> initCheckRecord(String jobParameter) {
+        try {
+            String today = "";
+            if (StringUtil.isMatch(jobParameter, Constants.REGEX_DATE)) {
+                today = jobParameter;
+            }
+            if (StringUtil.isNullOrEmpty(today)) {
+                today = LocalDateTimeUtil.todayStr();
+            }
+            checkRecordService.initCheckRecord(today);
+            return ExecutedResult.success();
+        } catch (Exception e) {
+            return ExecutedResult.failed(e.toString());
+        }
+    }
 }

+ 4 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/quartz/QuartzMainJobFactory.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/quartz/QuartzMainJobFactory.java

@@ -1,13 +1,13 @@
-package com.customs.cq.datacenter.system.quartz;
+package com.customs.cq.datacenter.business.quartz;
 
 import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.enums.EHandleStatus;
 import com.customs.cq.datacenter.common.enums.EState;
 import com.customs.cq.datacenter.common.utils.ExceptionUtil;
 import com.customs.cq.datacenter.common.utils.SerializeUtil;
-import com.customs.cq.datacenter.system.domain.QuartzTaskInfoPO;
-import com.customs.cq.datacenter.system.domain.QuartzTaskRecordPO;
-import com.customs.cq.datacenter.system.service.impl.QuartzService;
+import com.customs.cq.datacenter.business.domain.QuartzTaskInfoPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskRecordPO;
+import com.customs.cq.datacenter.business.service.QuartzService;
 import org.quartz.DisallowConcurrentExecution;
 import org.quartz.Job;
 import org.quartz.JobDataMap;

+ 225 - 136
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckRecordService.java

@@ -24,37 +24,31 @@ package com.customs.cq.datacenter.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Sequence;
-import com.customs.cq.datacenter.business.domain.CheckRecordPO;
-import com.customs.cq.datacenter.business.domain.DangerCheckFormPO;
-import com.customs.cq.datacenter.business.domain.GridInfoPO;
+import com.customs.cq.datacenter.business.domain.*;
+import com.customs.cq.datacenter.business.domain.bo.GridCheckFormBo;
 import com.customs.cq.datacenter.business.domain.vo.CheckRecordVO;
 import com.customs.cq.datacenter.business.entity.request.checkrecord.ReqCreateCheckRecord;
-import com.customs.cq.datacenter.business.entity.request.checkrecord.ReqModifyCheckRecord;
 import com.customs.cq.datacenter.business.entity.request.checkrecorditem.ReqCreateCheckRecordItem;
 import com.customs.cq.datacenter.business.entity.response.check.ResListGrid4User;
 import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
-import com.customs.cq.datacenter.business.mapper.impl.CheckRecordMapperImpl;
-import com.customs.cq.datacenter.business.mapper.impl.DangerCheckFormMapperImpl;
-import com.customs.cq.datacenter.business.mapper.impl.GridInfoMapperImpl;
-import com.customs.cq.datacenter.business.mapper.impl.GridPersonMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.*;
 import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.PagerResult;
 import com.customs.cq.datacenter.common.constant.Constants;
 import com.customs.cq.datacenter.common.core.domain.entity.SysUser;
 import com.customs.cq.datacenter.common.core.domain.model.LoginUser;
 import com.customs.cq.datacenter.common.core.service.BasicService;
-import com.customs.cq.datacenter.common.enums.ECheckFormStatus;
-import com.customs.cq.datacenter.common.enums.ECheckResult;
-import com.customs.cq.datacenter.common.enums.EResultCode;
-import com.customs.cq.datacenter.common.enums.EYesOrNo;
+import com.customs.cq.datacenter.common.enums.*;
 import com.customs.cq.datacenter.common.exception.ServiceException;
 import com.customs.cq.datacenter.common.helper.LoginHelper;
 import com.customs.cq.datacenter.common.model.Tuple;
 import com.customs.cq.datacenter.common.utils.*;
 import com.customs.cq.datacenter.system.mapper.SysDictDataMapper;
 import com.customs.cq.datacenter.system.mapper.SysUserMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
 import java.util.ArrayList;
@@ -68,11 +62,14 @@ import java.util.stream.Collectors;
  * @author lin.liu
  * @description 隐患检查记录
  */
+@Slf4j
 @Service
 public class CheckRecordService extends BasicService {
     @Autowired
     private CheckRecordMapperImpl dao;
     @Autowired
+    private CheckRecordItemMapperImpl checkRecordItemMapper;
+    @Autowired
     private SysDictDataMapper dictDataMapper;
     @Autowired
     private GridInfoMapperImpl gridInfoMapper;
@@ -81,6 +78,8 @@ public class CheckRecordService extends BasicService {
     @Autowired
     private DangerCheckFormMapperImpl checkFormMapper;
     @Autowired
+    private DangerCheckItemMapperImpl checkItemMapper;
+    @Autowired
     private SysUserMapper userMapper;
 
     @Autowired
@@ -90,14 +89,15 @@ public class CheckRecordService extends BasicService {
 
 
 
-    public ExecutedResult<Long> create(ReqCreateCheckRecord request) {
-        // 检验网格
-        GridInfoPO grid = gridInfoService.check4IdExc(request.getGridId());
-        // 校验隐患检查单
-        DangerCheckFormPO form = dangerCheckFormService.check4IdExc(request.getCheckFormId());
+    public ExecutedResult<String> submit(ReqCreateCheckRecord request) {
+        // 校验检查记录
+        ExecutedResult<CheckRecordPO> checkRecord = this.check4Id(request.getId());
+        if (checkRecord.isFailed()) {
+            return ExecutedResult.failed(checkRecord.getMsg());
+        }
         // 数据字典 - 关区代码
         Map<String, String> mapDicData = dictDataMapper.map4Type("sys_customs_code");
-        if (mapDicData.containsKey(request.getCustoms())) {
+        if (!mapDicData.containsKey(request.getCustoms())) {
             return ExecutedResult.failed("关区代码不存在." + request.getCustoms());
         }
 
@@ -111,24 +111,12 @@ public class CheckRecordService extends BasicService {
 
         // 转换po
         CheckRecordPO item = CopierUtil.mapTo(request, CheckRecordPO.class);
-        // 设置主键
-        item.setId(new Sequence(null).nextId());
-        // 检查单号
-        item.setCheckFormNo("CK" + LocalDateTimeUtil.toFormatString(LocalDateTime.now(), "yyyyMMddHHmmssSSS") + RandVerifyCode.complexCode(6));
-        // 检查表名称
-        item.setCheckFormName(form.getName());
-        // 所属部门
-        item.setDepartment(loginUser.getDeptId().toString());
-        // 部门名称
-        item.setDepartmentName(loginUser.getDeptName());
         // 关区名称
         item.setCustomsName(mapDicData.get(request.getCustoms()));
         // 检查时间
         item.setCheckTime(LocalDateTimeUtil.getTimeStamp(request.getCheckTime(), Constants.STR_DATE).getTime());
-        // 网格类型
-        item.setGridCategory(grid.getGridCategory());
-        // 隐患分类
-        item.setDangerCategory(grid.getDangerCategory());
+        // 检查人员
+        item.setCheckPerson(loginUser.getUserId().toString());
         // 附件列表
         item.setAttachmentList("");
         if (ListUtil.isNotNullOrEmpty(request.getListAttachment())) {
@@ -168,35 +156,49 @@ public class CheckRecordService extends BasicService {
         if (Objects.equals(request.getIsSubmit(), EYesOrNo.YES.getValue())) {
             item.setStatus(ECheckFormStatus.SUBMITTED.getValue());
         }
-        // 设置记录创建时间
-        item.setCreateTime(now);
-        // 是否删除(逻辑删除)初始值
-        item.setIsDelete(EYesOrNo.NO.getValue());
-        // 创建人信息
-        item.setCreateBy(loginUser.getUserId().toString());
-        item.setCreateByName(loginUser.getUsername());
-
-        int result = this.dao.insert(item);
-        if (result != 1) {
-            return ExecutedResult.failed("创建[隐患检查记录]失败。");
+        // 修改人信息
+        item.setUpdateBy(loginUser.getUserId().toString());
+        item.setUpdateByName(loginUser.getUsername());
+        item.setUpdateTime(LocalDateTimeUtil.getTimeStamp(now));
+
+        // 构建检查项列表
+        List<CheckRecordItemPO> listItem = request.getListItem().stream().map(c -> {
+            CheckRecordItemPO checkItem = new CheckRecordItemPO();
+            checkItem.setId(c.getId());
+            checkItem.setCustoms(item.getCustoms());
+            checkItem.setCustomsName(item.getCustomsName());
+            checkItem.setCheckTime(item.getCheckTime());
+            checkItem.setCheckPerson(item.getCheckPerson());
+            checkItem.setRectifyStatus(c.getCheckResult());
+            checkItem.setDangerDescription(c.getDangerDescription());
+            checkItem.setRectifyPlan(c.getRectifyPlan());
+            checkItem.setRectifyDeadline(c.getRectifyDeadline());
+            checkItem.setRectifyStatus(ERectifyStatus.NONE.getValue());
+            if (StringUtil.isNotNullOrEmpty(c.getRectifyPlan())) {
+                checkItem.setRectifySubmitTime(now);
+                checkItem.setRectifyStatus(ERectifyStatus.WAITING.getValue());
+            }
+
+            return checkItem;
+        }).collect(Collectors.toList());
+
+        try {
+            this.submitCheckRecord(item, listItem);
+        } catch (Exception e) {
+            return ExecutedResult.failed("提交检查单失败." + e.getMessage());
         }
-        return ExecutedResult.success(item.getId());
+        return ExecutedResult.success();
     }
-
-    public ExecutedResult<String> modify(ReqModifyCheckRecord request) {
-        // 验证记录是否存在
-        ExecutedResult<CheckRecordPO> checkExists = this.check4Id(request.getId());
-        if (checkExists.isFailed()) {
-            return ExecutedResult.failed(checkExists.getMsg());
+    @Transactional(rollbackFor = Exception.class)
+    private void submitCheckRecord(CheckRecordPO item, List<CheckRecordItemPO> listItem) throws Exception {
+        boolean updateCheckItem = checkRecordItemMapper.update(listItem);
+        if (!updateCheckItem) {
+            throw new Exception("更新检查项失败");
         }
-        // 转换po
-        CheckRecordPO item = CopierUtil.mapTo(request, CheckRecordPO.class);
-
-        int result = this.dao.updateById(item);
+        int result = dao.updateById(item);
         if (result != 1) {
-            return ExecutedResult.failed("编辑[隐患检查记录]失败。");
+            throw new Exception("更新检查记录失败");
         }
-        return ExecutedResult.success();
     }
 
     public ExecutedResult<CheckRecordVO> get(Long id) {
@@ -209,82 +211,6 @@ public class CheckRecordService extends BasicService {
         return ExecutedResult.success(result);
     }
 
-//    public ExecutedResult<String> stop(Long id) {
-//        // 验证记录是否存在
-//        ExecutedResult<CheckRecordPO> checkExists = this.check4Id(id);
-//        if (checkExists.isFailed()) {
-//            return ExecutedResult.failed(checkExists.getMsg());
-//        }
-//        CheckRecordPO item = new CheckRecordPO();
-//        item.setId(id);
-//        item.setStatus(EState.DISABLED.getValue());
-//
-//       int result = this.dao.updateById(item);
-//       if (result != 1) {
-//           return ExecutedResult.failed("停用[隐患检查记录]失败。");
-//       }
-//       return ExecutedResult.success();
-//   }
-//
-//    public ExecutedResult<String> enable(Long id) {
-//        // 验证记录是否存在
-//        ExecutedResult<CheckRecordPO> checkExists = this.check4Id(id);
-//        if (checkExists.isFailed()) {
-//            return ExecutedResult.failed(checkExists.getMsg());
-//        }
-//        CheckRecordPO item = new CheckRecordPO();
-//        item.setId(id);
-//        item.setStatus(EState.NORMAL.getValue());
-//
-//        int result = this.dao.updateById(item);
-//        if (result != 1) {
-//            return ExecutedResult.failed("启用[隐患检查记录]失败。");
-//        }
-//        return ExecutedResult.success();
-//    }
-//
-//    public ExecutedResult<String> setSort(ReqSetSort request) {
-//        // 验证记录是否存在
-//        ExecutedResult<CheckRecordPO> checkExists = this.check4Id(request.getId());
-//        if (checkExists.isFailed()) {
-//            return ExecutedResult.failed(checkExists.getMsg());
-//        }
-//        CheckRecordPO item = new CheckRecordPO();
-//        item.setId(request.getId());
-//        item.setSort(request.getSort());
-//
-//        int result = this.dao.updateById(item);
-//        if (result != 1) {
-//            return ExecutedResult.failed("设置[隐患检查记录]排序值失败。");
-//        }
-//        return ExecutedResult.success();
-//    }
-//
-//    public ExecutedResult<String> remove(Long id) {
-//        // 验证记录是否存在
-//        ExecutedResult<CheckRecordPO> checkExists = this.check4Id(request.getId());
-//        if (checkExists.isFailed()) {
-//            return ExecutedResult.failed(checkExists.getMsg());
-//        }
-//        CheckRecordPO item = new CheckRecordPO();
-//        item.setId(request.getId());
-//        item.setIsDelete(EYesOrNo.Yes.getValue());
-//
-//        int result = this.dao.updateById(item);
-//        if (result != 1) {
-//            return ExecutedResult.failed("设置[隐患检查记录]排序值失败。");
-//        }
-//        return ExecutedResult.success();
-//    }
-//
-//    public ExecutedResult<String> removeList(List<Long> ids) {
-//        Boolean result = this.dao.removeByListId(ids);
-//        if (BooleanUtils.isFalse(result)) {
-//            return ExecutedResult.failed("删除[隐患检查记录]失败。");
-//        }
-//        return ExecutedResult.success();
-//    }
-
     public ExecutedResult<List<CheckRecordVO>> getList(List<Long> listId) {
         List<CheckRecordVO> result = new ArrayList<>();
 
@@ -295,7 +221,23 @@ public class CheckRecordService extends BasicService {
         return ExecutedResult.success(result);
     }
 
-    public ExecutedResult<PagerResult<CheckRecordVO>> search(SearchCheckRecord search) {
+    public ExecutedResult<PagerResult<CheckRecordVO>> search(SearchCheckRecord search, boolean isGridAdmin) {
+        List<CheckRecordVO> listVo = new ArrayList<>();
+
+        if (isGridAdmin) {
+            LoginUser loginUser = LoginHelper.getLoginUser();
+            if (Objects.isNull(loginUser)) {
+                throw new ServiceException("尚未登陆.", EResultCode.UNAUTHORIZED.getCode());
+            }
+            // 获取用户
+            SysUser user = userMapper.selectUserById(Long.parseLong(loginUser.getLoginId()));
+            // 获取当前登录用户是网格管理员的网格id
+            List<Long> listGrid = gridPersonMapper.listGrid4AdminUser(user.getUserGuid());
+            if (ListUtil.isNullOrEmpty(listGrid)) {
+                return ExecutedResult.success(new PagerResult<>(search.getLimit(), search.getPage(), 0L, listVo));
+            }
+            search.setListGridId(listGrid);
+        }
         // 处理创建时间范围-查询参数
         Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange());
         if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) {
@@ -304,9 +246,16 @@ public class CheckRecordService extends BasicService {
         if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) {
             search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime());
         }
+        // 处理检查时间范围-查询参数
+        Tuple<String, String> checkTimeRange = ParameterUtil.getTimeRange(search.getCheckTimeRange());
+        if (StringUtil.isNotNullOrEmpty(checkTimeRange.getItem1())) {
+            search.setCheckTimeStart(LocalDateTimeUtil.getTimeStamp(checkTimeRange.getItem1()).getTime());
+        }
+        if (StringUtil.isNotNullOrEmpty(checkTimeRange.getItem2())) {
+            search.setCheckTimeEnd(LocalDateTimeUtil.getTimeStamp(checkTimeRange.getItem2()).getTime());
+        }
 
         IPage<CheckRecordPO> pageList = dao.search(search);
-        List<CheckRecordVO> listVo = new ArrayList<>();
         List<CheckRecordPO> list = pageList.getRecords();
         if (ListUtil.isNotNullOrEmpty(list)) {
             // 转换vo
@@ -329,12 +278,16 @@ public class CheckRecordService extends BasicService {
         SysUser user = userMapper.selectById(userId);
         // 用户所属网格列表
         List<Long> listGridId = gridPersonMapper.listGrid4User(user.getUserGuid());
+        if (ListUtil.isNullOrEmpty(listGridId)) {
+            return ExecutedResult.success(new ArrayList<>());
+        }
         // 网格列表
         List<GridInfoPO> list = gridInfoMapper.selectBatchIds(listGridId);
         // 网格隐患分类列表
         Map<Long, DangerCheckFormPO> mapForm = checkFormMapper.map4DangerCategory(list.stream().map(GridInfoPO::getDangerCategory).collect(Collectors.toList()));
         // 网格今日隐患检查记录
-        List<Long> listTodayFinishGridId = dao.checkToday4Grid(listGridId);
+        List<GridCheckFormBo> listTodayFinishGridId = dao.checkToday4Grid(listGridId);
+        Map<Long, GridCheckFormBo> map4Grid = listTodayFinishGridId.stream().collect(Collectors.toMap(GridCheckFormBo::getGridId, c -> c));
         List<ResListGrid4User> listVo = list.stream().map(c -> {
             DangerCheckFormPO form = mapForm.get(c.getDangerCategory());
 
@@ -347,10 +300,146 @@ public class CheckRecordService extends BasicService {
                 item.setCheckFormId(form.getId());
                 item.setCheckFormName(form.getName());
             }
-            item.setCheckStatus(listTodayFinishGridId.contains(c.getId()) ? 1 : 0);
+            item.setCheckStatus(ECheckFormStatus.WAITING.getValue());
+            if (map4Grid.containsKey(c.getId())) {
+                item.setCheckStatus(map4Grid.get(c.getId()).getStatus());
+            }
 
             return item;
         }).collect(Collectors.toList());
         return ExecutedResult.success(listVo);
     }
+
+    /**
+     * 指定日期生成待检记录
+     * @param date 指定日期
+     */
+    public void initCheckRecord(String date) {
+        // 获取所有隐患检查表
+        List<DangerCheckFormPO> listForm = checkFormMapper.selectList(null);
+        // 获取所有隐患检查表-检查项
+        List<DangerCheckItemPO> listCheckItem = checkItemMapper.selectList(null);
+        Map<Long, List<DangerCheckItemPO>> mapCheckItem4Form = listCheckItem.stream().collect(Collectors.groupingBy(DangerCheckItemPO::getCheckFormId));
+
+        // 检查单按隐患分类分组
+        Map<Long, DangerCheckFormPO> mapForm4DangerCategory = listForm.stream().collect(Collectors.toMap(DangerCheckFormPO::getDangerCategory, c -> c));
+
+        // 获取所有网格
+        List<GridInfoPO> listGrid = gridInfoMapper.selectList(null);
+
+        // 遍历网格
+        for (GridInfoPO grid : listGrid) {
+            // 指定网格的所有网格员
+            if (!mapForm4DangerCategory.containsKey(grid.getDangerCategory())) {
+                log.warn("指定日期生成待检记录, 此网格分类没有配置隐患检查表!{}", (grid.getGridName() + " - " + grid.getDangerCategory()));
+                continue;
+            }
+            // 今日是否已生成检查记录
+            Long count4Date = dao.checkDate4Grid(grid.getId(), date);
+            if (count4Date.compareTo(0L) > 0) {
+                continue;
+            }
+            DangerCheckFormPO form = mapForm4DangerCategory.get(grid.getDangerCategory());
+
+            Long now = LocalDateTimeUtil.nowTimeStamp();
+
+            // 生成待检记录
+            CheckRecordPO item = new CheckRecordPO();
+            // 设置主键
+            item.setId(new Sequence(null).nextId());
+            // 检查单号
+            item.setCheckFormNo("CK" + LocalDateTimeUtil.toFormatString(LocalDateTime.now(), "yyyyMMddHHmmss") + RandVerifyCode.complexCode(6));
+            // 所属网格
+            item.setGridId(grid.getId());
+            // 所属检查表
+            item.setCheckFormId(form.getId());
+            // 检查表名称
+            item.setCheckFormName(form.getName());
+            // 所属部门
+            item.setDepartment(grid.getDepartment());
+            // 部门名称
+            item.setDepartmentName(grid.getDepartmentName());
+            // 所属关区
+            item.setCustoms("");
+            // 关区名称
+            item.setCustomsName("");
+            // 检查时间
+            item.setCheckTime(0L);
+            // 检查人员
+            item.setCheckPerson("");
+            // 检查人员名称
+            item.setCheckPersonName("");
+            // 联系方式
+            item.setContactInfo("");
+            // 网格类型
+            item.setGridCategory(grid.getGridCategory());
+            // 隐患分类
+            item.setDangerCategory(grid.getDangerCategory());
+            // 附件列表
+            item.setAttachmentList("");
+            // 是否有隐患
+            item.setHasDanger(EYesOrNo.NO.getValue());
+            // 是否已提供整改措施
+            item.setHasRectifyPlan(EYesOrNo.NO.getValue());
+            // 整改措施提交时间
+            item.setRectifySubmitTime(0L);
+            //整改期限
+            item.setRectifyDeadline(0L);
+            // 状态
+            item.setStatus(ECheckFormStatus.WAITING.getValue());
+            // 数据创建时间
+            item.setCreateTime(now);
+            // 数据创建人
+            item.setCreateBy("system");
+            item.setCreateByName("系统");
+            // 是否删除(逻辑删除)初始值
+            item.setIsDelete(EYesOrNo.NO.getValue());
+
+            // 生成检查单的检查项
+            List<CheckRecordItemPO> listItem = mapCheckItem4Form.get(form.getId()).stream().map(c -> {
+                CheckRecordItemPO checkItem = new CheckRecordItemPO();
+                checkItem.setCheckRecordId(item.getId());
+                checkItem.setGridId(grid.getId());
+                checkItem.setCheckFormId(form.getId());
+                checkItem.setCheckFormName(form.getName());
+                checkItem.setDepartment(grid.getDepartment());
+                checkItem.setDepartmentName(grid.getDepartmentName());
+                checkItem.setCustoms("");
+                checkItem.setCustomsName("");
+                checkItem.setItemName(c.getItemName());
+                checkItem.setCheckTime(0L);
+                checkItem.setCheckPerson("");
+                checkItem.setCheckResult(0);
+                checkItem.setDangerDescription("");
+                checkItem.setRectifyPlan("");
+                checkItem.setRectifySubmitTime(0L);
+                checkItem.setRectifyDeadline(0L);
+                checkItem.setRectifyStatus(ERectifyStatus.NONE.getValue());
+                checkItem.setRectifyTime(0L);
+                checkItem.setIsOnTime(EYesOrNo.NO.getValue());
+                checkItem.setRectifyPerson("");
+                checkItem.setRectifyPersonName("");
+                checkItem.setCreateTime(now);
+                checkItem.setIsDelete(EYesOrNo.NO.getValue());
+
+                return checkItem;
+            }).collect(Collectors.toList());
+            try {
+                this.initCheckRecord(item, listItem);
+            } catch (Exception e) {
+                log.error("初始化网格检查记录错误." + e.getMessage(), e);
+            }
+        }
+    }
+    @Transactional(rollbackFor = Exception.class)
+    private void initCheckRecord(CheckRecordPO item, List<CheckRecordItemPO> listItem) throws Exception {
+        boolean insertCheckItem = checkRecordItemMapper.insert(listItem);
+        if (!insertCheckItem) {
+            throw new Exception("添加检查项失败");
+        }
+        int checkRecordRowCount = dao.insert(item);
+        if (checkRecordRowCount != 1) {
+            throw new Exception("添加检查记录失败");
+        }
+    }
 }

+ 17 - 17
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/service/impl/QuartzService.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/QuartzService.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.service.impl;
+package com.customs.cq.datacenter.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.customs.cq.datacenter.common.ExecutedResult;
@@ -8,22 +8,22 @@ import com.customs.cq.datacenter.common.enums.EState;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
 import com.customs.cq.datacenter.common.model.Tuple;
 import com.customs.cq.datacenter.common.utils.*;
-import com.customs.cq.datacenter.system.domain.QuartzTaskErrorPO;
-import com.customs.cq.datacenter.system.domain.QuartzTaskInfoPO;
-import com.customs.cq.datacenter.system.domain.QuartzTaskRecordPO;
-import com.customs.cq.datacenter.system.entity.search.SearchQuartzTaskInfo;
-import com.customs.cq.datacenter.system.entity.search.SearchQuartzTaskRecord;
-import com.customs.cq.datacenter.system.entity.request.quartztaskinfo.ReqCreateQuartzTaskInfo;
-import com.customs.cq.datacenter.system.entity.request.quartztaskinfo.ReqModifyQuartzTaskInfo;
-import com.customs.cq.datacenter.system.entity.request.quartztaskinfo.ReqRunTaskRightNow;
-import com.customs.cq.datacenter.system.domain.vo.QuartzTaskErrorVO;
-import com.customs.cq.datacenter.system.domain.vo.QuartzTaskInfoVO;
-import com.customs.cq.datacenter.system.domain.vo.QuartzTaskRecordVO;
-import com.customs.cq.datacenter.system.mapper.impl.QuartzTaskErrorMapperImpl;
-import com.customs.cq.datacenter.system.mapper.impl.QuartzTaskInfoMapperImpl;
-import com.customs.cq.datacenter.system.mapper.impl.QuartzTaskRecordMapperImpl;
-import com.customs.cq.datacenter.system.quartz.QuartzExecutor;
-import com.customs.cq.datacenter.system.quartz.QuartzMainJobFactory;
+import com.customs.cq.datacenter.business.domain.QuartzTaskErrorPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskInfoPO;
+import com.customs.cq.datacenter.business.domain.QuartzTaskRecordPO;
+import com.customs.cq.datacenter.business.entity.search.SearchQuartzTaskInfo;
+import com.customs.cq.datacenter.business.entity.search.SearchQuartzTaskRecord;
+import com.customs.cq.datacenter.business.entity.request.quartztaskinfo.ReqCreateQuartzTaskInfo;
+import com.customs.cq.datacenter.business.entity.request.quartztaskinfo.ReqModifyQuartzTaskInfo;
+import com.customs.cq.datacenter.business.entity.request.quartztaskinfo.ReqRunTaskRightNow;
+import com.customs.cq.datacenter.business.domain.vo.QuartzTaskErrorVO;
+import com.customs.cq.datacenter.business.domain.vo.QuartzTaskInfoVO;
+import com.customs.cq.datacenter.business.domain.vo.QuartzTaskRecordVO;
+import com.customs.cq.datacenter.business.mapper.impl.QuartzTaskErrorMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.QuartzTaskInfoMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.QuartzTaskRecordMapperImpl;
+import com.customs.cq.datacenter.business.quartz.QuartzExecutor;
+import com.customs.cq.datacenter.business.quartz.QuartzMainJobFactory;
 import org.quartz.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

+ 7 - 7
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/service/impl/StatisticsService.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/StatisticsService.java

@@ -20,7 +20,7 @@
  * #                  神兽保佑
  * #                  永无BUG!
  */
-package com.customs.cq.datacenter.system.service.impl;
+package com.customs.cq.datacenter.business.service;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -32,12 +32,12 @@ import com.customs.cq.datacenter.common.model.Tuple;
 import com.customs.cq.datacenter.common.utils.*;
 import com.customs.cq.datacenter.common.core.service.BasicService;
 import com.customs.cq.datacenter.system.mapper.SysUserMapper;
-import com.customs.cq.datacenter.system.domain.StatisticsUserLoginPO;
-import com.customs.cq.datacenter.system.domain.SysTotalStatisticsPO;
-import com.customs.cq.datacenter.system.entity.request.systotalstatistics.ReqCreateSysTotalStatistics;
-import com.customs.cq.datacenter.system.entity.response.statistics.ResNearMonthUserLogin;
-import com.customs.cq.datacenter.system.mapper.impl.StatisticsUserLoginMapperImpl;
-import com.customs.cq.datacenter.system.mapper.impl.SysTotalStatisticsMapperImpl;
+import com.customs.cq.datacenter.business.domain.StatisticsUserLoginPO;
+import com.customs.cq.datacenter.business.domain.SysTotalStatisticsPO;
+import com.customs.cq.datacenter.business.entity.request.systotalstatistics.ReqCreateSysTotalStatistics;
+import com.customs.cq.datacenter.business.entity.response.statistics.ResNearMonthUserLogin;
+import com.customs.cq.datacenter.business.mapper.impl.StatisticsUserLoginMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.SysTotalStatisticsMapperImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/service/impl/UserStatisticsService.java → secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/UserStatisticsService.java

@@ -1,4 +1,4 @@
-package com.customs.cq.datacenter.system.service.impl;
+package com.customs.cq.datacenter.business.service;
 
 import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.constant.Constants;
@@ -7,11 +7,11 @@ import com.customs.cq.datacenter.common.enums.EYesOrNo;
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.utils.SnowFlakeUtil;
-import com.customs.cq.datacenter.system.domain.StatisticsUserLoginPO;
-import com.customs.cq.datacenter.system.domain.SysTotalStatisticsPO;
+import com.customs.cq.datacenter.business.domain.StatisticsUserLoginPO;
+import com.customs.cq.datacenter.business.domain.SysTotalStatisticsPO;
 import com.customs.cq.datacenter.system.mapper.SysLogininforMapper;
 import com.customs.cq.datacenter.system.mapper.SysUserMapper;
-import com.customs.cq.datacenter.system.mapper.impl.StatisticsUserLoginMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.StatisticsUserLoginMapperImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 13 - 13
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/PagerResult.java

@@ -13,11 +13,11 @@ public class PagerResult<T> {
     /**
      * 页大小(每页返回的记录条数)
      **/
-    private Long limit = 10L;
+    private Number limit = 10L;
     /**
      * 页号(第几页, 从1开始)
      **/
-    private Long page = 1L;
+    private Number page = 1L;
     /**
      * 记录总条数
      **/
@@ -41,29 +41,29 @@ public class PagerResult<T> {
      * @param total 记录总条数
      * @param list 数据包
      */
-    public PagerResult(Long limit, Long page, Number total, List<T> list) {
+    public PagerResult(Number limit, Number page, Number total, List<T> list) {
         this.limit = limit;
         this.page = page;
         this.total = total;
         this.list = list;
     }
 
-    public Long getLimit() {
+    public Number getLimit() {
         return limit;
     }
-    public void setLimit(Long limit) {
+    public void setLimit(Number limit) {
         this.limit = limit;
     }
 
-    public Long getPage() {
+    public Number getPage() {
         return page;
     }
 
-    public void setPage(Long page) {
+    public void setPage(Number page) {
         this.page = page;
     }
 
-    public Long getTotal() {
+    public Number getTotal() {
         return total.longValue();
     }
 
@@ -82,9 +82,9 @@ public class PagerResult<T> {
     /**
      * 总页数
      */
-    public Long getTotalPage() {
-        Long page = this.total.longValue() / this.limit;
-        if(this.total.longValue() % this.limit != 0){
+    public Number getTotalPage() {
+        Long page = this.total.longValue() / this.limit.longValue();
+        if(this.total.longValue() % this.limit.longValue() != 0){
             page++;
         }
         return page;
@@ -94,13 +94,13 @@ public class PagerResult<T> {
      * 是否还有上一页
      */
     public boolean getIsHasPrePage() {
-        return this.getPage() > 1;
+        return this.getPage().longValue() > 1L;
     }
 
     /**
      * 是否还有下一页
      */
     public boolean getIsHasNextPage() {
-        return this.getPage() < this.getTotalPage().intValue();
+        return this.getPage().longValue() < this.getTotalPage().longValue();
     }
 }

+ 11 - 4
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/ECheckFormStatus.java

@@ -3,15 +3,22 @@ package com.customs.cq.datacenter.common.enums;
 import java.util.Arrays;
 import java.util.Objects;
 
+/**
+ * 检查单状态
+ */
 public enum ECheckFormStatus {
     /**
-     * 暂存=1,
+     * 未检=0,
      */
-    STAGING("暂存", 1),
+    WAITING("未检", 0),
     /**
-     * 已提交=2,
+     * 暂存=10,
      */
-    SUBMITTED("已提交", 2),
+    STAGING("暂存", 10),
+    /**
+     * 已提交=20,
+     */
+    SUBMITTED("已提交", 20),
     ;
 
     /**

+ 3 - 0
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/ECheckResult.java

@@ -3,6 +3,9 @@ package com.customs.cq.datacenter.common.enums;
 import java.util.Arrays;
 import java.util.Objects;
 
+/**
+ * 检查结果
+ */
 public enum ECheckResult {
     /**
      * 无隐患=1,

+ 0 - 69
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/EPatrolPlanState.java

@@ -1,69 +0,0 @@
-package com.customs.cq.datacenter.common.enums;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * 巡更计划状态枚举
- */
-public enum EPatrolPlanState {
-    /**
-     * 启用=1,
-     */
-    NORMAL("启用", 1),
-    /**
-     * 停止=2,
-     */
-    DISABLED("停止", 2),
-    /**
-     * 删除=3,
-     */
-    DELETED("删除", 3);
-
-    /**
-     * 枚举描述
-     */
-    private String desc;
-    /**
-     * 枚举值
-     */
-    private Integer value;
-
-    public Integer getValue() {
-        return value;
-    }
-    public String getDesc() {
-        return desc;
-    }
-
-    /**
-     * 构造方法
-     * @param desc 枚举描述
-     * @param value 枚举值
-     */
-    EPatrolPlanState(String desc, Integer value) {
-        this.desc = desc;
-        this.value = value;
-    }
-
-    /**
-     * 根据值获取枚举
-     *
-     * @param value 枚举值
-     * @return
-     */
-    public static EPatrolPlanState getByValue(Integer value) {
-        return Arrays.stream(EPatrolPlanState.values())
-            .filter(e -> Objects.equals(e.getValue(), value))
-            .findAny()
-            .orElse(null);
-    }
-
-    @Override
-    public String toString() {
-        return "EPatrolPlanState{" +
-            "desc='" + desc + '\'' +
-            ", value=" + value +
-            '}';
-    }
-}

+ 0 - 71
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/EPatrolResult.java

@@ -1,71 +0,0 @@
-package com.customs.cq.datacenter.common.enums;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * 巡更结果
- */
-public enum EPatrolResult {
-    /**
-     * 待完成
-     */
-    WAITING("待完成", 100),
-
-    /**
-     * 部分完成=120
-     */
-    PART("部分完成", 120),
-
-    /**
-     * 已完成=200
-     */
-    COMPLETED("已完成", 200),
-
-    /**
-     * 漏巡=300
-     */
-    MISS("漏巡", 300),
-    ;
-
-    private String desc;//枚举描述
-    private Integer value;//枚举值
-
-    public Integer getValue() {
-        return value;
-    }
-    public String getDesc() {
-        return desc;
-    }
-
-    /**
-     * 构造方法
-     * @param desc 枚举描述
-     * @param value 枚举值
-     */
-    EPatrolResult(String desc, Integer value) {
-        this.desc = desc;
-        this.value = value;
-    }
-
-    /**
-     * 根据值获取枚举
-     *
-     * @param value 枚举值
-     * @return
-     */
-    public static EPatrolResult getByValue(Integer value) {
-        return Arrays.stream(EPatrolResult.values())
-            .filter(e -> Objects.equals(e.getValue(), value))
-            .findFirst()
-            .orElse(null);
-    }
-
-    @Override
-    public String toString() {
-        return "EPatrolResult{" +
-            "desc='" + desc + '\'' +
-            ", value=" + value +
-            '}';
-    }
-}

+ 20 - 24
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/EAttendanceState.java → secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/ERectifyStatus.java

@@ -4,29 +4,25 @@ import java.util.Arrays;
 import java.util.Objects;
 
 /**
- * 出勤状态 枚举
+ * 整改状态
  */
-public enum EAttendanceState {
+public enum ERectifyStatus {
     /**
-     * 正常=1,
+     * 无需整改=0,
      */
-    NORMAL("正常", 1),
+    NONE("无需整改", 0),
     /**
-     * 迟到=2,
+     * 待整改=10,
      */
-    LATED("迟到", 2),
+    WAITING("待整改", 10),
     /**
-     * 早退=3,
+     * 整改中=20,
      */
-    LEAVE_EARLY("早退", 3),
+    DOING("整改中", 20),
     /**
-     * 缺勤=4,
+     * 已整改=30,
      */
-    ABSENCE("缺勤", 4),
-    /**
-     * 休假=5,
-     */
-    LEAVE("休假", 5)
+    DONE("已整改", 30),
     ;
 
     /**
@@ -50,7 +46,7 @@ public enum EAttendanceState {
      * @param desc 枚举描述
      * @param value 枚举值
      */
-    EAttendanceState(String desc, Integer value) {
+    ERectifyStatus(String desc, Integer value) {
         this.desc = desc;
         this.value = value;
     }
@@ -61,18 +57,18 @@ public enum EAttendanceState {
      * @param value 枚举值
      * @return
      */
-    public static EAttendanceState getByValue(Integer value) {
-        return Arrays.stream(EAttendanceState.values())
-            .filter(e -> Objects.equals(e.getValue(), value))
-            .findAny()
-            .orElse(null);
+    public static ERectifyStatus getByValue(Integer value) {
+        return Arrays.stream(ERectifyStatus.values())
+                .filter(e -> Objects.equals(e.getValue(), value))
+                .findAny()
+                .orElse(null);
     }
 
     @Override
     public String toString() {
-        return "EAttendanceState{" +
-            "desc='" + desc + '\'' +
-            ", value=" + value +
-            '}';
+        return "ERectifyStatus{" +
+                "desc='" + desc + '\'' +
+                ", value=" + value +
+                '}';
     }
 }

+ 0 - 67
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/EVisitingApplyState.java

@@ -1,67 +0,0 @@
-package com.customs.cq.datacenter.common.enums;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-public enum EVisitingApplyState {
-    /**
-     * 待审核=100,
-     */
-    AWAITING("待审核", 100),
-    /**
-     * 审核通过=200,
-     */
-    PASSED("审核通过", 200),
-    /**
-     * 审核拒绝=300,
-     */
-    REFUSED("审核拒绝", 300)
-    ;
-
-    /**
-     * 枚举描述
-     */
-    private String desc;
-    /**
-     * 枚举值
-     */
-    private Integer value;
-
-    public Integer getValue() {
-        return value;
-    }
-    public String getDesc() {
-        return desc;
-    }
-
-    /**
-     * 构造方法
-     * @param desc 枚举描述
-     * @param value 枚举值
-     */
-    EVisitingApplyState(String desc, Integer value) {
-        this.desc = desc;
-        this.value = value;
-    }
-
-    /**
-     * 根据值获取枚举
-     *
-     * @param value 枚举值
-     * @return
-     */
-    public static EVisitingApplyState getByValue(Integer value) {
-        return Arrays.stream(EVisitingApplyState.values())
-            .filter(e -> Objects.equals(e.getValue(), value))
-            .findAny()
-            .orElse(null);
-    }
-
-    @Override
-    public String toString() {
-        return "EVisitingApplyState{" +
-            "desc='" + desc + '\'' +
-            ", value=" + value +
-            '}';
-    }
-}

+ 3 - 3
secure-producting-host/src/main/java/com/customs/cq/datacenter/host/web/controller/statistics/StatisticsController.java

@@ -30,9 +30,9 @@ import com.customs.cq.datacenter.common.utils.ParameterUtil;
 import com.customs.cq.datacenter.common.validator.ParameterValidateResult;
 import com.customs.cq.datacenter.common.validator.ParameterValidator;
 import com.customs.cq.datacenter.common.core.controller.BasicController;
-import com.customs.cq.datacenter.system.entity.request.systotalstatistics.ReqCreateSysTotalStatistics;
-import com.customs.cq.datacenter.system.entity.response.statistics.ResNearMonthUserLogin;
-import com.customs.cq.datacenter.system.service.impl.StatisticsService;
+import com.customs.cq.datacenter.business.entity.request.systotalstatistics.ReqCreateSysTotalStatistics;
+import com.customs.cq.datacenter.business.entity.response.statistics.ResNearMonthUserLogin;
+import com.customs.cq.datacenter.business.service.StatisticsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 

+ 9 - 9
secure-producting-host/src/main/java/com/customs/cq/datacenter/host/web/controller/system/QuartzController.java

@@ -4,15 +4,15 @@ import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.PagerResult;
 import com.customs.cq.datacenter.common.annotation.Log;
 import com.customs.cq.datacenter.common.enums.BusinessType;
-import com.customs.cq.datacenter.system.entity.search.SearchQuartzTaskInfo;
-import com.customs.cq.datacenter.system.entity.search.SearchQuartzTaskRecord;
-import com.customs.cq.datacenter.system.entity.request.quartztaskinfo.ReqCreateQuartzTaskInfo;
-import com.customs.cq.datacenter.system.entity.request.quartztaskinfo.ReqModifyQuartzTaskInfo;
-import com.customs.cq.datacenter.system.entity.request.quartztaskinfo.ReqRunTaskRightNow;
-import com.customs.cq.datacenter.system.domain.vo.QuartzTaskErrorVO;
-import com.customs.cq.datacenter.system.domain.vo.QuartzTaskInfoVO;
-import com.customs.cq.datacenter.system.domain.vo.QuartzTaskRecordVO;
-import com.customs.cq.datacenter.system.service.impl.QuartzService;
+import com.customs.cq.datacenter.business.entity.search.SearchQuartzTaskInfo;
+import com.customs.cq.datacenter.business.entity.search.SearchQuartzTaskRecord;
+import com.customs.cq.datacenter.business.entity.request.quartztaskinfo.ReqCreateQuartzTaskInfo;
+import com.customs.cq.datacenter.business.entity.request.quartztaskinfo.ReqModifyQuartzTaskInfo;
+import com.customs.cq.datacenter.business.entity.request.quartztaskinfo.ReqRunTaskRightNow;
+import com.customs.cq.datacenter.business.domain.vo.QuartzTaskErrorVO;
+import com.customs.cq.datacenter.business.domain.vo.QuartzTaskInfoVO;
+import com.customs.cq.datacenter.business.domain.vo.QuartzTaskRecordVO;
+import com.customs.cq.datacenter.business.service.QuartzService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
secure-producting-host/src/test/java/com/customs/cq/datacenter/host/GenCodeRun.java

@@ -288,7 +288,7 @@ public class GenCodeRun {
      * 只生成以下配置的表
      */
     private static final List<String> ONLY_TABLES = Arrays.asList(
-        "SP_CHECK_RECORD_ITEM"
+
     );
 
     public static void main(String[] args) {

+ 1 - 1
secure-producting-host/src/test/java/com/customs/cq/datacenter/host/UserStatisticsTest.java

@@ -1,6 +1,6 @@
 package com.customs.cq.datacenter.host;
 
-import com.customs.cq.datacenter.system.service.impl.UserStatisticsService;
+import com.customs.cq.datacenter.business.service.UserStatisticsService;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;

+ 0 - 6
secure-producting-system/pom.xml

@@ -59,11 +59,5 @@
             <groupId>jakarta.validation</groupId>
             <artifactId>jakarta.validation-api</artifactId>
         </dependency>
-
-        <!--quartz依赖-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-quartz</artifactId>
-        </dependency>
     </dependencies>
 </project>

+ 15 - 1
secure-producting-system/src/main/java/com/customs/cq/datacenter/system/service/SysLoginService.java

@@ -6,6 +6,8 @@ import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.customs.cq.datacenter.common.core.domain.entity.SysDept;
+import com.customs.cq.datacenter.system.mapper.SysDeptMapper;
 import com.customs.cq.datacenter.system.mapper.SysUserMapper;
 import com.customs.cq.datacenter.common.constant.CacheConstants;
 import com.customs.cq.datacenter.common.constant.Constants;
@@ -29,12 +31,14 @@ import com.customs.cq.datacenter.common.utils.redis.RedisUtils;
 import com.customs.cq.datacenter.common.utils.spring.SpringUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.time.Duration;
 import java.time.LocalDateTime;
 import java.util.List;
+import java.util.Objects;
 import java.util.function.Supplier;
 
 /**
@@ -46,6 +50,8 @@ import java.util.function.Supplier;
 @Slf4j
 @Service
 public class SysLoginService {
+    @Autowired
+    private SysDeptMapper deptMapper;
 
     private final SysUserMapper userMapper;
     private final ISysConfigService configService;
@@ -332,7 +338,15 @@ public class SysLoginService {
         loginUser.setUserType(user.getUserType());
         loginUser.setMenuPermission(permissionService.getMenuPermission(user));
         loginUser.setRolePermission(permissionService.getRolePermission(user));
-        loginUser.setDeptName(ObjectUtil.isNull(user.getDept()) ? "" : user.getDept().getDeptName());
+        loginUser.setDeptName("");
+        if (Objects.isNull(user.getDept())) {
+            SysDept dept = deptMapper.selectById(user.getDeptId());
+            if (Objects.nonNull(dept)) {
+                loginUser.setDeptName(dept.getDeptName());
+            }
+        } else {
+            loginUser.setDeptName(user.getDept().getDeptName());
+        }
         List<RoleDTO> roles = BeanUtil.copyToList(user.getRoles(), RoleDTO.class);
         loginUser.setRoles(roles);
         return loginUser;

+ 18 - 0
secure-producting-vue/src/api/form/DangerCheckRecord.js

@@ -34,3 +34,21 @@ export function modify(data) {
     data: data
   })
 }
+
+// 我的隐患检查
+export function listMine(data) {
+  return request({
+    url: '/checkRecord/listMine',
+    method: 'post',
+    data: data
+  })
+}
+
+// 我的隐患检查(网格管理员)
+export function listAdminMine(data) {
+  return request({
+    url: '/checkRecord/listAdminMine',
+    method: 'post',
+    data: data
+  })
+}

+ 7 - 1
secure-producting-vue/src/router/index.js

@@ -245,7 +245,13 @@ export const dynamicRoutes = [
         path: 'dangerCheckRecord',
         component: () => import('@/views/form/DangerCheckRecord'),
         name: 'DangerCheckRecord',
-        meta: { title: '隐患检查表', activeMenu: '/form/dangerCheckRecord' }
+        meta: { title: '检查记录', activeMenu: '/check/dangerCheckRecord' }
+      },
+      {
+        path: 'dangerCheckRecordMine',
+        component: () => import('@/views/check/DangerCheckRecordMine'),
+        name: 'DangerCheckRecordMine',
+        meta: { title: '我的检查', activeMenu: '/check/dangerCheckRecordMine' }
       }
     ]
   },

+ 562 - 0
secure-producting-vue/src/views/check/DangerCheckRecordMine.vue

@@ -0,0 +1,562 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryRef" :inline="true">
+      <el-form-item label="检查单号" prop="checkFormNo">
+        <el-input
+          v-model="queryParams.checkFormNo"
+          placeholder="请输入"
+          clearable
+          style="width: 200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="关区代码" prop="customs">
+        <el-input
+          v-model="queryParams.customs"
+          placeholder="请输入"
+          clearable
+          style="width: 200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="检查时间">
+        <el-date-picker
+          v-model="dateRangeCheckTime"
+          value-format="YYYY-MM-DD HH:mm:ss"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :default-time="[
+            new Date(2000, 1, 1, 0, 0, 0),
+            new Date(2000, 1, 1, 23, 59, 59),
+          ]"
+          style="width:240px"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="检查单状态" prop="listStatus">
+        <el-select
+          v-model="queryParams.listStatus"
+          multiple
+          clearable
+          placeholder="请选择"
+          style="max-width:240px"
+        >
+          <el-option
+            v-for="item in checkFormStatusList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="检查人员" prop="checkPersonName">
+        <el-input
+          v-model="queryParams.checkPersonName"
+          placeholder="请输入"
+          clearable
+          style="width:200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否有隐患" prop="hasDanger">
+        <el-radio-group v-model="queryParams.hasDanger">
+          <el-radio :label="0">无隐患</el-radio>
+          <el-radio :label="1">有隐患</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="网格类型" prop="ListGridCategory">
+        <el-select
+          v-model="queryParams.ListGridCategory"
+          multiple
+          clearable
+          placeholder="请选择"
+          style="max-width:240px"
+        >
+          <el-option
+            v-for="item in gridCategoryList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="隐患分类" prop="listDangerCategory">
+        <el-select
+          v-model="queryParams.listDangerCategory"
+          multiple
+          clearable
+          placeholder="请选择"
+          style="max-width:240px"
+        >
+          <el-option
+            v-for="item in dangerCategoryList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="所属部门" prop="listDepartment">
+        <el-tree-select
+          v-model="queryParams.listDepartment"
+          :data="deptOptions"
+          multiple
+          clearable
+          collapse-tags
+          collapse-tags-tooltip
+          :max-collapse-tags="3"
+          check-strictly
+          :props="{ value: 'id', label: 'label', children: 'children' }"
+          style="width:220px"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
+        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8" v-if="false">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="Plus"
+          @click="handleAdd"
+          >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="Edit"
+          :disabled="single"
+          @click="handleUpdate"
+          >修改</el-button>
+      </el-col>
+    </el-row>
+
+    <el-table
+      :data="dataList"
+      @selection-change="handleSelectionChange"
+      @row-dblclick="handleDetail"
+    >
+      <el-table-column label="检查时间" width="96" align="center" prop="checkTimeView">
+        <template #default="scope">
+          {{ parseTime(scope.row.checkTimeView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" width="60" align="center" prop="status">
+        <template #default="scope">
+          {{ getStatusTxt(scope.row.status) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="检查单号" width="231" align="center" prop="checkFormNo" />
+      <el-table-column label="检查表名称" width="300" align="left" prop="checkFormName" />
+      <el-table-column label="所属部门" align="center" prop="departmentTxt" />
+      <el-table-column label="所属关区" align="center" prop="customsName" />
+      <el-table-column label="检查人员" align="center" prop="checkPersonName" />
+      <el-table-column label="是否有隐患" width="89" align="center" prop="hasDangerTxt" />
+      <el-table-column label="整改期限" width="96" align="center" prop="rectifyDeadlineView">
+        <template #default="scope">
+          {{ parseTime(scope.row.rectifyDeadlineView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        width="150"
+        fixed="right"
+        class-name="small-padding fixed-width"
+      >
+        <template #default="scope">
+          <el-button
+            link
+            type="primary"
+            @click="handleDetail(scope.row)"
+            >详情</el-button>
+          <el-button
+            link
+            type="primary"
+            icon="Edit"
+            @click="handleUpdate(scope.row)"
+            >修改</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.page"
+      v-model:limit="queryParams.limit"
+      @pagination="getList"
+    />
+
+  <!-- 添加对话框 -->
+  <el-dialog
+    :title="title"
+    v-model="dialogOpenCreate"
+    width="750px"
+    append-to-body
+  >
+    <el-form
+      ref="formCrateRef"
+      :model="formCreate"
+      :rules="rulesCreate"
+      label-width="135px"
+    >
+      <el-form-item label="分类名称" prop="categoryName">
+        <el-input v-model="formCreate.categoryName" placeholder="请输入分类名称" />
+      </el-form-item>
+      <el-form-item label="检查频率" prop="checkCycle">
+        <el-select
+          v-model="formCreate.checkCycle"
+          placeholder="请选择"
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in checkCycleList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="描述" prop="description">
+        <el-input v-model="formCreate.description" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入描述" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button
+          :loading="createLoading"
+          type="primary"
+          @click="submitCreate"
+          >确 定</el-button>
+        <el-button @click="cancelCreate">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
+
+  <!-- 修改对话框 -->
+  <el-dialog
+    :title="title"
+    v-model="dialogOpenModify"
+    width="750px"
+    append-to-body
+  >
+    <el-form
+      :disabled="isDetail"
+      ref="formModifyRef"
+      :model="formModify"
+      :rules="rulesModify"
+      label-width="135px"
+    >
+      <el-form-item label="分类名称" prop="categoryName">
+        <el-input v-model="formModify.id" type="hidden" />
+        <el-input v-model="formModify.categoryName" placeholder="请输入分类名称" />
+      </el-form-item>
+      <el-form-item label="检查频率" prop="checkCycle">
+        <el-select
+          v-model="formModify.checkCycle"
+          placeholder="请选择"
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in checkCycleList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="描述" prop="description">
+        <el-input v-model="formModify.description" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入描述" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button
+          v-if="isDetail === false"
+          :loading="modifyLoading"
+          type="primary"
+          @click="submitModify"
+          >确 定</el-button>
+        <el-button @click="cancelModify">{{cancelModifyTxt}}</el-button>
+        <el-button type="primary" v-if="isDetail" @click="changeModify">编 辑</el-button>
+      </div>
+    </template>
+  </el-dialog>
+  </div>
+</template>
+
+<script setup name="DangerCheckRecordMine">
+import { deptTreeSelect } from "@/api/system/user";
+import { listAllGridCategory } from "@/api/grid/GridCategory";
+import { listAllDangerCategory } from "@/api/danger/DangerCategory";
+import { listEnumValue } from "@/api/system/base"
+import {
+  submit, detail, modify, listMine, listAdminMine
+} from "@/api/form/DangerCheckRecord";
+import { parseTime } from "@/utils/ruoyi"
+
+const { proxy } = getCurrentInstance();
+
+const getAdminList = ref(false);
+
+const deptOptions = ref(undefined);
+const gridCategoryList = ref([]);
+const dangerCategoryList = ref([]);
+const checkFormStatusList = ref([]);
+const dataList = ref([]);
+
+const createLoading = ref(false);
+const dialogOpenCreate = ref(false);
+
+const modifyLoading = ref(false);
+const dialogOpenModify = ref(false);
+
+const total = ref(0);
+const dateRangeCheckTime = ref([]);
+const ids = ref([]);
+const single = ref(true);
+const multiple = ref(true);
+const title = ref("");
+const cancelModifyTxt = ref("取 消");
+const isDetail = ref(false);
+
+const queryParams = ref({
+  page: 1,
+  limit: 10,
+  listStatus: undefined,
+  checkTimeRange: "",
+  checkFormNo: undefined,
+  ListGridCategory: undefined,
+  listDangerCategory: undefined,
+  listDepartment: undefined,
+  customs: undefined,
+  hasDanger: undefined
+});
+
+const formCreate = ref({});
+const rulesCreate = ref({
+  categoryName: [
+    { required: true, message: "分类名称不能为空", trigger: "blur" },
+    { max: 100, message: '分类名称字符长度不能超过100', trigger: 'blur' }
+  ],
+  description: [{ max: 200, message: '分类描述字符长度不能超过200', trigger: 'blur' }],
+});
+
+const formModify = ref({});
+const rulesModify = ref({
+  categoryName: [
+    { required: true, message: "分类名称不能为空", trigger: "blur" },
+    { max: 100, message: '分类名称字符长度不能超过1200', trigger: 'blur' }
+  ],
+  description: [{ max: 200, message: '分类描述字符长度不能超过500', trigger: 'blur' }],
+});
+
+
+
+/** 查询列表 */
+function getList() {
+  if (
+    dateRangeCheckTime &&
+    dateRangeCheckTime.value &&
+    dateRangeCheckTime.value[0]
+  ) {
+    queryParams.value.checkTimeRange = dateRangeCheckTime.value.join(" ~ ");
+  }
+  if (getAdminList.value) {
+    listAdminMine(queryParams.value).then((response) => {
+        dataList.value = response.data.list;
+        total.value = response.data.total;
+    });
+  } else {
+    listMine(queryParams.value).then((response) => {
+        dataList.value = response.data.list;
+        total.value = response.data.total;
+    });
+  }
+};
+/** 搜索按钮操作 */
+function handleQuery() {
+  queryParams.value.page = 1;
+  getList();
+}
+/** 重置按钮操作 */
+function resetQuery() {
+  dateRangeCheckTime.value = [];
+  proxy.resetForm("queryRef");
+  handleQuery();
+}
+/** 选择条数  */
+function handleSelectionChange(selection) {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+}
+/** 取消新增按钮 */
+function cancelCreate() {
+  dialogOpenCreate.value = false;
+  resetCreate();
+}
+/** 新增表单重置 */
+function resetCreate() {
+  formCreate.value = {
+    categoryName: undefined,
+    description: undefined,
+  };
+  proxy.resetForm("formCrateRef");
+}
+/** 新增按钮 */
+function handleAdd() {
+  resetCreate();
+  dialogOpenCreate.value = true;
+  title.value = "提交隐患检查";
+}
+/** 新增提交 */
+function submitCreate() {
+  proxy.$refs["formCrateRef"].validate((valid) => {
+    if (valid) {
+      createLoading.value = true;
+
+      create(formCreate.value)
+        .then((response) => {
+          proxy.$modal.msgSuccess("提交成功");
+          dialogOpenCreate.value = false;
+          getList();
+        })
+        .finally(() => {
+          createLoading.value = false;
+        });
+    }
+  });
+}
+/** 取消编辑按钮 */
+function cancelModify() {
+  dialogOpenModify.value = false;
+  resetModify();
+}
+/** 编辑表单重置 */
+function resetModify() {
+  formModify.value = {
+    id: undefined,
+    categoryName: undefined,
+    description: undefined,
+  };
+  proxy.resetForm("formModifyRef");
+}
+/** 详情按钮 */
+function handleDetail(row) {
+  modifyLoading.value = true;
+  resetModify();
+  const id = row.id || ids.value[0];
+  detail(id).then((response) => {
+    isDetail.value = true;
+    modifyLoading.value = false;
+
+    formModify.value = response.data;
+    formModify.value.checkCycle = formModify.value.checkCycle + '';
+
+    dialogOpenModify.value = true;
+    title.value = "隐患检查单";
+    cancelModifyTxt.value = '关 闭';
+  });
+}
+/** 详情编辑 */
+function changeModify() {
+  isDetail.value = false;
+  title.value = "修改隐患检查单";
+}
+/** 修改按钮 */
+function handleUpdate(row) {
+  modifyLoading.value = true;
+  resetModify();
+  const id = row.id || ids.value[0];
+  detail(id).then((response) => {
+    isDetail.value = false;
+    modifyLoading.value = false;
+
+    formModify.value = response.data;
+    formModify.value.checkCycle = formModify.value.checkCycle + '';
+
+    dialogOpenModify.value = true;
+    title.value = "修改隐患检查单";
+    cancelModifyTxt.value = '取 消';
+  });
+}
+/** 修改提交 */
+function submitModify() {
+  proxy.$refs["formModifyRef"].validate((valid) => {
+    if (valid) {
+      modifyLoading.value = true;
+
+      modify(formModify.value)
+        .then((response) => {
+          proxy.$modal.msgSuccess("修改成功");
+          dialogOpenModify.value = false;
+          getList();
+        })
+        .finally(() => {
+          modifyLoading.value = false;
+        });
+    }
+  });
+}
+
+
+function getStatusTxt(status) {
+  let find = checkFormStatusList.value.find(c => parseInt(c.value) === status);
+  if (find) {
+    return find.label;
+  }
+  return '未知';
+}
+
+
+
+/** 获取检查单状态下拉树结构 */
+function getCheckFormStatus() {  
+  listEnumValue('ECheckFormStatus').then(response => {
+    checkFormStatusList.value = response.data;
+  });
+};
+/** 查询部门下拉树结构 */
+function getDeptTree() {
+  deptTreeSelect().then(response => {
+    deptOptions.value = response.data;
+  });
+};
+/** 初始化网格类型下拉框数据 */
+function initListGridCategory() {
+  listAllGridCategory().then((response) => {
+    gridCategoryList.value = response.data;
+  });
+}
+/** 初始化隐患分类下拉框数据 */
+function initListDangerCategory() {
+  listAllDangerCategory().then((response) => {
+    dangerCategoryList.value = response.data;
+  });
+}
+
+
+
+// 调用获取检查单状态下拉树结构
+getCheckFormStatus();
+// 调用初始化部门下拉框数据
+getDeptTree();
+// 调用初始化网格类型下拉框数据
+initListGridCategory();
+// 调用初始化隐患分类下拉框数据
+initListDangerCategory();
+
+/** 页面加载完毕 */
+onMounted(async () => {
+  // 获取列表数据
+  getList();
+});
+</script>

+ 51 - 35
secure-producting-vue/src/views/form/DangerCheckRecord.vue

@@ -31,30 +31,16 @@
             new Date(2000, 1, 1, 0, 0, 0),
             new Date(2000, 1, 1, 23, 59, 59),
           ]"
+          style="width:240px"
         ></el-date-picker>
       </el-form-item>
-      <el-form-item label="检查人员" prop="checkPerson">
-        <el-input
-          v-model="queryParams.checkPerson"
-          placeholder="请输入"
-          clearable
-          style="width: 200px"
-          @keyup.enter="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="是否有隐患" prop="hasDanger">
-        <el-radio-group v-model="queryParams.hasDanger">
-          <el-radio :label="0">无隐患</el-radio>
-          <el-radio :label="1">有隐患</el-radio>
-        </el-radio-group>
-      </el-form-item>
       <el-form-item label="检查单状态" prop="listStatus">
         <el-select
           v-model="queryParams.listStatus"
           multiple
           clearable
           placeholder="请选择"
-          style="width: 240px"
+          style="max-width:240px"
         >
           <el-option
             v-for="item in checkFormStatusList"
@@ -64,13 +50,28 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="检查人员" prop="checkPersonName">
+        <el-input
+          v-model="queryParams.checkPersonName"
+          placeholder="请输入"
+          clearable
+          style="width:200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否有隐患" prop="hasDanger">
+        <el-radio-group v-model="queryParams.hasDanger">
+          <el-radio :label="0">无隐患</el-radio>
+          <el-radio :label="1">有隐患</el-radio>
+        </el-radio-group>
+      </el-form-item>
       <el-form-item label="网格类型" prop="ListGridCategory">
         <el-select
           v-model="queryParams.ListGridCategory"
           multiple
           clearable
           placeholder="请选择"
-          style="width: 240px"
+          style="max-width:240px"
         >
           <el-option
             v-for="item in gridCategoryList"
@@ -86,7 +87,7 @@
           multiple
           clearable
           placeholder="请选择"
-          style="width: 240px"
+          style="max-width:240px"
         >
           <el-option
             v-for="item in dangerCategoryList"
@@ -98,13 +99,16 @@
       </el-form-item>
       <el-form-item label="所属部门" prop="listDepartment">
         <el-tree-select
-          v-model="value"
+          v-model="queryParams.listDepartment"
           :data="deptOptions"
           multiple
+          clearable
+          collapse-tags
+          collapse-tags-tooltip
+          :max-collapse-tags="3"
           check-strictly
-          :render-after-expand="false"
-          show-checkbox
-          style="width: 240px"
+          :props="{ value: 'id', label: 'label', children: 'children' }"
+          style="width:220px"
         />
       </el-form-item>
       <el-form-item>
@@ -138,20 +142,27 @@
       @selection-change="handleSelectionChange"
       @row-dblclick="handleDetail"
     >
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="检查时间" align="center" prop="heckTimeView" />
-      <el-table-column label="状态" align="center" prop="status">
+      <el-table-column label="检查时间" width="96" align="center" prop="checkTimeView">
+        <template #default="scope">
+          {{ parseTime(scope.row.checkTimeView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" width="60" align="center" prop="status">
         <template #default="scope">
           {{ getStatusTxt(scope.row.status) }}
         </template>
       </el-table-column>
-      <el-table-column label="检查单号" align="center" prop="checkFormNo" />
-      <el-table-column label="检查表名称" align="center" prop="checkFormName" />
+      <el-table-column label="检查单号" width="231" align="center" prop="checkFormNo" />
+      <el-table-column label="检查表名称" width="300" align="left" prop="checkFormName" />
       <el-table-column label="所属部门" align="center" prop="departmentTxt" />
       <el-table-column label="所属关区" align="center" prop="customsName" />
-      <el-table-column label="检查人员" align="center" prop="checkPerson" />
-      <el-table-column label="是否有隐患" align="center" prop="hasDangerTxt" />
-      <el-table-column label="整改期限" align="center" prop="rectifyDeadlineView" />
+      <el-table-column label="检查人员" align="center" prop="checkPersonName" />
+      <el-table-column label="是否有隐患" width="89" align="center" prop="hasDangerTxt" />
+      <el-table-column label="整改期限" width="96" align="center" prop="rectifyDeadlineView">
+        <template #default="scope">
+          {{ parseTime(scope.row.rectifyDeadlineView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
       <el-table-column
         label="操作"
         align="center"
@@ -289,6 +300,7 @@ import { listEnumValue } from "@/api/system/base"
 import {
   submit, detail, modify, search
 } from "@/api/form/DangerCheckRecord";
+import { parseTime } from "@/utils/ruoyi"
 
 const { proxy } = getCurrentInstance();
 
@@ -323,7 +335,7 @@ const queryParams = ref({
   listDangerCategory: undefined,
   listDepartment: undefined,
   customs: undefined,
-  hasDanger: 0
+  hasDanger: undefined
 });
 
 const formCreate = ref({});
@@ -488,9 +500,9 @@ function submitModify() {
 
 
 function getStatusTxt(status) {
-  let find = checkFormStatusList.value.filter(c => c.value === status);
+  let find = checkFormStatusList.value.find(c => parseInt(c.value) === status);
   if (find) {
-    return find.Label;
+    return find.label;
   }
   return '未知';
 }
@@ -532,6 +544,10 @@ getDeptTree();
 initListGridCategory();
 // 调用初始化隐患分类下拉框数据
 initListDangerCategory();
-// 调用列表查询
-getList();
+
+/** 页面加载完毕 */
+onMounted(async () => {
+  // 获取列表数据
+  getList();
+});
 </script>

+ 11 - 4
secure-producting-vue/src/views/grid/components/MyGridAndCheck.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
-    <el-card shadow="hover" header="隐患检查" style="margin-bottom: 5px">
-      <el-table :data="listMineGrid" stripe style="width: 100%">
+    <el-card shadow="hover" header="今日隐患检查" style="margin-bottom: 5px">
+      <el-table :data="listMineGrid" stripe style="width: 100%" empty-text="当期帐号没有网格归属,请联系管理员!">
         <el-table-column prop="checkFormName" label="检查表信息" :show-overflow-tooltip="true">
           <template #default="scope">
             {{ scope.row.gridName + ' - ' + scope.row.checkFormName }}
@@ -14,9 +14,11 @@
               v-if="scope.row.checkStatus === 1"
               link
               type="primary"
+              icon="View"
               @click="handleDetail(scope.row)"
             >查看</el-button>
             <el-button
+              v-if="scope.row.checkStatus === 0"
               link
               type="primary"
               icon="Edit"
@@ -43,7 +45,7 @@
               :gridId="submitItem.gridId"
               :checkFormId="submitItem.checkFormId"
               :checkFormName="submitItem.checkFormName"
-              @closeCallback="showSubmitCheck = false"
+              @closeCallback="submitCallBack"
             ></submit-danger-check>
           </el-scrollbar>
         </div>
@@ -98,7 +100,12 @@ function handleDoForm(row) {
 
 function submitCheck() {
   // 调用子组件的函数
-  proxy.$refs["refSubmitCheck"].submitCheck();
+  proxy.$refs.refSubmitCheck.submitCheck();
+}
+
+function submitCallBack() {
+  showSubmitCheck.value = false;
+  getListPerson();
 }
 
 getListPerson();

+ 11 - 10
secure-producting-vue/src/views/grid/components/SubmitDangerCheck.vue

@@ -33,9 +33,9 @@
           placeholder="请选择"
         />
       </el-form-item>
-      <el-form-item label="检查人员" prop="checkPerson">
+      <el-form-item label="检查人员" prop="checkPersonName">
         <span class="form-line-left">
-          <el-input v-model="formSubmit.checkPerson" placeholder="请输入" style="width:215px;" />
+          <el-input v-model="formSubmit.checkPersonName" placeholder="请输入" style="width:215px;" />
         </span>
         <span class="form-line-right">联系方式</span>
         <el-input v-model="formSubmit.contactInfo" placeholder="请输入" style="width:220px;" />
@@ -188,13 +188,11 @@ const props = defineProps({
     checkFormName: {
         type: String,
         default: '',
-    },
-    // 关闭回调函数
-    closeCallback: {
-      type: Object
     }
 });
 
+const emit = defineEmits(['closeCallback']);
+
 const uploadUrl = import.meta.env.VITE_APP_BASE_API + "/file/upload";
 const allowedFileTypes = ref([
   'image/jpeg',   // JPEG 图像文件
@@ -217,7 +215,7 @@ const formSubmit = ref({
   checkFormId: props.checkFormId,
   customs: undefined,
   checkTime: parseTime(new Date(), '{y}-{m}-{d}'),
-  checkPerson: '',
+  checkPersonName: '',
   contactInfo: '',
   listAttachment: [],
   listItem: [],
@@ -231,7 +229,7 @@ const rulesSubmit = ref({
   checkFormId: [{ required: true, message: "所属检查表不能为空", trigger: "blur" }],
   customs: [{ required: true, message: "关区代码不能为空", trigger: "blur" }],
   checkTime: [{ required: true, message: "检查时间不能为空", trigger: "blur" }],
-  checkPerson: [{ required: true, message: "检查人员不能为空", trigger: "blur" }],
+  checkPersonName: [{ required: true, message: "检查人员不能为空", trigger: "blur" }],
   contactInfo: [{ required: true, message: "联系方式不能为空", trigger: "blur" }],
   listItem: [{ required: true, message: "检查项列表不能为空", trigger: "blur" }],
   isSubmit: [{ required: true, message: "是否直接提交不能为空", trigger: "blur" }],
@@ -319,7 +317,7 @@ function submitCheck() {
       submit(formSubmit.value)
       .then((response) => {
         proxy.$modal.msgSuccess("提交成功");
-        that.props.closeCallback();
+        emit('closeCallback');
       })
       .finally(() => {
         loadingSubmit.value = false;
@@ -336,7 +334,7 @@ function getLoginUser() {
   .then((response) => {
     loginUser.value = response.data.user;
 
-    formSubmit.value.checkPerson = loginUser.value.nickName;
+    formSubmit.value.checkPersonName = loginUser.value.nickName;
     formSubmit.value.contactInfo = loginUser.value.phonenumber;
   });
 }
@@ -377,4 +375,7 @@ onMounted(async () => {
   initListDictData();
   getFormDetail();
 });
+
+// 主动暴露函数给父组件
+defineExpose({ submitCheck });
 </script>

+ 2 - 0
sql/20240814.sql

@@ -340,6 +340,7 @@ CREATE TABLE "SECURE_PRODUCTING"."SP_CHECK_RECORD"(
   "CUSTOMS_NAME" VARCHAR(200) NOT NULL DEFAULT '',
   "CHECK_TIME" BIGINT NOT NULL DEFAULT 0,
   "CHECK_PERSON" VARCHAR(50) NOT NULL DEFAULT '',
+  "CHECK_PERSON_NAME" VARCHAR(50) NOT NULL DEFAULT '',
   "CONTACT_INFO" VARCHAR(50) NOT NULL DEFAULT '',
   "GRID_CATEGORY" BIGINT NOT NULL DEFAULT 0,
   "DANGER_CATEGORY" BIGINT NOT NULL DEFAULT 0,
@@ -385,6 +386,7 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."CUSTOMS" IS '所属关
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."CUSTOMS_NAME" IS '关区名称';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."CHECK_TIME" IS '检查时间';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."CHECK_PERSON" IS '检查人员';
+COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."CHECK_PERSON_NAME" IS '检查人员名称';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."CONTACT_INFO" IS '联系方式';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."GRID_CATEGORY" IS '网格类型';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."DANGER_CATEGORY" IS '隐患分类';