From 32eb0860abdb7f073c35a5701a1ffd2ecc643340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Fri, 4 Aug 2023 10:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=89=B9=E5=A4=8D=E6=80=BB?= =?UTF-8?q?=E9=87=91=E9=A2=9D=20=E9=A1=B9=E7=9B=AE=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E6=80=BB=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/manage/DashboardProjectManage.java | 35 ++++++++++++++++++---- .../model/vo/DashboardProjectSummaryVO.java | 10 +++++++ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java index cb1cea6..45c7bcc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.dashboard.manage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.pmapi.dashboard.model.basic.QueryTimeYearBO; import com.ningdatech.pmapi.dashboard.model.po.QueryYearPO; @@ -73,8 +74,11 @@ public class DashboardProjectManage { public DashboardProjectSummaryVO getProjectSummary(QueryYearPO queryYearPO) { // 预算年度 Integer year = queryYearPO.getYear(); + String regionCode = queryYearPO.getRegionCode(); List allProjectWithRepeatList = iProjectService.list(Wrappers.lambdaQuery(Project.class) - .eq(Project::getProjectYear, year)); + .eq(Objects.nonNull(year), Project::getProjectYear, year) + .eq(StringUtils.isNotBlank(regionCode), Project::getAreaCode, regionCode) + ); List allProjectList = allProjectWithRepeatList.stream() .filter(r -> r.getNewest()).collect(Collectors.toList()); @@ -92,14 +96,30 @@ public class DashboardProjectManage { // 已立项项目数 Integer approvedProjectCnt = projectCnt - toBeApprovedProjectCnt; + // 项目立项率 + Double projectApprovalRate = new BigDecimal((float) approvedProjectCnt / projectCnt).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + + // 项目申报总金额 + List declareAmountList = allProjectList.stream().filter(r -> Objects.nonNull(r.getDeclareAmount())) + .map(Project::getDeclareAmount). + collect(Collectors.toList()); + BigDecimal declareAmountSum = new BigDecimal("0"); + for (BigDecimal declareAmount : declareAmountList) { + declareAmountSum.add(declareAmount); + } + + // 项目批复总金额 + List approvedTotalInvestmentIncreaseList = allProjectList.stream().filter(r -> Objects.nonNull(r.getApprovedTotalInvestmentIncrease())) + .map(Project::getApprovedTotalInvestmentIncrease) + .collect(Collectors.toList()); + BigDecimal approvedTotalInvestmentIncreaseSum = new BigDecimal("0"); + for (BigDecimal approvedTotalInvestmentIncrease : approvedTotalInvestmentIncreaseList) { + approvedTotalInvestmentIncreaseSum.add(approvedTotalInvestmentIncrease); + } + // 项目画像 -// * 项目立项率 -// * 项目申报总金额 -// * 项目批复总金额 // * 项目采购总金额 // * 资金核定率 -// * 延期项目数 -// * 延期占比 // 延期项目数 延期占比 List projectDelayApplyList = iProjectDelayApplyService @@ -147,6 +167,9 @@ public class DashboardProjectManage { dashboardProjectSummaryVO.setProjectCnt(projectCnt); dashboardProjectSummaryVO.setApprovedProjectCnt(approvedProjectCnt); dashboardProjectSummaryVO.setToBeApprovedProjectCnt(toBeApprovedProjectCnt); + dashboardProjectSummaryVO.setProjectApprovalRate(projectApprovalRate); + dashboardProjectSummaryVO.setDeclareAmountSum(declareAmountSum); + dashboardProjectSummaryVO.setApprovedTotalInvestmentIncreaseSum(approvedTotalInvestmentIncreaseSum); dashboardProjectSummaryVO.setDelayProjectCnt(delayProjectCnt); dashboardProjectSummaryVO.setDelayProportion(delayProportion); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java index 541fdb6..86c75f2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.dashboard.model.vo; +import com.ningdatech.pmapi.common.compare.Compare; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -31,6 +32,15 @@ public class DashboardProjectSummaryVO { @ApiModelProperty("已立项项目数") private Integer approvedProjectCnt; + @ApiModelProperty("项目立项率") + private Double projectApprovalRate; + + @ApiModelProperty("项目申报总金额") + private BigDecimal declareAmountSum; + + @ApiModelProperty("项目批复总金额") + private BigDecimal approvedTotalInvestmentIncreaseSum; + @ApiModelProperty("延期项目数") private Integer delayProjectCnt;