diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java index 090cfb3b..ba503c16 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java @@ -13,6 +13,7 @@ import com.jero.common.exception.JeroBootException; import com.jero.common.util.UUIDUtils; import com.jero.modules.activiti.entity.ProcessAll; import com.jero.modules.activiti.enums.ProcessTypeEnum; +import com.jero.modules.activiti.process.common.entity.ProcessDraft; import com.jero.modules.activiti.process.common.service.ProcessDraftService; import com.jero.modules.activiti.process.fb.common.ProcessDefinitionKey; import com.jero.modules.activiti.process.fb.dto.BasicProcessInfoDTO; @@ -29,8 +30,12 @@ import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon; import com.jero.modules.laws.common.mapper.LawsCommonMapper; import com.jero.modules.laws.common.service.ILawsCommonService; import com.jero.modules.laws.common.util.CurrentUserUtil; +import com.jero.modules.laws.standard.entity.LawsDomesticStandard; import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard; +import com.jero.modules.laws.standard.entity.LawsOverseasStandard; +import com.jero.modules.laws.standard.service.ILawsDomesticStandardService; import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService; +import com.jero.modules.laws.standard.service.ILawsOverseasStandardService; import com.jero.modules.laws.standardization.entity.LawsStandardization; import com.jero.modules.laws.standardization.service.ILawsStandardizationService; import com.jero.modules.system.service.ISysDictService; @@ -84,6 +89,10 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl map = JSON.parseObject(businessJson, Map.class); + if ("1".equals(businessData.getOperateType())) { + int documentCount = lawsDomesticStandardService.count( + new LambdaQueryWrapper() + .eq(LawsDomesticStandard::getStandardNumber, map.get(FieldCommon.STANDARD_NUMBER))); + int overseasCount = lawsOverseasStandardService.count( + new LambdaQueryWrapper() + .eq(LawsOverseasStandard::getStandardNumber, map.get(FieldCommon.STANDARD_NUMBER))); + if (documentCount > 0 || overseasCount > 0){ + throw new JeroBootException("标准编号已入库或已发起入库流程,不可重复发起!"); + } + + List list = list( + new LambdaQueryWrapper() + .ne(ProcessFbEntryChange::getId, businessId) + .eq(ProcessFbEntryChange::getStandardNumber, map.get(FieldCommon.STANDARD_NUMBER))); + for (ProcessFbEntryChange processFbEntryChange : list) { + int count = processDraftService.count( + new LambdaQueryWrapper() + .eq(ProcessDraft::getProjectId, processFbEntryChange.getId()) + .and(qw -> qw.ne(ProcessDraft::getSaveSource, "3") + .or().isNull(ProcessDraft::getSaveSource))); + if (count == 0){ + throw new JeroBootException("标准编号已入库或已发起入库流程,不可重复发起!"); + } + } + } + } + /** * @Author: liao * @Date: 2023/11/6 14:52