|
@@ -8,6 +8,7 @@ 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;
|
|
@@ -27,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
|
|
@@ -93,25 +97,17 @@ 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()))){
|
|
|
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 false;
|
|
|
}
|
|
|
|
|
@@ -147,12 +143,14 @@ 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>()
|
|
|
.eq("regular_id", id)
|
|
|
.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()));
|
|
|
}
|
|
@@ -168,6 +166,23 @@ public class RegularManagementFacade {
|
|
|
}
|
|
|
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;
|
|
|
+ }
|
|
|
}
|