7 Commity 1e1f3b8fe2 ... 4a3a22dd4a

Autor SHA1 Správa Dátum
  lin.liu 4a3a22dd4a 检查表 3 týždňov pred
  lin.liu f6a6f0769a 隐患分类 3 týždňov pred
  lin.liu fcac5999df 获取枚举接口 3 týždňov pred
  lin.liu 3e21c981a6 接口顺序 3 týždňov pred
  lin.liu 99b1a035e5 修改数据库字段 3 týždňov pred
  lin.liu b4afed8a5c 接口顺序 3 týždňov pred
  lin.liu d9a25f7295 从数据库生成代码 3 týždňov pred
38 zmenil súbory, kde vykonal 2223 pridanie a 86 odobranie
  1. 128 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckFormGridCycleController.java
  2. 3 3
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRecordController.java
  3. 3 3
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRectifyDelayController.java
  4. 3 3
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRectifyProgressController.java
  5. 3 3
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRevokeController.java
  6. 75 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/CheckFormGridCyclePO.java
  7. 4 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/DangerCategoryPO.java
  8. 0 8
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/DangerCheckFormPO.java
  9. 0 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/DangerCheckItemPO.java
  10. 57 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/CheckFormGridCycleVO.java
  11. 5 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/DangerCategoryVO.java
  12. 17 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/DangerCheckFormVO.java
  13. 55 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkformgridcycle/ReqCreateCheckFormGridCycle.java
  14. 59 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkformgridcycle/ReqModifyCheckFormGridCycle.java
  15. 4 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercategory/ReqCreateDangerCategory.java
  16. 4 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercategory/ReqModifyDangerCategory.java
  17. 6 16
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercheckform/ReqCreateDangerCheckForm.java
  18. 6 16
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercheckform/ReqModifyDangerCheckForm.java
  19. 0 4
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercheckitem/ReqCreateDangerCheckItem.java
  20. 23 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchCheckFormGridCycle.java
  21. 7 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchDangerCategory.java
  22. 14 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/CheckFormGridCycleMapper.java
  23. 100 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckFormGridCycleMapperImpl.java
  24. 9 6
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/DangerCategoryMapperImpl.java
  25. 14 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/DangerCheckItemMapperImpl.java
  26. 212 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckFormGridCycleService.java
  27. 212 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckRecordItemService.java
  28. 10 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/DangerCategoryService.java
  29. 98 12
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/DangerCheckFormService.java
  30. 212 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/DangerCheckItemService.java
  31. 79 0
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/enums/ECheckCycle.java
  32. 48 0
      secure-producting-host/src/main/java/com/customs/cq/datacenter/host/web/controller/common/BaseController.java
  33. 36 0
      secure-producting-vue/src/api/form/DangerCheckForm.js
  34. 9 0
      secure-producting-vue/src/api/system/base.js
  35. 15 0
      secure-producting-vue/src/router/index.js
  36. 65 0
      secure-producting-vue/src/views/danger/DangerCategory.vue
  37. 586 0
      secure-producting-vue/src/views/form/DangerCheckForm.vue
  38. 42 8
      sql/20240814.sql

+ 128 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckFormGridCycleController.java

@@ -0,0 +1,128 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.controller;
+
+import com.customs.cq.datacenter.common.ExecutedResult;
+import com.customs.cq.datacenter.common.PagerResult;
+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.common.model.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+import com.customs.cq.datacenter.business.service.CheckFormGridCycleService;
+import com.customs.cq.datacenter.business.entity.request.checkformgridcycle.ReqCreateCheckFormGridCycle;
+import com.customs.cq.datacenter.business.entity.request.checkformgridcycle.ReqModifyCheckFormGridCycle;
+import com.customs.cq.datacenter.business.entity.search.SearchCheckFormGridCycle;
+import com.customs.cq.datacenter.business.domain.vo.CheckFormGridCycleVO;
+
+/**
+ * 1060.检查表-网格-频率设置
+ * @author lin.liu
+ * @description 1060.检查表-网格-频率设置
+ * @order 1060
+ */
+@RestController
+@RequestMapping(value = "checkFormGridCycle")
+public class CheckFormGridCycleController extends BasicController {
+    @Autowired
+    private CheckFormGridCycleService service;
+
+    /**
+     * 创建[检查表-网格-频率设置]
+     * @author lin.liu
+     * @description 创建[检查表-网格-频率设置]
+     */
+    @PostMapping(value = "create")
+    public ExecutedResult<Long> create(@RequestBody ReqCreateCheckFormGridCycle request) {
+        //#region 参数验证
+        ParameterValidator validator = new ParameterValidator()
+                // 非空
+                //.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.create(request);
+    }
+
+    /**
+     * 编辑[检查表-网格-频率设置]
+     * @author lin.liu
+     * @description 编辑[检查表-网格-频率设置]
+     */
+    @PostMapping(value = "modify")
+    public ExecutedResult<String> modify(@RequestBody ReqModifyCheckFormGridCycle 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);
+    }
+
+    /**
+     * 获取[检查表-网格-频率设置]
+     * @author lin.liu
+     * @description 获取[检查表-网格-频率设置]
+     */
+    @GetMapping(value = "get/{id}")
+    public ExecutedResult<CheckFormGridCycleVO> get(@PathVariable Long id) {
+        return this.service.get(id);
+    }
+
+    /**
+     * 根据id批量获取[检查表-网格-频率设置]
+     * @author lin.liu
+     * @description 根据id批量获取[检查表-网格-频率设置]
+     */
+    @PostMapping(value = "getList")
+    public ExecutedResult<List<CheckFormGridCycleVO>> getList(@RequestBody ReqListId request) {
+        return this.service.getList(request.getListId());
+    }
+
+    /**
+     * 查询[检查表-网格-频率设置]
+     * @author lin.liu
+     * @description 查询[检查表-网格-频率设置]
+     */
+    @PostMapping(value = "search")
+    public ExecutedResult<PagerResult<CheckFormGridCycleVO>> search(@RequestBody SearchCheckFormGridCycle request) {
+        return this.service.search(request);
+    }
+}

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

@@ -39,10 +39,10 @@ import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
 import com.customs.cq.datacenter.business.domain.vo.CheckRecordVO;
 
 /**
- * 2020.隐患检查记录
+ * 2010.隐患检查记录
  * @author lin.liu
- * @description 2020.隐患检查记录
- * @order 2020
+ * @description 2010.隐患检查记录
+ * @order 2010
  */
 @RestController
 @RequestMapping(value = "checkRecord")

+ 3 - 3
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRectifyDelayController.java

@@ -39,10 +39,10 @@ import com.customs.cq.datacenter.business.entity.search.SearchCheckRectifyDelay;
 import com.customs.cq.datacenter.business.domain.vo.CheckRectifyDelayVO;
 
 /**
- * 2120.隐患整改延期申请
+ * 2040.隐患整改延期申请
  * @author lin.liu
- * @description 2120.隐患整改延期申请
- * @order 2120
+ * @description 2040.隐患整改延期申请
+ * @order 2040
  */
 @RestController
 @RequestMapping(value = "checkRectifyDelay")

+ 3 - 3
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRectifyProgressController.java

@@ -39,10 +39,10 @@ import com.customs.cq.datacenter.business.entity.search.SearchCheckRectifyProgre
 import com.customs.cq.datacenter.business.domain.vo.CheckRectifyProgressVO;
 
 /**
- * 9000.隐患整改进度
+ * 2030.隐患整改进度
  * @author lin.liu
- * @description 9000.隐患整改进度
- * @order 9000
+ * @description 2030.隐患整改进度
+ * @order 2030
  */
 @RestController
 @RequestMapping(value = "checkRectifyProgress")

+ 3 - 3
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRevokeController.java

@@ -39,10 +39,10 @@ import com.customs.cq.datacenter.business.entity.search.SearchCheckRevoke;
 import com.customs.cq.datacenter.business.domain.vo.CheckRevokeVO;
 
 /**
- * 2130.隐患检查单撤回申请
+ * 2020.隐患检查单撤回申请
  * @author lin.liu
- * @description 2130.隐患检查单撤回申请
- * @order 2130
+ * @description 2020.隐患检查单撤回申请
+ * @order 2020
  */
 @RestController
 @RequestMapping(value = "checkRevoke")

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

@@ -0,0 +1,75 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.domain;
+
+import lombok.Data;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.sql.Timestamp;
+import java.time.LocalDate;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+@Data
+@TableName("SP_CHECK_FORM_GRID_CYCLE")
+public class CheckFormGridCyclePO {
+	/**
+	 * 主键
+	 */
+	private Long id;
+	/**
+	 * 关联检查表
+	 */
+	private Long checkFormId;
+	/**
+	 * 检查表名称
+	 */
+	private String checkFormName;
+	/**
+	 * 关联网格
+	 */
+	private Long gridId;
+	/**
+	 * 网格名称
+	 */
+	private String gridName;
+	/**
+	 * 检查频率 ECheckCycle
+	 */
+	private Integer checkCycle;
+	/**
+	 * 数据创建时间
+	 */
+	private Long createTime;
+	/**
+	 * 最后更新时间
+	 */
+	private Timestamp updateTime;
+	/**
+	 * 是否删除(逻辑删除)
+	 */
+	private Integer isDelete;
+}

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

