Browse Source

modify:

1. 首页标段数量统计异常修复;
tags/24080901
WendyYang 4 months ago
parent
commit
8971a386b6
1 changed files with 13 additions and 12 deletions
  1. +13
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java

+ 13
- 12
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java View File

@@ -60,6 +60,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.function.ToLongBiFunction;
import java.util.function.ToLongFunction;
import java.util.stream.Collectors;

@@ -227,12 +228,12 @@ public class WorkbenchManage {
Map<Long, Long> projBizMap = purchaseEventMap.getOrDefault(event.name(), Collections.emptyMap());
return projBizMap.values().stream().mapToLong(l -> l).sum();
};
ToLongFunction<AbstractStateChangeEvent> countProject = event -> {
ToLongBiFunction<AbstractStateChangeEvent, ProcessNode> countProject = (event, node) -> {
Map<Long, Long> projBizMap = purchaseEventMap.getOrDefault(event.name(), Collections.emptyMap());
if (event.name().equals(ProcessNode.PROJECT_ADAPTION.name())
|| event.name().equals(ProcessNode.SYSTEM_SELF_TEST.name())
|| event.name().equals(ProcessNode.SYSTEM_TEST_VALID.name())
|| event.name().equals(ProcessNode.XCFHX_REVIEW.name())) {
if (node.equals(ProcessNode.PROJECT_ADAPTION)
|| node.equals(ProcessNode.SYSTEM_SELF_TEST)
|| node.equals(ProcessNode.SYSTEM_TEST_VALID)
|| node.equals(ProcessNode.XCFHX_REVIEW)) {
return projBizMap.size();
} else {
return projectPurchaseCountMap.entrySet().stream().filter(w -> {
@@ -284,7 +285,7 @@ public class WorkbenchManage {
projectCount = projectPurchaseCountMap.size();
if (bidCount > 0) {
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class)
.select(PurchaseStatusChange::getEvent)
.select(PurchaseStatusChange::getEvent,PurchaseStatusChange::getProjectId)
.in(PurchaseStatusChange::getProjectId, allVersionProjectIds)
.in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED,
SelfTestStateChangeEvent.SELF_TEST_PASSED,
@@ -302,29 +303,29 @@ public class WorkbenchManage {
break;
case PROJECT_ADAPTION:
bidCount = countPurchase.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED);
projectCount = countProject.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED);
projectCount = countProject.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED, node);
break;
case SYSTEM_SELF_TEST:
bidCount = countPurchase.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED);
projectCount = countProject.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED);
projectCount = countProject.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED, node);
break;
case SYSTEM_TEST_VALID:
bidCount = countPurchase.applyAsLong(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED);
projectCount = countProject.applyAsLong(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED);
projectCount = countProject.applyAsLong(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED, node);
break;
case FIRST_INSPECTED:
case PILOT_RUNNING:
// 初验试运行数量同步
bidCount = countPurchase.applyAsLong(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES);
projectCount = countProject.applyAsLong(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES);
projectCount = countProject.applyAsLong(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES, node);
break;
case XCFHX_REVIEW:
bidCount = countPurchase.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED);
projectCount = countProject.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED);
projectCount = countProject.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED, node);
break;
case FINAL_INSPECTED:
bidCount = countPurchase.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED);
projectCount = countProject.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED);
projectCount = countProject.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED, node);
break;
default:
break;


Loading…
Cancel
Save