From 0ff9949c6a0eed1370282200326f048548fa0eb4 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 29 Apr 2024 10:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=95=B0=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hz/pm/api/workbench/manage/WorkbenchManage.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java index 0cd428d..d0fb800 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java @@ -14,6 +14,7 @@ import com.hz.pm.api.common.statemachine.event.*; import com.hz.pm.api.common.util.DecimalUtil; import com.hz.pm.api.projectdeclared.model.entity.Purchase; import com.hz.pm.api.projectdeclared.service.IPurchaseService; +import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; import com.hz.pm.api.projectlib.handle.AbstractProcessHandle.ProcessNode; @@ -219,7 +220,7 @@ public class WorkbenchManage { public List projectProcessStageStatistics(WorkbenchReq req) { initWorkbenchDefaultParam(req); List retData = new ArrayList<>(); - List projectIds = new ArrayList<>(); + List allVersionProjectIds = new ArrayList<>(); Map purchaseEventMap = new HashMap<>(); ToLongFunction countPurchase = event -> purchaseEventMap.getOrDefault(event.name(), 0L); // 查询完成立项备案的项目 @@ -241,10 +242,12 @@ public class WorkbenchManage { switch (node) { case PROJECT_DECLARED: count = projects.size(); - projectIds.addAll(CollUtils.fieldList(projects, Project::getId)); + for (Project project : projects) { + allVersionProjectIds.addAll(ProjectIdCodeCacheUtil.get(project.getProjectCode())); + } break; case PROJECT_REVIEW: - count = getProjectCount(projectIds, ProjectStateChangeEvent.PROJECT_REVIEW_PASS); + count = getProjectCount(allVersionProjectIds, ProjectStateChangeEvent.PROJECT_REVIEW_PASS); break; case APPROVAL_AMOUNT: count = projects.stream() @@ -253,15 +256,15 @@ public class WorkbenchManage { .count(); break; case PROJECT_APPROVAL: - count = getProjectCount(projectIds, ProjectStateChangeEvent.DECLARED_RECORD_PASS); + count = getProjectCount(allVersionProjectIds, ProjectStateChangeEvent.DECLARED_RECORD_PASS); break; case PROJECT_PURCHASE: count = purchaseService.count(Wrappers.lambdaQuery(Purchase.class) - .in(Purchase::getProjectId, projectIds)); + .in(Purchase::getProjectId, allVersionProjectIds)); if (count > 0) { Wrapper pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) .select(PurchaseStatusChange::getEvent) - .in(PurchaseStatusChange::getProjectId, projectIds) + .in(PurchaseStatusChange::getProjectId, allVersionProjectIds) .in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED, SelfTestStateChangeEvent.SELF_TEST_PASSED, TestValidStateChangeEvent.TEST_VALID_INFO_PASSED,