|
@@ -14,6 +14,7 @@ import com.hz.pm.api.common.statemachine.event.*; |
|
|
import com.hz.pm.api.common.util.DecimalUtil; |
|
|
import com.hz.pm.api.common.util.DecimalUtil; |
|
|
import com.hz.pm.api.projectdeclared.model.entity.Purchase; |
|
|
import com.hz.pm.api.projectdeclared.model.entity.Purchase; |
|
|
import com.hz.pm.api.projectdeclared.service.IPurchaseService; |
|
|
import com.hz.pm.api.projectdeclared.service.IPurchaseService; |
|
|
|
|
|
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; |
|
|
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; |
|
|
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; |
|
|
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; |
|
|
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; |
|
|
import com.hz.pm.api.projectlib.handle.AbstractProcessHandle.ProcessNode; |
|
|
import com.hz.pm.api.projectlib.handle.AbstractProcessHandle.ProcessNode; |
|
@@ -219,7 +220,7 @@ public class WorkbenchManage { |
|
|
public List<ProjectProcessStageStatisticsVO> projectProcessStageStatistics(WorkbenchReq req) { |
|
|
public List<ProjectProcessStageStatisticsVO> projectProcessStageStatistics(WorkbenchReq req) { |
|
|
initWorkbenchDefaultParam(req); |
|
|
initWorkbenchDefaultParam(req); |
|
|
List<ProjectProcessStageStatisticsVO> retData = new ArrayList<>(); |
|
|
List<ProjectProcessStageStatisticsVO> retData = new ArrayList<>(); |
|
|
List<Long> projectIds = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<Long> allVersionProjectIds = new ArrayList<>(); |
|
|
Map<String, Long> purchaseEventMap = new HashMap<>(); |
|
|
Map<String, Long> purchaseEventMap = new HashMap<>(); |
|
|
ToLongFunction<AbstractStateChangeEvent> countPurchase = event -> purchaseEventMap.getOrDefault(event.name(), 0L); |
|
|
ToLongFunction<AbstractStateChangeEvent> countPurchase = event -> purchaseEventMap.getOrDefault(event.name(), 0L); |
|
|
// 查询完成立项备案的项目 |
|
|
// 查询完成立项备案的项目 |
|
@@ -241,10 +242,12 @@ public class WorkbenchManage { |
|
|
switch (node) { |
|
|
switch (node) { |
|
|
case PROJECT_DECLARED: |
|
|
case PROJECT_DECLARED: |
|
|
count = projects.size(); |
|
|
count = projects.size(); |
|
|
projectIds.addAll(CollUtils.fieldList(projects, Project::getId)); |
|
|
|
|
|
|
|
|
for (Project project : projects) { |
|
|
|
|
|
allVersionProjectIds.addAll(ProjectIdCodeCacheUtil.get(project.getProjectCode())); |
|
|
|
|
|
} |
|
|
break; |
|
|
break; |
|
|
case PROJECT_REVIEW: |
|
|
case PROJECT_REVIEW: |
|
|
count = getProjectCount(projectIds, ProjectStateChangeEvent.PROJECT_REVIEW_PASS); |
|
|
|
|
|
|
|
|
count = getProjectCount(allVersionProjectIds, ProjectStateChangeEvent.PROJECT_REVIEW_PASS); |
|
|
break; |
|
|
break; |
|
|
case APPROVAL_AMOUNT: |
|
|
case APPROVAL_AMOUNT: |
|
|
count = projects.stream() |
|
|
count = projects.stream() |
|
@@ -253,15 +256,15 @@ public class WorkbenchManage { |
|
|
.count(); |
|
|
.count(); |
|
|
break; |
|
|
break; |
|
|
case PROJECT_APPROVAL: |
|
|
case PROJECT_APPROVAL: |
|
|
count = getProjectCount(projectIds, ProjectStateChangeEvent.DECLARED_RECORD_PASS); |
|
|
|
|
|
|
|
|
count = getProjectCount(allVersionProjectIds, ProjectStateChangeEvent.DECLARED_RECORD_PASS); |
|
|
break; |
|
|
break; |
|
|
case PROJECT_PURCHASE: |
|
|
case PROJECT_PURCHASE: |
|
|
count = purchaseService.count(Wrappers.lambdaQuery(Purchase.class) |
|
|
count = purchaseService.count(Wrappers.lambdaQuery(Purchase.class) |
|
|
.in(Purchase::getProjectId, projectIds)); |
|
|
|
|
|
|
|
|
.in(Purchase::getProjectId, allVersionProjectIds)); |
|
|
if (count > 0) { |
|
|
if (count > 0) { |
|
|
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) |
|
|
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) |
|
|
.select(PurchaseStatusChange::getEvent) |
|
|
.select(PurchaseStatusChange::getEvent) |
|
|
.in(PurchaseStatusChange::getProjectId, projectIds) |
|
|
|
|
|
|
|
|
.in(PurchaseStatusChange::getProjectId, allVersionProjectIds) |
|
|
.in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED, |
|
|
.in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED, |
|
|
SelfTestStateChangeEvent.SELF_TEST_PASSED, |
|
|
SelfTestStateChangeEvent.SELF_TEST_PASSED, |
|
|
TestValidStateChangeEvent.TEST_VALID_INFO_PASSED, |
|
|
TestValidStateChangeEvent.TEST_VALID_INFO_PASSED, |
|
|