@@ -44,6 +44,10 @@ public class DangerCategoryPO {
 	 * 类别名称
 	 */
 	private String categoryName;
+	/**
+	 * 检查频率 ECheckCycle
+	 */
+	private Integer checkCycle;
 	/**
 	 * 描述
 	 */

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

@@ -44,14 +44,6 @@ public class DangerCheckFormPO {
 	 * 检查表名称
 	 */
 	private String name;
-	/**
-	 * 所属部门
-	 */
-	private String department;
-	/**
-	 * 部门名称
-	 */
-	private String departmentName;
 	/**
 	 * 隐患分类
 	 */

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

@@ -60,10 +60,6 @@ public class DangerCheckItemPO {
 	 * 最后更新时间
 	 */
 	private Timestamp updateTime;
-	/**
-	 * null
-	 */
-	private String updateBy;
 	/**
 	 * 是否删除(逻辑删除)
 	 */

+ 57 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/CheckFormGridCycleVO.java

@@ -0,0 +1,57 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.domain.vo;
+
+import lombok.Data;
+
+import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
+import com.customs.cq.datacenter.common.utils.NumericUtil;
+import java.util.Objects;
+
+import com.customs.cq.datacenter.common.core.vo.BasicVO;
+import com.customs.cq.datacenter.business.domain.CheckFormGridCyclePO;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+@Data
+public class CheckFormGridCycleVO extends CheckFormGridCyclePO implements BasicVO {
+
+    @Override
+    public String getCreateTimeView() {
+        if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) {
+            return LocalDateTimeUtil.toFormatString(this.getCreateTime());
+        }
+        return "";
+    }
+
+    @Override
+    public String getUpdateTimeView() {
+        if (Objects.isNull(this.getUpdateTime())) {
+            return "";
+        }
+        return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime());
+    }
+}

+ 5 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/DangerCategoryVO.java

@@ -22,6 +22,7 @@
 */
 package com.customs.cq.datacenter.business.domain.vo;
 
+import com.customs.cq.datacenter.common.enums.ECheckCycle;
 import lombok.Data;
 
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
@@ -54,4 +55,8 @@ public class DangerCategoryVO extends DangerCategoryPO implements BasicVO {
         }
         return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime());
     }
+
+    public String getCheckCycleTxt() {
+        return ECheckCycle.getByValue(this.getCheckCycle()).getDesc();
+    }
 }

+ 17 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/DangerCheckFormVO.java

@@ -22,10 +22,14 @@
 */
 package com.customs.cq.datacenter.business.domain.vo;
 
+import com.customs.cq.datacenter.business.entity.request.dangercheckitem.ReqCreateDangerCheckItem;
+import com.customs.cq.datacenter.common.enums.ECheckCycle;
 import lombok.Data;
 
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
+
+import java.util.List;
 import java.util.Objects;
 
 import com.customs.cq.datacenter.common.core.vo.BasicVO;
@@ -54,4 +58,17 @@ public class DangerCheckFormVO extends DangerCheckFormPO implements BasicVO {
         }
         return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime());
     }
+    /**
+     * 检查项列表
+     */
+    private List<ReqCreateDangerCheckItem> listItem;
+
+    /**
+     * 隐患分类名称
+     */
+    private String dangerCategoryTxt;
+
+    public String getDangerCategoryTxt() {
+        return ECheckCycle.getByValue(this.getCheckCycle()).getDesc();
+    }
 }

+ 55 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkformgridcycle/ReqCreateCheckFormGridCycle.java

@@ -0,0 +1,55 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.entity.request.checkformgridcycle;
+
+import lombok.Data;
+import java.time.LocalDate;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+@Data
+public class ReqCreateCheckFormGridCycle {
+	/**
+	 * 关联检查表
+	 */
+	private Long checkFormId;
+	/**
+	 * 检查表名称
+	 */
+	private String checkFormName;
+	/**
+	 * 关联网格
+	 */
+	private Long gridId;
+	/**
+	 * 网格名称
+	 */
+	private String gridName;
+	/**
+	 * 检查频率 ECheckCycle
+	 */
+	private Integer checkCycle;
+}

+ 59 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/checkformgridcycle/ReqModifyCheckFormGridCycle.java

@@ -0,0 +1,59 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.entity.request.checkformgridcycle;
+
+import lombok.Data;
+import java.time.LocalDate;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+@Data
+public class ReqModifyCheckFormGridCycle {
+	/**
+	 * 主键
+	 */
+	private Long id;
+	/**
+	 * 关联检查表
+	 */
+	private Long checkFormId;
+	/**
+	 * 检查表名称
+	 */
+	private String checkFormName;
+	/**
+	 * 关联网格
+	 */
+	private Long gridId;
+	/**
+	 * 网格名称
+	 */
+	private String gridName;
+	/**
+	 * 检查频率 ECheckCycle
+	 */
+	private Integer checkCycle;
+}

+ 4 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercategory/ReqCreateDangerCategory.java

@@ -36,6 +36,10 @@ public class ReqCreateDangerCategory {
 	 * 类别名称
 	 */
 	private String categoryName;
+	/**
+	 * 检查频率 ECheckCycle
+	 */
+	private Integer checkCycle;
 	/**
 	 * 描述
 	 */

+ 4 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercategory/ReqModifyDangerCategory.java

@@ -40,6 +40,10 @@ public class ReqModifyDangerCategory {
 	 * 类别名称
 	 */
 	private String categoryName;
+	/**
+	 * 检查频率 ECheckCycle
+	 */
+	private Integer checkCycle;
 	/**
 	 * 描述
 	 */

+ 6 - 16
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercheckform/ReqCreateDangerCheckForm.java

@@ -22,8 +22,10 @@
 */
 package com.customs.cq.datacenter.business.entity.request.dangercheckform;
 
+import com.customs.cq.datacenter.business.entity.request.dangercheckitem.ReqCreateDangerCheckItem;
 import lombok.Data;
 import java.time.LocalDate;
+import java.util.List;
 
 /**
  * 隐患检查表
@@ -36,28 +38,16 @@ public class ReqCreateDangerCheckForm {
 	 * 检查表名称
 	 */
 	private String name;
-	/**
-	 * 所属部门
-	 */
-	private String department;
-	/**
-	 * 部门名称
-	 */
-	private String departmentName;
 	/**
 	 * 隐患分类
 	 */
 	private Long dangerCategory;
-	/**
-	 * 检查频率 ECheckCycle
-	 */
-	private Integer checkCycle;
-	/**
-	 * 检查次数(周期内)
-	 */
-	private Integer checkTimes;
 	/**
 	 * 描述
 	 */
 	private String description;
+	/**
+	 * 检查项列表
+	 */
+	private List<ReqCreateDangerCheckItem> listItem;
 }

+ 6 - 16
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercheckform/ReqModifyDangerCheckForm.java

@@ -22,8 +22,10 @@
 */
 package com.customs.cq.datacenter.business.entity.request.dangercheckform;
 
+import com.customs.cq.datacenter.business.entity.request.dangercheckitem.ReqCreateDangerCheckItem;
 import lombok.Data;
 import java.time.LocalDate;
+import java.util.List;
 
 /**
  * 隐患检查表
@@ -40,26 +42,10 @@ public class ReqModifyDangerCheckForm {
 	 * 检查表名称
 	 */
 	private String name;
-	/**
-	 * 所属部门
-	 */
-	private String department;
-	/**
-	 * 部门名称
-	 */
-	private String departmentName;
 	/**
 	 * 隐患分类
 	 */
 	private Long dangerCategory;
-	/**
-	 * 检查频率 ECheckCycle
-	 */
-	private Integer checkCycle;
-	/**
-	 * 检查次数(周期内)
-	 */
-	private Integer checkTimes;
 	/**
 	 * 描述
 	 */
@@ -68,4 +54,8 @@ public class ReqModifyDangerCheckForm {
 	 * 状态 EState
 	 */
 	private Integer status;
+	/**
+	 * 检查项列表
+	 */
+	private List<ReqCreateDangerCheckItem> listItem;
 }

+ 0 - 4
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/request/dangercheckitem/ReqCreateDangerCheckItem.java

@@ -32,10 +32,6 @@ import java.time.LocalDate;
  */
 @Data
 public class ReqCreateDangerCheckItem {
-	/**
-	 * 所属隐患检查表
-	 */
-	private Long checkFormId;
 	/**
 	 * 检查项名称
 	 */

+ 23 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchCheckFormGridCycle.java

@@ -0,0 +1,23 @@
+package com.customs.cq.datacenter.business.entity.search;
+
+import com.customs.cq.datacenter.common.model.SearchBasicDTO;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+public class SearchCheckFormGridCycle extends SearchBasicDTO {
+	@Override
+	public String toString() {
+		return "SearchCheckFormGridCycle{" + "'" +
+			"keywords='" + getKeywords() +
+			", status =" + getStatus() +
+			", listStatus =" + getListStatus() +
+			", createTimeRange='" + getCreateTimeRange() + "'" +
+			", createTimeStart =" + getCreateTimeEnd() +
+			", createTimeEnd =" + getCreateTimeEnd() +
+			", orderBy='" + getOrderBy() + "'" +
+		'}';
+	}
+}

+ 7 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchDangerCategory.java

@@ -1,13 +1,20 @@
 package com.customs.cq.datacenter.business.entity.search;
 
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
+import lombok.Data;
 
 /**
  * 隐患类别
  * @author lin.liu
  * @description 隐患类别
  */
+@Data
 public class SearchDangerCategory extends SearchBasicDTO {
+	/**
+	 * 检查频率 ECheckCycle
+	 */
+	private Integer checkCycle;
+
 	@Override
 	public String toString() {
 		return "SearchDangerCategory{" + "'" +

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

@@ -0,0 +1,14 @@
+package com.customs.cq.datacenter.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import com.customs.cq.datacenter.business.domain.CheckFormGridCyclePO;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+@Mapper
+public interface CheckFormGridCycleMapper extends BaseMapper<CheckFormGridCyclePO> {
+}

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

@@ -0,0 +1,100 @@
+package com.customs.cq.datacenter.business.mapper.impl;
+
+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.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.NumericUtil;
+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 org.springframework.stereotype.Repository;
+import com.customs.cq.datacenter.business.entity.search.SearchCheckFormGridCycle;
+import com.customs.cq.datacenter.business.domain.CheckFormGridCyclePO;
+import com.customs.cq.datacenter.business.mapper.CheckFormGridCycleMapper;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+@Repository
+public class CheckFormGridCycleMapperImpl extends BasicMapper<CheckFormGridCyclePO> {
+    public CheckFormGridCycleMapperImpl(CheckFormGridCycleMapper mapper) {
+        super(mapper);
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param request 请求参数
+     */
+    @Override
+    public IPage<CheckFormGridCyclePO> search(SearchBasicDTO request) {
+        // 查询条件类型还原
+        SearchCheckFormGridCycle search = (SearchCheckFormGridCycle)request;
+
+        LambdaQueryWrapper<CheckFormGridCyclePO> queryWrapper = this.getQuery();
+        // 状态非逻辑删除
+        queryWrapper.eq(CheckFormGridCyclePO::getIsDelete, EYesOrNo.NO.getValue());
+        // 状态
+        //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, CheckFormGridCyclePO::getState, search.getStatus());
+        // 状态列表
+        //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), CheckFormGridCyclePO::getState, search.getListStatus());
+        // 数据创建时间-起始
+        queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, CheckFormGridCyclePO::getCreateTime, search.getCreateTimeStart());
+        // 数据创建时间-截止
+        queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, CheckFormGridCyclePO::getCreateTime, search.getCreateTimeEnd());
+        // 关键字
+        //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) {
+        //    queryWrapper.and(q ->
+        //        q.like(CheckFormGridCyclePO::getRealName, search.getKeywords())
+        //        .or().like(CheckFormGridCyclePO::getContactPhone, search.getKeywords())
+        //    );
+        //}
+        // 排序处理
+        if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) {
+            for (OrderByDTO item : search.getOrderBy()) {
+                EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy());
+                // 顺序排序
+                if (item.getIsAsc()) {
+                    switch (orderBy) {
+                        // 主键
+                        case ID:
+                            queryWrapper.orderByAsc(CheckFormGridCyclePO::getId);
+                            break;
+                        // 数据创建时间
+                        case CREATE_TIME:
+                            queryWrapper.orderByAsc(CheckFormGridCyclePO::getCreateTime);
+                            break;
+                        // 最后更新时间
+                        case UPDATE_TIME:
+                            queryWrapper.orderByAsc(CheckFormGridCyclePO::getUpdateTime);
+                            break;
+                    }
+                } else {
+                    // 倒叙排序
+                    switch (orderBy) {
+                        // 主键
+                        case ID:
+                            queryWrapper.orderByAsc(CheckFormGridCyclePO::getId);
+                            break;
+                            // 数据创建时间
+                        case CREATE_TIME:
+                            queryWrapper.orderByAsc(CheckFormGridCyclePO::getCreateTime);
+                            break;
+                            // 最后更新时间
+                        case UPDATE_TIME:
+                            queryWrapper.orderByAsc(CheckFormGridCyclePO::getUpdateTime);
+                            break;
+                    }
+                }
+            }
+        } else {
+            queryWrapper.orderByDesc(CheckFormGridCyclePO::getId);
+        }
+        return mapper.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper);
+    }
+}

