|
|
@@ -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<Project> 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<Project> 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<BigDecimal> 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<BigDecimal> 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<ProjectDelayApply> 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); |
|
|
|