Browse Source

综合安保评价规则代码提交

jingyuanchao 2 years ago
parent
commit
5ae5aa3e9a
29 changed files with 2075 additions and 1 deletions
  1. 5 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/constant/CacheConstants.java
  2. 53 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/domain/CoreSafetyDict.java
  3. 109 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/domain/CoreSafetyIndexCalculateRule.java
  4. 78 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/domain/CoreSafetyIndexCalculateRuleItem.java
  5. 40 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleInsertDto.java
  6. 22 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleItemInsertDto.java
  7. 22 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleItemUpdateDto.java
  8. 24 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRulePageDto.java
  9. 40 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleUpdateDto.java
  10. 57 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/vo/CoreSafetyIndexCalculateRuleDetailVo.java
  11. 25 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/vo/CoreSafetyIndexCalculateRuleItemVo.java
  12. 41 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/vo/CoreSafetyIndexCalculateRulePageVo.java
  13. 56 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/enums/safetyindex/CalculateTypeEnums.java
  14. 71 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyDictController.java
  15. 85 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyIndexCalculateRuleController.java
  16. 91 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyIndexCalculateRuleItemController.java
  17. 62 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/mapper/CoreSafetyDictMapper.java
  18. 62 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/mapper/CoreSafetyIndexCalculateRuleItemMapper.java
  19. 68 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/mapper/CoreSafetyIndexCalculateRuleMapper.java
  20. 71 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyDictService.java
  21. 71 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyIndexCalculateRuleItemService.java
  22. 76 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyIndexCalculateRuleService.java
  23. 112 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyDictServiceImpl.java
  24. 120 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyIndexCalculateRuleItemServiceImpl.java
  25. 196 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyIndexCalculateRuleServiceImpl.java
  26. 88 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetyindex/CoreSafetyDictMapper.xml
  27. 136 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetyindex/CoreSafetyIndexCalculateRuleItemMapper.xml
  28. 183 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetyindex/CoreSafetyIndexCalculateRuleMapper.xml
  29. 11 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

+ 5 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/constant/CacheConstants.java

@@ -66,4 +66,9 @@ public class CacheConstants
      * 所有角色缓存
      */
     public static final String ROLE_CACHE_LIST_KEY = "sys_role_list";
+
+    /**
+     * 安全指标字典缓存
+     */
+    public static final String SAFETY_DICT_LIST = "safety_dict_list";
 }

+ 53 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/domain/CoreSafetyDict.java

@@ -0,0 +1,53 @@
+package com.xunmei.common.core.domain.safetyindex.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 安全指标配置字典对象 core_safety_dict
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_safety_dict")
+@ApiModel(value = "CoreSafetyDict对象", description = "安全指标配置字典")
+public class CoreSafetyDict {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    @TableField(value = "code")
+    @ApiModelProperty(value = "指标分类code")
+    private String code;
+
+    @TableField(value = "parent_code")
+    @ApiModelProperty(value = "父级code")
+    private String parentCode;
+
+    @TableField(value = "name")
+    @ApiModelProperty(value = "指标分类name")
+    private String name;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("code", getCode())
+                .append("parentCode", getParentCode())
+                .append("name", getName())
+                .toString();
+    }
+}

+ 109 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/domain/CoreSafetyIndexCalculateRule.java

@@ -0,0 +1,109 @@
+package com.xunmei.common.core.domain.safetyindex.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;
+import lombok.experimental.Accessors;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 安全指标配置对象 core_safety_index_calculate_rule
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_safety_index_calculate_rule")
+@ApiModel(value = "CoreSafetyIndexCalculateRule对象", description = "安全指标配置")
+public class CoreSafetyIndexCalculateRule extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+
+    @TableId(value = "id")
+    private Long id;
+
+    @TableField(value = "type_code")
+    @ApiModelProperty(value = "指标分类code")
+    private String typeCode;
+
+    @TableField(value = "project_code")
+    @ApiModelProperty(value = "指标项目code")
+    private String projectCode;
+
+    @TableField(value = "point_code")
+    @ApiModelProperty(value = "指标要点code")
+    private String pointCode;
+
+    @TableField(value = "deduction_type")
+    @ApiModelProperty(value = "扣分方式 1:直接扣分,2最高扣分")
+    private Integer deductionType;
+
+    @TableField(value = "score")
+    @ApiModelProperty(value = "分值")
+    private Integer score;
+
+    @TableField(value = "formula")
+    @ApiModelProperty(value = "扣分规则描述")
+    private String formula;
+
+    @TableField(value = "org_type")
+    @ApiModelProperty(value = "机构类型")
+    private Integer orgType;
+
+    @TableField(value = "deleted")
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除 0否1是")
+    private int deleted;
+
+    @TableField(value = "cycle")
+    @ApiModelProperty(value = "周期,只有在指标分类为安保履职时使用")
+    private Integer cycle;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+
+
+                .append("id", getId())
+
+
+                .append("typeCode", getTypeCode())
+
+
+                .append("projectCode", getProjectCode())
+
+
+                .append("pointCode", getPointCode())
+
+
+                .append("deductionType", getDeductionType())
+
+
+                .append("score", getScore())
+
+
+                .append("formula", getFormula())
+
+
+                .append("orgType", getOrgType())
+
+
+                .append("deleted", getDeleted())
+
+
+                .append("cycle", getCycle())
+
+
+                .toString();
+    }
+}

+ 78 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/domain/CoreSafetyIndexCalculateRuleItem.java

@@ -0,0 +1,78 @@
+package com.xunmei.common.core.domain.safetyindex.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+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;
+import lombok.experimental.Accessors;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 安全指标指数评价规则项对象 core_safety_index_calculate_rule_item
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_safety_index_calculate_rule_item")
+@ApiModel(value = "CoreSafetyIndexCalculateRuleItem对象", description = "安全指标指数评价规则项")
+public class CoreSafetyIndexCalculateRuleItem extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+
+    @TableField(value = "rule_id")
+    @ApiModelProperty(value = "安全指标主键")
+    private Long ruleId;
+
+    @TableField(value = "indicator_note")
+    @ApiModelProperty(value = "细化指数描述")
+    private String indicatorNote;
+
+    /**
+     * @see com.xunmei.common.core.enums.safetyindex.CalculateTypeEnums
+     */
+    @TableField(value = "calculate_type")
+    @ApiModelProperty(value = "计算类型 1累计数,2连续数,3 分类,4 固化值")
+    private Integer calculateType;
+
+    @TableField(value = "indicator_days")
+    @ApiModelProperty(value = "连续数,连续多少天")
+    private Integer indicatorDays;
+
+    @TableField(value = "item_type")
+    @ApiModelProperty(value = "calculate_type为3是用来存具体分类")
+    private Integer itemType;
+
+    @TableField(value = "item_value")
+    @ApiModelProperty(value = "扣分系数")
+    private Double itemValue;
+
+    @TableField(value = "order_num")
+    @ApiModelProperty(value = "排序")
+    private int orderNum;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("ruleId", getRuleId())
+                .append("indicatorNote", getIndicatorNote())
+                .append("calculateType", getCalculateType())
+                .append("indicatorDays", getIndicatorDays())
+                .append("itemType", getItemType())
+                .append("itemValue", getItemValue())
+                .append("orderNum", getOrderNum())
+                .toString();
+    }
+}

+ 40 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleInsertDto.java

@@ -0,0 +1,40 @@
+package com.xunmei.common.core.domain.safetyindex.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CoreSafetyIndexCalculateRuleInsertDto {
+
+    private Long id;
+
+    @ApiModelProperty("机构类型")
+    private Integer orgType;
+
+    @ApiModelProperty("指标分类code")
+    private String typeCode;
+
+    @ApiModelProperty("指标项目code")
+    private String projectCode;
+
+    @ApiModelProperty("指标要点code")
+    private String pointCode;
+
+    @ApiModelProperty(value = "扣分方式",notes = "1:直接扣分,2最高扣分")
+    private Integer deductionType;
+
+    @ApiModelProperty(value = "分值")
+    private Integer score;
+
+    @ApiModelProperty(value = "扣分公式")
+    private String formula;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "指标要点列表",notes = "扣分规则明细")
+    private List<CoreSafetyIndexCalculateRuleItemInsertDto> itemList;
+
+}

