Kaynağa Gözat

Merge branch 'dev/20220228_v3.0.1通用版_渠道管理第一期' into test

zhanghang 3 yıl önce
ebeveyn
işleme
7d7fc3f958

+ 1 - 1
daqe-center/src/main/java/com/lantone/daqe/dto/GetByIdColumnVerifyDTO.java

@@ -37,7 +37,7 @@ public class GetByIdColumnVerifyDTO implements Serializable {
     private String isRequired;
 
     @ApiModelProperty(value = "标准值")
-    private String standardvalue;
+    private String[] standardValueList;
 
     @ApiModelProperty(value = "正则式id")
     private Long regularId;

+ 50 - 0
daqe-center/src/main/java/com/lantone/daqe/dto/GetColumnVerifyDTO.java

@@ -0,0 +1,50 @@
+package com.lantone.daqe.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 根据ID获取字段校验规则明细数据-接口入参
+ * @author: zhanghang
+ * @time: 2022/3/10 10:01
+ */
+@ApiModel(value = "根据ID获取字段校验规则明细数据-接口出参")
+@Getter
+@Setter
+public class GetColumnVerifyDTO implements Serializable {
+
+    private static final long serialVersionUID = 1598464598027326148L;
+    @ApiModelProperty(value = "表的列信息ID")
+    private Long columnId;
+
+    @ApiModelProperty(value = "表名称(中文)")
+    private String tableCname;
+
+    @ApiModelProperty(value = "表名称(英文)")
+    private String tableEname;
+
+    @ApiModelProperty(value = "字段名称(中文)")
+    private String columnCname;
+
+    @ApiModelProperty(value = "字段名称(英文)")
+    private String columnEname;
+
+    @ApiModelProperty(value = "是否必填,0:否,1:是")
+    private String isRequired;
+
+    @ApiModelProperty(value = "标准值")
+    private String standardValue;
+
+    @ApiModelProperty(value = "正则式id")
+    private Long regularId;
+
+    @ApiModelProperty(value = "正则式名称")
+    private String regular;
+
+    @ApiModelProperty(value = "说明")
+    private String description;
+}

+ 42 - 0
daqe-center/src/main/java/com/lantone/daqe/enums/DataSaveUrlEnum.java

@@ -0,0 +1,42 @@
+package com.lantone.daqe.enums;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 数据保存url注解
+ * @author: songxl
+ * @time: 2022/3/4 16:03
+ */
+public enum DataSaveUrlEnum {
+    BEHOSPITAL_INFO("save/saveBehospitalCode", "病历数据"),
+    HOME_PAGE("save/saveHomePages", "病案首页"),
+    MEDICAL_RECORD("save/saveRecs", "文书记录");
+
+    @Getter
+    @Setter
+    private String key;
+
+    @Getter
+    @Setter
+    private String name;
+
+    DataSaveUrlEnum(String key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static DataSaveUrlEnum getEnum(String key) {
+        for (DataSaveUrlEnum item : DataSaveUrlEnum.values()) {
+            if (item.key.equals(key)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(String key) {
+        DataSaveUrlEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+}

+ 11 - 9
daqe-center/src/main/java/com/lantone/daqe/facade/BlockLossManagementFacade.java

@@ -25,6 +25,7 @@ import com.lantone.daqe.entity.BlocklossResult;
 import com.lantone.daqe.entity.HomePage;
 import com.lantone.daqe.entity.MedicalRecord;
 import com.lantone.daqe.entity.MedicalRecordContent;
+import com.lantone.daqe.enums.DataSaveUrlEnum;
 import com.lantone.daqe.enums.LossStatusEnum;
 import com.lantone.daqe.enums.LossTypeEnum;
 import com.lantone.daqe.enums.LossWayEnum;
@@ -136,7 +137,7 @@ public class BlockLossManagementFacade {
 
         //获取操作记录数据
         //病历数据
-        dataCompareVO.setOperationUrl("save/saveBehospitalCode");
+        dataCompareVO.setOperationUrl(DataSaveUrlEnum.BEHOSPITAL_INFO.getKey());
         List<GetOperationLogDTO> behospitalCodeLogs = getOperationLogs(dataCompareVO);
         //病案首页数据
         List<GetOperationLogDTO> homePageLogs = new ArrayList<>();
@@ -151,10 +152,10 @@ public class BlockLossManagementFacade {
             logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
             dataCompareVO.setBehospitalCodes(logCodes);
             //病案首页数据
-            dataCompareVO.setOperationUrl("save/saveHomePages");
+            dataCompareVO.setOperationUrl(DataSaveUrlEnum.HOME_PAGE.getKey());
             homePageLogs = removeRepeat(getOperationLogs(dataCompareVO), "homePageId");
             //文书数据
-            dataCompareVO.setOperationUrl("save/saveRecs");
+            dataCompareVO.setOperationUrl(DataSaveUrlEnum.MEDICAL_RECORD.getKey());
             recLogs = removeRepeat(getOperationLogs(dataCompareVO), "recTitle");
         }
 
@@ -624,9 +625,9 @@ public class BlockLossManagementFacade {
      * @Return com.lantone.daqe.dto.BlockLossTypeGatherDTO
      */
     public BlockLossTypeGatherDTO blockLossTypeGather(BlockLossTypeGatherVO blockLossTypeGatherVO) {
-        blockLossTypeGatherVO.setOperationUrls(Lists.newArrayList("save/saveBehospitalCode",
-                "save/saveHomePages",
-                "save/saveRecs"));
+        blockLossTypeGatherVO.setOperationUrls(Lists.newArrayList(DataSaveUrlEnum.BEHOSPITAL_INFO.getKey(),
+                DataSaveUrlEnum.HOME_PAGE.getKey(),
+                DataSaveUrlEnum.MEDICAL_RECORD.getKey()));
 
         DataCompareVO dataCompareVO = new DataCompareVO();
         dataCompareVO.setStartDate(blockLossTypeGatherVO.getStartDate());
@@ -640,7 +641,7 @@ public class BlockLossManagementFacade {
 
         //获取该时间段的日志数量
         //病历数据
-        dataCompareVO.setOperationUrl("save/saveBehospitalCode");
+        dataCompareVO.setOperationUrl(DataSaveUrlEnum.BEHOSPITAL_INFO.getKey());
         List<GetOperationLogDTO> behospitalCodeLogs = getOperationLogs(dataCompareVO);
         //病案首页数据
         List<GetOperationLogDTO> homePageLogs = new ArrayList<>();
@@ -651,10 +652,10 @@ public class BlockLossManagementFacade {
             List<String> logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
             dataCompareVO.setBehospitalCodes(logCodes);
             //病案首页数据
-            dataCompareVO.setOperationUrl("save/saveHomePages");
+            dataCompareVO.setOperationUrl(DataSaveUrlEnum.HOME_PAGE.getKey());
             homePageLogs = getOperationLogs(dataCompareVO);
             //文书数据
-            dataCompareVO.setOperationUrl("save/saveRecs");
+            dataCompareVO.setOperationUrl(DataSaveUrlEnum.MEDICAL_RECORD.getKey());
             recLogs = getOperationLogs(dataCompareVO);
             Integer logNum = logCodes.size() + homePageLogs.size() + recLogs.size();
             blockLossTypeGatherDTO.setLogNum(logNum);
@@ -662,6 +663,7 @@ public class BlockLossManagementFacade {
 
         //获取该时间段的实际数量
         List<String> codes = behospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                 .ge(blockLossTypeGatherVO.getStartDate() != null, "behospital_date", blockLossTypeGatherVO.getStartDate())
                 .le(blockLossTypeGatherVO.getEndDate() != null, "behospital_date", blockLossTypeGatherVO.getEndDate()))

+ 62 - 20
daqe-center/src/main/java/com/lantone/daqe/facade/ColumnVerifyManagementFacade.java

@@ -13,6 +13,7 @@ import com.lantone.daqe.dto.GetByIdColumnVerifyDTO;
 import com.lantone.daqe.dto.GetColumnDTO;
 import com.lantone.daqe.dto.GetColumnInfoDTO;
 import com.lantone.daqe.dto.GetColumnNameDTO;
+import com.lantone.daqe.dto.GetColumnVerifyDTO;
 import com.lantone.daqe.dto.GetColumnVerifyPageDTO;
 import com.lantone.daqe.dto.GetRegularDTO;
 import com.lantone.daqe.dto.GetTableColumnNameDTO;
@@ -94,16 +95,42 @@ public class ColumnVerifyManagementFacade {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("column_id", getByIdColumnVerifyVO.getColumnId())
         );
-        GetByIdColumnVerifyDTO byIdColumnVerify = columnVerifyFacade.getBaseMapper().getByIdColumnVerify(getByIdColumnVerifyVO);
+        //获取规则总表数据
+        List<GetColumnVerifyDTO> columnVerifyDTOList = columnVerifyFacade.getBaseMapper().getByIdColumnVerify(getByIdColumnVerifyVO);
+        GetByIdColumnVerifyDTO getByIdColumnVerifyDTO = new GetByIdColumnVerifyDTO();
+        List<String> standardValueList = new ArrayList<>();
+        if (ListUtil.isEmpty(columnVerifyDTOList)) {
+            Asserts.fail("不存在该字段关联规则 !");
+        }
+        GetColumnVerifyDTO columnVerifyDTO = columnVerifyDTOList.get(0);
+        getByIdColumnVerifyDTO.setColumnId(columnVerifyDTO.getColumnId());
+        getByIdColumnVerifyDTO.setColumnCname(columnVerifyDTO.getColumnCname());
+        getByIdColumnVerifyDTO.setColumnEname(columnVerifyDTO.getColumnEname());
+        getByIdColumnVerifyDTO.setTableCname(columnVerifyDTO.getTableCname());
+        getByIdColumnVerifyDTO.setTableEname(columnVerifyDTO.getTableEname());
+        getByIdColumnVerifyDTO.setIsRequired(columnVerifyDTO.getIsRequired());
+        getByIdColumnVerifyDTO.setRegular(columnVerifyDTO.getRegular());
+        getByIdColumnVerifyDTO.setDescription(columnVerifyDTO.getDescription());
+        //处理关键值信息
+        for (GetColumnVerifyDTO getColumnVerifyDTO : columnVerifyDTOList) {
+            if (StringUtil.isNotEmpty(getColumnVerifyDTO.getStandardValue())) {
+                standardValueList.add(getColumnVerifyDTO.getStandardValue());
+            }
+        }
+
         if (mappingFacadeOne != null) {
             RegularInfo one = regularInfoFacade.getOne(new QueryWrapper<RegularInfo>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("id", mappingFacadeOne.getRegularId())
             );
-            byIdColumnVerify.setRegularId(mappingFacadeOne.getRegularId());
-            byIdColumnVerify.setRegular(one.getName());
+            getByIdColumnVerifyDTO.setRegularId(mappingFacadeOne.getRegularId());
+            getByIdColumnVerifyDTO.setRegular(one.getName());
         }
-        return byIdColumnVerify;
+        String[] strings = new String[standardValueList.size()];
+        if (ListUtil.isNotEmpty(standardValueList)) {
+            getByIdColumnVerifyDTO.setStandardValueList(standardValueList.toArray(strings));
+        }
+        return getByIdColumnVerifyDTO;
     }
 
     /**
@@ -125,8 +152,8 @@ public class ColumnVerifyManagementFacade {
     public List<GetColumnNameDTO> getColumnName(GetColumnNameVO getColumnNameVO) {
         List<ColumnInfo> columnInfoList = columnInfoFacade.getBaseMapper().selectList(new QueryWrapper<ColumnInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq(StringUtil.isNotBlank(getColumnNameVO.getTableEname()),"table_ename",getColumnNameVO.getTableEname())
-                .eq(StringUtil.isNotBlank(getColumnNameVO.getTableCname()),"table_cname",getColumnNameVO.getTableCname())
+                .eq(StringUtil.isNotBlank(getColumnNameVO.getTableEname()), "table_ename", getColumnNameVO.getTableEname())
+                .eq(StringUtil.isNotBlank(getColumnNameVO.getTableCname()), "table_cname", getColumnNameVO.getTableCname())
                 .like(StringUtil.isNotBlank(getColumnNameVO.getColumnCname()), "column_cname", getColumnNameVO.getColumnCname())
                 .like(StringUtil.isNotBlank(getColumnNameVO.getColumnEname()), "column_ename", getColumnNameVO.getColumnEname())
                 .groupBy("column_cname", "column_ename")
@@ -215,6 +242,11 @@ public class ColumnVerifyManagementFacade {
             columnVerify.setTableCname(columnInfoVO.getTableCname());
             columnVerify.setTableEname(columnInfoVO.getTableEname());
             if (addColumnVerifyVO.getRegularId() != null) {
+                //新增前判断是否存在该正则
+                RegularInfo regularInfo = regularInfoFacade.getBaseMapper().selectById(addColumnVerifyVO.getRegularId());
+                if (regularInfo == null) {
+                    Asserts.fail("该正则不存在,已被删除,请重新关联正则!");
+                }
                 //插入正则维护表
                 //先判断是否该字段信息是否已关联正则
                 RegularMapping selectOneMapping = regularMappingFacade.getBaseMapper().selectOne(new QueryWrapper<RegularMapping>()
@@ -228,7 +260,7 @@ public class ColumnVerifyManagementFacade {
                 regularMapping.setColumnId(columnId);
                 regularMapping.setGmtCreate(new Date());
                 regularMapping.setGmtModified(new Date());
-                if(principleId!=null) {
+                if (principleId != null) {
                     regularMapping.setCreator(principleId.toString());
                 }
                 regularMapping.setRegularId(addColumnVerifyVO.getRegularId());
@@ -245,7 +277,7 @@ public class ColumnVerifyManagementFacade {
                 columnVerify.setDescription(addColumnVerifyVO.getDescription());
                 columnVerify.setGmtCreate(new Date());
                 columnVerify.setGmtModified(new Date());
-                if(principleId!=null) {
+                if (principleId != null) {
                     columnVerify.setCreator(principleId.toString());
                 }
                 try {
@@ -268,7 +300,7 @@ public class ColumnVerifyManagementFacade {
                 nonnullInfo.setColumnId(columnId);
                 nonnullInfo.setGmtCreate(new Date());
                 nonnullInfo.setGmtModified(new Date());
-                if(principleId!=null) {
+                if (principleId != null) {
                     nonnullInfo.setCreator(principleId.toString());
                 }
                 nonnullInfo.setIsRequired(addColumnVerifyVO.getIsRequired());
@@ -285,7 +317,7 @@ public class ColumnVerifyManagementFacade {
                 columnVerify.setDescription(addColumnVerifyVO.getDescription());
                 columnVerify.setGmtCreate(new Date());
                 columnVerify.setGmtModified(new Date());
-                if(principleId!=null) {
+                if (principleId != null) {
                     columnVerify.setCreator(principleId.toString());
                 }
                 try {
@@ -302,7 +334,7 @@ public class ColumnVerifyManagementFacade {
                     standardvalueInfo.setColumnId(columnId);
                     standardvalueInfo.setGmtCreate(new Date());
                     standardvalueInfo.setGmtModified(new Date());
-                    if(principleId!=null) {
+                    if (principleId != null) {
                         standardvalueInfo.setCreator(principleId.toString());
                     }
                     standardvalueInfo.setVal(standardValue);
@@ -319,7 +351,7 @@ public class ColumnVerifyManagementFacade {
                     columnVerify.setDescription(addColumnVerifyVO.getDescription());
                     columnVerify.setGmtCreate(new Date());
                     columnVerify.setGmtModified(new Date());
-                    if(principleId!=null) {
+                    if (principleId != null) {
                         columnVerify.setCreator(principleId.toString());
                     }
                     try {
@@ -473,6 +505,11 @@ public class ColumnVerifyManagementFacade {
                 if (updateColumnVerifyVO.getRegularId() != null) {
                     //插入正则维护表
                     if (selectOneMapping != null) {
+                        //修改前判断是否存在该正则
+                        RegularInfo regularInfo = regularInfoFacade.getBaseMapper().selectById(updateColumnVerifyVO.getRegularId());
+                        if (regularInfo == null) {
+                            Asserts.fail("该正则不存在,已被删除,请重新关联正则!");
+                        }
                         //已关联正则走修改
                         regularMappingFacade.update(new UpdateWrapper<RegularMapping>()
                                 .eq("column_id", columnId)
@@ -494,10 +531,15 @@ public class ColumnVerifyManagementFacade {
                         );
                     } else {
                         //未关联正则走新增
+                        //新增前判断是否存在该正则
+                        RegularInfo regularInfo = regularInfoFacade.getBaseMapper().selectById(updateColumnVerifyVO.getRegularId());
+                        if (regularInfo == null) {
+                            Asserts.fail("该正则不存在,已被删除,请重新关联正则!");
+                        }
                         RegularMapping regularMapping = new RegularMapping();
                         regularMapping.setColumnId(columnId);
                         regularMapping.setGmtCreate(new Date());
-                        if(principleId!=null) {
+                        if (principleId != null) {
                             regularMapping.setCreator(principleId.toString());
                         }
                         regularMapping.setRegularId(updateColumnVerifyVO.getRegularId());
@@ -513,7 +555,7 @@ public class ColumnVerifyManagementFacade {
                         columnVerify.setVerifyVal(updateColumnVerifyVO.getRegularName());
                         columnVerify.setDescription(updateColumnVerifyVO.getDescription());
                         columnVerify.setGmtCreate(new Date());
-                        if(principleId!=null) {
+                        if (principleId != null) {
                             columnVerify.setCreator(principleId.toString());
                         }
                         try {
@@ -522,7 +564,7 @@ public class ColumnVerifyManagementFacade {
                             Asserts.fail("保存失败");
                         }
                     }
-                }else {
+                } else {
                     //为空则存在的关联给删掉
                     if (selectOneMapping != null) {
                         //已关联正则删除
@@ -571,7 +613,7 @@ public class ColumnVerifyManagementFacade {
                         NonnullInfo nonnullInfo = new NonnullInfo();
                         nonnullInfo.setColumnId(columnId);
                         nonnullInfo.setGmtCreate(new Date());
-                        if(principleId!=null) {
+                        if (principleId != null) {
                             nonnullInfo.setCreator(principleId.toString());
                         }
                         nonnullInfo.setIsRequired(updateColumnVerifyVO.getIsRequired());
@@ -587,7 +629,7 @@ public class ColumnVerifyManagementFacade {
                         columnVerify.setVerifyVal(updateColumnVerifyVO.getIsRequired());
                         columnVerify.setDescription(updateColumnVerifyVO.getDescription());
                         columnVerify.setGmtCreate(new Date());
-                        if(principleId!=null) {
+                        if (principleId != null) {
                             columnVerify.setCreator(principleId.toString());
                         }
                         try {
@@ -614,7 +656,7 @@ public class ColumnVerifyManagementFacade {
                         standardvalueInfo.setGmtCreate(new Date());
                         standardvalueInfo.setGmtModified(new Date());
                         standardvalueInfo.setVal(standardValue);
-                        if(principleId!=null) {
+                        if (principleId != null) {
                             standardvalueInfo.setCreator(principleId.toString());
                         }
                         try {
@@ -630,7 +672,7 @@ public class ColumnVerifyManagementFacade {
                         columnVerify.setDescription(updateColumnVerifyVO.getDescription());
                         columnVerify.setGmtCreate(new Date());
                         columnVerify.setGmtModified(new Date());
-                        if(principleId!=null) {
+                        if (principleId != null) {
                             columnVerify.setCreator(principleId.toString());
                         }
                         try {
@@ -639,7 +681,7 @@ public class ColumnVerifyManagementFacade {
                             Asserts.fail("保存失败");
                         }
                     }
-                }else {
+                } else {
                     //为空则存在的关联给删掉
                     standardvalueInfoFacade.remove(new UpdateWrapper<StandardvalueInfo>()
                             .eq("column_id", columnId)

+ 45 - 23
daqe-center/src/main/java/com/lantone/daqe/facade/RegularManagementFacade.java

@@ -8,12 +8,14 @@ import com.lantone.common.enums.IsDeleteEnum;
 import com.lantone.common.exception.Asserts;
 import com.lantone.common.util.BeanUtil;
 import com.lantone.common.util.DateUtil;
+import com.lantone.common.util.ListUtil;
 import com.lantone.common.util.SysUserUtils;
 import com.lantone.daqe.dto.GetRegularPageDTO;
 import com.lantone.daqe.entity.ColumnVerify;
 import com.lantone.daqe.entity.RegularInfo;
 import com.lantone.daqe.entity.RegularMapping;
 import com.lantone.daqe.entity.RegularResult;
+import com.lantone.daqe.enums.ColumnVerifyTypeEnum;
 import com.lantone.daqe.facade.base.ColumnVerifyFacade;
 import com.lantone.daqe.facade.base.RegularInfoFacade;
 import com.lantone.daqe.facade.base.RegularMappingFacade;
@@ -26,6 +28,9 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @Description: 正则式维护-业务处理类
  * @author: songxl
@@ -54,7 +59,7 @@ public class RegularManagementFacade {
      */
     public IPage<GetRegularPageDTO> getRegularPage(GetRegularPageVO getRegularPageVO) {
         QueryWrapper<RegularInfo> wrapper = new QueryWrapper();
-        wrapper.like("name",getRegularPageVO.getName());
+        wrapper.like("name", getRegularPageVO.getName());
         regularInfoFacade.list(wrapper);
         return regularInfoFacade.getBaseMapper().getRegularPage(getRegularPageVO);
     }
@@ -92,24 +97,20 @@ public class RegularManagementFacade {
         regularInfo.setModifier(SysUserUtils.getCurrentPrinciple() == null ? "0" : SysUserUtils.getCurrentPrinciple());
         regularInfo.setGmtModified(DateUtil.now());
         //修改表字段的正则式校验结果表中的正则式
+        //先获取正则维护关联表id
+        List<Long> regularMappingIdList = getRegularMappingId(upRegularByIdVO.getId());
         if (regularInfoFacade.updateById(regularInfo)) {
-            if(regularResultFacade.update(new UpdateWrapper<RegularResult>()
-                    .eq(upRegularByIdVO.getHospitalId() != null, "hospital_id", upRegularByIdVO.getHospitalId())
-                    .eq("regular_id", upRegularByIdVO.getId())
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .set("regular_name", upRegularByIdVO.getName())
-                    .set("regular_val", upRegularByIdVO.getVal())
-                    .set("modifier", SysUserUtils.getCurrentPrinciple() == null ? "0" : SysUserUtils.getCurrentPrinciple())
-                    .set("gmt_modified", DateUtil.now())
-                    .set("regular_des", upRegularByIdVO.getDescription()))){
+            if (ListUtil.isNotEmpty(regularMappingIdList)) {
                 return columnVerifyFacade.update(new UpdateWrapper<ColumnVerify>()
-                        .eq("verify_id", upRegularByIdVO.getId())
+                        .in("verify_id", regularMappingIdList)
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("type", ColumnVerifyTypeEnum.REGULAR_TYPE.getKey())
                         .set("verify_val", upRegularByIdVO.getName())
                         .set("modifier", SysUserUtils.getCurrentPrinciple() == null ? "0" : SysUserUtils.getCurrentPrinciple())
                         .set("gmt_modified", DateUtil.now()));
             }
-            }
+            return true;
+        }
         return false;
     }
 
@@ -145,26 +146,47 @@ public class RegularManagementFacade {
         regularInfo.setGmtModified(DateUtil.now());
         regularInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
         if (regularInfoFacade.updateById(regularInfo)) {
+            //先获取正则维护关联表id
+            List<Long> regularMappingIdList = getRegularMappingId(id);
             //删除表字段的实际值与正则式关联关系
-            if(regularMappingFacade.remove(new UpdateWrapper<RegularMapping>()
+            if (regularMappingFacade.remove(new UpdateWrapper<RegularMapping>()
                     .eq("regular_id", id)
-                    .eq("is_deleted", IsDeleteEnum.N.getKey()))){
+                    .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
                 return columnVerifyFacade.remove(new UpdateWrapper<ColumnVerify>()
-                        .eq("verify_id", id)
+                        .in("verify_id", regularMappingIdList)
+                        .eq("type", ColumnVerifyTypeEnum.REGULAR_TYPE.getKey())
                         .eq("is_deleted", IsDeleteEnum.N.getKey()));
             }
             //删除表字段的正则式校验结果表中的正则式
-//            return regularResultFacade.update(new UpdateWrapper<RegularResult>()
-//                    .eq(hospitalId != null, "hospital_id", hospitalId)
-//                    .eq("regular_id", id)
-//                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-//                    .set("modifier", SysUserUtils.getCurrentPrinciple() == null ? "0" : SysUserUtils.getCurrentPrinciple())
-//                    .set("gmt_modified", DateUtil.now())
-//                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
+            //            return regularResultFacade.update(new UpdateWrapper<RegularResult>()
+            //                    .eq(hospitalId != null, "hospital_id", hospitalId)
+            //                    .eq("regular_id", id)
+            //                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+            //                    .set("modifier", SysUserUtils.getCurrentPrinciple() == null ? "0" : SysUserUtils.getCurrentPrinciple())
+            //                    .set("gmt_modified", DateUtil.now())
+            //                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
 
         }
         return false;
     }
 
-
+    /**
+     * 根据正则id获取正则维护表id集合
+     *
+     * @param id
+     * @return: 正则维护表id集合
+     */
+    public List<Long> getRegularMappingId(Long id) {
+        List<Long> regularMappingIdList = new ArrayList<>();
+        List<RegularMapping> regularMappingList = regularMappingFacade.getBaseMapper().selectList(new QueryWrapper<RegularMapping>()
+                .eq("regular_id", id)
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+        );
+        if (ListUtil.isNotEmpty(regularMappingList)) {
+            for (RegularMapping regularMapping : regularMappingList) {
+                regularMappingIdList.add(regularMapping.getId());
+            }
+        }
+        return regularMappingIdList;
+    }
 }

+ 2 - 2
daqe-center/src/main/java/com/lantone/daqe/mapper/ColumnVerifyMapper.java

@@ -2,8 +2,8 @@ package com.lantone.daqe.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.lantone.daqe.dto.GetByIdColumnVerifyDTO;
 import com.lantone.daqe.dto.GetColumnDTO;
+import com.lantone.daqe.dto.GetColumnVerifyDTO;
 import com.lantone.daqe.dto.GetColumnVerifyPageDTO;
 import com.lantone.daqe.entity.ColumnVerify;
 import com.lantone.daqe.vo.AddColumnVO;
@@ -21,7 +21,7 @@ import java.util.List;
 public interface ColumnVerifyMapper extends BaseMapper<ColumnVerify> {
     IPage<GetColumnVerifyPageDTO> getColumnVerifyPage(@Param("getColumnVerifyPageVO") GetColumnVerifyPageVO getColumnVerifyPageVO);
 
-    GetByIdColumnVerifyDTO getByIdColumnVerify(@Param("getByIdColumnVerifyVO") GetByIdColumnVerifyVO getByIdColumnVerifyVO);
+    List<GetColumnVerifyDTO> getByIdColumnVerify(@Param("getByIdColumnVerifyVO") GetByIdColumnVerifyVO getByIdColumnVerifyVO);
 
     List<GetColumnDTO> getColumn(@Param("addColumnVO") AddColumnVO addColumnVO);
 

+ 1 - 16
daqe-center/src/main/resources/mapper/ColumnVerifyMapper.xml

@@ -64,19 +64,7 @@
     </select>
 
 
-    <select id="getByIdColumnVerify" resultType="com.lantone.daqe.dto.GetByIdColumnVerifyDTO">
-        SELECT
-        a.column_id,
-        a.table_cname,
-        a.table_ename,
-        a.column_cname,
-        a.column_ename,
-        GROUP_CONCAT(a.isRequired SEPARATOR ';') isRequired,
-        GROUP_CONCAT(a.standardvalue SEPARATOR ';') standardvalue,
-        GROUP_CONCAT(a.regular SEPARATOR ';') regular,
-        a.description
-        FROM
-        (
+    <select id="getByIdColumnVerify" resultType="com.lantone.daqe.dto.GetColumnVerifyDTO">
         SELECT
         dcv.column_id,
         dcv.table_cname,
@@ -93,9 +81,6 @@
         WHERE
         dcv.is_deleted = 'N'
         and dcv.column_id= #{getByIdColumnVerifyVO.columnId}
-        ) a
-        GROUP BY
-        a.column_id
     </select>
 
     <select id="getColumn" resultType="com.lantone.daqe.dto.GetColumnDTO">