Browse Source

补全工作台项目申报、评审数据统计

tags/24080901
WendyYang 8 months ago
parent
commit
af315ef8fe
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java

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

@@ -208,6 +208,12 @@ public class WorkbenchManage {
return retDetail; return retDetail;
} }


public long getProjectCount(List<Long> projectIds, ProjectStateChangeEvent event) {
return projectStatusChangeService.count(Wrappers.lambdaQuery(ProjectStatusChange.class)
.in(ProjectStatusChange::getProjectId, projectIds)
.eq(ProjectStatusChange::getEvent, event));
}

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<>();
@@ -224,6 +230,9 @@ public class WorkbenchManage {
.select(Project::getId) .select(Project::getId)
.eq(Project::getProjectYear, req.getProjectYear()) .eq(Project::getProjectYear, req.getProjectYear())
.eq(Project::getNewest, Boolean.TRUE) .eq(Project::getNewest, Boolean.TRUE)
.exists("select 1 from nd_project_status_change npsc " +
"where npsc.project_code = nd_project.project_code and " +
"npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS)
.in(Project::getBuildOrgCode, CollUtils.convert(viewUnitIds, String::valueOf)); .in(Project::getBuildOrgCode, CollUtils.convert(viewUnitIds, String::valueOf));
List<Project> projects = projectService.list(query); List<Project> projects = projectService.list(query);
if (projects.isEmpty()) { if (projects.isEmpty()) {
@@ -233,17 +242,16 @@ public class WorkbenchManage {
projectIds.addAll(CollUtils.fieldList(projects, Project::getId)); projectIds.addAll(CollUtils.fieldList(projects, Project::getId));
break; break;
case PROJECT_REVIEW: case PROJECT_REVIEW:
count = 0;
count = getProjectCount(projectIds, ProjectStateChangeEvent.PROJECT_REVIEW_PASS);
break; break;
case APPROVAL_AMOUNT: case APPROVAL_AMOUNT:
count = projectService.count(Wrappers.lambdaQuery(Project.class) count = projectService.count(Wrappers.lambdaQuery(Project.class)
.in(Project::getId, projectIds) .in(Project::getId, projectIds)
.gt(Project::getApprovalAmount, BigDecimal.ZERO)
.isNotNull(Project::getApprovalAmount)); .isNotNull(Project::getApprovalAmount));
break; break;
case PROJECT_APPROVAL: case PROJECT_APPROVAL:
count = projectStatusChangeService.count(Wrappers.lambdaQuery(ProjectStatusChange.class)
.in(ProjectStatusChange::getProjectId, projectIds)
.eq(ProjectStatusChange::getEvent, ProjectStateChangeEvent.DECLARED_RECORD_PASS));
count = getProjectCount(projectIds, 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)


Loading…
Cancel
Save