diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/util/StandardUtil.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/util/StandardUtil.java index 0414dad2..7ba3b040 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/util/StandardUtil.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/util/StandardUtil.java @@ -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() - .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() + .in(SarFileCompareInfo::getSerialNumberLeft, standardNumberList) + .or().in(SarFileCompareInfo::getSerialNumberRight, standardNumberList)); + if (count2 > 0) { + throw new JeroBootException(ResultCommon.SCC_DELETE_STANDARD_ERROR4); + } } }