|
@@ -28,6 +28,7 @@ import com.lantone.daqe.entity.RegularMapping;
|
|
|
import com.lantone.daqe.entity.RegularResult;
|
|
|
import com.lantone.daqe.entity.StandardvalueInfo;
|
|
|
import com.lantone.daqe.entity.StandardvalueResult;
|
|
|
+import com.lantone.daqe.enums.ColumnResultTypeEnum;
|
|
|
import com.lantone.daqe.enums.ColumnVerifyTypeEnum;
|
|
|
import com.lantone.daqe.facade.base.ColumnInfoFacade;
|
|
|
import com.lantone.daqe.facade.base.ColumnResultFacade;
|
|
@@ -629,12 +630,30 @@ public class ColumnVerifyManagementFacade {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
);
|
|
|
Long mappingId = selectOneMapping.getId();
|
|
|
+ Long regularId = selectOneMapping.getRegularId();
|
|
|
+ //获取结果表id
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ List<RegularResult> regularResults = regularResultFacade.getBaseMapper().selectList(new QueryWrapper<RegularResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("regular_id", regularId));
|
|
|
+ if (ListUtil.isNotEmpty(regularResults)) {
|
|
|
+ regularResults.stream().forEach(regularResult -> {
|
|
|
+ ids.add(regularResult.getId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //删除结果表数据
|
|
|
+ regularResultFacade.remove(new UpdateWrapper<RegularResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("regular_id", regularId)
|
|
|
+ );
|
|
|
//修改总表
|
|
|
columnVerifyFacade.remove(new UpdateWrapper<ColumnVerify>()
|
|
|
.eq("column_id", columnId)
|
|
|
.eq("type", ColumnVerifyTypeEnum.REGULAR_TYPE.getKey())
|
|
|
.eq("verify_id", mappingId)
|
|
|
);
|
|
|
+ //删除结果表数据
|
|
|
+ delColumnResult(ids, ColumnResultTypeEnum.REGULAR_TYPE.getKey());
|
|
|
}
|
|
|
//未关联则不处理
|
|
|
}
|
|
@@ -738,6 +757,21 @@ public class ColumnVerifyManagementFacade {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ //获取结果表id
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ List<StandardvalueResult> standardvalueResultsList = standardvalueResultFacade.getBaseMapper().selectList(new QueryWrapper<StandardvalueResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", columnId));
|
|
|
+ if (ListUtil.isNotEmpty(standardvalueResultsList)) {
|
|
|
+ standardvalueResultsList.stream().forEach(standardvalueResult -> {
|
|
|
+ ids.add(standardvalueResult.getId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //删除结果表数据
|
|
|
+ standardvalueResultFacade.remove(new UpdateWrapper<StandardvalueResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", columnId));
|
|
|
+ delColumnResult(ids, ColumnResultTypeEnum.STANDARD_TYPE.getKey());
|
|
|
//为空则存在的关联给删掉
|
|
|
standardvalueInfoFacade.remove(new UpdateWrapper<StandardvalueInfo>()
|
|
|
.eq("column_id", columnId)
|
|
@@ -752,6 +786,20 @@ public class ColumnVerifyManagementFacade {
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 删除结果总表数据
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @param type
|
|
|
+ * @return:
|
|
|
+ */
|
|
|
+ public Boolean delColumnResult(List<Long> ids , String type){
|
|
|
+ return columnResultFacade.remove(new UpdateWrapper<ColumnResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("type",type)
|
|
|
+ .in("result_id",ids)
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 根据表名新增字段信息
|