Parcourir la source

modify:

1. 首页统计修改;
tags/24082601
WendyYang il y a 2 mois
Parent
révision
de8e5deeed
1 fichiers modifiés avec 9 ajouts et 6 suppressions
  1. +9
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java

+ 9
- 6
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java Voir le fichier

@@ -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,


Chargement…
Annuler
Enregistrer