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 64912e7..46b8b93 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 @@ -400,18 +400,21 @@ public class WorkbenchManage { .in(Purchase::getProjectId, allProjectIds); List purchases = purchaseService.list(purchaseQuery); projectPurchaseCountMap.putAll(CollUtils.group(purchases, Purchase::getProjectId)); - int projectCount = CollUtil.count(projectPurchaseCountMap.values(), - w -> CollUtil.allMatch(w, x -> StrUtil.isNotBlank(x.getSupplier()))); - currStat.setProjectCount(projectCount); - Pair systemReplaceCount = countReplaceSystemByProjectIds(projectPurchaseCountMap.keySet()); + List projectIds = projectPurchaseCountMap.entrySet().stream() + .filter(w -> CollUtil.allMatch(w.getValue(), + p -> StrUtil.isNotBlank(p.getSupplier()))) + .map(Map.Entry::getKey) + .collect(Collectors.toList()); + currStat.setProjectCount(projectIds.size()); + Pair systemReplaceCount = countReplaceSystemByProjectIds(projectIds); currStat.setSourceCount(systemReplaceCount.getKey()); currStat.setTargetCount(systemReplaceCount.getValue()); - List projectCodes = CollUtils.convert(projectPurchaseCountMap.keySet(), ProjectIdCodeCacheUtil::get); + List projectCodes = CollUtils.convert(projectIds, ProjectIdCodeCacheUtil::get); currStat.setStoppedCount(stoppedProjectCount(projectStatusChangeMap, projectCodes)); if (!purchases.isEmpty()) { Wrapper pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) .select(PurchaseStatusChange::getEvent, PurchaseStatusChange::getProjectId) - .in(PurchaseStatusChange::getProjectId, allProjectIds) + .in(PurchaseStatusChange::getProjectId, projectIds) .in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED, SelfTestStateChangeEvent.SELF_TEST_PASSED,