Parcourir la source

安全检查定义及管理

jiawuxian il y a 2 ans
Parent
commit
9930b8d5b8
33 fichiers modifiés avec 2021 ajouts et 0 suppressions
  1. 86 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/SafetyCheckRuleController.java
  2. 78 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/SafetyCheckRuleItemController.java
  3. 59 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/SafetyCheckRule.java
  4. 44 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/SafetyCheckRuleItem.java
  5. 59 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/SafetyCheckRulePoint.java
  6. 40 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rule/SafetyCheckRuleEditDto.java
  7. 14 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rule/SafetyCheckRuleListForOrgDto.java
  8. 22 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rule/SafetyCheckRulePageDto.java
  9. 33 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRuleItemDetailDto.java
  10. 37 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRuleItemDto.java
  11. 24 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRuleItemPageDto.java
  12. 12 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRulePointSelectPageDto.java
  13. 73 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rulePoint/SafetyCheckRulePointDetailDto.java
  14. 62 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rulePoint/SafetyCheckRulePointDto.java
  15. 69 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rulePoint/SafetyCheckRulePointInfoDto.java
  16. 39 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/SafetyCheckRuleItemMapper.java
  17. 39 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/SafetyCheckRuleMapper.java
  18. 69 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/SafetyCheckRulePointMapper.java
  19. 49 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ISafetyCheckRuleItemService.java
  20. 31 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ISafetyCheckRulePointService.java
  21. 44 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ISafetyCheckRuleService.java
  22. 298 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRuleItemServiceImpl.java
  23. 66 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRulePointServiceImpl.java
  24. 176 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRuleServiceImpl.java
  25. 19 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/rule/SafetyCheckRuleGroupVo.java
  26. 45 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/rule/SafetyCheckRuleInfoVo.java
  27. 38 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/rule/SafetyCheckRulePageVo.java
  28. 27 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/ruleItem/RuleTreeItem.java
  29. 30 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/ruleItem/SafetyCheckRuleItemPageVo.java
  30. 43 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/ruleItem/SafetyCheckRulePointSelectVo.java
  31. 31 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/SafetyCheckRuleItemMapper.xml
  32. 51 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/SafetyCheckRuleMapper.xml
  33. 214 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/SafetyCheckRulePointMapper.xml

+ 86 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/SafetyCheckRuleController.java

@@ -0,0 +1,86 @@
+package com.xunmei.core.safetyCheck.controller;
+
+import com.xunmei.common.core.vo.IdNameVo;
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRuleEditDto;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRuleListForOrgDto;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRulePageDto;
+import com.xunmei.core.safetyCheck.service.ISafetyCheckRuleService;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRulePageVo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author 景远超
+ * @since 2022-04-26
+ */
+@RestController()
+@RequestMapping("/safetycheck/rule/")
+public class SafetyCheckRuleController extends BaseController {
+
+    @Resource
+    private ISafetyCheckRuleService safetyCheckRuleService;
+
+    @ApiOperation(value = "查询规范列表")
+    @GetMapping("page")
+    @RequiresPermissions("safetycheck:rule")
+    public TableDataInfo getAppRulePage(SafetyCheckRulePageDto query) {
+        final TableDataInfo appRulePage = safetyCheckRuleService.getRulePage(query);
+        return appRulePage;
+    }
+
+    @ApiOperation(value = "查询所有规范")
+    @GetMapping("all")
+    @RequiresPermissions("safetycheck:rule")
+    public AjaxResult getAllRule() {
+        final List<SafetyCheckRulePageVo> appRulePage = safetyCheckRuleService.getAllRule();
+        return success(appRulePage);
+    }
+
+    @ApiOperation(value = "规范详情")
+    @GetMapping("{id}")
+    @RequiresPermissions("safetycheck:rule:query")
+    public AjaxResult info(@PathVariable Long id) {
+        return success(safetyCheckRuleService.get(id));
+    }
+
+    @ApiOperation(value = "新增/编辑")
+    @PostMapping("edit")
+    @RequiresPermissions(value = {"safetycheck:rule:add", "safetycheck:rule:edit"})
+    public AjaxResult edit(@RequestBody SafetyCheckRuleEditDto editDto) {
+        return success(safetyCheckRuleService.edit(editDto));
+    }
+
+    @ApiOperation(value = "删除规范")
+    @RequiresPermissions("safetycheck:rule:remove")
+    @DeleteMapping("{id}")
+    public AjaxResult del(@PathVariable Long id) {
+        safetyCheckRuleService.del(id);
+        return success();
+    }
+
+    @ApiOperation(value = "查询机构可用的规范")
+    @GetMapping("ruleListForOrg")
+//    @RequiresPermissions(value={"safetycheck:rule"})
+    public AjaxResult ruleListForOrg(SafetyCheckRuleListForOrgDto dto) {
+        List<IdNameVo> list = safetyCheckRuleService.ruleListForOrg(dto);
+        return success(list);
+    }
+
+    @ApiOperation(value = "获取")
+    @GetMapping("/orgtree")
+    public AjaxResult getRuleTree() {
+        return success(safetyCheckRuleService.getRuleTree(SecurityUtils.getLoginUser().getSysUser().getOrgId()));
+    }
+}

+ 78 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/SafetyCheckRuleItemController.java

@@ -0,0 +1,78 @@
+package com.xunmei.core.safetyCheck.controller;
+
+
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.resumption.dto.ruleItem.AppRuleItemDto;
+import com.xunmei.core.resumption.dto.ruleItem.AppRuleItemPageDto;
+import com.xunmei.core.resumption.dto.ruleItem.AppRulePointSelectPageDto;
+import com.xunmei.core.resumption.service.IAppRuleItemService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+@RestController()
+@RequestMapping("/safetycheck/ruleItem/")
+public class SafetyCheckRuleItemController extends BaseController {
+
+    @Resource
+    private IAppRuleItemService appRuleItemService;
+
+
+    @ApiOperation(value = "新增/编辑")
+    @PostMapping("edit")
+    @RequiresPermissions(value={"safetycheck:ruleManager:edit","safetycheck:ruleManager:add"})
+    public AjaxResult edit(@RequestBody AppRuleItemDto appRuleItemDto) {
+        return success(appRuleItemService.edit(appRuleItemDto));
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("page")
+    @RequiresPermissions("safetycheck:ruleManager:query")
+    public TableDataInfo page(AppRuleItemPageDto itemPageDto) {
+        return appRuleItemService.pageQuery(itemPageDto);
+    }
+
+    @ApiOperation(value = "删除")
+    @DeleteMapping("{id}")
+    @RequiresPermissions("safetycheck:ruleManager:remove")
+    public AjaxResult del(@PathVariable("id") Long id) {
+        return success(appRuleItemService.del(id));
+    }
+
+    @ApiOperation(value = "详情")
+    @GetMapping("{id}")
+    public AjaxResult findOne(@PathVariable("id") Long id) {
+        return success(appRuleItemService.findOne(id));
+    }
+
+    @ApiOperation(value = "规范组")
+    @GetMapping("/rule/tree")
+    @RequiresPermissions("safetycheck:ruleManager:query")
+    public AjaxResult getRuleTree() {
+        return success(appRuleItemService.getRuleTree(SecurityUtils.getLoginUser().getSysUser().getOrgId()));
+    }
+
+    /**
+     * 获取履职内容选择框的翻页列表
+     *
+     * @return
+     */
+    @GetMapping("pointSelectionPage")
+    public TableDataInfo pointSelectionPage(AppRulePointSelectPageDto dto) {
+        TableDataInfo data = appRuleItemService.pointSelectionPage(dto);
+        return data;
+    }
+}

+ 59 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/SafetyCheckRule.java

@@ -0,0 +1,59 @@
+package com.xunmei.core.safetyCheck.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xunmei.common.core.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author system
+ * @since 2022-04-26
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("core_resumption_rule")
+@ApiModel(value="履职内容库定义对象", description="")
+public class SafetyCheckRule extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "履职内容库类型id")
+    @TableField("type")
+    private String type;
+
+    @ApiModelProperty(value = "履职内容库名称")
+    @TableField("name")
+    private String name;
+
+    @ApiModelProperty(value = "履职机构类型")
+    @TableField("org_type")
+    private String orgType;
+
+    @ApiModelProperty(value = "发布机构")
+    @TableField("org_id")
+    private Long orgId;
+
+    @ApiModelProperty(value = "0:禁用 1:启用")
+    @TableField("status")
+    private String status;
+
+    @ApiModelProperty(value = "备注")
+    @TableField("remark")
+    private String remark;
+
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除 1是 0否")
+    private int deleted;
+}

+ 44 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/SafetyCheckRuleItem.java

