|
@@ -11,10 +11,13 @@ 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.ColumnResult;
|
|
|
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.ColumnResultFacade;
|
|
|
import com.lantone.daqe.facade.base.ColumnVerifyFacade;
|
|
|
import com.lantone.daqe.facade.base.RegularInfoFacade;
|
|
|
import com.lantone.daqe.facade.base.RegularMappingFacade;
|
|
@@ -29,6 +32,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 正则式维护-业务处理类
|
|
@@ -50,6 +54,9 @@ public class RegularManagementFacade {
|
|
|
@Autowired
|
|
|
private ColumnVerifyFacade columnVerifyFacade;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ColumnResultFacade columnResultFacade;
|
|
|
+
|
|
|
/**
|
|
|
* 获取正则式维护分页列表
|
|
|
*
|
|
@@ -146,19 +153,34 @@ public class RegularManagementFacade {
|
|
|
if (regularMappingFacade.remove(new UpdateWrapper<RegularMapping>()
|
|
|
.eq("regular_id", id)
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()))) {
|
|
|
- return columnVerifyFacade.remove(new UpdateWrapper<ColumnVerify>()
|
|
|
+ if (columnVerifyFacade.remove(new UpdateWrapper<ColumnVerify>()
|
|
|
.in("verify_id", regularMappingIdList)
|
|
|
.eq("type", ColumnVerifyTypeEnum.REGULAR_TYPE.getKey())
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
|
|
|
+ //拿到正则结果表中关联数据的id
|
|
|
+ List<RegularResult> regularResults = regularResultFacade.getBaseMapper().selectList(new QueryWrapper<RegularResult>()
|
|
|
+ .eq("regular_id", id)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ );
|
|
|
+ List<Long> regularResultId = new ArrayList<>();
|
|
|
+ regularResults.stream().forEach(regularResult->{
|
|
|
+ regularResultId.add(regularResult.getId());
|
|
|
+ });
|
|
|
+ // 删除表字段的正则式校验结果表中的正则式
|
|
|
+ if (regularResultFacade.remove(new UpdateWrapper<RegularResult>()
|
|
|
+ .eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
+ .eq("regular_id", id)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
|
|
|
+ //删除总结果表信息
|
|
|
+ return columnResultFacade.remove(new UpdateWrapper<ColumnResult>()
|
|
|
+ .eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("result_id",regularResultId)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- //删除表字段的正则式校验结果表中的正则式
|
|
|
- // 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;
|
|
@@ -185,16 +207,16 @@ public class RegularManagementFacade {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 判断该正则式是否关联
|
|
|
+ * 判断该正则式是否关联
|
|
|
*
|
|
|
* @param upRegularByIdVO
|
|
|
* @Return java.lang.Boolean
|
|
|
*/
|
|
|
public Boolean isRelation(UpRegularByIdVO upRegularByIdVO) {
|
|
|
int count = regularMappingFacade.count(new QueryWrapper<RegularMapping>()
|
|
|
- .eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
- .eq("regular_id",upRegularByIdVO.getId()));
|
|
|
- if(count>0){
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("regular_id", upRegularByIdVO.getId()));
|
|
|
+ if (count > 0) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|