From fbc9e50d8110ac068997e4323c46fa1479f64c85 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Thu, 25 Jan 2024 11:49:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=A0=87=E5=87=86=E6=B3=95=E8=A7=84?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E6=B5=81=E7=A8=8B):=2080749?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProcessFbEntryChangeServiceImpl.java | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) 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 e9b94e75..8713cb83 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 @@ -31,14 +31,8 @@ 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.entity.LawsTreeNode; -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.standard.service.ILawsTreeNodeService; +import com.jero.modules.laws.standard.entity.*; +import com.jero.modules.laws.standard.service.*; import com.jero.modules.laws.standardization.entity.LawsStandardization; import com.jero.modules.laws.standardization.service.ILawsStandardizationService; import com.jero.modules.system.entity.SysDepart; @@ -107,6 +101,8 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl objectMap) { + private void sendMsg(Map objectMap, String businessId) { String module = (String) objectMap.get(FieldCommon.MODULE); String id = (String) objectMap.get("id"); String standardNumber = (String) objectMap.get(FieldCommon.STANDARD_NUMBER); @@ -276,28 +272,30 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl replacedList = Arrays.asList(replaced.split(",")); + if (StringUtils.isNotBlank(replaced) && !replaced.equals(replacedOld) && StringUtils.isNotBlank(replacedOld)) { // 代替标准 + List replacedOldList = Arrays.asList(replacedOld.split(",")); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.in(ProcessFbEntryChange::getStandardNumber, replacedList); - queryWrapper.eq(ProcessFbEntryChange::getOperateType, "2"); - List fbEntryChangeList = list(queryWrapper); - List userIdList = fbEntryChangeList.stream() - .map(ProcessFbEntryChange::getUserId) - .distinct().collect(Collectors.toList()); - userId = StringUtils.join(userIdList, ","); + queryWrapper.in(ProcessFbEntryChange::getStandardNumber, replacedOldList); + queryWrapper.eq(ProcessFbEntryChange::getOperateType, "1"); + List processFbEntryChangeList = list(queryWrapper); + userId = processFbEntryChangeList.stream().map(ProcessFbEntryChange::getUserId).collect(Collectors.joining(",")); templateCode = MessageTemplateCodeCommon.STANDARD_CHANGE_REPLACE; } if (StringUtils.isNotBlank(reference) && !reference.equals(referenceOld)) { // 引用标准 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(LawsEnterpriseStandard::getReferenceStandard, standardNumber); - queryWrapper.isNotNull(LawsEnterpriseStandard::getMainDraftingUser); - List enterpriseStandardList = lawsEnterpriseStandardService.list(queryWrapper); - List userIdList = enterpriseStandardList.stream() - .map(LawsEnterpriseStandard::getMainDraftingUser) - .distinct().collect(Collectors.toList()); - userId = StringUtils.join(userIdList, ","); + List lawsReplacedStandardList = lawsReplacedStandardService.list( + new LambdaQueryWrapper() + .eq(LawsReplacedStandard::getReplaced, standardNumber)); + if (!lawsReplacedStandardList.isEmpty()){ + List replacedByList = lawsReplacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toList()); + List lawsEnterpriseStandardList = lawsEnterpriseStandardService.list( + new LambdaQueryWrapper() + .in(LawsEnterpriseStandard::getStandardNumber, replacedByList)); + if (!lawsEnterpriseStandardList.isEmpty()){ + List mainDraftingUserList = lawsEnterpriseStandardList.stream().map(LawsEnterpriseStandard::getMainDraftingUser).collect(Collectors.toList()); + userId = String.join(",", mainDraftingUserList); + } + } templateCode = MessageTemplateCodeCommon.STANDARD_CHANGE_REFERENCE; }