+ 22 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleItemInsertDto.java

@@ -0,0 +1,22 @@
+package com.xunmei.common.core.domain.safetyindex.dto;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class CoreSafetyIndexCalculateRuleItemInsertDto {
+
+
+
+    @ApiModelProperty(value = "计算项目")
+    private String indicatorNote;
+
+    @ApiModelProperty(value = "计算类型",notes = "1:累计数,2:连续数,3:分类,4:固化值")
+    private Integer calculateType;
+
+    private Integer indicatorDays;
+
+    @ApiModelProperty(value = "系数")
+    private Double itemValue;
+}

+ 22 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleItemUpdateDto.java

@@ -0,0 +1,22 @@
+package com.xunmei.common.core.domain.safetyindex.dto;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class CoreSafetyIndexCalculateRuleItemUpdateDto {
+
+    private Long id;
+
+    @ApiModelProperty(value = "计算项目")
+    private String indicatorNote;
+
+    @ApiModelProperty(value = "计算类型",notes = "1:累计数,2:连续数,3:分类,4:固化值")
+    private Integer calculateType;
+
+    private Integer indicatorDays;
+
+    @ApiModelProperty(value = "系数")
+    private Double itemValue;
+}

+ 24 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRulePageDto.java

@@ -0,0 +1,24 @@
+package com.xunmei.common.core.domain.safetyindex.dto;
+
+import com.xunmei.common.core.web.domain.PageRequest;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CoreSafetyIndexCalculateRulePageDto extends PageRequest {
+
+    @ApiModelProperty("机构类型")
+    private Integer orgType;
+
+    @ApiModelProperty("指标分类code")
+    private String typeCode;
+
+    @ApiModelProperty("指标项目code")
+    private String projectCode;
+
+    @ApiModelProperty("指标要点code")
+    private String pointCode;
+
+}

+ 40 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/dto/CoreSafetyIndexCalculateRuleUpdateDto.java

@@ -0,0 +1,40 @@
+package com.xunmei.common.core.domain.safetyindex.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CoreSafetyIndexCalculateRuleUpdateDto {
+
+    private Long id;
+
+    @ApiModelProperty("机构类型")
+    private Integer orgType;
+
+    @ApiModelProperty("指标分类code")
+    private String typeCode;
+
+    @ApiModelProperty("指标项目code")
+    private String projectCode;
+
+    @ApiModelProperty("指标要点code")
+    private String pointCode;
+
+    @ApiModelProperty(value = "扣分方式",notes = "1:直接扣分,2最高扣分")
+    private Integer deductionType;
+
+    @ApiModelProperty(value = "分值")
+    private Integer score;
+
+    @ApiModelProperty(value = "扣分公式")
+    private String formula;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "指标要点列表",notes = "扣分规则明细")
+    private List<CoreSafetyIndexCalculateRuleItemUpdateDto> itemList;
+
+}

+ 57 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/vo/CoreSafetyIndexCalculateRuleDetailVo.java

@@ -0,0 +1,57 @@
+package com.xunmei.common.core.domain.safetyindex.vo;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CoreSafetyIndexCalculateRuleDetailVo {
+
+    private Long id;
+
+    @JsonIgnore
+    @ApiModelProperty("机构类型")
+    private Integer orgType;
+
+    @ApiModelProperty("机构类型名称")
+    private String orgTypeText;
+
+    @JsonIgnore
+    @ApiModelProperty("指标分类code")
+    private String typeCode;
+
+    @ApiModelProperty("指标分类名称")
+    private String typeCodeText;
+
+    @JsonIgnore
+    @ApiModelProperty("指标项目code")
+    private String projectCode;
+
+    @ApiModelProperty("指标项目名称")
+    private String projectCodeText;
+
+    @JsonIgnore
+    @ApiModelProperty("指标要点code")
+    private String pointCode;
+
+    @ApiModelProperty("指标要点名称")
+    private String pointCodeText;
+
+    @ApiModelProperty(value = "扣分方式",notes = "1:直接扣分,2最高扣分")
+    private Integer deductionType;
+
+    @ApiModelProperty(value = "分值")
+    private Integer score;
+
+    @ApiModelProperty(value = "扣分公式")
+    private String formula;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "指标要点列表",notes = "扣分规则明细")
+    private List<CoreSafetyIndexCalculateRuleItemVo> itemList;
+
+}

+ 25 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/vo/CoreSafetyIndexCalculateRuleItemVo.java

@@ -0,0 +1,25 @@
+package com.xunmei.common.core.domain.safetyindex.vo;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class CoreSafetyIndexCalculateRuleItemVo {
+
+    private Long id;
+
+    @ApiModelProperty(value = "计算项目")
+    private String indicatorNote;
+
+    @ApiModelProperty(value = "计算类型",notes = "1:累计数,2:连续数,3:分类,4:固化值")
+    private Integer calculateType;
+
+    @ApiModelProperty(value = "计算类型名称")
+    private String calculateTypeText;
+
+    private Integer indicatorDays;
+
+    @ApiModelProperty(value = "系数")
+    private Double itemValue;
+}

+ 41 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/vo/CoreSafetyIndexCalculateRulePageVo.java

@@ -0,0 +1,41 @@
+package com.xunmei.common.core.domain.safetyindex.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class CoreSafetyIndexCalculateRulePageVo {
+
+    private Long id;
+
+    @ApiModelProperty("机构类型")
+    private Integer orgType;
+
+    @ApiModelProperty("机构类型名称")
+    private String orgTypeText;
+
+    @ApiModelProperty("指标分类code")
+    private String typeCode;
+
+    @ApiModelProperty("指标分类名称")
+    private String typeCodeText;
+
+    @ApiModelProperty("指标项目code")
+    private String projectCode;
+
+    @ApiModelProperty("指标项目名称")
+    private String projectCodeText;
+
+    @ApiModelProperty("指标要点code")
+    private String pointCode;
+
+    @ApiModelProperty("指标要点名称")
+    private String pointCodeText;
+
+    @ApiModelProperty(value = "扣分方式",notes = "1:直接扣分,2最高扣分")
+    private Integer deductionType;
+
+    @ApiModelProperty(value = "分值")
+    private Integer score;
+
+}

+ 56 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/enums/safetyindex/CalculateTypeEnums.java

@@ -0,0 +1,56 @@
+package com.xunmei.common.core.enums.safetyindex;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+@Getter
+@AllArgsConstructor
+public enum CalculateTypeEnums {
+
+
+    TOTAL(1, "累计数"),
+
+    CONTINUOUS(2, "连续数"),
+
+    CATEGORY(3, "分类"),
+
+    CURING_NUMBER(4, "固化值"),
+
+
+    ;
+
+
+    /**
+     * 所有枚举
+     */
+    private static final Map<Integer, CalculateTypeEnums> enumMap = new LinkedHashMap<>();
+
+    static {
+        for (CalculateTypeEnums enumNode : CalculateTypeEnums.values()) {
+            enumMap.put(enumNode.code, enumNode);
+        }
+    }
+
+    private final Integer code;
+    private final String name;
+
+    /**
+     * 根据code获取name
+     */
+    public static String getName(Integer code) {
+        CalculateTypeEnums e = enumMap.get(code);
+        return e != null ? e.getName() : "";
+    }
+
+    /**
+     * 根据code获取name
+     */
+    public static CalculateTypeEnums getCalculateTypeEnum(Integer code) {
+        return enumMap.get(code);
+    }
+
+}

+ 71 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyDictController.java