@@ -0,0 +1,44 @@
+package com.xunmei.core.safetyCheck.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.xunmei.common.core.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("core_resumption_rule_item")
+@ApiModel(value="履职项对象", description="")
+public class SafetyCheckRuleItem extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id",type = IdType.ASSIGN_ID)
+    private Long id;
+
+    @ApiModelProperty(value = "规范要点id")
+    @TableField("rule_id")
+    private Long ruleId;
+
+    @ApiModelProperty(value = "检查项名称")
+    @TableField("name")
+    private String name;
+
+    @ApiModelProperty(value = "标准及要求")
+    @TableField("`desc`")
+    private String desc;
+
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除 1是 0否")
+    private int deleted;
+}

+ 59 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/SafetyCheckRulePoint.java

@@ -0,0 +1,59 @@
+package com.xunmei.core.safetyCheck.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xunmei.common.core.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("core_resumption_rule_point")
+@ApiModel(value = "履职内容要点对象", description = "")
+public class SafetyCheckRulePoint extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "规范id")
+    @TableField("rule_id")
+    private Long ruleId;
+
+    @ApiModelProperty(value = "检查项id")
+    @TableField("item_id")
+    private Long itemId;
+
+    @ApiModelProperty(value = "检查要点")
+    @TableField("name")
+    private String name;
+
+    @ApiModelProperty(value = "检查区域,区域表id")
+    @TableField("area_id")
+    private Long areaId;
+
+    @TableField("business_type")
+    @ApiModelProperty(value = "该要点关联的业务类型")
+    private String businessType;
+
+    @ApiModelProperty(value = "时间类型,0无,1时分")
+    @TableField("remark")
+    private String remark;
+
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除 1是 0否")
+    private int deleted;
+}

+ 40 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rule/SafetyCheckRuleEditDto.java

@@ -0,0 +1,40 @@
+package com.xunmei.core.safetyCheck.dto.rule;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/26 10:26
+ */
+@Data
+public class SafetyCheckRuleEditDto {
+
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @NotBlank(message = "规则名称不能为空")
+    @ApiModelProperty("规范名称")
+    private String name;
+
+    @NotNull(message = "规则类型不能为空")
+    @ApiModelProperty("规范类型id")
+    private String type;
+
+    @ApiModelProperty(value = "受检机构类型")
+    @NotNull(message = "受检机构类型不能为空")
+    private String orgType;
+
+    @ApiModelProperty(value = "状态")
+    @NotBlank(message = "状态不能为空")
+    private String status;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+}

+ 14 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rule/SafetyCheckRuleListForOrgDto.java

@@ -0,0 +1,14 @@
+package com.xunmei.core.safetyCheck.dto.rule;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+
+public class SafetyCheckRuleListForOrgDto {
+    @NotNull(message = "缺少机构类型")
+    private String orgType;
+
+//    private  Long orgId;
+}

+ 22 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rule/SafetyCheckRulePageDto.java

@@ -0,0 +1,22 @@
+package com.xunmei.core.safetyCheck.dto.rule;
+
+import com.xunmei.common.core.web.domain.PageDto;
+import com.xunmei.core.resumption.vo.appRule.AppRulePageVo;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRulePageVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class SafetyCheckRulePageDto extends PageDto<SafetyCheckRulePageVo> {
+    @ApiModelProperty(value = "履职内容库名称")
+    private String name;
+
+    @ApiModelProperty(value = "履职内容库类型id")
+    private String type;
+
+    @ApiModelProperty(value = "履职机构类型")
+    private String orgType;
+
+    private Long orgId;
+
+}

+ 33 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRuleItemDetailDto.java

@@ -0,0 +1,33 @@
+package com.xunmei.core.safetyCheck.dto.ruleItem;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointDetailDto;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/5 9:10
+ */
+@Data
+public class SafetyCheckRuleItemDetailDto {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "检查项id")
+    private Long id;
+
+    @ApiModelProperty(value = "检查项名称")
+    private String name;
+
+//    @ApiModelProperty(value = "检查项编号")
+//    private Integer itemNum;
+
+    @ApiModelProperty(value = "检查项标准及要求")
+    private String desc;
+
+    @ApiModelProperty(value = "检查点")
+    private List<SafetyCheckRulePointDetailDto> pointDtoList;
+}

+ 37 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRuleItemDto.java

@@ -0,0 +1,37 @@
+package com.xunmei.core.safetyCheck.dto.ruleItem;
+
+import com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointDto;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/27 16:57
+ */
+@Data
+public class SafetyCheckRuleItemDto {
+
+    @ApiModelProperty(value = "规则项id")
+    private Long id;
+
+//    @ApiModelProperty(value = "规则编号")
+//    private Integer itemNum;
+
+    @ApiModelProperty(value = "规则名称")
+    private String name;
+
+//    @ApiModelProperty(value = "")
+//    private String desc;
+
+    @ApiModelProperty(value = "履职内容库id")
+    private Long ruleId;
+//
+//    @NotNull(message = "规则类型不能为空")
+//    @ApiModelProperty("规范类型id")
+//    private Long ruleTypeId;
+
+    @ApiModelProperty(value = "履职内容")
+    private List<SafetyCheckRulePointDto> pointDtoList;
+}

+ 24 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRuleItemPageDto.java

@@ -0,0 +1,24 @@
+package com.xunmei.core.safetyCheck.dto.ruleItem;
+
+import com.xunmei.common.core.web.domain.PageDto;
+import com.xunmei.core.resumption.domain.AppRuleItem;
+import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRuleItemPageVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/27 18:13
+ */
+@Data
+public class SafetyCheckRuleItemPageDto extends PageDto<SafetyCheckRuleItemPageVo> {
+
+    @ApiModelProperty(value = "id")
+    private  Long ruleId;
+
+    @ApiModelProperty(value = "履职项名称")
+    private  String itemName;
+
+    @ApiModelProperty(value = "履职内容名称")
+    private String pointName;
+}

+ 12 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/ruleItem/SafetyCheckRulePointSelectPageDto.java

@@ -0,0 +1,12 @@
+package com.xunmei.core.safetyCheck.dto.ruleItem;
+
+import com.xunmei.common.core.web.domain.PageDto;
+import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRulePointSelectVo;
+import lombok.Data;
+
+@Data
+public class SafetyCheckRulePointSelectPageDto extends PageDto<SafetyCheckRulePointSelectVo> {
+    private Long ruleId;
+
+    private String key;
+}

+ 73 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rulePoint/SafetyCheckRulePointDetailDto.java

