From e05ba6fd4801e87bc6ea4220861d05b0bab7192a Mon Sep 17 00:00:00 2001 From: caihaohan Date: Thu, 8 Aug 2024 16:55:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=BD=B1=E5=93=8D=E4=BC=81=E6=A0=87=E5=8F=91?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/ReplaceImplementationDateMsgJob.java | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/job/ReplaceImplementationDateMsgJob.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/job/ReplaceImplementationDateMsgJob.java index 65eb56fd..609720c6 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/job/ReplaceImplementationDateMsgJob.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/job/ReplaceImplementationDateMsgJob.java @@ -11,6 +11,10 @@ import com.jero.modules.laws.standard.entity.LawsReplacedStandard; import com.jero.modules.laws.standard.service.ILawsDomesticStandardService; import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService; import com.jero.modules.laws.standard.service.ILawsReplacedStandardService; +import com.jero.modules.laws.standardmasterplan.entity.LawsStandardMasterPlan; +import com.jero.modules.laws.standardmasterplan.entity.LawsStandardMasterPlanSublist; +import com.jero.modules.laws.standardmasterplan.servicce.ILawsStandardMasterPlanService; +import com.jero.modules.laws.standardmasterplan.servicce.ILawsStandardMasterPlanSublistService; import com.jero.modules.personal.entity.LawsStandardCollection; import com.jero.modules.personal.service.ILawsStandardCollectionService; import lombok.extern.slf4j.Slf4j; @@ -23,6 +27,8 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; +import static com.jero.modules.laws.standardmasterplan.common.LawsStandardMasterPlanCommon.INFORMATION_INPUT; + @Slf4j public class ReplaceImplementationDateMsgJob implements Job { @@ -41,6 +47,12 @@ public class ReplaceImplementationDateMsgJob implements Job { @Resource private ILawsStandardCollectionService collectionService; + @Resource + private ILawsStandardMasterPlanService masterPlanService; + + @Resource + private ILawsStandardMasterPlanSublistService masterPlanSublistService; + @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { this.sendGbStandardMsg(); @@ -160,14 +172,14 @@ public class ReplaceImplementationDateMsgJob implements Job { Date tomorrowMidnight = cal.getTime(); // 根据新认证车实施日期筛选出已经到期的标准 - for (LawsDomesticStandard es : standardList) { - Date implementationDate = es.getImplementationDate(); + for (LawsDomesticStandard gb : standardList) { + Date implementationDate = gb.getImplementationDate(); if (implementationDate == null) { continue; } // 判断实施日期大于今天0点小于明天0点 if (implementationDate.equals(todayMidnight) && implementationDate.before(tomorrowMidnight)) { - allExpireStandardNumberList.add(es.getStandardNumber()); + allExpireStandardNumberList.add(gb.getId()); } } @@ -206,7 +218,20 @@ public class ReplaceImplementationDateMsgJob implements Job { standard = standard.split("《")[0]; LawsDomesticStandard replaceStandard = standardMap.get(standard); // 被代替标准的主起草人,责任人,收藏标准的人员 - userIdList.add(replaceStandard.getResponsibleUser()); + LambdaQueryWrapper mpWrapper = new LambdaQueryWrapper<>(); + mpWrapper.eq(LawsStandardMasterPlan::getStandardId, replaceStandard.getId()); + List masterPlanList = masterPlanService.list(mpWrapper); + if (!masterPlanList.isEmpty()) { + // 找到所有类型为1的主计划信息的责任人 + LambdaQueryWrapper sublistWrapper = new LambdaQueryWrapper<>(); + sublistWrapper.eq(LawsStandardMasterPlanSublist::getType, INFORMATION_INPUT); + sublistWrapper.in(LawsStandardMasterPlanSublist::getMasterPlanId, + masterPlanList.stream().map(LawsStandardMasterPlan::getId).collect(Collectors.toList())); + List sublistList = masterPlanSublistService.list(sublistWrapper); + for (LawsStandardMasterPlanSublist sublist : sublistList) { + userIdList.add(sublist.getResponsiblePerson()); + } + } // 获取收藏标准的所有人员 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(LawsStandardCollection::getStandardId, replaceStandard.getId());