@@ -0,0 +1,71 @@
+package com.xunmei.core.safetyindex.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.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict;
+import com.xunmei.core.safetyindex.service.ICoreSafetyDictService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 安全指标配置字典Controller
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Api(tags = {"CoreSafetyDict"})
+@RestController
+@RequestMapping("/safetyDict")
+public class CoreSafetyDictController extends BaseController {
+    @Autowired
+    private ICoreSafetyDictService coreSafetyDictService;
+
+
+    @ApiOperation(value = "分页接口")
+    @GetMapping("/page")
+    public TableDataInfo<CoreSafetyDict> page(CoreSafetyDict coreSafetyDict) {
+        return coreSafetyDictService.selectPage(coreSafetyDict);
+    }
+
+
+    @ApiOperation(value = "列表数据")
+    @GetMapping("/list")
+    public TableDataInfo<CoreSafetyDict> list(CoreSafetyDict coreSafetyDict) {
+        return coreSafetyDictService.selectPage(coreSafetyDict);
+    }
+
+    @ApiOperation(value = "详情接口")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(coreSafetyDictService.selectCoreSafetyDictById(id));
+    }
+
+
+    @ApiOperation(value = "新增接口")
+    @Log(title = "安全指标配置字典", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreSafetyDict coreSafetyDict) {
+        return toAjax(coreSafetyDictService.insertCoreSafetyDict(coreSafetyDict));
+    }
+
+
+    @ApiOperation(value = "编辑接口")
+    @Log(title = "安全指标配置字典", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreSafetyDict coreSafetyDict) {
+        return toAjax(coreSafetyDictService.updateCoreSafetyDict(coreSafetyDict));
+    }
+
+
+    @ApiOperation(value = "删除接口")
+    @Log(title = "安全指标配置字典", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(coreSafetyDictService.deleteCoreSafetyDictByIds(ids));
+    }
+}

+ 85 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyIndexCalculateRuleController.java

@@ -0,0 +1,85 @@
+package com.xunmei.core.safetyindex.controller;
+
+import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRuleInsertDto;
+import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRulePageDto;
+import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRuleUpdateDto;
+import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo;
+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.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.core.safetyindex.service.ICoreSafetyIndexCalculateRuleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 安全指标配置Controller
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Api(tags = {"CoreSafetyIndexCalculateRule"})
+@RestController
+@RequestMapping("/safetyIndexRule")
+public class CoreSafetyIndexCalculateRuleController extends BaseController {
+    @Autowired
+    private ICoreSafetyIndexCalculateRuleService coreSafetyIndexCalculateRuleService;
+
+    /**
+     * 查询安全指标配置列表
+     */
+    @ApiOperation(value = "查询CoreSafetyIndexCalculateRule列表")
+    @RequiresPermissions("core:safetyIndexRule:list")
+    @GetMapping("/list")
+    public TableDataInfo<CoreSafetyIndexCalculateRulePageVo> list(CoreSafetyIndexCalculateRulePageDto request) {
+        return coreSafetyIndexCalculateRuleService.selectPage(request);
+    }
+
+
+    /**
+     * 获取安全指标配置详细信息
+     */
+    @ApiOperation(value = "获取CoreSafetyIndexCalculateRule详细信息")
+    @RequiresPermissions("core:safetyIndexRule:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(coreSafetyIndexCalculateRuleService.selectCoreSafetyIndexCalculateRuleById(id));
+    }
+
+    /**
+     * 新增安全指标配置
+     */
+    @ApiOperation(value = "新增CoreSafetyIndexCalculateRule")
+    @RequiresPermissions("core:safetyIndexRule:add")
+    @Log(title = "安全指标配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreSafetyIndexCalculateRuleInsertDto request) {
+        return toAjax(coreSafetyIndexCalculateRuleService.insertCoreSafetyIndexCalculateRule(request));
+    }
+
+    /**
+     * 修改安全指标配置
+     */
+    @ApiOperation(value = "修改CoreSafetyIndexCalculateRule")
+    @RequiresPermissions("core:safetyIndexRule:edit")
+    @Log(title = "安全指标配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreSafetyIndexCalculateRuleUpdateDto request) {
+        return toAjax(coreSafetyIndexCalculateRuleService.updateCoreSafetyIndexCalculateRule(request));
+    }
+
+    /**
+     * 删除安全指标配置
+     */
+    @ApiOperation(value = "删除CoreSafetyIndexCalculateRule")
+    @RequiresPermissions("core:safetyIndexRule:remove")
+    @Log(title = "安全指标配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(coreSafetyIndexCalculateRuleService.deleteCoreSafetyIndexCalculateRuleByIds(ids));
+    }
+}

+ 91 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyIndexCalculateRuleItemController.java

@@ -0,0 +1,91 @@
+package com.xunmei.core.safetyindex.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xunmei.common.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem;
+import com.xunmei.core.safetyindex.service.ICoreSafetyIndexCalculateRuleItemService;
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 安全指标指数评价规则项Controller
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Api(tags = {"CoreSafetyIndexCalculateRuleItem" })
+@RestController
+@RequestMapping("/safetyIndexRuleItem")
+public class CoreSafetyIndexCalculateRuleItemController extends BaseController {
+    @Autowired
+    private ICoreSafetyIndexCalculateRuleItemService coreSafetyIndexCalculateRuleItemService;
+
+/**
+ * 查询安全指标指数评价规则项列表
+ */
+@ApiOperation(value = "查询CoreSafetyIndexCalculateRuleItem列表")
+@RequiresPermissions("core:safetyIndexRuleItem:list")
+@GetMapping("/list")
+    public TableDataInfo<CoreSafetyIndexCalculateRuleItem> list(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem) {
+
+        return coreSafetyIndexCalculateRuleItemService.selectPage( coreSafetyIndexCalculateRuleItem);
+    }
+
+
+
+    /**
+     * 获取安全指标指数评价规则项详细信息
+     */
+    @ApiOperation(value = "获取CoreSafetyIndexCalculateRuleItem详细信息")
+    @RequiresPermissions("core:safetyIndexRuleItem:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(coreSafetyIndexCalculateRuleItemService.selectCoreSafetyIndexCalculateRuleItemById(id));
+    }
+
+    /**
+     * 新增安全指标指数评价规则项
+     */
+    @ApiOperation(value = "新增CoreSafetyIndexCalculateRuleItem")
+    @RequiresPermissions("core:safetyIndexRuleItem:add")
+    @Log(title = "安全指标指数评价规则项" , businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem) {
+        return toAjax(coreSafetyIndexCalculateRuleItemService.insertCoreSafetyIndexCalculateRuleItem(coreSafetyIndexCalculateRuleItem));
+    }
+
+    /**
+     * 修改安全指标指数评价规则项
+     */
+    @ApiOperation(value = "修改CoreSafetyIndexCalculateRuleItem")
+    @RequiresPermissions("core:safetyIndexRuleItem:edit")
+    @Log(title = "安全指标指数评价规则项" , businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem) {
+        return toAjax(coreSafetyIndexCalculateRuleItemService.updateCoreSafetyIndexCalculateRuleItem(coreSafetyIndexCalculateRuleItem));
+    }
+
+    /**
+     * 删除安全指标指数评价规则项
+     */
+    @ApiOperation(value = "删除CoreSafetyIndexCalculateRuleItem")
+    @RequiresPermissions("core:safetyIndexRuleItem:remove")
+    @Log(title = "安全指标指数评价规则项" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(coreSafetyIndexCalculateRuleItemService.deleteCoreSafetyIndexCalculateRuleItemByIds(ids));
+    }
+}

+ 62 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/mapper/CoreSafetyDictMapper.java

