From af315ef8fe151ac2fb451fcd99c96d28563350cd Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 19 Apr 2024 14:39:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=A8=E5=B7=A5=E4=BD=9C=E5=8F=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=94=B3=E6=8A=A5=E3=80=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hz/pm/api/workbench/manage/WorkbenchManage.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java index 4b8a874..8ac112b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java @@ -208,6 +208,12 @@ public class WorkbenchManage { return retDetail; } + public long getProjectCount(List projectIds, ProjectStateChangeEvent event) { + return projectStatusChangeService.count(Wrappers.lambdaQuery(ProjectStatusChange.class) + .in(ProjectStatusChange::getProjectId, projectIds) + .eq(ProjectStatusChange::getEvent, event)); + } + public List projectProcessStageStatistics(WorkbenchReq req) { initWorkbenchDefaultParam(req); List retData = new ArrayList<>(); @@ -224,6 +230,9 @@ public class WorkbenchManage { .select(Project::getId) .eq(Project::getProjectYear, req.getProjectYear()) .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)); List projects = projectService.list(query); if (projects.isEmpty()) { @@ -233,17 +242,16 @@ public class WorkbenchManage { projectIds.addAll(CollUtils.fieldList(projects, Project::getId)); break; case PROJECT_REVIEW: - count = 0; + count = getProjectCount(projectIds, ProjectStateChangeEvent.PROJECT_REVIEW_PASS); break; case APPROVAL_AMOUNT: count = projectService.count(Wrappers.lambdaQuery(Project.class) .in(Project::getId, projectIds) + .gt(Project::getApprovalAmount, BigDecimal.ZERO) .isNotNull(Project::getApprovalAmount)); break; 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; case PROJECT_PURCHASE: count = purchaseService.count(Wrappers.lambdaQuery(Purchase.class)