+ 9 - 6
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/DangerCategoryMapperImpl.java

@@ -14,6 +14,7 @@ import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 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 org.springframework.stereotype.Repository;
 
 import java.util.ArrayList;
@@ -52,13 +53,15 @@ public class DangerCategoryMapperImpl extends BasicMapper<DangerCategoryPO> {
         queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, DangerCategoryPO::getCreateTime, search.getCreateTimeStart());
         // 数据创建时间-截止
         queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, DangerCategoryPO::getCreateTime, search.getCreateTimeEnd());
+        // 检查频率
+        queryWrapper.eq(NumericUtil.tryParseInt(search.getCheckCycle()).compareTo(0) > 0, DangerCategoryPO::getCheckCycle, search.getCheckCycle());
         // 关键字
-        //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) {
-        //    queryWrapper.and(q ->
-        //        q.like(DangerCategoryPO::getRealName, search.getKeywords())
-        //        .or().like(DangerCategoryPO::getContactPhone, search.getKeywords())
-        //    );
-        //}
+        if (StringUtil.isNotNullOrEmpty(search.getKeywords())) {
+            queryWrapper.and(q ->
+                q.like(DangerCategoryPO::getCategoryName, search.getKeywords())
+                .or().like(DangerCategoryPO::getCategoryName, search.getKeywords())
+            );
+        }
         // 排序处理
         if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) {
             for (OrderByDTO item : search.getOrderBy()) {

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

@@ -15,6 +15,8 @@ import com.customs.cq.datacenter.business.entity.search.SearchDangerCheckItem;
 import com.customs.cq.datacenter.business.domain.DangerCheckItemPO;
 import com.customs.cq.datacenter.business.mapper.DangerCheckItemMapper;
 
+import java.util.List;
+
 /**
  * 隐患检查表-检查项
  * @author lin.liu
@@ -97,4 +99,16 @@ public class DangerCheckItemMapperImpl extends BasicMapper<DangerCheckItemPO> {
         }
         return mapper.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper);
     }
+
+    public int removeByCheckForm(Long formId) {
+        LambdaQueryWrapper<DangerCheckItemPO> where = this.getQuery();
+        where.eq(DangerCheckItemPO::getCheckFormId, formId);
+        return mapper.delete(where);
+    }
+
+    public List<DangerCheckItemPO> list4CheckForm(Long formId) {
+        LambdaQueryWrapper<DangerCheckItemPO> where = this.getQuery();
+        where.eq(DangerCheckItemPO::getCheckFormId, formId);
+        return mapper.selectList(where);
+    }
 }

+ 212 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckFormGridCycleService.java

@@ -0,0 +1,212 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.customs.cq.datacenter.common.*;
+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.common.core.service.BasicService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import com.customs.cq.datacenter.business.mapper.impl.CheckFormGridCycleMapperImpl;
+import com.customs.cq.datacenter.business.entity.request.checkformgridcycle.ReqCreateCheckFormGridCycle;
+import com.customs.cq.datacenter.business.entity.request.checkformgridcycle.ReqModifyCheckFormGridCycle;
+import com.customs.cq.datacenter.business.entity.search.SearchCheckFormGridCycle;
+import com.customs.cq.datacenter.business.domain.CheckFormGridCyclePO;
+import com.customs.cq.datacenter.business.domain.vo.CheckFormGridCycleVO;
+
+/**
+ * 检查表-网格-频率设置
+ * @author lin.liu
+ * @description 检查表-网格-频率设置
+ */
+@Service
+public class CheckFormGridCycleService extends BasicService {
+    @Autowired
+    private CheckFormGridCycleMapperImpl dao;
+
+    public ExecutedResult<Long> create(ReqCreateCheckFormGridCycle request) {
+        // 转换po
+        CheckFormGridCyclePO item = CopierUtil.mapTo(request, CheckFormGridCyclePO.class);
+        // 设置主键
+        item.setId(SnowFlakeUtil.getId());
+        // 设置状态
+        //item.setStatus(EState.NORMAL.getValue());
+        // 设置记录创建时间
+        item.setCreateTime(LocalDateTimeUtil.nowTimeStamp());
+        // 是否删除(逻辑删除)初始值
+        item.setIsDelete(EYesOrNo.NO.getValue());
+
+        int result = this.dao.insert(item);
+        if (result != 1) {
+            return ExecutedResult.failed("创建[检查表-网格-频率设置]失败。");
+        }
+        return ExecutedResult.success(item.getId());
+    }
+
+    public ExecutedResult<String> modify(ReqModifyCheckFormGridCycle request) {
+        // 验证记录是否存在
+        ExecutedResult<CheckFormGridCyclePO> checkExists = this.check4Id(request.getId());
+        if (checkExists.isFailed()) {
+            return ExecutedResult.failed(checkExists.getMsg());
+        }
+        // 转换po
+        CheckFormGridCyclePO item = CopierUtil.mapTo(request, CheckFormGridCyclePO.class);
+
+        int result = this.dao.updateById(item);
+        if (result != 1) {
+            return ExecutedResult.failed("编辑[检查表-网格-频率设置]失败。");
+        }
+        return ExecutedResult.success();
+    }
+
+    public ExecutedResult<CheckFormGridCycleVO> get(Long id) {
+        CheckFormGridCycleVO result = new CheckFormGridCycleVO();
+
+        CheckFormGridCyclePO find = dao.selectById(id);
+        if (null != find) {
+            result = CopierUtil.mapTo(find, CheckFormGridCycleVO.class);
+        }
+        return ExecutedResult.success(result);
+    }
+
+//    public ExecutedResult<String> stop(Long id) {
+//        // 验证记录是否存在
+//        ExecutedResult<CheckFormGridCyclePO> checkExists = this.check4Id(id);
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckFormGridCyclePO item = new CheckFormGridCyclePO();
+//        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<CheckFormGridCyclePO> checkExists = this.check4Id(id);
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckFormGridCyclePO item = new CheckFormGridCyclePO();
+//        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<CheckFormGridCyclePO> checkExists = this.check4Id(request.getId());
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckFormGridCyclePO item = new CheckFormGridCyclePO();
+//        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<CheckFormGridCyclePO> checkExists = this.check4Id(request.getId());
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckFormGridCyclePO item = new CheckFormGridCyclePO();
+//        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<CheckFormGridCycleVO>> getList(List<Long> listId) {
+        List<CheckFormGridCycleVO> result = new ArrayList<>();
+
+        List<CheckFormGridCyclePO> list = this.dao.selectBatchIds(listId);
+        if (ListUtil.isNotNullOrEmpty(list)) {
+            result = CopierUtil.mapTo(list, CheckFormGridCycleVO.class);
+        }
+        return ExecutedResult.success(result);
+    }
+
+    public ExecutedResult<PagerResult<CheckFormGridCycleVO>> search(SearchCheckFormGridCycle search) {
+        // 处理创建时间范围-查询参数
+        Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange());
+        if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) {
+            search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime());
+        }
+        if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) {
+            search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime());
+        }
+
+        IPage<CheckFormGridCyclePO> pageList = dao.search(search);
+        List<CheckFormGridCycleVO> listVo = new ArrayList<>();
+        List<CheckFormGridCyclePO> list = pageList.getRecords();
+        if (ListUtil.isNotNullOrEmpty(list)) {
+            // 转换vo
+            listVo = CopierUtil.mapTo(list, CheckFormGridCycleVO.class);
+        }
+        PagerResult<CheckFormGridCycleVO> result = new PagerResult<>(pageList.getSize(), pageList.getCurrent(), pageList.getTotal(), listVo);
+        return ExecutedResult.success(result);
+    }
+
+    protected ExecutedResult<CheckFormGridCyclePO> check4Id(Long id) {
+        CheckFormGridCyclePO exists = dao.selectById(id);
+        if (Objects.isNull(exists)) {
+            return ExecutedResult.failed("[检查表-网格-频率设置]不存在:" + id);
+        }
+        return ExecutedResult.success(exists);
+    }
+}