@@ -0,0 +1,62 @@
+package com.xunmei.core.safetyindex.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict;
+
+import java.util.List;
+
+/**
+ * 安全指标配置字典Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+public interface CoreSafetyDictMapper extends BaseMapper<CoreSafetyDict> {
+    /**
+     * 查询安全指标配置字典
+     *
+     * @param id 安全指标配置字典主键
+     * @return 安全指标配置字典
+     */
+    CoreSafetyDict selectCoreSafetyDictById(Long id);
+
+    /**
+     * 查询安全指标配置字典列表
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 安全指标配置字典集合
+     */
+    List<CoreSafetyDict> selectCoreSafetyDictList(CoreSafetyDict coreSafetyDict);
+
+    /**
+     * 新增安全指标配置字典
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 结果
+     */
+    int insertCoreSafetyDict(CoreSafetyDict coreSafetyDict);
+
+    /**
+     * 修改安全指标配置字典
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 结果
+     */
+    int updateCoreSafetyDict(CoreSafetyDict coreSafetyDict);
+
+    /**
+     * 删除安全指标配置字典
+     *
+     * @param id 安全指标配置字典主键
+     * @return 结果
+     */
+    int deleteCoreSafetyDictById(Long id);
+
+    /**
+     * 批量删除安全指标配置字典
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreSafetyDictByIds(Long[] ids);
+}

+ 62 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/mapper/CoreSafetyIndexCalculateRuleItemMapper.java

@@ -0,0 +1,62 @@
+package com.xunmei.core.safetyindex.mapper;
+
+import java.util.List;
+
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 安全指标指数评价规则项Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+public interface CoreSafetyIndexCalculateRuleItemMapper extends BaseMapper<CoreSafetyIndexCalculateRuleItem> {
+    /**
+     * 查询安全指标指数评价规则项
+     *
+     * @param id 安全指标指数评价规则项主键
+     * @return 安全指标指数评价规则项
+     */
+    CoreSafetyIndexCalculateRuleItem selectCoreSafetyIndexCalculateRuleItemById(Long id);
+
+    /**
+     * 查询安全指标指数评价规则项列表
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 安全指标指数评价规则项集合
+     */
+    List<CoreSafetyIndexCalculateRuleItem> selectCoreSafetyIndexCalculateRuleItemList(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem);
+
+    /**
+     * 新增安全指标指数评价规则项
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 结果
+     */
+    int insertCoreSafetyIndexCalculateRuleItem(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem);
+
+    /**
+     * 修改安全指标指数评价规则项
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 结果
+     */
+    int updateCoreSafetyIndexCalculateRuleItem(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem);
+
+    /**
+     * 删除安全指标指数评价规则项
+     *
+     * @param id 安全指标指数评价规则项主键
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleItemById(Long id);
+
+    /**
+     * 批量删除安全指标指数评价规则项
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleItemByIds(Long[] ids);
+}

+ 68 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/mapper/CoreSafetyIndexCalculateRuleMapper.java

@@ -0,0 +1,68 @@
+package com.xunmei.core.safetyindex.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule;
+import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRulePageDto;
+import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 安全指标配置Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+public interface CoreSafetyIndexCalculateRuleMapper extends BaseMapper<CoreSafetyIndexCalculateRule> {
+    /**
+     * 查询安全指标配置
+     *
+     * @param id 安全指标配置主键
+     * @return 安全指标配置
+     */
+    CoreSafetyIndexCalculateRule selectCoreSafetyIndexCalculateRuleById(Long id);
+
+    /**
+     * 查询安全指标配置列表
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 安全指标配置集合
+     */
+    List<CoreSafetyIndexCalculateRule> selectCoreSafetyIndexCalculateRuleList(CoreSafetyIndexCalculateRule coreSafetyIndexCalculateRule);
+
+    /**
+     * 新增安全指标配置
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 结果
+     */
+    int insertCoreSafetyIndexCalculateRule(CoreSafetyIndexCalculateRule coreSafetyIndexCalculateRule);
+
+    /**
+     * 修改安全指标配置
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 结果
+     */
+    int updateCoreSafetyIndexCalculateRule(CoreSafetyIndexCalculateRule coreSafetyIndexCalculateRule);
+
+    /**
+     * 删除安全指标配置
+     *
+     * @param id 安全指标配置主键
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleById(Long id);
+
+    /**
+     * 批量删除安全指标配置
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleByIds(Long[] ids);
+
+    Page<CoreSafetyIndexCalculateRulePageVo> selectPageData(Page<CoreSafetyIndexCalculateRulePageVo> pageRequest, @Param("request") CoreSafetyIndexCalculateRulePageDto request);
+}

+ 71 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyDictService.java

@@ -0,0 +1,71 @@
+package com.xunmei.core.safetyindex.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+import java.util.List;
+
+/**
+ * 安全指标配置字典Service接口
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+public interface ICoreSafetyDictService extends IService<CoreSafetyDict> {
+    /**
+     * 查询安全指标配置字典
+     *
+     * @param id 安全指标配置字典主键
+     * @return 安全指标配置字典
+     */
+     CoreSafetyDict selectCoreSafetyDictById(Long id);
+
+    /**
+     * 查询安全指标配置字典列表
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 安全指标配置字典集合
+     */
+    List<CoreSafetyDict> selectCoreSafetyDictList(CoreSafetyDict coreSafetyDict);
+
+    /**
+     * 新增安全指标配置字典
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 结果
+     */
+    int insertCoreSafetyDict(CoreSafetyDict coreSafetyDict);
+
+    /**
+     * 修改安全指标配置字典
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 结果
+     */
+    int updateCoreSafetyDict(CoreSafetyDict coreSafetyDict);
+
+    /**
+     * 批量删除安全指标配置字典
+     *
+     * @param ids 需要删除的安全指标配置字典主键集合
+     * @return 结果
+     */
+    int deleteCoreSafetyDictByIds(Long[] ids);
+
+    /**
+     * 删除安全指标配置字典信息
+     *
+     * @param id 安全指标配置字典主键
+     * @return 结果
+     */
+    int deleteCoreSafetyDictById(Long id);
+
+    /**
+     * 查询安全指标配置字典分页数据
+     *
+     * @param coreSafetyDict 查询条件对象
+     * @return Page
+     */
+    TableDataInfo<CoreSafetyDict> selectPage(CoreSafetyDict coreSafetyDict);
+}

+ 71 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyIndexCalculateRuleItemService.java

@@ -0,0 +1,71 @@
+package com.xunmei.core.safetyindex.service;
+
+import java.util.List;
+
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 安全指标指数评价规则项Service接口
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+public interface ICoreSafetyIndexCalculateRuleItemService extends IService<CoreSafetyIndexCalculateRuleItem> {
+    /**
+     * 查询安全指标指数评价规则项
+     *
+     * @param id 安全指标指数评价规则项主键
+     * @return 安全指标指数评价规则项
+     */
+     CoreSafetyIndexCalculateRuleItem selectCoreSafetyIndexCalculateRuleItemById(Long id);
+
+    /**
+     * 查询安全指标指数评价规则项列表
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 安全指标指数评价规则项集合
+     */
+    List<CoreSafetyIndexCalculateRuleItem> selectCoreSafetyIndexCalculateRuleItemList(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem);
+
+    /**
+     * 新增安全指标指数评价规则项
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 结果
+     */
+    int insertCoreSafetyIndexCalculateRuleItem(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem);
+
+    /**
+     * 修改安全指标指数评价规则项
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 结果
+     */
+    int updateCoreSafetyIndexCalculateRuleItem(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem);
+
+    /**
+     * 批量删除安全指标指数评价规则项
+     *
+     * @param ids 需要删除的安全指标指数评价规则项主键集合
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleItemByIds(Long[] ids);
+
+    /**
+     * 删除安全指标指数评价规则项信息
+     *
+     * @param id 安全指标指数评价规则项主键
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleItemById(Long id);
+
+    /**
+     * 查询安全指标指数评价规则项分页数据
+     *
+     * @param coreSafetyIndexCalculateRuleItem 查询条件对象
+     * @return Page
+     */
+    TableDataInfo<CoreSafetyIndexCalculateRuleItem> selectPage(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem);
+}

