瀏覽代碼

联调履职内容库定义

jiawuxian 2 年之前
父節點
當前提交
931157a800
共有 18 個文件被更改,包括 146 次插入430 次删除
  1. 20 19
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/utils/IDHelper.java
  2. 0 84
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/utils/snowId/IDHelper.java
  3. 0 131
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/utils/snowId/SnowflaskGenerator.java
  4. 10 9
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/AppRuleController.java
  5. 9 9
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRule.java
  6. 6 14
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRuleItem.java
  7. 9 50
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRulePoint.java
  8. 4 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRule/AppRuleEditDto.java
  9. 0 23
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRule/AppRulePageDto.java
  10. 4 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/AppRuleMapper.java
  11. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IAppRuleService.java
  12. 3 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java
  13. 2 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleItemServiceImpl.java
  14. 10 13
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleServiceImpl.java
  15. 18 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRule/AppRuleInfoVo.java
  16. 4 10
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRule/AppRulePageVo.java
  17. 45 44
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRuleMapper.xml
  18. 1 1
      soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/service/impl/FJNXSyncServiceImpl.java

+ 20 - 19
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/utils/IDHelper.java

@@ -1,8 +1,8 @@
 package com.xunmei.common.core.utils;
 
 import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
 import com.xunmei.common.core.utils.snowId.DateHelper;