@@ -0,0 +1,73 @@
+package com.xunmei.core.safetyCheck.dto.rulePoint;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/5 9:11
+ */
+@Data
+public class SafetyCheckRulePointDetailDto {
+
+    @ApiModelProperty(value = "检查点id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+//    @ApiModelProperty(value = "规范id")
+//    private Long ruleId;
+
+//    @ApiModelProperty(value = "检查要点编号")
+//    private int pointNum;
+
+    @ApiModelProperty(value = "检查要点名称")
+    private String name;
+
+    @ApiModelProperty(value = "检查区域,区域表id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long areaId;
+
+    @ApiModelProperty(value = "检查区域名称")
+    private String areaName;
+
+//    @ApiModelProperty(value = "安防类型,字典表value")
+//    private Integer safeType;
+//
+//    @ApiModelProperty(value = "安防类型名称")
+//    private String safeTypeName;
+//
+//    @ApiModelProperty(value = "整改期限,天数")
+//    private int reformDay;
+//
+//    @ApiModelProperty(value = "检查方法,字典表value")
+//    private Integer inspection;
+//
+//    @ApiModelProperty(value = "检查方法名称")
+//    private String inspectionName;
+//
+//    @ApiModelProperty(value = "数据类型,数据类型表id")
+//    private Long dataType;
+//
+//    @ApiModelProperty(value = "数据类型,数据类型表id")
+//    private String dataTypeName;
+//
+//    @ApiModelProperty(value = "时间类型,0无,1时分")
+//    private Integer timeType;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+//    @ApiModelProperty(value = "风险等级code")
+//    private Long degreeRisk;
+//
+//    @ApiModelProperty(value = "风险等级名称")
+//    private String degreeRiskName;
+
+    /*@ApiModelProperty(value = "sys_area_check 主键id")
+    private Long nfcBindId;*/
+
+    @ApiModelProperty(value = "要点关联的业务类型")
+    private String businessType;
+}

+ 62 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rulePoint/SafetyCheckRulePointDto.java

@@ -0,0 +1,62 @@
+package com.xunmei.core.safetyCheck.dto.rulePoint;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/27 16:59
+ */
+@Data
+public class SafetyCheckRulePointDto {
+
+    @ApiModelProperty(value = "检查点id")
+    private Long id;
+
+//    @ApiModelProperty(value = "规范id")
+//    private Long ruleId;
+
+    @ApiModelProperty(value = "检查项id")
+    private Long itemId;
+
+//    @ApiModelProperty(value = "检查要点编号")
+//    private int pointNum;
+
+    @ApiModelProperty(value = "检查要点名称")
+    private String name;
+
+    @ApiModelProperty(value = "检查区域,区域表id")
+    private Long areaId;
+
+//    @ApiModelProperty(value = "安防类型,字典表id")
+//    private Integer safeType;
+//
+//    @ApiModelProperty(value = "整改期限,天数")
+//    private int reformDay;
+//
+//    @ApiModelProperty(value = "检查方法,字典表id")
+//    private Integer inspection;
+//
+//    @ApiModelProperty(value = "数据类型,数据类型表id")
+//    private Long dataType;
+//
+//    @ApiModelProperty(value = "时间类型,0无,1时分")
+//    private Integer timeType;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+//    @NotNull(message = "规则类型不能为空")
+//    @ApiModelProperty("规范类型id")
+//    private Long ruleTypeId;
+
+//    @ApiModelProperty("风险等级")
+//    private Long degreeRisk;
+
+    /*@ApiModelProperty(value = "nfc采集点id")
+    private Long nfcBindId;*/
+
+    @ApiModelProperty(value = "要点关联的业务类型")
+    private String businessType;
+
+}

+ 69 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/dto/rulePoint/SafetyCheckRulePointInfoDto.java

@@ -0,0 +1,69 @@
+package com.xunmei.core.safetyCheck.dto.rulePoint;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/6/9 11:04
+ */
+@Data
+public class SafetyCheckRulePointInfoDto {
+
+    @ApiModelProperty(value = "检查项id")
+    private Long itemId;
+
+//    @ApiModelProperty(value = "检查项编号")
+//    private Integer itemNum;
+
+    @ApiModelProperty(value = "检查项内容")
+    private String itemName;
+
+    @ApiModelProperty(value = "检查项描述")
+    private String itemDesc;
+
+    @ApiModelProperty(value = "检查点id")
+    private Long id;
+
+//    @ApiModelProperty(value = "检查要点编号")
+//    private int pointNum;
+
+//    @ApiModelProperty(value = "安防类型,字典表value")
+//    private Integer safeType;
+//
+//    @ApiModelProperty(value = "安防类型名称")
+//    private String safeTypeText;
+
+    @ApiModelProperty(value = "检查区域,区域表id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long areaId;
+
+    @ApiModelProperty(value = "检查区域名称")
+    private String areaName;
+
+    @ApiModelProperty(value = "采集点名称")
+    private String nfcName;
+
+    @ApiModelProperty(value = "检查要点名称")
+    private String pointName;
+
+    @ApiModelProperty(value = "履职计划名称")
+    private String planName;
+
+    @ApiModelProperty(value = "履职计划名称")
+    private Long planId;
+
+    @ApiModelProperty(value = "sys_area_check 主键id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long nfcBindId;
+
+    private Integer pointSource;
+
+    @ApiModelProperty(value = "检查要点的数据来源")
+    private Integer businessType;
+
+    @ApiModelProperty(value = "检查要点的数据来源文本")
+    private String businessTypeText;
+}

+ 39 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/SafetyCheckRuleItemMapper.java

@@ -0,0 +1,39 @@
+package com.xunmei.core.safetyCheck.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.core.resumption.domain.AppRuleItem;
+import com.xunmei.core.resumption.dto.ruleItem.AppRuleItemPageDto;
+import com.xunmei.core.resumption.vo.appRuleItem.AppRuleItemPageVo;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRuleItem;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRuleItemPageDto;
+import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRuleItemPageVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+@Mapper
+public interface SafetyCheckRuleItemMapper extends BaseMapper<SafetyCheckRuleItem> {
+
+    Page<SafetyCheckRuleItemPageVo> pageQuery(Page<SafetyCheckRuleItemPageVo> page, @Param("itemPageDto") SafetyCheckRuleItemPageDto itemPageDto);
+
+//    List<SecBookDtInstDto> selectDataTypeList();
+
+
+//    List<AreaListVo> selectCheckAreaList();
+
+
+//    Integer checkItemIsUse(@Param("id") Long id);
+
+//    Integer checkItemNumRepeat(@Param("id") Long id, @Param("ruleId") Long ruleId, @Param("itemNum") Integer itemNum);
+
+    Integer checkItemNameRepeat(@Param("id") Long id, @Param("ruleId") Long ruleId, @Param("itemName") String itemName);
+}

+ 39 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/SafetyCheckRuleMapper.java

@@ -0,0 +1,39 @@
+package com.xunmei.core.safetyCheck.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.core.resumption.domain.AppRule;
+import com.xunmei.core.resumption.dto.rule.AppRulePageDto;
+import com.xunmei.core.resumption.vo.appRule.AppRuleGroupVo;
+import com.xunmei.core.resumption.vo.appRule.AppRulePageVo;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRule;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRulePageDto;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRuleGroupVo;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRulePageVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author system
+ * @since 2022-04-26
+ */
+@Mapper
+@Repository
+public interface SafetyCheckRuleMapper extends BaseMapper<SafetyCheckRule> {
+
+    Page<SafetyCheckRulePageVo> selectPageByCondition(@Param("page") Page<SafetyCheckRulePageVo> page, @Param("appRule") SafetyCheckRulePageDto appRule);
+
+    List<SafetyCheckRuleGroupVo> getRuleGroupList();
+
+//    AppRuleInfoVo get(Long id);
+
+    Integer checkRuleNameRepeat(@Param("id") Long id, @Param("name") String name);
+
+}

+ 69 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/SafetyCheckRulePointMapper.java

@@ -0,0 +1,69 @@
+package com.xunmei.core.safetyCheck.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.core.resumption.domain.AppRulePoint;
+import com.xunmei.core.resumption.dto.ruleItem.AppRulePointSelectPageDto;
+import com.xunmei.core.resumption.dto.rulePoint.AppRulePointDetailDto;
+import com.xunmei.core.resumption.dto.rulePoint.AppRulePointInfoDto;
+import com.xunmei.core.resumption.vo.AppRulePointTaskVo;
+import com.xunmei.core.resumption.vo.appRuleItem.AppRulePointSelectVo;
+import com.xunmei.core.resumption.vo.resumptionRegister.ResumptionPointVo;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRulePoint;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRulePointSelectPageDto;
+import com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointDetailDto;
+import com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointInfoDto;
+import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRulePointSelectVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+@Mapper
+public interface SafetyCheckRulePointMapper extends BaseMapper<SafetyCheckRulePoint> {
+
+    List<SafetyCheckRulePointDetailDto> selectDataListByItemId(Long id);
+
+//    List<AppRulePointInfoDto> selectDataListByIdList(@Param("pointIds") List<Long> pointIds, @Param("planIdList") List<Long> planIdList);
+
+    List<SafetyCheckRulePointInfoDto> selectPointListByIdList(@Param("pointIds") List<Long> pointIds, @Param("normIdList") List<Long> planIdList);
+
+//    List<SafetyCheckRulePointTaskVo> findPointByPlan(Long planid);
+
+    List<Map<String, Object>> findAreaListPlan(Long planid);
+
+    Map<String, Object> findByName(Map<String, Object> param);
+
+    Integer checkIsUsed(@Param("pointId") Long pointId);
+
+    List<Long> selectPointIds(Long id);
+
+    void updateDeleted(@Param("id") Long id, @Param("deleted") int deleted);
+
+    void updatePlanItem(@Param("id") Long id, @Param("newId") Long newId);
+
+//    Integer checkPointNumRepeat(@Param("itemId") Long itemId, @Param("pointId") Long pointId, @Param("pointNum") Integer pointNum);
+
+    Integer checkPointNameRepeat(@Param("itemId") Long itemId, @Param("pointId") Long pointId, @Param("pointName") String pointName);
+
+//    List<PointVo> findPointBySafetyPlan(Map<String,Object> param);
+//
+//    List<PointVo> findPointBySafetyPlanb(Map<String, Object> param);
+//
+//    List<ResumptionPointVo> findPointByRulePlan(@Param("planId")Long planId,@Param("resumptionId") Long resumptionId);
+
+    Integer checkIsJoinResumptionPlan(@Param("pointIds") List<Long> pointIds);
+
+    Page<SafetyCheckRulePointSelectVo> pointSelectionPage(@Param("page") Page<SafetyCheckRulePointSelectVo> page,
+                                                          @Param("query") SafetyCheckRulePointSelectPageDto query);
+//    Integer checkIsJoinSafetyCheckTaskPlan(@Param("pointIds") List<Long> pointIds);
+}

+ 49 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ISafetyCheckRuleItemService.java

@@ -0,0 +1,49 @@
+package com.xunmei.core.safetyCheck.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.resumption.vo.appRuleItem.RuleTreeItem;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRuleItem;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRuleItemDetailDto;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRuleItemDto;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRuleItemPageDto;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRulePointSelectPageDto;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+public interface ISafetyCheckRuleItemService extends IService<SafetyCheckRuleItem> {
+
+    long edit(SafetyCheckRuleItemDto appRuleItemDto);
+
+    TableDataInfo pageQuery(SafetyCheckRuleItemPageDto itemPageDto);
+
+    SafetyCheckRuleItemDetailDto findOne(Long id);
+
+    boolean del(Long id);
+
+    List<RuleTreeItem> getRuleTree(Long orgId);
+
+    /**
+     * 获取履职内容选择框的翻页列表
+     * @param dto
+     * @return
+     */
+    TableDataInfo pointSelectionPage(SafetyCheckRulePointSelectPageDto dto);
+//    SysDictListDto dict();
+
+//    List<SecBookDtInstDto> dataType();
+
+//    List<AreaListVo> selectCheckAreaList();
+
+
+//    JsonResponse<?> checkRepeat(AppRuleItemCheckDto checkDto);
+
+}

+ 31 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ISafetyCheckRulePointService.java

@@ -0,0 +1,31 @@
+package com.xunmei.core.safetyCheck.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.core.resumption.domain.AppRulePoint;
+import com.xunmei.core.resumption.vo.AppRulePointTaskVo;
+import com.xunmei.core.resumption.vo.resumptionRegister.ResumptionPointVo;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRulePoint;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+public interface ISafetyCheckRulePointService extends IService<SafetyCheckRulePoint> {
+
+//    List<SafetyCheckRulePointTaskVo> findPointByPlan(Long id);
+
+    List<Map<String, Object>> findAreaListPlan(Long planid);
+
+    Map<String, Object> findByName(String name,Long ruleId);
+
+//    List<PointVo> findPointBySafetyPlan(Long planId,String taskId,int type);
+//
+//    List<ResumptionPointVo> findPointByRulePlan(Long planId,Long resumptionId);
+}

+ 44 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ISafetyCheckRuleService.java

@@ -0,0 +1,44 @@
+package com.xunmei.core.safetyCheck.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.vo.IdNameVo;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.resumption.vo.appRuleItem.RuleTreeItem;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRule;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRuleEditDto;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRuleListForOrgDto;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRulePageDto;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRuleInfoVo;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRulePageVo;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author system
+ * @since 2022-04-26
+ */
+public interface ISafetyCheckRuleService extends IService<SafetyCheckRule> {
+
+    TableDataInfo getRulePage(SafetyCheckRulePageDto query);
+
+    List<SafetyCheckRulePageVo> getAllRule();
+
+    Long edit(SafetyCheckRuleEditDto appRuleEditDto);
+
+    //检查手册规范类型在检查项、检查要点是否一致
+//    boolean  checkRuleTypeUniformity(Long id,  int ruletype);
+
+    void del(Long id);
+
+
+    SafetyCheckRuleInfoVo get(Long id);
+
+    List<IdNameVo> ruleListForOrg(SafetyCheckRuleListForOrgDto dto);
+
+    List<RuleTreeItem> getRuleTree(Long orgId);
+}

+ 298 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRuleItemServiceImpl.java

@@ -0,0 +1,298 @@
+package com.xunmei.core.safetyCheck.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.map.MapUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.utils.IDHelper;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.resumption.domain.AppRule;
+import com.xunmei.core.resumption.domain.AppRuleItem;
+import com.xunmei.core.resumption.domain.AppRulePoint;
+import com.xunmei.core.resumption.dto.ruleItem.AppRuleItemDetailDto;
+import com.xunmei.core.resumption.dto.ruleItem.AppRuleItemPageDto;
+import com.xunmei.core.resumption.dto.ruleItem.AppRulePointSelectPageDto;
+import com.xunmei.core.resumption.dto.rulePoint.AppRulePointDetailDto;
+import com.xunmei.core.resumption.dto.rulePoint.AppRulePointDto;
+import com.xunmei.core.resumption.vo.appRuleItem.AppRuleItemPageVo;
+import com.xunmei.core.resumption.vo.appRuleItem.AppRulePointSelectVo;
+import com.xunmei.core.resumption.vo.appRuleItem.RuleTreeItem;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRule;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRuleItem;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRulePoint;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRuleItemDetailDto;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRuleItemDto;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRuleItemPageDto;
+import com.xunmei.core.safetyCheck.dto.ruleItem.SafetyCheckRulePointSelectPageDto;
+import com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointDetailDto;
+import com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointDto;
+import com.xunmei.core.safetyCheck.mapper.SafetyCheckRuleItemMapper;
+import com.xunmei.core.safetyCheck.mapper.SafetyCheckRuleMapper;
+import com.xunmei.core.safetyCheck.mapper.SafetyCheckRulePointMapper;
+import com.xunmei.core.safetyCheck.service.ISafetyCheckRuleItemService;
+import com.xunmei.core.safetyCheck.service.ISafetyCheckRulePointService;
+import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRuleItemPageVo;
+import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRulePointSelectVo;
+import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.domain.SysOrg;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+@Service
+public class SafetyCheckRuleItemServiceImpl
+        extends ServiceImpl<SafetyCheckRuleItemMapper, SafetyCheckRuleItem>
+        implements ISafetyCheckRuleItemService {
+    @Resource
+    private SafetyCheckRuleItemMapper safetyCheckRuleItemMapper;
+    @Resource
+    private ISafetyCheckRulePointService safetyCheckRulePointService;
+    @Resource
+    private SafetyCheckRulePointMapper safetyCheckRulePointMapper;
+//    @Resource
+//    private SysDictDetailService sysDictDetailService;
+
+    @Resource
+    RemoteOrgService remoteOrgService;
+    @Resource
+    private SafetyCheckRuleMapper safetyCheckRuleMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public long edit(SafetyCheckRuleItemDto ruleItemDto) {
+        final SafetyCheckRuleItem item = new SafetyCheckRuleItem();
+        BeanUtils.copyProperties(ruleItemDto, item);
+//        if (item.getId() == null) {
+//            item.setId(IDHelper.id());
+//        }
+
+//        Integer num = safetyCheckRuleItemMapper.checkItemNumRepeat(item.getId(), item.getRuleId(), item.getItemNum());
+//        if (num > 0) {
+//            throw new RuntimeException("检查项编号重复");
+//        }
+
+        Integer itemNameNums = safetyCheckRuleItemMapper.checkItemNameRepeat(item.getId(), item.getRuleId(), item.getName());
+        if (itemNameNums > 0) {
+            throw new RuntimeException("检查项名称重复");
+        }
+
+        final SafetyCheckRule rule = safetyCheckRuleMapper.selectById(ruleItemDto.getRuleId());
+        if (rule == null) {
+            throw new RuntimeException("请选择具体规范新增数据!");
+        }
+
+        saveOrUpdate(item);
+        final List<SafetyCheckRulePointDto> pointDtoList = ruleItemDto.getPointDtoList();
+        Set<String> hashMap = new HashSet<>();
+        for (SafetyCheckRulePointDto appRulePointDto : pointDtoList) {
+            if (hashMap.contains(appRulePointDto.getName())) {
+                throw new RuntimeException("履职内容重复!");
+            }
+            hashMap.add(appRulePointDto.getName());
+        }
+
+
+        final List<Long> pointIds = safetyCheckRulePointMapper.selectPointIds(item.getId());
+        if (pointIds.size() > 0) {
+            List<Long> idList2 = pointDtoList.stream().map(SafetyCheckRulePointDto::getId).collect(Collectors.toList());
+            for (Long pointId : pointIds) {
+                if (!idList2.contains(pointId)) {
+                    Integer isUsed = safetyCheckRulePointMapper.checkIsUsed(pointId);
+                    if (isUsed == null) {
+                        safetyCheckRulePointMapper.deleteById(pointId);
+                    } else {
+                        throw new RuntimeException("有要点已被使用,不能删除!");
+                    }
+                }
+            }
+        }
+
+
+        for (SafetyCheckRulePointDto appRulePointDto : pointDtoList) {
+            SafetyCheckRulePoint point = new SafetyCheckRulePoint();
+            BeanUtils.copyProperties(appRulePointDto, point);
+            point.setItemId(item.getId());
+            point.setRuleId(item.getRuleId());
+            if (point.getId() == null) {
+                //新增
+                point.setId(IDHelper.id());
+
+                safetyCheckRulePointService.save(point);
+            } else {
+                //修改
+                Integer isUsed = safetyCheckRulePointMapper.checkIsUsed(point.getId());
+                if (isUsed == null) {
+                    safetyCheckRulePointService.updateById(point);
+                } else {
+                    //将之前的记录逻辑删除,然后新增一条记录关联到检查项
+                    safetyCheckRulePointMapper.updateDeleted(point.getId(), 1);
+                    Long newId = IDHelper.id();
+                    safetyCheckRulePointMapper.updatePlanItem(point.getId(), newId);
+                    point.setId(newId);
+                    safetyCheckRulePointMapper.insert(point);
+
+                }
+            }
+        }
+        return item.getId();
+    }
+
+    @Override
+    public TableDataInfo pageQuery(SafetyCheckRuleItemPageDto itemPageDto) {
+        Page<SafetyCheckRuleItemPageVo> page;
+
+        page = safetyCheckRuleItemMapper.pageQuery(itemPageDto.getPageDto(), itemPageDto);
+//        int order = itemPageDto() * itemPageDto.getSize();
+        for (SafetyCheckRuleItemPageVo vo : page.getRecords()) {
+//            vo.setOrder(++order);
+            final List<SafetyCheckRulePointDetailDto> pointList = safetyCheckRulePointMapper.selectDataListByItemId(vo.getId());
+            vo.setPointDtoList(pointList);
+        }
+
+        return TableDataInfo.success(page);
+    }
+
+    @Override
+    public SafetyCheckRuleItemDetailDto findOne(Long id) {
+        final SafetyCheckRuleItem appRuleItem = safetyCheckRuleItemMapper.selectById(id);
+        if (ObjectUtil.isNull(appRuleItem)) {
+            return null;
+        }
+        SafetyCheckRuleItemDetailDto appRuleItemDto = new SafetyCheckRuleItemDetailDto();
+        BeanUtils.copyProperties(appRuleItem, appRuleItemDto);
+
+        List<SafetyCheckRulePointDetailDto> list = safetyCheckRulePointMapper.selectDataListByItemId(id);
+        appRuleItemDto.setPointDtoList(list);
+        return appRuleItemDto;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean del(Long id) {
+        List<Long> idList = safetyCheckRulePointMapper.selectPointIds(id);
+        if (idList.size() > 0) {
+
+            Integer num1 = safetyCheckRulePointMapper.checkIsJoinResumptionPlan(idList);
+            if (ObjectUtil.isNotNull(num1)) {
+                throw new RuntimeException("该检查项已被检查计划或履职计划关联,请先删除检查计划或履职计划!");
+            }
+        }
+        safetyCheckRuleItemMapper.deleteById(id);
+        safetyCheckRulePointMapper.deleteByMap(MapUtil.of("item_id", id));
+        return true;
+    }
+
+    @Override
+    public List<RuleTreeItem> getRuleTree(Long orgId) {
+        List<RuleTreeItem> tree = new ArrayList<>();
+        List<SysOrg> orgs = remoteOrgService
+                .listByTypes(OrgListByTypesConditionEto.builder().orgId(orgId).orgTypes(Arrays.asList("1", "2", "3", "4", "11")).build())
+                .getData();
+        if (ObjectUtil.isEmpty(orgs)) {
+            return tree;
+        }
+        Map<Long, SysOrg> orgMap = orgs.stream().collect(Collectors.toMap(o -> o.getId(), o -> o));
+        List<SysOrg> tops = orgs.stream().filter(o -> !orgMap.containsKey(o.getParentId())).collect(Collectors.toList());
+        if (CollectionUtil.isEmpty(tops)) {
+            return tree;
+        }
+        List<Long> orgIds = orgs.stream().map(o -> o.getId()).collect(Collectors.toList());
+        List<SafetyCheckRule> rules = safetyCheckRuleMapper.selectList(new LambdaQueryWrapper<SafetyCheckRule>().in(SafetyCheckRule::getOrgId, orgIds));
+
+        tree = tops.stream().map(o -> generateTree(o, orgs, rules)).collect(Collectors.toList());
+
+        return tree;
+    }
+
+    private RuleTreeItem generateTree(SysOrg parent, List<SysOrg> allOrg, List<SafetyCheckRule> allRule) {
+        RuleTreeItem item = RuleTreeItem.builder().isRule(0).id(parent.getId()).label(parent.getName()).children(new ArrayList<>()).build();
+        List<RuleTreeItem> ruleItems = allRule.stream().filter(r -> ObjectUtil.equal(r.getOrgId(), parent.getId()))
+                .map(o -> RuleTreeItem.builder().isRule(1).id(o.getId()).label(o.getName()).orgType(o.getOrgType()).build())
+                .collect(Collectors.toList());
+        item.getChildren().addAll(ruleItems);
+
+        List<SysOrg> children = allOrg.stream()
+                .filter(o -> ObjectUtil.equal(o.getParentId(), parent.getId()))
+                .collect(Collectors.toList());
+        for (SysOrg child : children) {
+            item.getChildren().add(generateTree(child, allOrg, allRule));
+        }
+
+        return item;
+    }
+
+    /**
+     * 获取履职内容选择框的翻页列表
+     *
+     * @param dto
+     * @return
+     */
+    @Override
+    public TableDataInfo pointSelectionPage(SafetyCheckRulePointSelectPageDto dto) {
+        Page<SafetyCheckRulePointSelectVo> page = dto.getPageDto();
+        page = safetyCheckRulePointMapper.pointSelectionPage(page, dto);
+        return TableDataInfo.success(page);
+    }
+
+//    @Override
+//    public SysDictListDto dict() {
+//        final SysDictListDto dto = new SysDictListDto();
+//        final List<SysDictDetail> detailList = sysDictDetailService.all();
+//        final List<SysDictDetail> checkMethodList = detailList.stream().filter(detail -> "check_method".equals(detail.getDictCode())).collect(Collectors.toList());
+//        final List<SysDictDetail> checkTypeList = detailList.stream().filter(detail -> "check_type".equals(detail.getDictCode())).collect(Collectors.toList());
+//        final List<SysDictDetail> rectifyTremList = detailList.stream().filter(detail -> "rectify_trem".equals(detail.getDictCode())).collect(Collectors.toList());
+//        dto.setCheckTypeList(checkTypeList);
+//        dto.setRectifyTremList(rectifyTremList);
+//        dto.setCheckMethodList(checkMethodList);
+//        return dto;
+//    }
+
+//    @Override
+//    public List<SecBookDtInstDto> dataType() {
+//
+//        return safetyCheckRuleItemMapper.selectDataTypeList();
+//    }
+//
+//    @Override
+//    public List<AreaListVo> selectCheckAreaList() {
+//        return safetyCheckRuleItemMapper.selectCheckAreaList();
+//    }
+
+//    @Override
+//    public JsonResponse<?> checkRepeat(AppRuleItemCheckDto checkDto) {
+//        if (checkDto.getItemNum() != null) {
+//            Integer num = safetyCheckRuleItemMapper.checkItemNumRepeat(checkDto.getItemId(), checkDto.getRuleId(), checkDto.getItemNum());
+//            if (num > 0) {
+//                return JsonResponse.fail("检查项编号重复!");
+//            }
+//        }
+//        if (checkDto.getPointNum() != null) {
+//            Integer num = safetyCheckRulePointMapper.checkPointNumRepeat(checkDto.getItemId(), checkDto.getPointId(), checkDto.getPointNum());
+//            if (num > 0) {
+//                return JsonResponse.fail("要点编号重复!");
+//            }
+//        }
+//        if (!StringUtil.isNullOrEmpty(checkDto.getPointName())) {
+//            Integer num = safetyCheckRulePointMapper.checkPointNameRepeat(checkDto.getItemId(), checkDto.getPointId(), checkDto.getPointName());
+//            if (num > 0) {
+//                return JsonResponse.fail("要点名称重复!");
+//            }
+//        }
+//        return JsonResponse.success();
+//    }
+}

+ 66 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRulePointServiceImpl.java

@@ -0,0 +1,66 @@
+package com.xunmei.core.safetyCheck.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.core.resumption.domain.AppRulePoint;
+import com.xunmei.core.resumption.mapper.AppRulePointMapper;
+import com.xunmei.core.resumption.service.IAppRulePointService;
+import com.xunmei.core.resumption.vo.AppRulePointTaskVo;
+import com.xunmei.core.resumption.vo.resumptionRegister.ResumptionPointVo;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRulePoint;
+import com.xunmei.core.safetyCheck.mapper.SafetyCheckRulePointMapper;
+import com.xunmei.core.safetyCheck.service.ISafetyCheckRulePointService;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-04-27
+ */
+@Service
+public class SafetyCheckRulePointServiceImpl extends ServiceImpl<SafetyCheckRulePointMapper, SafetyCheckRulePoint> implements ISafetyCheckRulePointService {
+
+
+
+    @Override
+    public List<Map<String, Object>> findAreaListPlan(Long planid) {
+        return baseMapper.findAreaListPlan(planid);
+    }
+
+    @Override
+    public Map<String, Object> findByName(String name, Long ruleId) {
+        Map<String, Object> param = new HashMap<>();
+        param.put("name", name);
+        param.put("ruleId", ruleId);
+        return baseMapper.findByName(param);
+    }
+
+    //    @Override
+//    public List<PointVo> findPointBySafetyPlan(Long planId,String taskId,int type) {
+//        Map<String,Object> param = new HashMap<>();
+//        param.put("taskId",taskId);
+//        param.put("planId",planId);
+//        param.put("type",type);
+//        if(type==0){
+//            return baseMapper.findPointBySafetyPlan(param);
+//        }else{
+//            return baseMapper.findPointBySafetyPlanb(param);
+//        }
+//
+//    }
+//
+//    @Override
+//    public List<ResumptionPointVo> findPointByRulePlan(Long planId, Long resumptionId) {
+//        return baseMapper.findPointByRulePlan(planId, resumptionId);
+//    }
+//    @Override
+//    public List<AppRulePointTaskVo> findPointByPlan(Long planid) {
+//        return baseMapper.findPointByPlan(planid);
+//    }
+}

+ 176 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRuleServiceImpl.java

@@ -0,0 +1,176 @@
+package com.xunmei.core.safetyCheck.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.utils.IDHelper;
+import com.xunmei.common.core.vo.IdNameVo;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.resumption.domain.AppRule;
+import com.xunmei.core.resumption.dto.rule.AppRuleEditDto;
+import com.xunmei.core.resumption.dto.rule.AppRuleListForOrgDto;
+import com.xunmei.core.resumption.vo.appRule.AppRuleInfoVo;
+import com.xunmei.core.resumption.vo.appRule.AppRulePageVo;
+import com.xunmei.core.resumption.vo.appRuleItem.RuleTreeItem;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRule;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRuleEditDto;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRuleListForOrgDto;
+import com.xunmei.core.safetyCheck.dto.rule.SafetyCheckRulePageDto;
+import com.xunmei.core.safetyCheck.mapper.SafetyCheckRuleMapper;
+import com.xunmei.core.safetyCheck.service.ISafetyCheckRuleService;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRuleInfoVo;
+import com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRulePageVo;
+import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.domain.SysOrg;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author system
+ * @since 2022-04-26
+ */
+@Slf4j
+@Service
+public class SafetyCheckRuleServiceImpl extends ServiceImpl<SafetyCheckRuleMapper, SafetyCheckRule> implements ISafetyCheckRuleService {
+    @Resource
+    private SafetyCheckRuleMapper safetyCheckRuleMapper;
+
+    @Resource
+    RemoteOrgService remoteOrgService;
+
+    @Override
+    public TableDataInfo getRulePage(SafetyCheckRulePageDto query) {
+        Page<SafetyCheckRulePageVo> page = query.getPageDto();
+        page = safetyCheckRuleMapper.selectPageByCondition(page, query);
+
+        return TableDataInfo.success(page);
+    }
+
+    @Override
+    public List<SafetyCheckRulePageVo> getAllRule() {
+        List<SafetyCheckRule> all = safetyCheckRuleMapper.selectList(new QueryWrapper());
+        List<SafetyCheckRulePageVo> r = new ArrayList<>();
+        for (SafetyCheckRule appRule : all) {
+            SafetyCheckRulePageVo vo = new SafetyCheckRulePageVo();
+            BeanUtils.copyProperties(appRule, vo);
+            r.add(vo);
+        }
+
+        return r;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Long edit(SafetyCheckRuleEditDto appRuleEditDto) {
+        final SafetyCheckRule appRule = new SafetyCheckRule();
+        BeanUtils.copyProperties(appRuleEditDto, appRule);
+        Integer nums = safetyCheckRuleMapper.checkRuleNameRepeat(appRule.getId(), appRule.getName());
+        if (nums > 0) {
+            throw new RuntimeException("规则名称重复");
+        }
+
+        if (appRule.getId() == null) {
+            appRule.setId(IDHelper.id());
+//            appRule.setOrgId(4352539158904832L);
+            appRule.setOrgId(SecurityUtils.getLoginUser().getSysUser().getOrgId());
+            save(appRule);
+        } else {
+            updateById(appRule);
+//            safetyCheckRuleMapper.updateItemRuleType(appRuleEditDto.getId(), appRuleEditDto.getRuleTypeId());
+//            safetyCheckRuleMapper.updatePointRuleType(appRuleEditDto.getId(), appRuleEditDto.getRuleTypeId());
+        }
+        return appRule.getId();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void del(Long id) {
+        safetyCheckRuleMapper.deleteById(id);
+    }
+
+    @Override
+    public SafetyCheckRuleInfoVo get(Long id) {
+        SafetyCheckRule rule = safetyCheckRuleMapper.selectById(id);
+        return SafetyCheckRuleInfoVo.of(rule);
+    }
+
+    @Override
+    public List<IdNameVo> ruleListForOrg(SafetyCheckRuleListForOrgDto dto) {
+        Long loginOrgId = SecurityUtils.getLoginUser().getOrgId();
+        List<Long> upOrgIds = remoteOrgService.getUpOrgs(loginOrgId);
+        if(CollectionUtil.isEmpty(upOrgIds)){
+            return new ArrayList<>();
+        }
+        
+        List<SafetyCheckRule> rules = safetyCheckRuleMapper.selectList(new LambdaQueryWrapper<SafetyCheckRule>()
+                .in(SafetyCheckRule::getOrgId, upOrgIds)
+                .eq(SafetyCheckRule::getOrgType, dto.getOrgType())
+                .eq(SafetyCheckRule::getStatus, "0")
+                .select(SafetyCheckRule::getId,SafetyCheckRule::getName)
+        );
+        List<IdNameVo> list = rules.stream().map(r -> {
+            IdNameVo vo = new IdNameVo();
+            BeanUtils.copyProperties(r, vo);
+            return vo;
+        }).collect(Collectors.toList());
+
+        return list;
+    }
+
+    @Override
+    public List<RuleTreeItem> getRuleTree(Long orgId) {
+        List<RuleTreeItem> tree = new ArrayList<>();
+        List<SysOrg> orgs = remoteOrgService
+                .listByTypes(OrgListByTypesConditionEto.builder().orgId(orgId).orgTypes(Arrays.asList("1", "2", "3", "4", "11")).build())
+                .getData();
+        if (ObjectUtil.isEmpty(orgs)) {
+            return tree;
+        }
+        Map<Long, SysOrg> orgMap = orgs.stream().collect(Collectors.toMap(o -> o.getId(), o -> o));
+        List<SysOrg> tops = orgs.stream().filter(o -> !orgMap.containsKey(o.getParentId())).collect(Collectors.toList());
+        if (CollectionUtil.isEmpty(tops)) {
+            return tree;
+        }
+        List<Long> orgIds = orgs.stream().map(o -> o.getId()).collect(Collectors.toList());
+        List<SafetyCheckRule> rules = safetyCheckRuleMapper.selectList(new LambdaQueryWrapper<SafetyCheckRule>().in(SafetyCheckRule::getOrgId, orgIds));
+
+        tree = tops.stream().map(o -> generateTree(o, orgs, rules)).collect(Collectors.toList());
+
+        return tree;
+    }
+
+    private RuleTreeItem generateTree(SysOrg parent, List<SysOrg> allOrg, List<SafetyCheckRule> allRule) {
+        RuleTreeItem item = RuleTreeItem.builder().isRule(0).id(parent.getId()).label(parent.getName()).children(new ArrayList<>()).build();
+        List<RuleTreeItem> ruleItems = allRule.stream().filter(r -> ObjectUtil.equal(r.getOrgId(), parent.getId()))
+                .map(o -> RuleTreeItem.builder().isRule(1).id(o.getId()).label(o.getName()).orgType(parent.getType().toString()).build())
+                .collect(Collectors.toList());
+        item.getChildren().addAll(ruleItems);
+
+        List<SysOrg> children = allOrg.stream()
+                .filter(o -> ObjectUtil.equal(o.getParentId(), parent.getId()))
+                .collect(Collectors.toList());
+        for (SysOrg child : children) {
+            item.getChildren().add(generateTree(child, allOrg, allRule));
+        }
+
+        return item;
+    }
+}

+ 19 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/rule/SafetyCheckRuleGroupVo.java

@@ -0,0 +1,19 @@
+package com.xunmei.core.safetyCheck.vo.rule;
+
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/27 16:26
+ */
+@Data
+public class SafetyCheckRuleGroupVo {
+
+    private Long orgTypeId;
+
+    private String orgType;
+
+    private Long ruleId;
+
+    private String ruleName;
+}

+ 45 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/rule/SafetyCheckRuleInfoVo.java

@@ -0,0 +1,45 @@
+package com.xunmei.core.safetyCheck.vo.rule;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.xunmei.core.resumption.domain.AppRule;
+import com.xunmei.core.safetyCheck.domain.SafetyCheckRule;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/29 8:57
+ */
+
+@Data
+public class SafetyCheckRuleInfoVo {
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @ApiModelProperty("规范名称")
+    private String name;
+
+    @ApiModelProperty("规范类型")
+    private String type;
+
+    //    private String ruleTypeName;
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long orgId;
+
+    @ApiModelProperty("受检机构类型")
+    private String orgType;
+
+    @ApiModelProperty("状态")
+    private String status;
+
+    @ApiModelProperty("备注")
+    private String remark;
+
+    public static SafetyCheckRuleInfoVo of(SafetyCheckRule rule) {
+        SafetyCheckRuleInfoVo vo = new SafetyCheckRuleInfoVo();
+        BeanUtil.copyProperties(rule, vo);
+        return vo;
+    }
+}

+ 38 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/rule/SafetyCheckRulePageVo.java

@@ -0,0 +1,38 @@
+package com.xunmei.core.safetyCheck.vo.rule;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/26 10:26
+ */
+@Data
+public class SafetyCheckRulePageVo {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @ApiModelProperty("规范名称")
+    private String name;
+
+    @ApiModelProperty("规范类型id")
+    private String type;
+
+    @ApiModelProperty(value = "受检机构类型")
+    private String orgType;
+
+    @ApiModelProperty(value = "发布机构名称")
+    private String orgName;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long orgId;
+
+    @ApiModelProperty(value = "状态")
+    private String status;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+}

+ 27 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/ruleItem/RuleTreeItem.java

@@ -0,0 +1,27 @@
+package com.xunmei.core.safetyCheck.vo.ruleItem;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@Builder
+
+public class RuleTreeItem {
+     @JsonSerialize(using = ToStringSerializer.class)
+     Long id;
+
+     String label;
+
+     int isRule;
+
+     /**
+      * 履职机构类型
+      */
+     String orgType;
+
+     List<RuleTreeItem> children;
+}

+ 30 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/ruleItem/SafetyCheckRuleItemPageVo.java

@@ -0,0 +1,30 @@
+package com.xunmei.core.safetyCheck.vo.ruleItem;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.xunmei.core.resumption.dto.rulePoint.AppRulePointDetailDto;
+import com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointDetailDto;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/4/27 18:18
+ */
+@Data
+public class SafetyCheckRuleItemPageVo {
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+//    private int order;
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long ruleId;
+    private String name;
+//    private Integer itemNum;
+    private String desc;
+    private Integer pointNums;
+    @ApiModelProperty(value = "检查点")
+    private List<SafetyCheckRulePointDetailDto> pointDtoList;
+}

+ 43 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/ruleItem/SafetyCheckRulePointSelectVo.java

@@ -0,0 +1,43 @@
+package com.xunmei.core.safetyCheck.vo.ruleItem;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/6/1 9:40
+ */
+@Data
+public class SafetyCheckRulePointSelectVo {
+
+    /**
+     * 履职内容id
+     */
+    @JsonSerialize(using= ToStringSerializer.class)
+    private Long id;
+
+    @ApiModelProperty("规范id")
+    @JsonSerialize(using= ToStringSerializer.class)
+    private Long ruleId;
+
+    private  String ruleName;
+
+    @ApiModelProperty("检查项id")
+    @JsonSerialize(using= ToStringSerializer.class)
+    private Long itemId;
+
+    private String itemName;
+
+    @ApiModelProperty("履职内容")
+    private String pointName;
+
+    /**
+     * 区域id
+     */
+    @JsonSerialize(using= ToStringSerializer.class)
+    private  Long areaId;
+
+    private  String areaName;
+}

+ 31 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/SafetyCheckRuleItemMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xunmei.core.safetyCheck.mapper.SafetyCheckRuleItemMapper">
+    <select id="pageQuery" resultType="com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRuleItemPageVo">
+        select i.*,
+        (select count(p.id) from core_safetycheck_rule_point p where p.item_id=i.id and p.deleted=0
+            <if test="itemPageDto.pointName!=null and itemPageDto.pointName!=''">
+                and `name` like concat('%',#{itemPageDto.pointName},'%')</if>
+        ) as pointNums from
+        core_safetycheck_rule_item i
+        <where>
+            i.deleted=0
+            <if test="itemPageDto.ruleId != null and itemPageDto.ruleId !=''">
+                and i.rule_id = #{itemPageDto.ruleId}
+            </if>
+            <if test="itemPageDto.itemName != null and itemPageDto.itemName!=''">
+                and i.name like CONCAT('%',#{itemPageDto.itemName},'%')
+            </if>
+            <if test="itemPageDto.pointName!=null and itemPageDto.pointName!=''">
+                and i.id in (select item_id from core_safetycheck_rule_point  where rule_id= #{itemPageDto.ruleId} and `name` like concat('%',#{itemPageDto.pointName},'%'))
+            </if>
+        </where>
+    </select>
+
+    <select id="checkItemNameRepeat" resultType="java.lang.Integer">
+        select count(id) from core_safetycheck_rule_item where rule_id=#{ruleId} and name=#{itemName}
+        <if test="id != null">
+            and id != #{id}
+        </if>
+    </select>
+</mapper>

+ 51 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/SafetyCheckRuleMapper.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xunmei.core.safetyCheck.mapper.SafetyCheckRuleMapper">
+    <select id="selectPageByCondition" resultType="com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRulePageVo">
+        select a.id as id,
+        a.name,
+        a.type,
+        a.org_type as orgType,
+        a.status as status,
+        a.remark as remark,
+        a.org_id as orgId,
+        org.name as orgName
+        from core_safetycheck_rule a
+        inner join sys_org org on a.org_id = org.id
+        <where>
+            a.deleted=0
+            <if test="appRule.name != null and appRule.name != ''">
+                and a.name like CONCAT('%',#{appRule.name},'%')
+            </if>
+            <if test="appRule.type != null and appRule.type != ''">
+                and a.type = #{appRule.type}
+            </if>
+            <if test="appRule.orgType != null">
+                and a.org_type = #{appRule.orgType}
+            </if>
+            <if test="appRule.checkSub==false">
+                and a.org_id=#{appRule.orgId}
+            </if>
+        </where>
+        order by a.create_time desc
+    </select>
+
+    <select id="getRuleGroupList" resultType="com.xunmei.core.safetyCheck.vo.rule.SafetyCheckRuleGroupVo">
+        select r.id       as ruleId,
+               r.name     as name,
+               d.name     as orgType,
+               r.org_type as orgTypeId
+        from core_safetycheck_rule r
+        inner join sys_dict_data d on r.type = d.id and d.dict_code = 'sys_org_type'
+        where status = "0" and r.deleted=0
+    </select>
+
+
+    <select id="checkRuleNameRepeat" resultType="java.lang.Integer">
+        select count(id) from core_safetycheck_rule where name=#{name}
+        <if test="id != null">
+            and id != #{id}
+        </if>
+    </select>
+
+</mapper>

+ 214 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/SafetyCheckRulePointMapper.xml

@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xunmei.core.safetyCheck.mapper.SafetyCheckRulePointMapper">
+    <select id="selectDataListByItemId" resultType="com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointDetailDto">
+        select p.*,a.name as areaName
+        from core_safetycheck_rule_point p
+        inner join sys_area a on p.area_id = a.id
+        where item_id = #{id}
+          and p.deleted = 0
+    </select>
+<!--    <select id="findPointByPlan" parameterType="Long" resultType="com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRulePointTaskVo">-->
+<!--        SELECT a.*, b.point_scan-->
+<!--        from core_safetycheck_rule_point a-->
+<!--                 LEFT JOIN core_safetycheck_plan_to_point b ON a.id = b.point_id-->
+<!--                 LEFT JOIN core_safetycheck_plan c ON b.plan_id = c.id-->
+<!--        WHERE c.id = #{planid}-->
+<!--    </select>-->
+    <select id="selectPointListByIdList" resultType="com.xunmei.core.safetyCheck.dto.rulePoint.SafetyCheckRulePointInfoDto"
+            parameterType="java.util.List">
+        select
+        ri.id as itemId,
+        ri.item_name as itemName,
+        ri.item_num as itemNum,
+        ri.item_desc as itemDesc,
+        p.id as id,
+        p.point_num as pointNum,
+        p.point_name as pointName,
+        p.safe_type as safeType,
+        d.name as safeTypeText,
+        p.area_id as areaId,
+        p.business_type as businessType,
+        a.name as areaName,
+        ap.rule_name as planName,
+        ap.id as planId,
+        2 as pointSource
+        from core_safetycheck_rule_point p
+        inner join core_safetycheck_rule_item ri on ri.id=p.item_id
+        inner join sys_area a on p.area_id = a.id
+        inner join sys_dict_detail d on d.code = p.safe_type and d.dict_code = 'check_type'
+        inner join t_app_rule ap on p.rule_id =ap.id
+        where p.deleted = 0 and ri.deleted=0
+        <if test="pointIds != null and pointIds.size > 0">
+            and p.id in
+            <foreach collection="pointIds" item="pointId" open="(" separator="," close=")">
+                #{pointId}
+            </foreach>
+        </if>
+        <if test="normIdList != null and normIdList.size > 0">
+            and ap.id in
+            <foreach collection="normIdList" item="planId" open="(" separator="," close=")">
+                #{planId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="findAreaListPlan" parameterType="Long" resultType="java.util.Map">
+        SELECT a.area_id as areaid, d.name as areaname
+        from core_safetycheck_rule_point a
+                 LEFT JOIN core_safetycheck_plan_to_point b ON a.id = b.point_id
+                 LEFT JOIN core_safetycheck_plan c ON b.plan_id = c.id
+                 LEFT JOIN sys_area d ON a.area_id = d.id
+        WHERE c.id = #{planid}
+    </select>
+
+
+    <select id="findByName" parameterType="java.util.HashMap" resultType="java.util.Map">
+        SELECT id, area_id
+        FROM core_safetycheck_rule_point a
+        WHERE a.name = #{name}
+          and rule_id = #{ruleId}
+    </select>
+
+    <select id="checkIsUsed" resultType="java.lang.Integer">
+        SELECT 1
+        FROM core_safetycheck_data a
+        WHERE a.item_id = #{pointId}
+        limit 1
+    </select>
+
+
+    <select id="selectPointIds" resultType="java.lang.Long">
+        select id
+        from core_safetycheck_rule_point
+        where item_id = #{id}
+          and deleted = 0
+    </select>
+
+    <update id="updateDeleted">
+        update core_safetycheck_rule_point
+        set deleted=#{deleted}
+        where id = #{id}
+    </update>
+
+    <update id="updatePlanItem">
+        update core_safetycheck_plan_to_point
+        set point_id=#{newId}
+        where point_id = #{id}
+    </update>
+
+<!--    <select id="checkPointNumRepeat" resultType="java.lang.Integer">-->
+<!--        select count(*)-->
+<!--        from core_resumption_rule_point-->
+<!--        where -->
+<!--        and item_id = #{itemId}-->
+<!--        and deleted = 0-->
+<!--        <if test="pointId != null">-->
+<!--            and id != #{pointId}-->
+<!--        </if>-->
+<!--    </select>-->
+
+    <select id="checkPointNameRepeat" resultType="java.lang.Integer">
+        select count(*)
+        from core_safetycheck_rule_point
+        where name = #{pointName}
+        and item_id = #{itemId}
+        and deleted = 0
+        <if test="pointId != null">
+            and id != #{pointId}
+        </if>
+    </select>
+
+<!--    <select id="findPointBySafetyPlan" parameterType="java.util.HashMap" resultType="com.isp.safecheck.vo.PointVo">-->
+<!--        SELECT a.id as pointId,a.point_name as pointName ,a.point_num as pointNum,a.item_id as itemId,a.area_id as areaId,f.name as areaName,a.time_type as timeType,-->
+<!--        b.plan_id as planId,e.item_name as itemName,b.point_scan as pointScan,d.DATA_NAME as dataName,d1.DATA_ITEM_NAME as dataDetailNameA,d2.DATA_ITEM_NAME as dataDetailNameB-->
+<!--        from core_resumption_rule_point a-->
+<!--                 LEFT JOIN t_app_safecheck_plan_to_item b ON a.id = b.item_id-->
+<!--                 LEFT JOIN t_app_safecheck_plan c ON b.plan_id = c.id-->
+<!--                 LEFT JOIN core_resumption_rule_item e ON a.item_id = e.id-->
+<!--                 left join sys_area f on a.area_id = f.id-->
+<!--                 left join sec_book_dt_inst d on a.data_type = d.id-->
+<!--                 left join sec_book_dti_inst d1 on d.id = d1.SEC_BOOK_DT_INST_ID and d1.DATA_ITEM_NUMB='001'-->
+<!--                 left join sec_book_dti_inst d2 on d.id = d2.SEC_BOOK_DT_INST_ID and d2.DATA_ITEM_NUMB='002'-->
+<!--        WHERE c.id = #{planId} and a.deleted=0-->
+<!--    </select>-->
+
+<!--    <select id="findPointBySafetyPlanb" parameterType="java.util.HashMap" resultType="com.isp.safecheck.vo.PointVo">-->
+<!--        SELECT  b.id as pointId,b.point_name as pointName ,b.point_num as pointNum,b.item_id as itemId,b.area_id as areaId,b.time_type as timeType,f.name as areaName,-->
+<!--        a.plan_id as planId,e.item_name as itemName,a.id as pointDataId,a.res_value as resValue,a.res_time as resTime,a.res_value as resValue,d.DATA_NAME as dataName,-->
+<!--       d1.DATA_ITEM_NAME as dataDetailNameA,d2.DATA_ITEM_NAME as dataDetailNameB-->
+<!--       FROM t_app_safety_task_data a LEFT JOIN core_resumption_rule_point b ON a.point_id  = b.id-->
+<!--       LEFT JOIN sys_area f ON a.area_id = f.id-->
+<!--       LEFT JOIN core_resumption_rule_item e ON a.item_id = e.id-->
+<!--       left join sec_book_dt_inst d on b.data_type = d.id-->
+<!--       left join sec_book_dti_inst d1 on d.id = d1.SEC_BOOK_DT_INST_ID and d1.DATA_ITEM_NUMB='001'-->
+<!--       left join sec_book_dti_inst d2 on d.id = d2.SEC_BOOK_DT_INST_ID and d2.DATA_ITEM_NUMB='002'-->
+<!--      WHERE a.task_id =#{taskId}-->
+
+<!--    </select>-->
+
+<!--    <select id="findPointByRulePlan" resultType="com.xunmei.core.safetyCheck.vo.resumptionRegister.ResumptionPointVo">-->
+<!--        SELECT-->
+<!--            a.id AS pointid,-->
+<!--            a.NAME AS pointname,&#45;&#45;             a.point_num AS pointnum,-->
+<!--            a.item_id AS itemid,-->
+<!--            a.area_id AS areaid,-->
+<!--            f.NAME AS areaname,&#45;&#45;             a.time_type AS timeType,-->
+<!--            b.plan_id AS planId,-->
+<!--            e.NAME AS itemname,-->
+<!--            b.point_scan AS pointScan,-->
+<!--            b.required,-->
+<!--            a.business_type AS businessType,-->
+<!--            rd.res_value,-->
+<!--            rd.res_time,-->
+<!--            rd.submit_time,-->
+<!--            rd.res_status,-->
+<!--            rd.res_remark,-->
+<!--            rd.submit_by,-->
+<!--            if(rd.id is null,null,rd.id) as pointdataid,-->
+<!--            rd.rectification_deadline as rectificationDeadline-->
+<!--        FROM-->
+<!--             core_safetycheck_plan_to_point b-->
+<!--                LEFT JOIN core_safetycheck_rule_point a ON a.id = b.point_id-->
+<!--                LEFT JOIN core_safetycheck_plan c ON b.plan_id = c.id-->
+<!--                LEFT JOIN core_safetycheck_rule_item e ON a.item_id = e.id-->
+<!--                LEFT JOIN sys_area f ON a.area_id = f.id-->
+<!--                LEFT JOIN core_safetycheck_data rd ON rd.item_id = b.point_id and rd.safetycheck_id=#{safetycheckId}-->
+<!--        WHERE-->
+<!--            c.id = #{planId} and a.deleted=0-->
+<!--    </select>-->
+<!--    -->
+    <select id="checkIsJoinResumptionPlan" resultType="java.lang.Integer">
+        SELECT DISTINCT 1
+        FROM core_safetycheck_plan_to_point
+        WHERE point_id in
+        <foreach collection="pointIds" item="pointId" index="index" open="(" separator="," close=")">
+            #{pointId}
+        </foreach>
+        limit 1
+    </select>
+    <select id="pointSelectionPage" resultType="com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRulePointSelectVo">
+        SELECT
+        p.id,
+        p.rule_id AS ruleId,
+        r.`name` AS ruleName,
+        p.item_id AS itemId,
+        i.`name` AS itemName,
+        p.`name` AS pointName,
+        a.id as areaId,
+        a.`name` AS areaName
+        FROM
+        core_safetycheck_rule_point p
+        INNER JOIN core_safetycheck_rule_item i ON p.item_id = i.id
+        INNER JOIN core_safetycheck_rule r ON p.rule_id = r.id
+        LEFT JOIN sys_area a ON p.area_id = a.id
+        WHERE
+        p.deleted = 0
+        AND p.rule_id =#{query.ruleId}
+        <if test="query.key!=null and query.key!=''">
+            AND (
+            p.`NAME` LIKE concat('%',#{query.key},'%')
+            OR i.`NAME` LIKE concat('%',#{query.key},'%'))
+        </if>
+    </select>
+</mapper>