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 3b26fbc..3171224 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 @@ -31,6 +31,7 @@ import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; import com.hz.pm.api.projectlib.model.enumeration.GovSystemReplaceTypeEnum; +import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; import com.hz.pm.api.projectlib.model.vo.SystemReplaceInfoVO; @@ -212,17 +213,19 @@ public class WorkbenchManage { if (projects.isEmpty()) { return retDetail; } - retDetail.setTotalApprovalAmount(DecimalUtil.sum(projects, Project::getApprovalAmount)); - retDetail.setTotalReviewAmount(DecimalUtil.sum(projects, Project::getReviewAmount)); - retDetail.setCurrOrgApprovalAmount(DecimalUtil.sum(projects, Project::getApprovalGovOwnFinanceAmount)); - retDetail.setUpperOrgApprovalAmount(DecimalUtil.sum(projects, Project::getApprovalGovSuperiorFinanceAmount)); - List projectIds = CollUtils.fieldList(projects, Project::getId); + List validProjects = CollUtils.filter(projects, w -> !ProjectStatus.STOPPED.eq(w.getStage())); + retDetail.setTotalApprovalAmount(DecimalUtil.sum(validProjects, Project::getApprovalAmount)); + retDetail.setTotalReviewAmount(DecimalUtil.sum(validProjects, Project::getReviewAmount)); + retDetail.setCurrOrgApprovalAmount(DecimalUtil.sum(validProjects, Project::getApprovalGovOwnFinanceAmount)); + retDetail.setUpperOrgApprovalAmount(DecimalUtil.sum(validProjects, Project::getApprovalGovSuperiorFinanceAmount)); + List validProjectIds = CollUtils.fieldList(validProjects, Project::getId); // 合同金额 List contracts = contractService.list(Wrappers.lambdaQuery(Contract.class) .select(Contract::getTotalAmount, Contract::getId) - .in(Contract::getProjectId, projectIds)); + .in(Contract::getProjectId, validProjectIds)); retDetail.setTotalContractAmount(DecimalUtil.sum(contracts, Contract::getTotalAmount)); // 系统替代情况统计 + List projectIds = CollUtils.fieldList(projects, Project::getId); Wrapper pgsriQuery = Wrappers.lambdaQuery(ProjectGovSystemReplaceInfos.class) .in(ProjectGovSystemReplaceInfos::getProjectId, projectIds); List systemReplaceInfos = systemReplaceInfosService.list(pgsriQuery);