+ 212 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckRecordItemService.java

@@ -0,0 +1,212 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.customs.cq.datacenter.common.*;
+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.common.core.service.BasicService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import com.customs.cq.datacenter.business.mapper.impl.CheckRecordItemMapperImpl;
+import com.customs.cq.datacenter.business.entity.request.checkrecorditem.ReqCreateCheckRecordItem;
+import com.customs.cq.datacenter.business.entity.request.checkrecorditem.ReqModifyCheckRecordItem;
+import com.customs.cq.datacenter.business.entity.search.SearchCheckRecordItem;
+import com.customs.cq.datacenter.business.domain.CheckRecordItemPO;
+import com.customs.cq.datacenter.business.domain.vo.CheckRecordItemVO;
+
+/**
+ * 隐患检查-检查项
+ * @author lin.liu
+ * @description 隐患检查-检查项
+ */
+@Service
+public class CheckRecordItemService extends BasicService {
+    @Autowired
+    private CheckRecordItemMapperImpl dao;
+
+    public ExecutedResult<Long> create(ReqCreateCheckRecordItem request) {
+        // 转换po
+        CheckRecordItemPO item = CopierUtil.mapTo(request, CheckRecordItemPO.class);
+        // 设置主键
+        item.setId(SnowFlakeUtil.getId());
+        // 设置状态
+        //item.setStatus(EState.NORMAL.getValue());
+        // 设置记录创建时间
+        item.setCreateTime(LocalDateTimeUtil.nowTimeStamp());
+        // 是否删除(逻辑删除)初始值
+        item.setIsDelete(EYesOrNo.NO.getValue());
+
+        int result = this.dao.insert(item);
+        if (result != 1) {
+            return ExecutedResult.failed("创建[隐患检查-检查项]失败。");
+        }
+        return ExecutedResult.success(item.getId());
+    }
+
+    public ExecutedResult<String> modify(ReqModifyCheckRecordItem request) {
+        // 验证记录是否存在
+        ExecutedResult<CheckRecordItemPO> checkExists = this.check4Id(request.getId());
+        if (checkExists.isFailed()) {
+            return ExecutedResult.failed(checkExists.getMsg());
+        }
+        // 转换po
+        CheckRecordItemPO item = CopierUtil.mapTo(request, CheckRecordItemPO.class);
+
+        int result = this.dao.updateById(item);
+        if (result != 1) {
+            return ExecutedResult.failed("编辑[隐患检查-检查项]失败。");
+        }
+        return ExecutedResult.success();
+    }
+
+    public ExecutedResult<CheckRecordItemVO> get(Long id) {
+        CheckRecordItemVO result = new CheckRecordItemVO();
+
+        CheckRecordItemPO find = dao.selectById(id);
+        if (null != find) {
+            result = CopierUtil.mapTo(find, CheckRecordItemVO.class);
+        }
+        return ExecutedResult.success(result);
+    }
+
+//    public ExecutedResult<String> stop(Long id) {
+//        // 验证记录是否存在
+//        ExecutedResult<CheckRecordItemPO> checkExists = this.check4Id(id);
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckRecordItemPO item = new CheckRecordItemPO();
+//        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<CheckRecordItemPO> checkExists = this.check4Id(id);
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckRecordItemPO item = new CheckRecordItemPO();
+//        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<CheckRecordItemPO> checkExists = this.check4Id(request.getId());
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckRecordItemPO item = new CheckRecordItemPO();
+//        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<CheckRecordItemPO> checkExists = this.check4Id(request.getId());
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        CheckRecordItemPO item = new CheckRecordItemPO();
+//        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<CheckRecordItemVO>> getList(List<Long> listId) {
+        List<CheckRecordItemVO> result = new ArrayList<>();
+
+        List<CheckRecordItemPO> list = this.dao.selectBatchIds(listId);
+        if (ListUtil.isNotNullOrEmpty(list)) {
+            result = CopierUtil.mapTo(list, CheckRecordItemVO.class);
+        }
+        return ExecutedResult.success(result);
+    }
+
+    public ExecutedResult<PagerResult<CheckRecordItemVO>> search(SearchCheckRecordItem search) {
+        // 处理创建时间范围-查询参数
+        Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange());
+        if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) {
+            search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime());
+        }
+        if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) {
+            search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime());
+        }
+
+        IPage<CheckRecordItemPO> pageList = dao.search(search);
+        List<CheckRecordItemVO> listVo = new ArrayList<>();
+        List<CheckRecordItemPO> list = pageList.getRecords();
+        if (ListUtil.isNotNullOrEmpty(list)) {
+            // 转换vo
+            listVo = CopierUtil.mapTo(list, CheckRecordItemVO.class);
+        }
+        PagerResult<CheckRecordItemVO> result = new PagerResult<>(pageList.getSize(), pageList.getCurrent(), pageList.getTotal(), listVo);
+        return ExecutedResult.success(result);
+    }
+
+    protected ExecutedResult<CheckRecordItemPO> check4Id(Long id) {
+        CheckRecordItemPO exists = dao.selectById(id);
+        if (Objects.isNull(exists)) {
+            return ExecutedResult.failed("[隐患检查-检查项]不存在:" + id);
+        }
+        return ExecutedResult.success(exists);
+    }
+}

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

@@ -33,7 +33,9 @@ import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.PagerResult;
 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.EResultCode;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
+import com.customs.cq.datacenter.common.exception.ServiceException;
 import com.customs.cq.datacenter.common.helper.LoginHelper;
 import com.customs.cq.datacenter.common.model.NameValueDto;
 import com.customs.cq.datacenter.common.model.Tuple;
@@ -227,6 +229,14 @@ public class DangerCategoryService extends BasicService {
         return ExecutedResult.success(exists);
     }
 
+    public DangerCategoryPO check4IdExc(Long id) {
+        DangerCategoryPO exists = dao.selectById(id);
+        if (Objects.isNull(exists)) {
+            throw new ServiceException("[隐患类别]不存在:" + id, EResultCode.NOT_FOUND.getCode());
+        }
+        return exists;
+    }
+
     /**
      * 获取所有隐患类别下拉选项
      */

+ 98 - 12
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/DangerCheckFormService.java

@@ -23,22 +23,34 @@
 package com.customs.cq.datacenter.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.customs.cq.datacenter.common.*;