+ 76 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyIndexCalculateRuleService.java

@@ -0,0 +1,76 @@
+package com.xunmei.core.safetyindex.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule;
+import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRuleInsertDto;
+import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRulePageDto;
+import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRuleUpdateDto;
+import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRuleDetailVo;
+import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+import java.util.List;
+
+/**
+ * 安全指标配置Service接口
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+public interface ICoreSafetyIndexCalculateRuleService extends IService<CoreSafetyIndexCalculateRule> {
+    /**
+     * 查询安全指标配置
+     *
+     * @param id 安全指标配置主键
+     * @return 安全指标配置
+     */
+    CoreSafetyIndexCalculateRuleDetailVo selectCoreSafetyIndexCalculateRuleById(Long id);
+
+    /**
+     * 查询安全指标配置列表
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 安全指标配置集合
+     */
+    List<CoreSafetyIndexCalculateRule> selectCoreSafetyIndexCalculateRuleList(CoreSafetyIndexCalculateRule coreSafetyIndexCalculateRule);
+
+    /**
+     * 新增安全指标配置
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 结果
+     */
+    int insertCoreSafetyIndexCalculateRule(CoreSafetyIndexCalculateRuleInsertDto coreSafetyIndexCalculateRule);
+
+    /**
+     * 修改安全指标配置
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 结果
+     */
+    int updateCoreSafetyIndexCalculateRule(CoreSafetyIndexCalculateRuleUpdateDto request);
+
+    /**
+     * 批量删除安全指标配置
+     *
+     * @param ids 需要删除的安全指标配置主键集合
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleByIds(Long[] ids);
+
+    /**
+     * 删除安全指标配置信息
+     *
+     * @param id 安全指标配置主键
+     * @return 结果
+     */
+    int deleteCoreSafetyIndexCalculateRuleById(Long id);
+
+    /**
+     * 查询安全指标配置分页数据
+     *
+     * @param coreSafetyIndexCalculateRule 查询条件对象
+     * @return Page
+     */
+    TableDataInfo<CoreSafetyIndexCalculateRulePageVo> selectPage(CoreSafetyIndexCalculateRulePageDto coreSafetyIndexCalculateRule);
+}

+ 112 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyDictServiceImpl.java