-import com.xunmei.common.core.utils.snowId.SnowflaskGenerator;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,25 +30,26 @@ public class IDHelper {
     @Autowired
     private Environment environment;
 
-    @PostConstruct
-    public void setStatic() {
-        long _workerId = 0L;
-        long _datacenterId = 0L;
-        if (environment.containsProperty("snowflake.workerId")) {
-            _workerId = environment.getProperty("snowflake.workerId", long.class);
-        }
-        if (environment.containsProperty("snowflake.datacenterId")) {
-            _datacenterId = environment.getProperty("snowflake.datacenterId", long.class);
-        }
-
-//        snowflaskGenerator = new SnowflaskGenerator(_workerId, _datacenterId);
-        snowflaskGenerator = new SnowflaskGenerator(0L, 0L);
-    }
-
-    private static  SnowflaskGenerator snowflaskGenerator = null;
-
+//    @PostConstruct
+//    public void setStatic() {
+//        long _workerId = 0L;
+//        long _datacenterId = 0L;
+//        if (environment.containsProperty("snowflake.workerId")) {
+//            _workerId = environment.getProperty("snowflake.workerId", long.class);
+//        }
+//        if (environment.containsProperty("snowflake.datacenterId")) {
+//            _datacenterId = environment.getProperty("snowflake.datacenterId", long.class);
+//        }
+//
+////        snowflaskGenerator = new SnowflaskGenerator(_workerId, _datacenterId);
+//        snowflaskGenerator = new SnowflaskGenerator(0L, 0L);
+//    }
+
+//    private static  SnowflaskGenerator snowflaskGenerator = null;
+
+    private static DefaultIdentifierGenerator idGenerator=new   DefaultIdentifierGenerator();
     public static Long id() {
-        return snowflaskGenerator.nextId();
+        return idGenerator.nextId(null);
     }
 
     public static String dateTime(final Date date) {

+ 0 - 84
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/utils/snowId/IDHelper.java

@@ -1,84 +0,0 @@
-package com.xunmei.common.core.utils.snowId;
-
-import cn.hutool.core.date.DateUtil;
-import org.apache.commons.lang3.StringUtils;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Objects;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static cn.hutool.core.date.DatePattern.PURE_DATETIME_PATTERN;
-
-public class IDHelper {
-
-    private static final SnowflaskGenerator snowflaskGenerator = new SnowflaskGenerator(0L, 0L);
-
-    public static Long id() {
-        return snowflaskGenerator.nextId();
-    }
-
-    public static String dateTime(final Date date) {
-        return DateUtil.format(date, PURE_DATETIME_PATTERN);
-    }
-
-    public static String dateTime(final Date date, final Serializable other) {
-        return DateUtil.format(date, PURE_DATETIME_PATTERN) + "|" + other.toString();
-    }
-
-    public static String date(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "D" + dateHelper.getMonth() + "" + dateHelper.getDate() + "|" + other.toString();
-    }
-
-    public static String month(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "M" + dateHelper.getMonth() + "|" + other.toString();
-    }
-
-    public static String week(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "W" + dateHelper.getWeek() + "|" + other.toString();
-    }
-
-    public static String quarter(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "Q" + dateHelper.getQuarter() + "|" + other.toString();
-    }
-
-    public static String halfyear(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "H" + dateHelper.getHalfyear() + "|" + other.toString();
-    }
-
-    public static String year(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "Y" + dateHelper.getYear() + "|" + other.toString();
-    }
-
-    public static String hour(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "R" + dateHelper.getMonth() + "" + dateHelper.getDate() + "" + dateHelper.getHour() + "|" + other.toString();
-    }
-
-    public static Long pad(final Serializable code, final Serializable id, final int i) {
-        return Long.parseLong(code + StringUtils.leftPad(id.toString(), i, "0"));
-    }
-
-    public static Long and(final Object... pp) {
-        return Long.parseLong(Stream.of(pp)
-                                    .filter(Objects::nonNull)
-                                    .map(Object::toString)
-                                    .collect(Collectors.joining()));
-    }
-
-//    public static String md5(final Serializable... os) {
-//        final StringBuilder stringBuilder = new StringBuilder(os.length * 10);
-//        for (final Serializable o : os) {
-//            stringBuilder.append(o.toString());
-//        }
-//        stringBuilder.trimToSize();
-//        return DigestUtils.md5Hex(stringBuilder.toString());
-//    }
-}

+ 0 - 131
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/utils/snowId/SnowflaskGenerator.java

@@ -1,131 +0,0 @@
-package com.xunmei.common.core.utils.snowId;
-
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * Long类型ID生成器,固定为19位长度
- * 生成ID,采用snowflake算法,64bit整数,1秒可以生成800万个ID
- * 0-41bit毫秒时间戳-10bit机器ID-12bit序列化
- * 42bit的毫秒时间戳,2000年算起可以支持该算法使用到2068年,10bit的工作机器id可以支持1024台机器,12序列号支持1毫秒产生4096个自增序列id
- */
-@Slf4j
-public class SnowflaskGenerator {
-
-    /** 开始时间截 (2015-01-01) */
-    private final long twepoch = 1420041600000L;
-
-    /** 机器id所占的位数 */
-    private final long workerIdBits = 1L;
-
-    /** 数据标识id所占的位数 */
-    private final long datacenterIdBits = 1L;
-
-    /** 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) */
-    private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
-
-    /** 支持的最大数据标识id,结果是31 */
-    private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
-
-    /** 序列在id中占的位数 */
-    private final long sequenceBits = 12L;
-
-    /** 机器ID向左移12位 */
-    private final long workerIdShift = sequenceBits;
-
-    /** 数据标识id向左移17位(12+5) */
-    private final long datacenterIdShift = sequenceBits + workerIdBits;
-
-    /** 时间截向左移22位(5+5+12) */
-    private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
-
-    /** 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) */
-    private final long sequenceMask = -1L ^ (-1L << sequenceBits);
-
-    /** 工作机器ID(0~31) */
-    private long workerId;
-
-    /** 数据中心ID(0~31) */
-    private long datacenterId;
-
-    /** 毫秒内序列(0~4095) */
-    private long sequence = 0L;
-
-    /** 上次生成ID的时间截 */
-    private long lastTimestamp = -1L;
-
-    //==============================Constructors=====================================
-    /**
-     * 构造函数
-     * @param workerId 工作ID (0~31)
-     * @param datacenterId 数据中心ID (0~31)
-     */
-    public SnowflaskGenerator(long workerId, long datacenterId) {
-        if (workerId > maxWorkerId || workerId < 0) {
-            throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
-        }
-        if (datacenterId > maxDatacenterId || datacenterId < 0) {
-            throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
-        }
-        this.workerId = workerId;
-        this.datacenterId = datacenterId;
-    }
-
-    // ==============================Methods==========================================
-    /**
-     * 获得下一个ID (该方法是线程安全的)
-     * @return SnowflakeId
-     */
-    public synchronized long nextId() {
-        long timestamp = timeGen();
-
-        //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
-        if (timestamp < lastTimestamp) {
-            throw new RuntimeException(
-                    String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
-        }
-
-        //如果是同一时间生成的,则进行毫秒内序列
-        if (lastTimestamp == timestamp) {
-            sequence = (sequence + 1) & sequenceMask;
-            //毫秒内序列溢出
-            if (sequence == 0) {
-                //阻塞到下一个毫秒,获得新的时间戳
-                timestamp = tilNextMillis(lastTimestamp);
-            }
-        }
-        //时间戳改变,毫秒内序列重置
-        else {
-            sequence = 0L;
-        }
-
-        //上次生成ID的时间截
-        lastTimestamp = timestamp;
-
-        //移位并通过或运算拼到一起组成64位的ID
-        return ((timestamp - twepoch) << timestampLeftShift) //
-                | (datacenterId << datacenterIdShift) //
-                | (workerId << workerIdShift) //
-                | sequence;
-    }
-
-    /**
-     * 阻塞到下一个毫秒,直到获得新的时间戳
-     * @param lastTimestamp 上次生成ID的时间截
-     * @return 当前时间戳
-     */
-    protected long tilNextMillis(long lastTimestamp) {
-        long timestamp = timeGen();
-        while (timestamp <= lastTimestamp) {
-            timestamp = timeGen();
-        }
-        return timestamp;
-    }
-
-    /**
-     * 返回以毫秒为单位的当前时间
-     * @return 当前时间(毫秒)
-     */
-    protected long timeGen() {
-        return System.currentTimeMillis();
-    }
-}

+ 10 - 9
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/AppRuleController.java

@@ -29,8 +29,8 @@ public class AppRuleController  extends BaseController {
     private IAppRuleService appRuleService;
 
     @ApiOperation(value = "查询规范列表")
-    @PostMapping("page")
-    public TableDataInfo getAppRulePage(@RequestBody AppRule appRule) {
+    @GetMapping("page")
+    public TableDataInfo getAppRulePage(AppRule appRule) {
         final TableDataInfo appRulePage = appRuleService.getAppRulePage(appRule);
         return appRulePage;
     }
@@ -42,22 +42,23 @@ public class AppRuleController  extends BaseController {
         return success(appRulePage);
     }
     @ApiOperation(value = "规范详情")
-    @GetMapping("info/{id}")
+    @GetMapping("{id}")
     public AjaxResult info(@PathVariable Long id) {
         return success(appRuleService.get(id));
     }
 
     @ApiOperation(value = "新增/编辑规范")
     @PostMapping("edit")
-    public AjaxResult add(@RequestBody AppRuleEditDto appRuleEditDto) {
+    public AjaxResult edit(@RequestBody AppRuleEditDto appRuleEditDto) {
+
         return success(appRuleService.edit(appRuleEditDto));
     }
 
-    @ApiOperation(value = "检查手册规范类型在检查项、检查要点是否一致")
-    @GetMapping("check/{id}/{ruletype}")
-    public AjaxResult checkRuleType(@PathVariable Long id,@PathVariable int ruletype) {
-        return success(appRuleService.checkRuleTypeUniformity(id,ruletype));
-    }
+//    @ApiOperation(value = "检查手册规范类型在检查项、检查要点是否一致")
+//    @GetMapping("check/{id}/{ruletype}")
+//    public AjaxResult checkRuleType(@PathVariable Long id,@PathVariable int ruletype) {
+//        return success(appRuleService.checkRuleTypeUniformity(id,ruletype));
+//    }
 
     @ApiOperation(value = "删除规范")
     @GetMapping("del/{id}")

+ 9 - 9
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRule.java

@@ -19,8 +19,8 @@ import lombok.EqualsAndHashCode;
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
-@TableName("t_app_rule")
-@ApiModel(value="AppRule对象", description="")
+@TableName("core_resumption_rule")
+@ApiModel(value="履职内容库定义对象", description="")
 public class AppRule extends BaseEntity {
 
     private static final long serialVersionUID = 1L;
@@ -29,24 +29,24 @@ public class AppRule extends BaseEntity {
     private Long id;
 
     @ApiModelProperty(value = "规范类型id")
-    @TableField("rule_type_id")
-    private Long ruleTypeId;
+    @TableField("type")
+    private String type;
 
     @ApiModelProperty(value = "规范名称")
-    @TableField("rule_name")
-    private String ruleName;
+    @TableField("name")
+    private String name;
 
     @ApiModelProperty(value = "受检机构类型")
     @TableField("org_type")
-    private Integer orgType;
+    private String orgType;
 
     @ApiModelProperty(value = "发布机构")
     @TableField("org_id")
     private Long orgId;
 
     @ApiModelProperty(value = "0:禁用 1:启用")
-    @TableField("rule_status")
-    private Integer ruleStatus;
+    @TableField("status")
+    private Integer status;
 
     @ApiModelProperty(value = "备注")
     @TableField("remark")

+ 6 - 14
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRuleItem.java

@@ -22,8 +22,8 @@ import javax.validation.constraints.NotNull;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@TableName("t_app_rule_item")
-@ApiModel(value="AppRuleItem对象", description="")
+@TableName("core_resumption_rule_item")
+@ApiModel(value="履职项对象", description="")
 public class AppRuleItem extends BaseEntity {
 
     private static final long serialVersionUID = 1L;
@@ -35,19 +35,11 @@ public class AppRuleItem extends BaseEntity {
     @TableField("rule_id")
     private Long ruleId;
 
-    @ApiModelProperty(value = "检查项编号")
-    @TableField("item_num")
-    private Integer itemNum;
-
     @ApiModelProperty(value = "检查项名称")
-    @TableField("item_name")
-    private String itemName;
+    @TableField("name")
+    private String name;
 
     @ApiModelProperty(value = "标准及要求")
-    @TableField("item_desc")
-    private String itemDesc;
-
-    @NotNull(message = "规则类型不能为空")
-    @ApiModelProperty("规范类型id")
-    private Long ruleTypeId;
+    @TableField("desc")
+    private String desc;
 }

+ 9 - 50
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRulePoint.java

@@ -20,8 +20,8 @@ import lombok.EqualsAndHashCode;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@TableName("t_app_rule_point")
-@ApiModel(value = "AppRulePoint对象", description = "")
+@TableName("core_resumption_rule_point")
+@ApiModel(value = "履职内容要点对象", description = "")
 public class AppRulePoint extends BaseEntity {
 
     private static final long serialVersionUID = 1L;
@@ -37,64 +37,23 @@ public class AppRulePoint extends BaseEntity {
     @TableField("item_id")
     private Long itemId;
 
-    @ApiModelProperty(value = "检查要点编号")
-    @TableField("point_num")
-    private Integer pointNum;
-
     @ApiModelProperty(value = "检查要点")
-    @TableField("point_name")
-    private String pointName;
+    @TableField("name")
+    private String name;
 
     @ApiModelProperty(value = "检查区域,区域表id")
     @TableField("area_id")
     private Long areaId;
 
-    @ApiModelProperty(value = "安防类型,字典表")
-    @TableField("safe_type")
-//    @Dict(dictCode = "safe_type")
-    private Integer safeType;
-
-    @ApiModelProperty(value = "整改期限,天数")
-    @TableField("reform_day")
-    private Integer reformDay;
-
-    @ApiModelProperty(value = "检查方法,字典表")
-    @TableField("inspection")
-    private Integer inspection;
-
-    @ApiModelProperty(value = "数据类型,数据类型表id")
-    @TableField("data_type")
-    private Long dataType;
-
-    @ApiModelProperty(value = "时间类型,0无,1时分")
-    @TableField("time_type")
-    private Integer timeType;
+    @TableField("business_type")
+    @ApiModelProperty(value = "该要点关联的业务类型")
+    private Integer businessType;
 
-    @ApiModelProperty(value = "时间类型,0无,1时分")
+   @ApiModelProperty(value = "时间类型,0无,1时分")
     @TableField("remark")
     private String remark;
 
-   /*
-    2022-6-16 需求变更,检查要点不再关联nfc采集点
-    @TableField("nfc_bind_id")
-    @ApiModelProperty(value = "nfc采集点id")
-    private Long nfcBindId;*/
-
-    @TableLogic(value = "0", delval = "1")
+   @TableLogic(value = "0", delval = "1")
     @ApiModelProperty(value = "是否禁用 1是 0否")
     private int deleted;
-
-    @TableField("rule_type_id")
-    @ApiModelProperty("规范类型id")
-    private Long ruleTypeId;
-
-    @TableField("degree_risk")
-    @ApiModelProperty("风险等级")
-    private Long degreeRisk;
-
-    @TableField("business_type")
-    @ApiModelProperty(value = "该要点关联的业务类型")
-    private Integer businessType;
-
-
 }

+ 4 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRule/AppRuleEditDto.java

@@ -21,19 +21,19 @@ public class AppRuleEditDto {
 
     @NotBlank(message = "规则名称不能为空")
     @ApiModelProperty("规范名称")
-    private String ruleName;
+    private String name;
 
     @NotNull(message = "规则类型不能为空")
     @ApiModelProperty("规范类型id")
-    private Long ruleTypeId;
+    private String type;
 
     @ApiModelProperty(value = "受检机构类型")
     @NotNull(message = "受检机构类型不能为空")
-    private Integer orgType;
+    private String orgType;
 
     @ApiModelProperty(value = "0:禁用 1:启用")
     @NotBlank(message = "状态不能为空")
-    private int ruleStatus;
+    private int status;
 
     @ApiModelProperty(value = "备注")
     private String remark;

+ 0 - 23
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRule/AppRulePageDto.java

@@ -1,23 +0,0 @@
-//package com.xunmei.core.resumption.mapper.dto.appRule;
-//
-//import com.xunmei.common.core.web.domain.PageDto;
-//import com.xunmei.core.resumption.domain.AppRule;
-//import io.swagger.annotations.ApiModelProperty;
-//import lombok.Data;
-//
-///**
-// * @author jingyuanchao
-// * @date 2022/4/26 10:26
-// */
-//@Data
-//public class AppRulePageDto extends PageDto<AppRule> {
-//
-//    @ApiModelProperty("规范名称")
-//    private String ruleName;
-//
-//    @ApiModelProperty("规范类型")
-//    private String ruleTypeId;
-//
-//    @ApiModelProperty("受检机构")
-//    private Integer orgType;
-//}

+ 4 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/AppRuleMapper.java

@@ -28,13 +28,11 @@ public interface AppRuleMapper extends BaseMapper<AppRule> {
 
     List<AppRuleGroupVo> getRuleGroupList();
 
-    AppRuleInfoVo get(Long id);
+//    AppRuleInfoVo get(Long id);
 
-    Integer checkRuleNameRepeat(@Param("id") Long id, @Param("ruleName") String ruleName);
+    Integer checkRuleNameRepeat(@Param("id") Long id, @Param("name") String name);
 
-    int checkRuleTypeUniformity(@Param("id") Long id, @Param("ruletype") int ruletype);
+//    int updateItemRuleType(@Param("id") Long id, @Param("ruletype") Long ruletype);
 
-    int updateItemRuleType(@Param("id") Long id, @Param("ruletype") Long ruletype);
-
-    int updatePointRuleType(@Param("id") Long id, @Param("ruletype") Long ruletype);
+//    int updatePointRuleType(@Param("id") Long id, @Param("ruletype") Long ruletype);
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IAppRuleService.java

@@ -27,7 +27,7 @@ public interface IAppRuleService extends IService<AppRule> {
     Long edit(AppRuleEditDto appRuleEditDto);
 
     //检查手册规范类型在检查项、检查要点是否一致
-    boolean  checkRuleTypeUniformity(Long id,  int ruletype);
+//    boolean  checkRuleTypeUniformity(Long id,  int ruletype);
 
     void del(Long id);
 

+ 3 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -390,12 +390,12 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         QueryWrapper<AppRule> qw = new QueryWrapper<>();
 
         if (info.getOrgType() != null) {
-            qw.lambda().eq(AppRule::getOrgType, info.getOrgType()).eq(AppRule::getRuleStatus, 0);
+            qw.lambda().eq(AppRule::getOrgType, info.getOrgType()).eq(AppRule::getStatus, 0);
         }
 
         if (info.getOrgId() != null) {
             SysOrg org = orgService.selectSysOrgById(info.getOrgId(), SecurityConstants.INNER).getData();
-            qw.lambda().eq(AppRule::getOrgType, org.getType()).eq(AppRule::getRuleStatus, 0);
+            qw.lambda().eq(AppRule::getOrgType, org.getType()).eq(AppRule::getStatus, 0);
         }
 
         List<AppRule> appRules = appRuleMapper.selectList(qw);
@@ -404,7 +404,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         for (AppRule appRule : appRules) {
             map = new HashMap<>();
             map.put("id", appRule.getId());
-            map.put("name", appRule.getRuleName());
+            map.put("name", appRule.getName());
             list.add(map);
         }
         return list;

+ 2 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleItemServiceImpl.java

@@ -65,7 +65,7 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
 //            throw new RuntimeException("检查项编号重复");
 //        }
 
-        Integer itemNameNums = appRuleItemMapper.checkItemNameRepeat(item.getId(), item.getRuleId(), item.getItemName());
+        Integer itemNameNums = appRuleItemMapper.checkItemNameRepeat(item.getId(), item.getRuleId(), item.getName());
         if (itemNameNums > 0) {
             throw new RuntimeException("检查项名称重复");
         }
@@ -74,7 +74,7 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
         if (appRule == null) {
             throw new RuntimeException("请选择具体规范新增数据!");
         }
-        item.setRuleTypeId(appRule.getRuleTypeId());
+
         saveOrUpdate(item);
         final List<AppRulePointDto> pointDtoList = appRuleItemDto.getPointDtoList();
         Map<Object, Object> hashMap = new HashMap<>();
@@ -110,7 +110,6 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
             AppRulePoint point = new AppRulePoint();
             BeanUtils.copyProperties(appRulePointDto, point);
             point.setItemId(item.getId());
-            point.setRuleTypeId(item.getRuleTypeId());
             if (point.getId() == null) {
                 //新增
                 point.setId(IDHelper.id());

+ 10 - 13
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleServiceImpl.java

@@ -20,6 +20,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import com.xunmei.common.core.utils.IDHelper;
+
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -45,10 +46,10 @@ public class AppRuleServiceImpl extends ServiceImpl<AppRuleMapper, AppRule> impl
 
     @Override
     public TableDataInfo getAppRulePage(AppRule appRule) {
-        Page<AppRulePageVo> page= appRule.<AppRulePageVo>toPage();
+        Page<AppRulePageVo> page = appRule.<AppRulePageVo>toPage();
         page = appRuleMapper.selectPageByCondition(page, appRule);
 
-        return  TableDataInfo.success(page);
+        return TableDataInfo.success(page);
     }
 
     @Override
@@ -68,31 +69,26 @@ public class AppRuleServiceImpl extends ServiceImpl<AppRuleMapper, AppRule> impl
     @Transactional(rollbackFor = Exception.class)
     public Long edit(AppRuleEditDto appRuleEditDto) {
         final AppRule appRule = new AppRule();
-        LoginUser loginUser = SecurityUtils.getLoginUser();
         BeanUtils.copyProperties(appRuleEditDto, appRule);
-        appRule.setOrgId(loginUser.getSysUser().getOrgId());
-        Integer nums = appRuleMapper.checkRuleNameRepeat(appRule.getId(), appRule.getRuleName());
+        Integer nums = appRuleMapper.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);
-            appRuleMapper.updateItemRuleType(appRuleEditDto.getId(), appRuleEditDto.getRuleTypeId());
-            appRuleMapper.updatePointRuleType(appRuleEditDto.getId(), appRuleEditDto.getRuleTypeId());
+//            appRuleMapper.updateItemRuleType(appRuleEditDto.getId(), appRuleEditDto.getRuleTypeId());
+//            appRuleMapper.updatePointRuleType(appRuleEditDto.getId(), appRuleEditDto.getRuleTypeId());
         }
         return appRule.getId();
     }
 
     @Override
-    public boolean checkRuleTypeUniformity(Long id, int ruletype) {
-        return appRuleMapper.checkRuleTypeUniformity(id, ruletype) > 0;
-    }
-
-    @Override
     @Transactional(rollbackFor = Exception.class)
     public void del(Long id) {
         appRuleMapper.deleteById(id);
@@ -142,6 +138,7 @@ public class AppRuleServiceImpl extends ServiceImpl<AppRuleMapper, AppRule> impl
 
     @Override
     public AppRuleInfoVo get(Long id) {
-        return appRuleMapper.get(id);
+        AppRule rule= appRuleMapper.selectById(id);
+        return AppRuleInfoVo.of(rule);
     }
 }

+ 18 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRule/AppRuleInfoVo.java

@@ -1,5 +1,9 @@
 package com.xunmei.core.resumption.vo.appRule;
 
+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 io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -10,23 +14,31 @@ import lombok.Data;
 
 @Data
 public class AppRuleInfoVo {
-
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
     @ApiModelProperty("规范名称")
-    private String ruleName;
+    private String name;
 
     @ApiModelProperty("规范类型")
-    private Long ruleTypeId;
+    private String type;
 
-    private String ruleTypeName;
+//    private String ruleTypeName;
+@JsonSerialize(using = ToStringSerializer.class)
+    private Long orgId;
 
     @ApiModelProperty("受检机构类型")
-    private Long orgType;
+    private String orgType;
 
     @ApiModelProperty("状态")
-    private Integer ruleStatus;
+    private Integer status;
 
     @ApiModelProperty("备注")
     private String remark;
+
+    public static AppRuleInfoVo of(AppRule rule) {
+        AppRuleInfoVo vo = new AppRuleInfoVo();
+        BeanUtil.copyProperties(rule, vo);
+        return vo;
+    }
 }

+ 4 - 10
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRule/AppRulePageVo.java

@@ -16,19 +16,13 @@ public class AppRulePageVo {
     private Long id;
 
     @ApiModelProperty("规范名称")
-    private String ruleName;
+    private String name;
 
     @ApiModelProperty("规范类型id")
-    private Long ruleTypeId;
-
-    @ApiModelProperty("规范类型名称")
-    private String ruleTypeName;
+    private String type;
 
     @ApiModelProperty(value = "受检机构类型")
-    private Integer orgType;
-
-    @ApiModelProperty(value = "受检机构类型名称")
-    private String orgTypeText;
+    private String orgType;
 
     @ApiModelProperty(value = "发布机构名称")
     private String orgName;
@@ -37,7 +31,7 @@ public class AppRulePageVo {
     private Long orgId;
 
     @ApiModelProperty(value = "0:禁用 1:启用")
-    private Integer ruleStatus;
+    private Integer status;
 
     @ApiModelProperty(value = "备注")
     private String remark;

+ 45 - 44
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRuleMapper.xml

@@ -3,25 +3,21 @@
 <mapper namespace="com.xunmei.core.resumption.mapper.AppRuleMapper">
     <select id="selectPageByCondition" resultType="com.xunmei.core.resumption.vo.appRule.AppRulePageVo">
         select a.id as id,
-        a.rule_name,
-        a.rule_type_id,
-        d.name as ruleTypeName,
+        a.name,
+        a.type,
         a.org_type as orgType,
-        a.rule_status as ruleStatus,
+        a.status as status,
         a.remark as remark,
         a.org_id as orgId,
-        d2.name as orgTypeText,
         org.name as orgName
-        from t_app_rule a
+        from core_resumption_rule a
         inner join sys_org org on a.org_id = org.id
-        inner join sys_dict_data d on a.rule_type_id=d.code and d.dict_code='rule_type'
-        inner join sys_dict_data d2 on org.type=d2.code and d2.dict_code='sys_org_type'
         <where>
-            <if test="appRule.ruleName != null and appRule.ruleName != ''">
-                and a.rule_name like CONCAT('%',#{appRule.ruleName},'%')
+            <if test="appRule.name != null and appRule.name != ''">
+                and a.name like CONCAT('%',#{appRule.name},'%')
             </if>
-            <if test="appRule.ruleTypeId != null and appRule.ruleTypeId != ''">
-                and a.rule_type_id = #{appRule.ruleTypeId}
+            <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}
@@ -34,46 +30,51 @@
     </select>
 
     <select id="getRuleGroupList" resultType="com.xunmei.core.resumption.vo.appRule.AppRuleGroupVo">
-        select r.id        as ruleId,
-               r.rule_name as ruleName,
-              d.name  as orgType,
-               r.org_type  as orgTypeId
-        from t_app_rule r
-                 inner join sys_dict_data d on r.rule_type_id = d.id and d.dict_code='sys_org_type'
-        where rule_status = 0
+        select r.id       as ruleId,
+               r.name     as name,
+               d.name     as orgType,
+               r.org_type as orgTypeId
+        from core_resumption_rule r
+                 inner join sys_dict_data d on r.type = d.id and d.dict_code = 'sys_org_type'
+        where status = 0
     </select>
 
-    <select id="get" resultType="com.xunmei.core.resumption.vo.appRule.AppRuleInfoVo">
-        select r.id,
-               r.rule_name    as ruleName,
-               r.rule_type_id as ruleTypeId,
-               d.name         as ruleTypeName,
-               r.org_type     as orgType,
-               r.rule_status  as ruleStatus,
-               r.remark       as remark
-        from t_app_rule r
-                 inner join sys_dict_data d on r.rule_type_id = d.code and d.dict_code = 'rule_type'
-        where r.id = #{id}
-    </select>
+<!--    <select id="get" resultType="com.xunmei.core.resumption.vo.appRule.AppRuleInfoVo">-->
+<!--        select r.id,-->
+<!--               r.name     as name,-->
+<!--               r.type     as type,-->
+<!--               r.org_type as orgType,-->
+<!--               r.status   as status,-->
+<!--               r.remark   as remark-->
+<!--        from core_resumption_rule r-->
+<!--                 inner join sys_dict_data d on r.type = d.code and d.dict_code = 'rule_type'-->
+<!--        where r.id = #{id}-->
+<!--    </select>-->
 
     <select id="checkRuleNameRepeat" resultType="java.lang.Integer">
-        select count(id) from t_app_rule where rule_name=#{ruleName}
+        select count(id) from core_resumption_rule where name=#{name}
         <if test="id != null">
             and id != #{id}
         </if>
     </select>
-    <select id="checkRuleTypeUniformity" resultType="java.lang.Integer">
-        SELECT SUM(c) as c from (
-              SELECT count(0) as c FROM t_app_rule_item WHERE rule_id=#{id} and rule_type_id!= #{ruletype}
-              UNION
-              SELECT count(0) as c FROM t_app_rule_point WHERE rule_id=#{id} and rule_type_id!= #{ruletype} )a
-    </select>
+    <!--    <select id="checkRuleTypeUniformity" resultType="java.lang.Integer">-->
+    <!--        SELECT SUM(c) as c from (-->
+    <!--              SELECT count(0) as c FROM core_resumption_rule_item WHERE rule_id=#{id} and type!= #{ruletype}-->
+    <!--              UNION-->
+    <!--              SELECT count(0) as c FROM core_resumption_rule_point WHERE rule_id=#{id} and type!= #{ruletype} )a-->
+    <!--    </select>-->
 
-    <update id="updateItemRuleType">
-        update t_app_rule_item set rule_type_id=#{ruletype} where rule_id=#{id} and rule_type_id!=#{ruletype}
-    </update>
+<!--    <update id="updateItemRuleType">-->
+<!--        update core_resumption_rule_item-->
+<!--        set type=#{ruletype}-->
+<!--        where rule_id = #{id}-->
+<!--          and type != #{ruletype}-->
+<!--    </update>-->
 
-    <update id="updatePointRuleType">
-        update t_app_rule_point set rule_type_id=#{ruletype} where rule_id=#{id} and rule_type_id!=#{ruletype}
-    </update>
+<!--    <update id="updatePointRuleType">-->
+<!--        update core_resumption_rule_point-->
+<!--        set type=#{ruletype}-->
+<!--        where rule_id = #{id}-->
+<!--          and type != #{ruletype}-->
+<!--    </update>-->
 </mapper>

+ 1 - 1
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/service/impl/FJNXSyncServiceImpl.java

@@ -4,8 +4,8 @@ import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.utils.IDHelper;
 import com.xunmei.common.core.utils.bean.BeanUtils;
-import com.xunmei.common.core.utils.snowId.IDHelper;
 import com.xunmei.sync.domain.FjnxOrgBusinessRelation;
 import com.xunmei.sync.domain.OrgFjnx;
 import com.xunmei.sync.dto.fjnxsync.FJNXOrgDto;