+import com.customs.cq.datacenter.business.domain.DangerCategoryPO;
+import com.customs.cq.datacenter.business.domain.DangerCheckFormPO;
+import com.customs.cq.datacenter.business.domain.DangerCheckItemPO;
+import com.customs.cq.datacenter.business.domain.vo.DangerCheckFormVO;
+import com.customs.cq.datacenter.business.entity.request.dangercheckform.ReqCreateDangerCheckForm;
+import com.customs.cq.datacenter.business.entity.request.dangercheckform.ReqModifyDangerCheckForm;
+import com.customs.cq.datacenter.business.entity.request.dangercheckitem.ReqCreateDangerCheckItem;
+import com.customs.cq.datacenter.business.entity.search.SearchDangerCheckForm;
+import com.customs.cq.datacenter.business.mapper.impl.DangerCategoryMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.DangerCheckFormMapperImpl;
+import com.customs.cq.datacenter.business.mapper.impl.DangerCheckItemMapperImpl;
+import com.customs.cq.datacenter.common.ExecutedResult;
+import com.customs.cq.datacenter.common.PagerResult;
+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.EState;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
+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.common.core.service.BasicService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
-import com.customs.cq.datacenter.business.mapper.impl.DangerCheckFormMapperImpl;
-import com.customs.cq.datacenter.business.entity.request.dangercheckform.ReqCreateDangerCheckForm;
-import com.customs.cq.datacenter.business.entity.request.dangercheckform.ReqModifyDangerCheckForm;
-import com.customs.cq.datacenter.business.entity.search.SearchDangerCheckForm;
-import com.customs.cq.datacenter.business.domain.DangerCheckFormPO;
-import com.customs.cq.datacenter.business.domain.vo.DangerCheckFormVO;
+import java.util.stream.Collectors;
 
 /**
  * 隐患检查表
@@ -49,27 +61,57 @@ import com.customs.cq.datacenter.business.domain.vo.DangerCheckFormVO;
 public class DangerCheckFormService extends BasicService {
     @Autowired
     private DangerCheckFormMapperImpl dao;
+    @Autowired
+    private DangerCheckItemMapperImpl checkItemMapper;
+    @Autowired
+    private DangerCategoryMapperImpl dangerCategoryMapper;
+    
+    @Autowired
+    private DangerCategoryService dangerCategoryService;
 
+    
+    
     public ExecutedResult<Long> create(ReqCreateDangerCheckForm request) {
+        DangerCategoryPO dangerCategory = dangerCategoryService.check4IdExc(request.getDangerCategory());
         // 转换po
         DangerCheckFormPO item = CopierUtil.mapTo(request, DangerCheckFormPO.class);
         // 设置主键
         item.setId(SnowFlakeUtil.getId());
+        // 检查频率
+        item.setCheckCycle(dangerCategory.getCheckCycle());
+        // 检查次数(周期内)
+        item.setCheckTimes(1);
         // 设置状态
-        //item.setStatus(EState.NORMAL.getValue());
+        item.setStatus(EState.NORMAL.getValue());
         // 设置记录创建时间
         item.setCreateTime(LocalDateTimeUtil.nowTimeStamp());
         // 是否删除(逻辑删除)初始值
         item.setIsDelete(EYesOrNo.NO.getValue());
+        // 创建人信息
+        LoginUser loginUser = LoginHelper.getLoginUser();
+        if (Objects.nonNull(loginUser)) {
+            item.setCreateBy(loginUser.getUserId().toString());
+            item.setCreateByName(loginUser.getUsername());
+        }
 
         int result = this.dao.insert(item);
         if (result != 1) {
             return ExecutedResult.failed("创建[隐患检查表]失败。");
         }
+        // 插入检查项列表
+        checkItemMapper.insert(request.getListItem().stream().map(c -> {
+            DangerCheckItemPO checkItem = new DangerCheckItemPO();
+            checkItem.setCheckFormId(item.getId());
+            checkItem.setItemName(c.getItemName());
+            checkItem.setDescription(c.getDescription());
+            checkItem.setCreateTime(LocalDateTimeUtil.nowTimeStamp());
+            return checkItem;
+        }).collect(Collectors.toList()));
         return ExecutedResult.success(item.getId());
     }
 
     public ExecutedResult<String> modify(ReqModifyDangerCheckForm request) {
+        DangerCategoryPO dangerCategory = dangerCategoryService.check4IdExc(request.getDangerCategory());
         // 验证记录是否存在
         ExecutedResult<DangerCheckFormPO> checkExists = this.check4Id(request.getId());
         if (checkExists.isFailed()) {
@@ -77,11 +119,30 @@ public class DangerCheckFormService extends BasicService {
         }
         // 转换po
         DangerCheckFormPO item = CopierUtil.mapTo(request, DangerCheckFormPO.class);
+        // 检查频率
+        item.setCheckCycle(dangerCategory.getCheckCycle());
+        // 更新人信息
+        LoginUser loginUser = LoginHelper.getLoginUser();
+        if (Objects.nonNull(loginUser)) {
+            item.setUpdateBy(loginUser.getUserId().toString());
+            item.setUpdateByName(loginUser.getUsername());
+        }
 
         int result = this.dao.updateById(item);
         if (result != 1) {
             return ExecutedResult.failed("编辑[隐患检查表]失败。");
         }
+        // 删除已有检查项
+        checkItemMapper.removeByCheckForm(request.getId());
+        // 插入检查项列表
+        checkItemMapper.insert(request.getListItem().stream().map(c -> {
+            DangerCheckItemPO checkItem = new DangerCheckItemPO();
+            checkItem.setCheckFormId(item.getId());
+            checkItem.setItemName(c.getItemName());
+            checkItem.setDescription(c.getDescription());
+            checkItem.setCreateTime(LocalDateTimeUtil.nowTimeStamp());
+            return checkItem;
+        }).collect(Collectors.toList()));
         return ExecutedResult.success();
     }
 
@@ -90,7 +151,13 @@ public class DangerCheckFormService extends BasicService {
 
         DangerCheckFormPO find = dao.selectById(id);
         if (null != find) {
+            // 获取检查项列表
+            List<DangerCheckItemPO> listItem = checkItemMapper.list4CheckForm(id);
+            DangerCategoryPO dangerCategory = dangerCategoryService.check4IdExc(find.getDangerCategory());
+
             result = CopierUtil.mapTo(find, DangerCheckFormVO.class);
+            result.setListItem(CopierUtil.mapTo(listItem, ReqCreateDangerCheckItem.class));
+            result.setDangerCategoryTxt(dangerCategory.getCategoryName());
         }
         return ExecutedResult.success(result);
     }
@@ -176,7 +243,17 @@ public class DangerCheckFormService extends BasicService {
 
         List<DangerCheckFormPO> list = this.dao.selectBatchIds(listId);
         if (ListUtil.isNotNullOrEmpty(list)) {
-            result = CopierUtil.mapTo(list, DangerCheckFormVO.class);
+            List<DangerCategoryPO> listDangerCategory = dangerCategoryMapper.selectBatchIds(list.stream().map(DangerCheckFormPO::getDangerCategory).distinct().collect(Collectors.toList()));
+            Map<Long, DangerCategoryPO> mapDangerCategory = listDangerCategory.stream()
+                    .collect(Collectors.toMap(DangerCategoryPO::getId, c -> c));
+            for (DangerCheckFormPO item : list) {
+                DangerCheckFormVO vo = CopierUtil.mapTo(item, DangerCheckFormVO.class);
+                vo.setDangerCategoryTxt("");
+                if (mapDangerCategory.containsKey(item.getDangerCategory())) {
+                    vo.setDangerCategoryTxt(mapDangerCategory.get(item.getDangerCategory()).getCategoryName());
+                }
+                result.add(vo);
+            }
         }
         return ExecutedResult.success(result);
     }
@@ -195,8 +272,17 @@ public class DangerCheckFormService extends BasicService {
         List<DangerCheckFormVO> listVo = new ArrayList<>();
         List<DangerCheckFormPO> list = pageList.getRecords();
         if (ListUtil.isNotNullOrEmpty(list)) {
-            // 转换vo
-            listVo = CopierUtil.mapTo(list, DangerCheckFormVO.class);
+            List<DangerCategoryPO> listDangerCategory = dangerCategoryMapper.selectBatchIds(list.stream().map(DangerCheckFormPO::getDangerCategory).distinct().collect(Collectors.toList()));
+            Map<Long, DangerCategoryPO> mapDangerCategory = listDangerCategory.stream()
+                    .collect(Collectors.toMap(DangerCategoryPO::getId, c -> c));
+            for (DangerCheckFormPO item : list) {
+                DangerCheckFormVO vo = CopierUtil.mapTo(item, DangerCheckFormVO.class);
+                vo.setDangerCategoryTxt("");
+                if (mapDangerCategory.containsKey(item.getDangerCategory())) {
+                    vo.setDangerCategoryTxt(mapDangerCategory.get(item.getDangerCategory()).getCategoryName());
+                }
+                listVo.add(vo);
+            }
         }
         PagerResult<DangerCheckFormVO> result = new PagerResult<>(pageList.getSize(), pageList.getCurrent(), pageList.getTotal(), listVo);
         return ExecutedResult.success(result);

+ 212 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/DangerCheckItemService.java

@@ -0,0 +1,212 @@
+/**
+#                                                    __----~~~~~~~~~~~------___
+#                                   .  .   ~~//====......          __--~ ~~
+#                   -.            \_|//     |||\\  ~~~~~~::::... /~
+#                ___-==_       _-~o~  \/    |||  \\            _/~~-
+#        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
+#    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
+#  .~       .~       |   \\ -_    /  /-   /   ||      \   /
+# /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
+# |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
+#          '         ~-|      /|    |-~\~~       __--~~
+#                      |-~~-_/ |    |   ~\_   _-~            /\
+#                           /  \     \__   \/~                \__
+#                       _--~ _/ | .-~~____--~-/                  ~~==.
+#                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
+#                                 -_     ~\      ~~---l__i__i__i--~~_/
+#                                 _-~-__   ~)  \--______________--~~
+#                               //.-~~~-~_--~- |-------~~~~~~~~
+#                                      //.-~~~--\
+#                  神兽保佑
+#                  永无BUG!
+*/
+package com.customs.cq.datacenter.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.customs.cq.datacenter.common.*;
+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.common.core.service.BasicService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import com.customs.cq.datacenter.business.mapper.impl.DangerCheckItemMapperImpl;
+import com.customs.cq.datacenter.business.entity.request.dangercheckitem.ReqCreateDangerCheckItem;
+import com.customs.cq.datacenter.business.entity.request.dangercheckitem.ReqModifyDangerCheckItem;
+import com.customs.cq.datacenter.business.entity.search.SearchDangerCheckItem;
+import com.customs.cq.datacenter.business.domain.DangerCheckItemPO;
+import com.customs.cq.datacenter.business.domain.vo.DangerCheckItemVO;
+
+/**
+ * 隐患检查表-检查项
+ * @author lin.liu
+ * @description 隐患检查表-检查项
+ */
+@Service
+public class DangerCheckItemService extends BasicService {
+    @Autowired
+    private DangerCheckItemMapperImpl dao;
+
+    public ExecutedResult<Long> create(ReqCreateDangerCheckItem request) {
+        // 转换po
+        DangerCheckItemPO item = CopierUtil.mapTo(request, DangerCheckItemPO.class);
+        // 设置主键
+        item.setId(SnowFlakeUtil.getId());
+        // 设置状态
+        //item.setStatus(EState.NORMAL.getValue());
+        // 设置记录创建时间
+        item.setCreateTime(LocalDateTimeUtil.nowTimeStamp());
+        // 是否删除(逻辑删除)初始值
+        item.setIsDelete(EYesOrNo.NO.getValue());
+
+        int result = this.dao.insert(item);
+        if (result != 1) {
+            return ExecutedResult.failed("创建[隐患检查表-检查项]失败。");
+        }
+        return ExecutedResult.success(item.getId());
+    }
+
+    public ExecutedResult<String> modify(ReqModifyDangerCheckItem request) {
+        // 验证记录是否存在
+        ExecutedResult<DangerCheckItemPO> checkExists = this.check4Id(request.getId());
+        if (checkExists.isFailed()) {
+            return ExecutedResult.failed(checkExists.getMsg());
+        }
+        // 转换po
+        DangerCheckItemPO item = CopierUtil.mapTo(request, DangerCheckItemPO.class);
+
+        int result = this.dao.updateById(item);
+        if (result != 1) {
+            return ExecutedResult.failed("编辑[隐患检查表-检查项]失败。");
+        }
+        return ExecutedResult.success();
+    }
+
+    public ExecutedResult<DangerCheckItemVO> get(Long id) {
+        DangerCheckItemVO result = new DangerCheckItemVO();
+
+        DangerCheckItemPO find = dao.selectById(id);
+        if (null != find) {
+            result = CopierUtil.mapTo(find, DangerCheckItemVO.class);
+        }
+        return ExecutedResult.success(result);
+    }
+
+//    public ExecutedResult<String> stop(Long id) {
+//        // 验证记录是否存在
+//        ExecutedResult<DangerCheckItemPO> checkExists = this.check4Id(id);
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        DangerCheckItemPO item = new DangerCheckItemPO();
+//        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<DangerCheckItemPO> checkExists = this.check4Id(id);
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        DangerCheckItemPO item = new DangerCheckItemPO();
+//        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<DangerCheckItemPO> checkExists = this.check4Id(request.getId());
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        DangerCheckItemPO item = new DangerCheckItemPO();
+//        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<DangerCheckItemPO> checkExists = this.check4Id(request.getId());
+//        if (checkExists.isFailed()) {
+//            return ExecutedResult.failed(checkExists.getMsg());
+//        }
+//        DangerCheckItemPO item = new DangerCheckItemPO();
+//        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<DangerCheckItemVO>> getList(List<Long> listId) {
+        List<DangerCheckItemVO> result = new ArrayList<>();
+
+        List<DangerCheckItemPO> list = this.dao.selectBatchIds(listId);
+        if (ListUtil.isNotNullOrEmpty(list)) {
+            result = CopierUtil.mapTo(list, DangerCheckItemVO.class);
+        }
+        return ExecutedResult.success(result);
+    }
+
+    public ExecutedResult<PagerResult<DangerCheckItemVO>> search(SearchDangerCheckItem search) {
+        // 处理创建时间范围-查询参数
+        Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange());
+        if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) {
+            search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime());
+        }
+        if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) {
+            search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime());
+        }
+
+        IPage<DangerCheckItemPO> pageList = dao.search(search);
+        List<DangerCheckItemVO> listVo = new ArrayList<>();
+        List<DangerCheckItemPO> list = pageList.getRecords();
+        if (ListUtil.isNotNullOrEmpty(list)) {
+            // 转换vo
+            listVo = CopierUtil.mapTo(list, DangerCheckItemVO.class);
+        }
+        PagerResult<DangerCheckItemVO> result = new PagerResult<>(pageList.getSize(), pageList.getCurrent(), pageList.getTotal(), listVo);
+        return ExecutedResult.success(result);
+    }
+
+    protected ExecutedResult<DangerCheckItemPO> check4Id(Long id) {
+        DangerCheckItemPO exists = dao.selectById(id);
+        if (Objects.isNull(exists)) {
+            return ExecutedResult.failed("[隐患检查表-检查项]不存在:" + id);
+        }
+        return ExecutedResult.success(exists);
+    }
+}

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

