From ce236c55801457be62c8634fde0d58dcce6d62e9 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 12 Apr 2024 15:17:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=8A=B6=E6=80=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handle/stage/FinalInspectionHandle.java | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/FinalInspectionHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/FinalInspectionHandle.java index 6735240..ab35d14 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/FinalInspectionHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/FinalInspectionHandle.java @@ -2,12 +2,9 @@ package com.hz.pm.api.projectlib.handle.stage; import com.hz.pm.api.projectdeclared.model.entity.Purchase; import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst; -import com.hz.pm.api.projectdeclared.service.IPurchaseInstService; import com.hz.pm.api.projectlib.handle.AbstractProcessHandle; import com.hz.pm.api.projectlib.handle.HandleParamContext; import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; -import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus; -import com.hz.pm.api.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.vo.ProcessDetailVO; import com.wflow.workflow.bean.vo.ProcessInfoVO; import com.wflow.workflow.bean.vo.ProcessProgressVo; @@ -33,9 +30,7 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class FinalInspectionHandle extends AbstractProcessHandle { - private final IPurchaseInstService purchaseInstService; private final ProcessInstanceService processInstanceService; - private final BuildUserUtils buildUserUtils; @Override public ProcessNode getProcessNode() { @@ -45,35 +40,37 @@ public class FinalInspectionHandle extends AbstractProcessHandle { @Override public void handle(HandleParamContext ctx) { ProcessDetailVO detail = new ProcessDetailVO(); - ctx.getProcessDetails().add(detail); detail.setProcessName(getProcessNode().getName()); if (!ctx.getPreStepStatus().equals(StepStatusEnum.COMPLETED)) { detail.setStepStatus(StepStatusEnum.NOT_START); } else { List purchases = ctx.getPurchases(); Map purchaseMap = purchases.stream() - .filter(w -> TenderStatus.FINALLY_INSPECTED_FAILED.eq(w.getStatus()) - || TenderStatus.FINALLY_INSPECTED_PASSED.eq(w.getStatus()) - || TenderStatus.ON_FINALLY_INSPECTED_APPLY.eq(w.getStatus())) .collect(Collectors.toMap(Purchase::getId, Function.identity())); StepStatusEnum stepStatus; if (purchaseMap.isEmpty()) { stepStatus = StepStatusEnum.NOT_START; } else { List processes = new ArrayList<>(); - Map instMap = purchaseInstService.list(purchaseMap.keySet(), InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()); + Map instMap = getPurchaseInstMap(ctx.getPurchaseInstList(), + purchaseMap.keySet(), InstTypeEnum.PROJECT_FINAL_INSPECTION); instMap.forEach((bidId, inst) -> { if (detail.getFinishTime() == null || detail.getFinishTime().isBefore(inst.getCreateOn())) { detail.setFinishTime(inst.getCreateOn()); } - ProcessProgressVo instanceDetail = processInstanceService.getProgressInstanceDetail(null, inst.getInstCode()); + ProcessProgressVo instDetail = processInstanceService.getProgressInstanceDetail(null, inst.getInstCode()); ProcessInfoVO tenderProgress = new ProcessInfoVO(); tenderProgress.setProcessName(purchaseMap.get(bidId).getBidName()); - tenderProgress.setProcessProgressVo(instanceDetail); + tenderProgress.setProcessProgressVo(instDetail); processes.add(tenderProgress); }); - stepStatus = getPurchaseStatus(processes); + if (instMap.size() != purchases.size()) { + stepStatus = StepStatusEnum.NOT_START; + } else { + stepStatus = getPurchaseStatus(processes); + } if (stepStatus != StepStatusEnum.NOT_START) { + ctx.getProcessDetails().add(detail); detail.setProcessInfoList(processes); } }