@@ -0,0 +1,112 @@
+package com.xunmei.core.safetyindex.service.impl;
+
+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.constant.CacheConstants;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict;
+import com.xunmei.common.redis.utils.RedisUtils;
+import com.xunmei.core.safetyindex.mapper.CoreSafetyDictMapper;
+import com.xunmei.core.safetyindex.service.ICoreSafetyDictService;
+import com.xunmei.system.api.RemoteOrgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 安全指标配置字典Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Service
+public class CoreSafetyDictServiceImpl extends ServiceImpl<CoreSafetyDictMapper, CoreSafetyDict> implements ICoreSafetyDictService {
+    @Autowired
+    private CoreSafetyDictMapper coreSafetyDictMapper;
+    @Autowired
+    private RemoteOrgService orgService;
+
+    @Override
+    public TableDataInfo<CoreSafetyDict> selectPage(CoreSafetyDict coreSafetyDict) {
+        Page<CoreSafetyDict> page = new Page<>(0, Integer.MAX_VALUE);
+
+        QueryWrapper<CoreSafetyDict> query = new QueryWrapper<>(coreSafetyDict);
+        Page<CoreSafetyDict> data = coreSafetyDictMapper.selectPage(page, query);
+        return TableDataInfo.build(data);
+    }
+
+
+    /**
+     * 查询安全指标配置字典
+     *
+     * @param id 安全指标配置字典主键
+     * @return 安全指标配置字典
+     */
+    @Override
+    public CoreSafetyDict selectCoreSafetyDictById(Long id) {
+        return coreSafetyDictMapper.selectById(id);
+    }
+
+    /**
+     * 查询安全指标配置字典列表
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 安全指标配置字典
+     */
+    @Override
+    public List<CoreSafetyDict> selectCoreSafetyDictList(CoreSafetyDict coreSafetyDict) {
+        if (RedisUtils.hasKey(CacheConstants.SAFETY_DICT_LIST)) {
+            Object cacheObject = RedisUtils.getCacheList(CacheConstants.SAFETY_DICT_LIST);
+        }
+        List<CoreSafetyDict> list = this.list();
+        RedisUtils.setCacheList(CacheConstants.SAFETY_DICT_LIST, list);
+        return list;
+    }
+
+    /**
+     * 新增安全指标配置字典
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 结果
+     */
+    @Override
+    public int insertCoreSafetyDict(CoreSafetyDict coreSafetyDict) {
+        return coreSafetyDictMapper.insert(coreSafetyDict);
+    }
+
+    /**
+     * 修改安全指标配置字典
+     *
+     * @param coreSafetyDict 安全指标配置字典
+     * @return 结果
+     */
+    @Override
+    public int updateCoreSafetyDict(CoreSafetyDict coreSafetyDict) {
+        return coreSafetyDictMapper.updateById(coreSafetyDict);
+    }
+
+    /**
+     * 批量删除安全指标配置字典
+     *
+     * @param ids 需要删除的安全指标配置字典主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafetyDictByIds(Long[] ids) {
+        return coreSafetyDictMapper.deleteBatchIds(Arrays.asList((ids)));
+    }
+
+    /**
+     * 删除安全指标配置字典信息
+     *
+     * @param id 安全指标配置字典主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafetyDictById(Long id) {
+        return coreSafetyDictMapper.deleteById(id);
+    }
+}

+ 120 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyIndexCalculateRuleItemServiceImpl.java

@@ -0,0 +1,120 @@
+package com.xunmei.core.safetyindex.service.impl;
+
+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.web.page.TableDataInfo;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem;
+import com.xunmei.core.safetyindex.mapper.CoreSafetyIndexCalculateRuleItemMapper;
+import com.xunmei.core.safetyindex.service.ICoreSafetyIndexCalculateRuleItemService;
+import com.xunmei.system.api.RemoteOrgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 安全指标指数评价规则项Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Service
+public class CoreSafetyIndexCalculateRuleItemServiceImpl extends ServiceImpl<CoreSafetyIndexCalculateRuleItemMapper, CoreSafetyIndexCalculateRuleItem> implements ICoreSafetyIndexCalculateRuleItemService {
+    @Autowired
+    private CoreSafetyIndexCalculateRuleItemMapper coreSafetyIndexCalculateRuleItemMapper;
+    @Autowired
+    private RemoteOrgService orgService;
+
+    @Override
+    public TableDataInfo<CoreSafetyIndexCalculateRuleItem> selectPage(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem) {
+
+        Page<CoreSafetyIndexCalculateRuleItem> page;
+        //分页
+        if (coreSafetyIndexCalculateRuleItem.getPageNum()!=null&&coreSafetyIndexCalculateRuleItem.getPageSize()!=null)
+        {
+            page = new Page<>(coreSafetyIndexCalculateRuleItem.getPageNum(), coreSafetyIndexCalculateRuleItem.getPageSize());
+        }else{
+            page = new Page<>();
+        }
+        //查询条件
+        QueryWrapper<CoreSafetyIndexCalculateRuleItem> query = new QueryWrapper<>(coreSafetyIndexCalculateRuleItem);
+
+        //获取数据
+        page = coreSafetyIndexCalculateRuleItemMapper.selectPage(page, query);
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+
+
+
+
+    }
+
+
+    /**
+     * 查询安全指标指数评价规则项
+     *
+     * @param id 安全指标指数评价规则项主键
+     * @return 安全指标指数评价规则项
+     */
+    @Override
+    public CoreSafetyIndexCalculateRuleItem selectCoreSafetyIndexCalculateRuleItemById(Long id) {
+        return coreSafetyIndexCalculateRuleItemMapper.selectById(id);
+    }
+
+    /**
+     * 查询安全指标指数评价规则项列表
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 安全指标指数评价规则项
+     */
+    @Override
+    public List<CoreSafetyIndexCalculateRuleItem> selectCoreSafetyIndexCalculateRuleItemList(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem) {
+        return coreSafetyIndexCalculateRuleItemMapper.selectList(new QueryWrapper<>(coreSafetyIndexCalculateRuleItem));
+    }
+
+    /**
+     * 新增安全指标指数评价规则项
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 结果
+     */
+    @Override
+    public int insertCoreSafetyIndexCalculateRuleItem(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem) {
+            return coreSafetyIndexCalculateRuleItemMapper.insert(coreSafetyIndexCalculateRuleItem);
+    }
+
+    /**
+     * 修改安全指标指数评价规则项
+     *
+     * @param coreSafetyIndexCalculateRuleItem 安全指标指数评价规则项
+     * @return 结果
+     */
+    @Override
+    public int updateCoreSafetyIndexCalculateRuleItem(CoreSafetyIndexCalculateRuleItem coreSafetyIndexCalculateRuleItem) {
+        return coreSafetyIndexCalculateRuleItemMapper.updateById(coreSafetyIndexCalculateRuleItem);
+    }
+
+    /**
+     * 批量删除安全指标指数评价规则项
+     *
+     * @param ids 需要删除的安全指标指数评价规则项主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafetyIndexCalculateRuleItemByIds(Long[] ids) {
+        return coreSafetyIndexCalculateRuleItemMapper.deleteBatchIds(Arrays.asList((ids)));
+    }
+
+    /**
+     * 删除安全指标指数评价规则项信息
+     *
+     * @param id 安全指标指数评价规则项主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafetyIndexCalculateRuleItemById(Long id) {
+        return coreSafetyIndexCalculateRuleItemMapper.deleteById(id);
+    }
+}

+ 196 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyIndexCalculateRuleServiceImpl.java

@@ -0,0 +1,196 @@
+package com.xunmei.core.safetyindex.service.impl;
+
+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.domain.safetyindex.domain.CoreSafetyDict;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule;
+import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem;
+import com.xunmei.common.core.domain.safetyindex.dto.*;
+import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRuleDetailVo;
+import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRuleItemVo;
+import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo;
+import com.xunmei.common.core.enums.OrgTypeEnum;
+import com.xunmei.common.core.enums.safetyindex.CalculateTypeEnums;
+import com.xunmei.common.core.exception.SystemException;
+import com.xunmei.common.core.util.BeanHelper;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.safetyindex.mapper.CoreSafetyIndexCalculateRuleMapper;
+import com.xunmei.core.safetyindex.service.ICoreSafetyDictService;
+import com.xunmei.core.safetyindex.service.ICoreSafetyIndexCalculateRuleItemService;
+import com.xunmei.core.safetyindex.service.ICoreSafetyIndexCalculateRuleService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 安全指标配置Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-10-09
+ */
+@Service
+public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSafetyIndexCalculateRuleMapper, CoreSafetyIndexCalculateRule> implements ICoreSafetyIndexCalculateRuleService {
+    @Autowired
+    private CoreSafetyIndexCalculateRuleMapper coreSafetyIndexCalculateRuleMapper;
+    @Autowired
+    private ICoreSafetyDictService safetyDictService;
+    @Autowired
+    private ICoreSafetyIndexCalculateRuleItemService ruleItemService;
+
+    @Override
+    public TableDataInfo<CoreSafetyIndexCalculateRulePageVo> selectPage(CoreSafetyIndexCalculateRulePageDto request) {
+
+        //获取数据
+        Page<CoreSafetyIndexCalculateRulePageVo> page = coreSafetyIndexCalculateRuleMapper.selectPageData(request.getPageRequest(), request);
+        List<CoreSafetyIndexCalculateRulePageVo> records = page.getRecords();
+        if (ObjectUtil.isEmpty(records)) {
+            return TableDataInfo.build(page);
+        }
+        Map<String, String> map =getCoreSafetyDictMap();
+        for (CoreSafetyIndexCalculateRulePageVo record : page.getRecords()) {
+            //设置组织名称
+            record.setOrgTypeText(OrgTypeEnum.getName(record.getOrgType()));
+            record.setTypeCodeText(map.get(record.getTypeCode()));
+            record.setProjectCodeText(map.get(record.getProjectCode()));
+            record.setPointCodeText(map.get(record.getPointCode()));
+
+        }
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+
+
+    }
+
+    private Map<String, String>  getCoreSafetyDictMap(){
+        List<CoreSafetyDict> dictList = safetyDictService.selectCoreSafetyDictList(null);
+        return dictList.stream().collect(Collectors.toMap(CoreSafetyDict::getCode, CoreSafetyDict::getName));
+    }
+
+    /**
+     * 查询安全指标配置
+     *
+     * @param id 安全指标配置主键
+     * @return 安全指标配置
+     */
+    @Override
+    public CoreSafetyIndexCalculateRuleDetailVo selectCoreSafetyIndexCalculateRuleById(Long id) {
+        CoreSafetyIndexCalculateRule calculateRule = coreSafetyIndexCalculateRuleMapper.selectById(id);
+        if (calculateRule==null){
+            throw new SystemException("安全指标配置不存在");
+        }
+        CoreSafetyIndexCalculateRuleDetailVo record = new CoreSafetyIndexCalculateRuleDetailVo();
+        BeanUtils.copyProperties(calculateRule, record);
+        Map<String, String> map = getCoreSafetyDictMap();
+        record.setOrgTypeText(OrgTypeEnum.getName(record.getOrgType()));
+        record.setTypeCodeText(map.get(record.getTypeCode()));
+        record.setProjectCodeText(map.get(record.getProjectCode()));
+        record.setPointCodeText(map.get(record.getPointCode()));
+        List<CoreSafetyIndexCalculateRuleItem> list = ruleItemService.list(new LambdaQueryWrapper<CoreSafetyIndexCalculateRuleItem>()
+                .eq(CoreSafetyIndexCalculateRuleItem::getRuleId, id));
+        List<CoreSafetyIndexCalculateRuleItemVo> properties = BeanHelper.copyProperties(list, CoreSafetyIndexCalculateRuleItemVo.class);
+        properties.forEach(r->{
+            r.setCalculateTypeText(CalculateTypeEnums.getName(r.getCalculateType()));
+        });
+        record.setItemList(properties);
+        return record;
+    }
+
+    /**
+     * 查询安全指标配置列表
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 安全指标配置
+     */
+    @Override
+    public List<CoreSafetyIndexCalculateRule> selectCoreSafetyIndexCalculateRuleList(CoreSafetyIndexCalculateRule coreSafetyIndexCalculateRule) {
+        return coreSafetyIndexCalculateRuleMapper.selectList(new QueryWrapper<>(coreSafetyIndexCalculateRule));
+    }
+
+    /**
+     * 新增安全指标配置
+     *
+     * @param coreSafetyIndexCalculateRule 安全指标配置
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int insertCoreSafetyIndexCalculateRule(CoreSafetyIndexCalculateRuleInsertDto coreSafetyIndexCalculateRule) {
+
+        CoreSafetyIndexCalculateRule calculateRule = new CoreSafetyIndexCalculateRule();
+        BeanUtils.copyProperties(coreSafetyIndexCalculateRule, calculateRule);
+        calculateRule.setCreateBy(SecurityUtils.getUserId().toString());
+        calculateRule.setUpdateBy(SecurityUtils.getUserId().toString());
+        calculateRule.setCreateTime(new Date());
+
+        List<CoreSafetyIndexCalculateRuleItemInsertDto> itemList = coreSafetyIndexCalculateRule.getItemList();
+        List<CoreSafetyIndexCalculateRuleItem> properties = BeanHelper.copyProperties(itemList, CoreSafetyIndexCalculateRuleItem.class);
+        properties.forEach(r->{
+            r.setCreateBy(SecurityUtils.getUserId().toString());
+            r.setUpdateBy(SecurityUtils.getUserId().toString());
+            r.setCreateTime(new Date());
+        });
+        ruleItemService.saveBatch(properties);
+
+        return coreSafetyIndexCalculateRuleMapper.insert(calculateRule);
+    }
+
+    /**
+     * 修改安全指标配置
+     *
+     * @param request 安全指标配置
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int updateCoreSafetyIndexCalculateRule(CoreSafetyIndexCalculateRuleUpdateDto request) {
+        CoreSafetyIndexCalculateRule coreSafetyIndexCalculateRule = new CoreSafetyIndexCalculateRule();
+        BeanUtils.copyProperties(request, coreSafetyIndexCalculateRule);
+        coreSafetyIndexCalculateRule.setUpdateBy(SecurityUtils.getUserId().toString());
+        coreSafetyIndexCalculateRule.setUpdateTime(new Date());
+        List<CoreSafetyIndexCalculateRuleItemUpdateDto> itemList = request.getItemList();
+        List<CoreSafetyIndexCalculateRuleItem> properties = BeanHelper.copyProperties(itemList, CoreSafetyIndexCalculateRuleItem.class);
+        properties.forEach(r->{
+            r.setUpdateBy(SecurityUtils.getUserId().toString());
+            r.setUpdateTime(new Date());
+            if (r.getId()==null){
+                r.setCreateBy(SecurityUtils.getUserId().toString());
+                r.setCreateTime(new Date());
+            }
+        });
+        ruleItemService.saveOrUpdateBatch(properties);
+        return coreSafetyIndexCalculateRuleMapper.updateById(coreSafetyIndexCalculateRule);
+    }
+
+    /**
+     * 批量删除安全指标配置
+     *
+     * @param ids 需要删除的安全指标配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafetyIndexCalculateRuleByIds(Long[] ids) {
+        return coreSafetyIndexCalculateRuleMapper.deleteBatchIds(Arrays.asList((ids)));
+    }
+
+    /**
+     * 删除安全指标配置信息
+     *
+     * @param id 安全指标配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafetyIndexCalculateRuleById(Long id) {
+        return coreSafetyIndexCalculateRuleMapper.deleteById(id);
+    }
+}

+ 88 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetyindex/CoreSafetyDictMapper.xml

@@ -0,0 +1,88 @@
+<?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.safetyindex.mapper.CoreSafetyDictMapper">
+
+    <resultMap type="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict" id="CoreSafetyDictResult">
+                <result property="id" column="id"/>
+                <result property="code" column="code"/>
+                <result property="parentCode" column="parent_code"/>
+                <result property="name" column="name"/>
+    </resultMap>
+
+    <sql id="selectCoreSafetyDictVo">
+        select id, code, parent_code, name
+        from core_safety_dict
+    </sql>
+
+    <select id="selectCoreSafetyDictList" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict"
+            resultMap="CoreSafetyDictResult">
+        <include refid="selectCoreSafetyDictVo"/>
+        <where>
+                        <if test="code != null  and code != ''">
+                            and code = #{code}
+                        </if>
+                        <if test="parentCode != null  and parentCode != ''">
+                            and parent_code = #{parentCode}
+                        </if>
+                        <if test="name != null  and name != ''">
+                            and name like concat('%', #{name}, '%')
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectCoreSafetyDictById" parameterType="Long"
+            resultMap="CoreSafetyDictResult">
+            <include refid="selectCoreSafetyDictVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertCoreSafetyDict" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict"            useGeneratedKeys="true" keyProperty="id">
+        insert into core_safety_dict
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="code != null and code != ''">code,
+                    </if>
+                    <if test="parentCode != null and parentCode != ''">parent_code,
+                    </if>
+                    <if test="name != null and name != ''">name,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="code != null and code != ''">#{code},
+                    </if>
+                    <if test="parentCode != null and parentCode != ''">#{parentCode},
+                    </if>
+                    <if test="name != null and name != ''">#{name},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreSafetyDict" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyDict">
+        update core_safety_dict
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="code != null and code != ''">code =
+                        #{code},
+                    </if>
+                    <if test="parentCode != null and parentCode != ''">parent_code =
+                        #{parentCode},
+                    </if>
+                    <if test="name != null and name != ''">name =
+                        #{name},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCoreSafetyDictById" parameterType="Long">
+        delete
+        from core_safety_dict where id = #{id}
+    </delete>
+
+    <delete id="deleteCoreSafetyDictByIds" parameterType="String">
+        delete from core_safety_dict where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 136 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetyindex/CoreSafetyIndexCalculateRuleItemMapper.xml

@@ -0,0 +1,136 @@
+<?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.safetyindex.mapper.CoreSafetyIndexCalculateRuleItemMapper">
+
+    <resultMap type="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem" id="CoreSafetyIndexCalculateRuleItemResult">
+                <result property="id" column="id"/>
+                <result property="ruleId" column="rule_id"/>
+                <result property="indicatorNote" column="indicator_note"/>
+                <result property="calculateType" column="calculate_type"/>
+                <result property="indicatorDays" column="indicator_days"/>
+                <result property="itemType" column="item_type"/>
+                <result property="itemValue" column="item_value"/>
+                <result property="orderNum" column="order_num"/>
+    </resultMap>
+
+    <sql id="selectCoreSafetyIndexCalculateRuleItemVo">
+        select id, rule_id, indicator_note, calculate_type, indicator_days, item_type, item_value, order_num
+        from core_safety_index_calculate_rule_item
+    </sql>
+
+    <select id="selectCoreSafetyIndexCalculateRuleItemList" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem"
+            resultMap="CoreSafetyIndexCalculateRuleItemResult">
+        <include refid="selectCoreSafetyIndexCalculateRuleItemVo"/>
+        <where>
+                        <if test="ruleId != null ">
+                            and rule_id = #{ruleId}
+                        </if>
+                        <if test="indicatorNote != null  and indicatorNote != ''">
+                            and indicator_note = #{indicatorNote}
+                        </if>
+                        <if test="calculateType != null ">
+                            and calculate_type = #{calculateType}
+                        </if>
+                        <if test="indicatorDays != null ">
+                            and indicator_days = #{indicatorDays}
+                        </if>
+                        <if test="itemType != null ">
+                            and item_type = #{itemType}
+                        </if>
+                        <if test="itemValue != null ">
+                            and item_value = #{itemValue}
+                        </if>
+                        <if test="orderNum != null ">
+                            and order_num = #{orderNum}
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectCoreSafetyIndexCalculateRuleItemById" parameterType="Long"
+            resultMap="CoreSafetyIndexCalculateRuleItemResult">
+            <include refid="selectCoreSafetyIndexCalculateRuleItemVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertCoreSafetyIndexCalculateRuleItem" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem">
+        insert into core_safety_index_calculate_rule_item
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="id != null">id,
+                    </if>
+                    <if test="ruleId != null">rule_id,
+                    </if>
+                    <if test="indicatorNote != null">indicator_note,
+                    </if>
+                    <if test="calculateType != null">calculate_type,
+                    </if>
+                    <if test="indicatorDays != null">indicator_days,
+                    </if>
+                    <if test="itemType != null">item_type,
+                    </if>
+                    <if test="itemValue != null">item_value,
+                    </if>
+                    <if test="orderNum != null">order_num,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="id != null">#{id},
+                    </if>
+                    <if test="ruleId != null">#{ruleId},
+                    </if>
+                    <if test="indicatorNote != null">#{indicatorNote},
+                    </if>
+                    <if test="calculateType != null">#{calculateType},
+                    </if>
+                    <if test="indicatorDays != null">#{indicatorDays},
+                    </if>
+                    <if test="itemType != null">#{itemType},
+                    </if>
+                    <if test="itemValue != null">#{itemValue},
+                    </if>
+                    <if test="orderNum != null">#{orderNum},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreSafetyIndexCalculateRuleItem" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRuleItem">
+        update core_safety_index_calculate_rule_item
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="ruleId != null">rule_id =
+                        #{ruleId},
+                    </if>
+                    <if test="indicatorNote != null">indicator_note =
+                        #{indicatorNote},
+                    </if>
+                    <if test="calculateType != null">calculate_type =
+                        #{calculateType},
+                    </if>
+                    <if test="indicatorDays != null">indicator_days =
+                        #{indicatorDays},
+                    </if>
+                    <if test="itemType != null">item_type =
+                        #{itemType},
+                    </if>
+                    <if test="itemValue != null">item_value =
+                        #{itemValue},
+                    </if>
+                    <if test="orderNum != null">order_num =
+                        #{orderNum},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCoreSafetyIndexCalculateRuleItemById" parameterType="Long">
+        delete
+        from core_safety_index_calculate_rule_item where id = #{id}
+    </delete>
+
+    <delete id="deleteCoreSafetyIndexCalculateRuleItemByIds" parameterType="String">
+        delete from core_safety_index_calculate_rule_item where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 183 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetyindex/CoreSafetyIndexCalculateRuleMapper.xml

@@ -0,0 +1,183 @@
+<?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.safetyindex.mapper.CoreSafetyIndexCalculateRuleMapper">
+
+    <resultMap type="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule" id="CoreSafetyIndexCalculateRuleResult">
+                <result property="id" column="id"/>
+                <result property="typeCode" column="type_code"/>
+                <result property="projectCode" column="project_code"/>
+                <result property="pointCode" column="point_code"/>
+                <result property="deductionType" column="deduction_type"/>
+                <result property="score" column="score"/>
+                <result property="formula" column="formula"/>
+                <result property="orgType" column="org_type"/>
+                <result property="deleted" column="deleted"/>
+                <result property="cycle" column="cycle"/>
+    </resultMap>
+
+    <sql id="selectCoreSafetyIndexCalculateRuleVo">
+        select id, type_code, project_code, point_code, deduction_type, score, formula, org_type, deleted, cycle, remark
+        from core_safety_index_calculate_rule
+    </sql>
+
+    <select id="selectCoreSafetyIndexCalculateRuleList" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule"
+            resultMap="CoreSafetyIndexCalculateRuleResult">
+        <include refid="selectCoreSafetyIndexCalculateRuleVo"/>
+        <where>
+                        <if test="typeCode != null  and typeCode != ''">
+                            and type_code = #{typeCode}
+                        </if>
+                        <if test="projectCode != null  and projectCode != ''">
+                            and project_code = #{projectCode}
+                        </if>
+                        <if test="pointCode != null  and pointCode != ''">
+                            and point_code = #{pointCode}
+                        </if>
+                        <if test="deductionType != null ">
+                            and deduction_type = #{deductionType}
+                        </if>
+                        <if test="score != null ">
+                            and score = #{score}
+                        </if>
+                        <if test="formula != null  and formula != ''">
+                            and formula = #{formula}
+                        </if>
+                        <if test="orgType != null ">
+                            and org_type = #{orgType}
+                        </if>
+                        <if test="deleted != null ">
+                            and deleted = #{deleted}
+                        </if>
+                        <if test="cycle != null ">
+                            and cycle = #{cycle}
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectCoreSafetyIndexCalculateRuleById" parameterType="Long"
+            resultMap="CoreSafetyIndexCalculateRuleResult">
+            <include refid="selectCoreSafetyIndexCalculateRuleVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertCoreSafetyIndexCalculateRule" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule">
+        insert into core_safety_index_calculate_rule
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="id != null">id,
+                    </if>
+                    <if test="typeCode != null">type_code,
+                    </if>
+                    <if test="projectCode != null">project_code,
+                    </if>
+                    <if test="pointCode != null">point_code,
+                    </if>
+                    <if test="deductionType != null">deduction_type,
+                    </if>
+                    <if test="score != null">score,
+                    </if>
+                    <if test="formula != null">formula,
+                    </if>
+                    <if test="orgType != null">org_type,
+                    </if>
+                    <if test="deleted != null">deleted,
+                    </if>
+                    <if test="cycle != null">cycle,
+                    </if>
+                    <if test="remark != null">remark,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="id != null">#{id},
+                    </if>
+                    <if test="typeCode != null">#{typeCode},
+                    </if>
+                    <if test="projectCode != null">#{projectCode},
+                    </if>
+                    <if test="pointCode != null">#{pointCode},
+                    </if>
+                    <if test="deductionType != null">#{deductionType},
+                    </if>
+                    <if test="score != null">#{score},
+                    </if>
+                    <if test="formula != null">#{formula},
+                    </if>
+                    <if test="orgType != null">#{orgType},
+                    </if>
+                    <if test="deleted != null">#{deleted},
+                    </if>
+                    <if test="cycle != null">#{cycle},
+                    </if>
+                    <if test="remark != null">#{remark},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreSafetyIndexCalculateRule" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule">
+        update core_safety_index_calculate_rule
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="typeCode != null">type_code =
+                        #{typeCode},
+                    </if>
+                    <if test="projectCode != null">project_code =
+                        #{projectCode},
+                    </if>
+                    <if test="pointCode != null">point_code =
+                        #{pointCode},
+                    </if>
+                    <if test="deductionType != null">deduction_type =
+                        #{deductionType},
+                    </if>
+                    <if test="score != null">score =
+                        #{score},
+                    </if>
+                    <if test="formula != null">formula =
+                        #{formula},
+                    </if>
+                    <if test="orgType != null">org_type =
+                        #{orgType},
+                    </if>
+                    <if test="deleted != null">deleted =
+                        #{deleted},
+                    </if>
+                    <if test="cycle != null">cycle =
+                        #{cycle},
+                    </if>
+                    <if test="remark != null">remark =
+                        #{remark},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCoreSafetyIndexCalculateRuleById" parameterType="Long">
+        delete
+        from core_safety_index_calculate_rule where id = #{id}
+    </delete>
+
+    <delete id="deleteCoreSafetyIndexCalculateRuleByIds" parameterType="String">
+        delete from core_safety_index_calculate_rule where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="selectPageData"
+            resultType="com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo"
+    parameterType="com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRulePageDto">
+        select t.id, t.org_type,t.type_code,t.project_code,t.point_code,t.deduction_type,t.score from core_safety_index_calculate_rule t
+        <where>
+            <if test="request.orgType !=null">
+                and t.org_type = #{request.orgType}
+            </if>
+            <if test="request.projectCode !=null">
+                and t.project_code = #{request.pointCode}
+            </if>
+            <if test="request.pointCode !=null">
+                and t.point_code = #{request.pointCode}
+            </if>
+        </where>
+
+    </select>
+</mapper>

+ 11 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -489,14 +489,24 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         resp.setOrgId(queryOrgId);
         return resp;
     }
+    private List<SysOrgVO> getOrgCache() {
+        List<SysOrgVO> cacheList = null;
+        Boolean isOk = RedisUtils.hasKey(CacheConstants.ORG_CACHE_LIST_KEY);
+        if (!isOk) {
+            cacheList = this.loadingOrgCache();
+        } else {
+            cacheList = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
+        }
 
+        return cacheList;
+    }
     @Override
     public List<SysOrg> selectOrgTreeListByCurOrgId(Long id) {
         SysOrg org = getById(id);
         if (ObjectUtil.hasEmpty(org, org.getType())) {
             throw new ServiceException(ErrorMsgConstants.CUR_USER_ORT_TYPE_ERROR);
         }
-        List<SysOrgVO> sysOrgList = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
+        List<SysOrgVO> sysOrgList = getOrgCache();
         sysOrgList.forEach(sysOrg -> {
             if (ObjectUtil.isNull(sysOrg.getSort())) {
                 sysOrg.setSort(0);