@@ -0,0 +1,79 @@
+package com.customs.cq.datacenter.common.enums;
+
+import java.util.Arrays;
+import java.util.Objects;
+
+public enum ECheckCycle {
+    /**
+     * 每天=1,
+     */
+    DAY("每天", 1),
+    /**
+     * 每周=2,
+     */
+    WEEK("每周", 2),
+    /**
+     * 每月=3,
+     */
+    MONTH("每月", 3),
+    /**
+     * 每季度=4,
+     */
+    QUARTER("每季度", 4),
+    /**
+     * 每半年=5,
+     */
+    HALF_YEAR("每半年", 5),
+    /**
+     * 每年=6,
+     */
+    YEAR("每年", 6),
+    ;
+
+    /**
+     * 枚举描述
+     */
+    private String desc;
+    /**
+     * 枚举值
+     */
+    private Integer value;
+
+    public Integer getValue() {
+        return value;
+    }
+    public String getDesc() {
+        return desc;
+    }
+
+    /**
+     * 构造方法
+     * @param desc 枚举描述
+     * @param value 枚举值
+     */
+    ECheckCycle(String desc, Integer value) {
+        this.desc = desc;
+        this.value = value;
+    }
+
+    /**
+     * 根据值获取枚举
+     *
+     * @param value 枚举值
+     * @return
+     */
+    public static ECheckCycle getByValue(Integer value) {
+        return Arrays.stream(ECheckCycle.values())
+                .filter(e -> Objects.equals(e.getValue(), value))
+                .findAny()
+                .orElse(null);
+    }
+
+    @Override
+    public String toString() {
+        return "ECheckCycle{" +
+                "desc='" + desc + '\'' +
+                ", value=" + value +
+                '}';
+    }
+}

+ 48 - 0
secure-producting-host/src/main/java/com/customs/cq/datacenter/host/web/controller/common/BaseController.java

@@ -0,0 +1,48 @@
+package com.customs.cq.datacenter.host.web.controller.common;
+
+import com.customs.cq.datacenter.common.ExecutedResult;
+import com.customs.cq.datacenter.common.core.controller.BasicController;
+import com.customs.cq.datacenter.common.model.NameValueDto;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 140.基础功能
+ * @order 140
+ */
+@RestController
+@RequestMapping("base")
+public class BaseController extends BasicController {
+    /**
+     * 获取指定枚举类型的所有值
+     * @param enumName 枚举类型名称
+     */
+    @GetMapping("listEnumValue/{enumName}")
+    public ExecutedResult<List<NameValueDto>> listEnumValue(@PathVariable String enumName) {
+        try {
+            Class<?> enumClass = Class.forName("com.customs.cq.datacenter.common.enums." + enumName);
+            Method valuesMethod = enumClass.getMethod("values");
+            Method getValueMethod = enumClass.getMethod("getValue");
+            Method getDescMethod = enumClass.getMethod("getDesc");
+
+            Object valuesObj = valuesMethod.invoke(enumClass);
+            Object[] values = (Object[]) valuesObj;
+
+            List<NameValueDto> result = new ArrayList<>();
+            for(Object c : values) {
+                String value = getValueMethod.invoke(c).toString();
+                String desc = getDescMethod.invoke(c).toString();
+                result.add(new NameValueDto(desc, value));
+            }
+            return ExecutedResult.success(result);
+        } catch (Exception e) {
+            return ExecutedResult.failed("获取枚举类型失败(" + enumName + "): " + e.getMessage());
+        }
+    }
+}

+ 36 - 0
secure-producting-vue/src/api/form/DangerCheckForm.js

@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+
+// 查询[隐患检查表]
+export function search(data) {
+  return request({
+    url: '/dangerCheckForm/search',
+    method: 'post',
+    data: data
+  })
+}
+
+// 获取[隐患检查表]
+export function detail(id) {
+  return request({
+    url: '/dangerCheckForm/get/' + id,
+    method: 'get'
+  })
+}
+
+// 创建[隐患检查表]
+export function create(data) {
+  return request({
+    url: '/dangerCheckForm/create',
+    method: 'post',
+    data: data
+  })
+}
+
+// 编辑[隐患检查表]
+export function modify(data) {
+  return request({
+    url: '/dangerCheckForm/modify',
+    method: 'post',
+    data: data
+  })
+}

+ 9 - 0
secure-producting-vue/src/api/system/base.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+// 获取指定枚举类型的所有值
+export function listEnumValue(enumName) {
+  return request({
+    url: '/base/listEnumValue/' + enumName,
+    method: 'get'
+  })
+}

+ 15 - 0
secure-producting-vue/src/router/index.js

@@ -219,6 +219,21 @@ export const dynamicRoutes = [
       }
     ]
   },
