|
|
@@ -400,18 +400,21 @@ public class WorkbenchManage { |
|
|
|
.in(Purchase::getProjectId, allProjectIds); |
|
|
|
List<Purchase> 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<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectIds(projectPurchaseCountMap.keySet()); |
|
|
|
List<Long> 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<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectIds(projectIds); |
|
|
|
currStat.setSourceCount(systemReplaceCount.getKey()); |
|
|
|
currStat.setTargetCount(systemReplaceCount.getValue()); |
|
|
|
List<String> projectCodes = CollUtils.convert(projectPurchaseCountMap.keySet(), ProjectIdCodeCacheUtil::get); |
|
|
|
List<String> projectCodes = CollUtils.convert(projectIds, ProjectIdCodeCacheUtil::get); |
|
|
|
currStat.setStoppedCount(stoppedProjectCount(projectStatusChangeMap, projectCodes)); |
|
|
|
if (!purchases.isEmpty()) { |
|
|
|
Wrapper<PurchaseStatusChange> 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, |
|
|
|