fix(88091): 增加对比校验

This commit is contained in:
yjz
2024-08-07 20:06:00 +08:00
parent 96678bfe72
commit 170fe1aa7a
@@ -8,6 +8,8 @@ import com.jero.modules.activiti.enums.ProcessStatusEnum;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService;
import com.jero.modules.activiti.service.ProcessAllService;
import com.jero.modules.compare.entity.SarFileCompareInfo;
import com.jero.modules.compare.service.ISarFileCompareInfoService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.service.DoNotSplitStandardProvider;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
@@ -34,6 +36,9 @@ public class StandardUtil {
@Resource
private ILawsDomesticStandardService lawsDomesticStandardService;
@Resource
private ISarFileCompareInfoService sarFileCompareInfoService;
@Resource
private ProcessStandardInterpretService processStandardInterpretService;
@@ -94,11 +99,21 @@ public class StandardUtil {
.collect(Collectors.toList());
int count = sarFileSplitInfoService.count(
new LambdaQueryWrapper<SarFileSplitInfoEO>()
.in(SarFileSplitInfoEO::getStandardId, needDelStandardIdList)
.or().in(SarFileSplitInfoEO::getSerialNumber, standardNumberList));
.isNull(SarFileSplitInfoEO::getPublishBeforeId)
.and(w -> w.in(SarFileSplitInfoEO::getStandardId, needDelStandardIdList)
.or().in(SarFileSplitInfoEO::getSerialNumber, standardNumberList)));
if (count > 0) {
throw new JeroBootException(ResultCommon.SCC_DELETE_STANDARD_ERROR2);
}
// 查询对比数据
int count2 = sarFileCompareInfoService.count(
new LambdaQueryWrapper<SarFileCompareInfo>()
.in(SarFileCompareInfo::getSerialNumberLeft, standardNumberList)
.or().in(SarFileCompareInfo::getSerialNumberRight, standardNumberList));
if (count2 > 0) {
throw new JeroBootException(ResultCommon.SCC_DELETE_STANDARD_ERROR4);
}
}
}