+  // 隐患检查表
+  {
+    path: '/from',
+    component: Layout,
+    hidden: true,
+    permissions: ['from:index:list'],
+    children: [
+      {
+        path: 'dangerCheckForm',
+        component: () => import('@/views/form/DangerCheckForm'),
+        name: 'DangerCheckForm',
+        meta: { title: '隐患检查表', activeMenu: '/form/dangerCheckForm' }
+      }
+    ]
+  },
   {
     path: '/policy',
     component: Layout,

+ 65 - 0
secure-producting-vue/src/views/danger/DangerCategory.vue

@@ -10,6 +10,21 @@
           @keyup.enter="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="检查频率" prop="checkCycle">
+        <el-select
+          v-model="queryParams.checkCycle"
+          clearable
+          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="创建时间">
         <el-date-picker
           v-model="dateRangeCreateTime"
@@ -58,6 +73,7 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="主键" align="center" prop="id" />
       <el-table-column label="分类名称" align="center" prop="categoryName" />
+      <el-table-column label="检查频率" align="center" prop="checkCycleTxt" />
       <el-table-column label="创建时间" align="center" prop="createTimeView" />
       <el-table-column label="最后更新时间" align="center" prop="updateTimeView" />
       <el-table-column
@@ -107,6 +123,20 @@
       <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>
@@ -141,6 +171,20 @@
         <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>
@@ -162,12 +206,14 @@
 </template>
 
 <script setup name="DangerCategory">
+import { listEnumValue } from "@/api/system/base"
 import {
   create, detail, modify, search
 } from "@/api/danger/DangerCategory";
 
 const { proxy } = getCurrentInstance();
 
+const checkCycleList = ref([]);
 const dataList = ref([]);
 
 const createLoading = ref(false);
@@ -304,7 +350,10 @@ function handleDetail(row) {
   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 = '关 闭';
@@ -323,7 +372,10 @@ function handleUpdate(row) {
   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 = '取 消';
@@ -348,6 +400,19 @@ function submitModify() {
   });
 }
 
+
+
+/** 获取检查频率下拉框枚举值列表 */
+function getCheckCycleList() {
+  listEnumValue('ECheckCycle').then(response => {
+    checkCycleList.value = response.data;
+  });
+};
+
+
+
+// 获取检查频率下拉框枚举值列表
+getCheckCycleList();
 // 调用列表查询
 getList();
 </script>

+ 586 - 0
secure-producting-vue/src/views/form/DangerCheckForm.vue

@@ -0,0 +1,586 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryRef" :inline="true">
+      <el-form-item label="关键字" prop="keywords">
+        <el-input
+          v-model="queryParams.keywords"
+          placeholder="请输入关键字"
+          clearable
+          style="width: 200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="隐患分类" prop="listDangerCategory">
+        <el-select
+          v-model="queryParams.listDangerCategory"
+          multiple
+          collapse-tags
+          collapse-tags-tooltip
+          placeholder="请选择"
+          style="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="checkCycle">
+        <el-select
+          v-model="queryParams.checkCycle"
+          clearable
+          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="创建时间">
+        <el-date-picker
+          v-model="dateRangeCreateTime"
+          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),
+          ]"
+        ></el-date-picker>
+      </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">
+      <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 type="selection" width="55" align="center" />
+      <el-table-column label="检查表名称" align="center" prop="name" />
+      <el-table-column label="隐患分类" align="center" prop="dangerCategoryTxt" />
+      <el-table-column label="检查频率" align="center" prop="checkCycleTxt" />
+      <el-table-column label="创建时间" align="center" prop="createTimeView" />
+      <el-table-column label="隐患分类" align="center" prop="dangerCategoryTxt" />
+      <el-table-column label="数据创建人" align="center" prop="createByName" />
+      <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="85px"
+      >
+        <el-form-item label="检查表名称" prop="name">
+          <el-input v-model="formCreate.name" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="隐患分类" prop="dangerCategory">
+          <el-select
+            v-model="formCreate.dangerCategory"
+            placeholder="请选择"
+            style="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="description">
+          <el-input v-model="formCreate.description" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="检查项" prop="listItem">
+            <div class="line-point" v-for="(item, key) in formCreate.listItem" :key="key">
+              <span class="point-index">{{(key+1)}}</span>
+              <span class="point-must">*</span>
+              <label>检查项名称:&nbsp;</label>
+              <el-input v-model="item.itemName" style="width:150px;" size="small" placeholder="请输入" />
+              &nbsp;
+              <span class="point-must">*</span>
+              <label>说明:&nbsp;</label>
+              <el-input v-model="item.description" type="textarea" :autosize="{ minRows: 1, maxRows: 2 }" style="width:230px;vertical-align:top;margin-top:5px;" size="small" placeholder="请输入" />
+              <el-button
+                v-if="key === formCreate.listItem.length - 1"
+                style="vertical-align: top; margin-left: 5px"
+                type="success"
+                icon="Plus"
+                circle
+                @click="handleAddPoint(1)"
+              ></el-button>
+              <el-button
+                v-if="key != 0"
+                style="vertical-align: top; margin-left: 5px"
+                type="danger"
+                icon="Minus"
+                circle
+                @click="handleRemovePoint(1, item)"
+              ></el-button>
+            </div>
+        </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="85px"
+      >
+        <el-form-item label="检查表名称" prop="name">
+          <el-input v-model="formModify.name" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="隐患分类" prop="dangerCategory">
+          <el-select
+            v-model="formModify.dangerCategory"
+            placeholder="请选择"
+            style="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="status">
+          <el-switch v-model="formModify.status" :active-value="1" :inactive-value="0" />
+        </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-item label="检查项" prop="listItem">
+            <div class="line-point" v-for="(item, key) in formModify.listItem" :key="key">
+              <span class="point-index">{{(key+1)}}</span>
+              <span class="point-must">*</span>
+              <label>检查项名称:&nbsp;</label>
+              <el-input v-model="item.itemName" style="width:150px;" size="small" placeholder="请输入" />
+              &nbsp;
+              <span class="point-must">*</span>
+              <label>说明:&nbsp;</label>
+              <el-input v-model="item.description" type="textarea" :autosize="{ minRows: 1, maxRows: 2 }" style="width:230px;vertical-align:top;margin-top:5px;" size="small" placeholder="请输入" />
+              <el-button
+                v-if="key === formModify.listItem.length - 1"
+                style="vertical-align: top; margin-left: 5px"
+                type="success"
+                icon="Plus"
+                circle
+                @click="handleAddPoint(2)"
+              ></el-button>
+              <el-button
+                v-if="key != 0"
+                style="vertical-align: top; margin-left: 5px"
+                type="danger"
+                icon="Minus"
+                circle
+                @click="handleRemovePoint(2, item)"
+              ></el-button>
+            </div>
+        </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>
+
+<style scoped>
+  .line-point { margin-bottom:5px; }
+  .point-must { color:red; }
+  .point-index {
+    display: inline-block;
+    width: 25px;
+    line-height: 20px;
+    border: solid 1px;
+    border-radius: 10px;
+    margin-right: 5px;
+    text-align: center;
+    vertical-align: middle;
+    background-color: orangered;
+    color: white;
+  }
+</style>
+
+<script setup name="DangerCheckForm">
+import { listEnumValue } from "@/api/system/base"
+import { listAllDangerCategory } from "@/api/danger/DangerCategory";
+import { detail, modify, create, search } from "@/api/form/DangerCheckForm";
+
+const { proxy } = getCurrentInstance();
+
+const checkCycleList = ref([]);
+const dangerCategoryList = 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 dateRangeCreateTime = 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,
+  createTimeRange: "",
+  keywords: undefined,
+  listStatus: undefined,
+  createTime: undefined,
+  listGridCategory: [],
+  listDangerCategory: [],
+});
+
+const formCreate = ref({});
+const rulesCreate = ref({
+  gridName: [
+    { required: true, message: "网格名称不能为空", trigger: "blur" },
+    { max: 50, message: "网格名称字符长度不能超过50", trigger: "blur" },
+  ],
+  department: [
+    { required: true, message: "所属部门不能为空", trigger: "blur" },
+    { max: 50, message: "所属部门字符长度不能超过50", trigger: "blur" },
+  ],
+  departmentName: [
+    { required: true, message: "部门名称不能为空", trigger: "blur" },
+    { max: 200, message: "部门名称字符长度不能超过200", trigger: "blur" },
+  ],
+  gridCategory: [{ required: true, message: "网格类型不能为空", trigger: "blur" }],
+  dangerCategory: [{ required: true, message: "隐患分类不能为空", trigger: "blur" }],
+  gridPersonDuty: [{ max: 500, message: "网格员职责字符长度不能超过500", trigger: "blur" }],
+});
+
+const formModify = ref({});
+const rulesModify = ref({
+  gridName: [
+    { required: true, message: "网格名称不能为空", trigger: "blur" },
+    { max: 50, message: "网格名称字符长度不能超过50", trigger: "blur" },
+  ],
+  department: [
+    { required: true, message: "所属部门不能为空", trigger: "blur" },
+    { max: 50, message: "所属部门字符长度不能超过50", trigger: "blur" },
+  ],
+  departmentName: [
+    { required: true, message: "部门名称不能为空", trigger: "blur" },
+    { max: 200, message: "部门名称字符长度不能超过200", trigger: "blur" },
+  ],
+  gridCategory: [{ required: true, message: "网格类型不能为空", trigger: "blur" }],
+  dangerCategory: [{ required: true, message: "隐患分类不能为空", trigger: "blur" }],
+  gridPersonDuty: [{ max: 500, message: "网格员职责字符长度不能超过500", trigger: "blur" }],
+  status: [{ required: true, message: "状态", trigger: "blur" }],
+});
+
+
+
+/** 查询列表 */
+function getList() {
+  if (
+    dateRangeCreateTime &&
+    dateRangeCreateTime.value &&
+    dateRangeCreateTime.value[0]
+  ) {
+    queryParams.value.createTimeRange = dateRangeCreateTime.value.join(" ~ ");
+  }
+  search(queryParams.value).then((response) => {
+    dataList.value = response.data.list;
+    total.value = response.data.total;
+  });
+}
+/** 搜索按钮操作 */
+function handleQuery() {
+  queryParams.value.page = 1;
+  getList();
+}
+/** 重置按钮操作 */
+function resetQuery() {
+  dateRangeCreateTime.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 = {
+    gridName: undefined,
+    listDepartment: undefined,
+    gridCategory: undefined,
+    dangerCategory: undefined,
+    gridPersonDuty: undefined,
+    listItem: [
+        {
+            itemName: '',
+            description: ''
+        }
+    ]
+  };
+  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,
+    gridName: undefined,
+    listDepartment: undefined,
+    gridCategory: undefined,
+    dangerCategory: undefined,
+    gridPersonDuty: undefined,
+    status: undefined,
+    listItem: 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;
+
+    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;
+
+    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 handleAddPoint(type) {
+  if (type === 1) {
+    formCreate.value.listItem.push({
+        itemName: undefined,
+        description: undefined
+    });
+  } else {
+    formModify.value.listItem.push({
+        itemName: undefined,
+        description: undefined
+    });
+  }
+}
+/** 移除点位 */
+function handleRemovePoint(type, item) {
+    if (type === 1) {
+        const index = formCreate.value.listItem.indexOf(item);
+        if (index !== -1) {
+            formCreate.value.listItem.splice(index, 1);
+        }
+    } else {
+        const index = formModify.value.listItem.indexOf(item);
+        if (index !== -1) {
+            formModify.value.listItem.splice(index, 1);
+        }
+    }
+}
+
+
+
+/** 获取检查频率下拉框枚举值列表 */
+function getCheckCycleList() {
+  listEnumValue('ECheckCycle').then(response => {
+    checkCycleList.value = response.data;
+  });
+};
+/** 初始化隐患分类下拉框数据 */
+function initListDangerCategory() {
+  listAllDangerCategory().then((response) => {
+    dangerCategoryList.value = response.data;
+  });
+}
+
+
+
+// 获取检查频率下拉框枚举值列表
+getCheckCycleList();
+// 调用初始化隐患分类下拉框数据
+initListDangerCategory();
+// 调用列表查询
+getList();
+</script>

+ 42 - 8
sql/20240814.sql

@@ -47,6 +47,7 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_GRID_CATEGORY"."IS_DELETE" IS '是否
 CREATE TABLE "SECURE_PRODUCTING"."SP_DANGER_CATEGORY"(
   "ID" BIGINT NOT NULL,
   "CATEGORY_NAME" VARCHAR(50) NOT NULL DEFAULT '',
+  "CHECK_CYCLE" TINYINT NOT NULL DEFAULT 0,
   "DESCRIPTION" VARCHAR(50) NOT NULL DEFAULT '',
   "STATUS" TINYINT NOT NULL DEFAULT 0,
   "CREATE_TIME" BIGINT NOT NULL DEFAULT 0,
@@ -73,6 +74,7 @@ END;
 COMMENT ON TABLE "SECURE_PRODUCTING"."SP_DANGER_CATEGORY" IS '隐患类别';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CATEGORY"."ID" IS '主键';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CATEGORY"."CATEGORY_NAME" IS '类别名称';
+COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CATEGORY"."CHECK_CYCLE" IS '检查频率 ECheckCycle';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CATEGORY"."DESCRIPTION" IS '描述';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CATEGORY"."STATUS" IS '状态 EState';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CATEGORY"."CREATE_TIME" IS '数据创建时间';
@@ -142,7 +144,7 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_GRID_INFO"."IS_DELETE" IS '是否删
 
 
 
--- SP_GRID_PERSON "SECURE_PRODUCTING".- 网格人员
+-- SP_GRID_PERSON - 网格人员
 CREATE TABLE "SECURE_PRODUCTING"."SP_GRID_PERSON"(
   "ID" BIGINT NOT NULL,
   "DEPARTMENT" VARCHAR(50) NOT NULL DEFAULT '',
@@ -202,8 +204,6 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_GRID_PERSON"."IS_DELETE" IS '是否
 CREATE TABLE "SECURE_PRODUCTING"."SP_DANGER_CHECK_FORM"(
   "ID" BIGINT NOT NULL,
   "NAME" VARCHAR(200) NOT NULL DEFAULT '',
-  "DEPARTMENT" VARCHAR(50) NOT NULL DEFAULT '',
-  "DEPARTMENT_NAME" VARCHAR(200) NOT NULL DEFAULT '',
   "DANGER_CATEGORY" BIGINT NOT NULL DEFAULT 0,
   "CHECK_CYCLE" TINYINT NOT NULL DEFAULT 0,
   "CHECK_TIMES" TINYINT NOT NULL DEFAULT 0,
@@ -220,7 +220,6 @@ CREATE TABLE "SECURE_PRODUCTING"."SP_DANGER_CHECK_FORM"(
   PRIMARY KEY("ID")
 );
 -- 索引
-CREATE INDEX IDX_SP_DANGER_CHECK_FORM_DEPARTMENT ON "SECURE_PRODUCTING"."SP_DANGER_CHECK_FORM"("DEPARTMENT");
 CREATE INDEX IDX_SP_DANGER_CHECK_FORM_DANGER_CATEGORY ON "SECURE_PRODUCTING"."SP_DANGER_CHECK_FORM"("DANGER_CATEGORY");
 CREATE INDEX IDX_SP_DANGER_CHECK_FORM_CHECK_CYCLE ON "SECURE_PRODUCTING"."SP_DANGER_CHECK_FORM"("CHECK_CYCLE");
 CREATE INDEX IDX_SP_DANGER_CHECK_FORM_STATUS ON "SECURE_PRODUCTING"."SP_DANGER_CHECK_FORM"("STATUS");
@@ -236,8 +235,6 @@ END;
 COMMENT ON TABLE "SECURE_PRODUCTING"."SP_DANGER_CHECK_FORM" IS '隐患检查表';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."ID" IS '主键';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."NAME" IS '检查表名称';
-COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."DEPARTMENT" IS '所属部门';
-COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."DEPARTMENT_NAME" IS '部门名称';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."DANGER_CATEGORY" IS '隐患分类';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."CHECK_CYCLE" IS '检查频率 ECheckCycle';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."CHECK_TIMES" IS '检查次数(周期内)';
@@ -259,11 +256,10 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_FORM"."IS_DELETE" IS '
 CREATE TABLE "SECURE_PRODUCTING"."SP_DANGER_CHECK_ITEM"(
   "ID" BIGINT NOT NULL,
   "CHECK_FORM_ID" BIGINT NOT NULL DEFAULT 0,
-  "ITEM_NAME" VARCHAR(50) NOT NULL DEFAULT '',
+  "ITEM_NAME" VARCHAR(200) NOT NULL DEFAULT '',
   "DESCRIPTION" VARCHAR(500) NOT NULL DEFAULT '',
   "CREATE_TIME" BIGINT NOT NULL DEFAULT 0,
   "UPDATE_TIME" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(),
-  "UPDATE_BY" VARCHAR(50) NOT NULL DEFAULT '',
   "IS_DELETE" TINYINT NOT NULL DEFAULT 0,
   -- 主键
   PRIMARY KEY("ID")
@@ -290,6 +286,44 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_DANGER_CHECK_ITEM"."IS_DELETE" IS '
 
 
 
+-- SP_CHECK_FORM_GRID_CYCLE - 检查表-网格-频率设置
+CREATE TABLE "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"(
+  "ID" BIGINT NOT NULL,
+  "CHECK_FORM_ID" BIGINT NOT NULL DEFAULT 0,
+  "CHECK_FORM_NAME" VARCHAR(200) NOT NULL DEFAULT '',
+  "GRID_ID" BIGINT NOT NULL DEFAULT 0,
+  "GRID_NAME" VARCHAR(50) NOT NULL DEFAULT '',
+  "CHECK_CYCLE" TINYINT NOT NULL DEFAULT 0,
+  "CREATE_TIME" BIGINT NOT NULL DEFAULT 0,
+  "UPDATE_TIME" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(),
+  "IS_DELETE" TINYINT NOT NULL DEFAULT 0,
+  -- 主键
+  PRIMARY KEY("ID")
+);
+-- 索引
+CREATE INDEX IDX_SP_CHECK_FORM_GRID_CYCLE_CHECK_FORM_ID ON "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"("CHECK_FORM_ID");
+CREATE INDEX IDX_SP_CHECK_FORM_GRID_CYCLE_GRID_ID ON "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"("GRID_ID");
+CREATE INDEX IDX_SP_CHECK_FORM_GRID_CYCLE_CREATE_TIME ON "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"("CREATE_TIME");
+-- 触发器:自动赋值最后修改时间
+CREATE OR REPLACE TRIGGER "SECURE_PRODUCTING"."TG_SP_CHECK_FORM_GRID_CYCLE"
+BEFORE INSERT OR UPDATE ON "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE" FOR EACH ROW
+BEGIN
+  :new.UPDATE_TIME=CURRENT_TIMESTAMP();
+END;
+
+-- 字段描述
+COMMENT ON TABLE "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE" IS '检查表-网格-频率设置';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."ID" IS '主键';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."CHECK_FORM_ID" IS '关联检查表';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."CHECK_FORM_NAME" IS '检查表名称';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."GRID_ID" IS '关联网格';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."GRID_NAME" IS '网格名称';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."CHECK_CYCLE" IS '检查频率 ECheckCycle';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."CREATE_TIME" IS '数据创建时间';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."UPDATE_TIME" IS '最后更新时间';
+COMMENT ON COLUMN "SECURE_PRODUCTING"."SP_CHECK_FORM_GRID_CYCLE"."IS_DELETE" IS '是否删除(逻辑删除)';
+
+
 
 
 -- SP_CHECK_RECORD - 隐患检查记录