|
@@ -332,13 +332,10 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<String> getProjectCodes(Map<String, List<ProjectStatusChange>> projectStatusChanges, |
|
|
public List<String> getProjectCodes(Map<String, List<ProjectStatusChange>> projectStatusChanges, |
|
|
List<String> projectCodes, |
|
|
|
|
|
ProjectStateChangeEvent event) { |
|
|
ProjectStateChangeEvent event) { |
|
|
return projectStatusChanges.entrySet().stream() |
|
|
return projectStatusChanges.entrySet().stream() |
|
|
.filter(w -> projectCodes.contains(w.getKey())) |
|
|
|
|
|
.filter(w -> CollUtil.anyMatch(w.getValue(), w1 -> event.eq(w1.getEvent()))) |
|
|
.filter(w -> CollUtil.anyMatch(w.getValue(), w1 -> event.eq(w1.getEvent()))) |
|
|
.map(Map.Entry::getKey) |
|
|
.map(Map.Entry::getKey) |
|
|
.filter(projectCodes::contains) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -348,7 +345,7 @@ public class WorkbenchManage { |
|
|
return CollUtil.count(projectStatusChanges.entrySet(), w -> { |
|
|
return CollUtil.count(projectStatusChanges.entrySet(), w -> { |
|
|
List<ProjectStatusChange> changes = w.getValue(); |
|
|
List<ProjectStatusChange> changes = w.getValue(); |
|
|
return CollUtil.anyMatch(changes, w1 -> startEvent.eq(w1.getEvent())) |
|
|
return CollUtil.anyMatch(changes, w1 -> startEvent.eq(w1.getEvent())) |
|
|
&& CollUtil.anyMatch(changes, w1 -> !finishEvent.eq(w1.getEvent())); |
|
|
|
|
|
|
|
|
&& CollUtil.allMatch(changes, w1 -> !finishEvent.eq(w1.getEvent())); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -422,8 +419,7 @@ public class WorkbenchManage { |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case PROJECT_REVIEW: { |
|
|
case PROJECT_REVIEW: { |
|
|
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, allProjectCodes, |
|
|
|
|
|
ProjectStateChangeEvent.PROJECT_REVIEW_PASS); |
|
|
|
|
|
|
|
|
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, ProjectStateChangeEvent.PROJECT_REVIEW_PASS); |
|
|
currStat.setProjectCount(projectCodes.size()); |
|
|
currStat.setProjectCount(projectCodes.size()); |
|
|
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes); |
|
|
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes); |
|
|
currStat.setSourceCount(systemReplaceCount.getKey()); |
|
|
currStat.setSourceCount(systemReplaceCount.getKey()); |
|
@@ -454,8 +450,7 @@ public class WorkbenchManage { |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case PROJECT_APPROVAL: { |
|
|
case PROJECT_APPROVAL: { |
|
|
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, allProjectCodes, |
|
|
|
|
|
ProjectStateChangeEvent.DECLARED_RECORD_PASS); |
|
|
|
|
|
|
|
|
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, ProjectStateChangeEvent.DECLARED_RECORD_PASS); |
|
|
currStat.setProjectCount(projectCodes.size()); |
|
|
currStat.setProjectCount(projectCodes.size()); |
|
|
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes); |
|
|
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes); |
|
|
currStat.setSourceCount(systemReplaceCount.getKey()); |
|
|
currStat.setSourceCount(systemReplaceCount.getKey()); |
|
@@ -466,27 +461,21 @@ public class WorkbenchManage { |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case PROJECT_PURCHASE: { |
|
|
case PROJECT_PURCHASE: { |
|
|
Wrapper<Purchase> purchaseQuery = Wrappers.lambdaQuery(Purchase.class) |
|
|
|
|
|
.select(Purchase::getId, Purchase::getProjectId, Purchase::getBidType, |
|
|
|
|
|
Purchase::getStatus, Purchase::getSupplier) |
|
|
|
|
|
.in(Purchase::getProjectId, allProjectIds); |
|
|
|
|
|
List<Purchase> purchases = purchaseService.list(purchaseQuery); |
|
|
|
|
|
projectPurchaseCountMap.putAll(CollUtils.group(purchases, Purchase::getProjectId)); |
|
|
|
|
|
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(projectIds, ProjectIdCodeCacheUtil::get); |
|
|
|
|
|
currStat.setStoppedCount(stoppedProjectCount(projectStatusChangeMap, projectCodes)); |
|
|
|
|
|
if (!projectIds.isEmpty()) { |
|
|
|
|
|
|
|
|
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, ProjectStateChangeEvent.SUBMIT_PURCHASE_CONTRACT_RECORD); |
|
|
|
|
|
currStat.setProjectCount(projectCodes.size()); |
|
|
|
|
|
if (!projectCodes.isEmpty()) { |
|
|
|
|
|
Wrapper<Purchase> purchaseQuery = Wrappers.lambdaQuery(Purchase.class) |
|
|
|
|
|
.select(Purchase::getId, Purchase::getProjectId, Purchase::getBidType, Purchase::getStatus) |
|
|
|
|
|
.in(Purchase::getProjectId, allProjectIds); |
|
|
|
|
|
List<Purchase> purchases = purchaseService.list(purchaseQuery); |
|
|
|
|
|
projectPurchaseCountMap.putAll(CollUtils.group(purchases, Purchase::getProjectId)); |
|
|
|
|
|
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes); |
|
|
|
|
|
currStat.setSourceCount(systemReplaceCount.getKey()); |
|
|
|
|
|
currStat.setTargetCount(systemReplaceCount.getValue()); |
|
|
|
|
|
currStat.setStoppedCount(stoppedProjectCount(projectStatusChangeMap, projectCodes)); |
|
|
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) |
|
|
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) |
|
|
.select(PurchaseStatusChange::getEvent, PurchaseStatusChange::getProjectId) |
|
|
.select(PurchaseStatusChange::getEvent, PurchaseStatusChange::getProjectId) |
|
|
.in(PurchaseStatusChange::getProjectId, projectIds) |
|
|
|
|
|
|
|
|
.in(PurchaseStatusChange::getBidId, CollUtils.fieldList(purchases, Purchase::getId)) |
|
|
.in(PurchaseStatusChange::getEvent, |
|
|
.in(PurchaseStatusChange::getEvent, |
|
|
ADAPT_INFO_PASSED, |
|
|
ADAPT_INFO_PASSED, |
|
|
SELF_TEST_PASSED, |
|
|
SELF_TEST_PASSED, |
|
|