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,