|
|
@ -976,60 +976,116 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
//根据改革所属任务或行政区返回统计结果
|
|
|
|
@Override |
|
|
|
public CountByConditionOV countByReformName(String reformName) { |
|
|
|
public CountByConditionOV countByCondition(String condition) { |
|
|
|
HuzhouProjectinfo projectInfo = new HuzhouProjectinfo(); |
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
|
List<HuzhouProjectinfoOV> projectinfoOVList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); |
|
|
|
List<String> allProjectIds = projectinfoOVList.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
Map<String, List<HuzhouProjectinfoOV>> reformMap = projectinfoOVList.stream().collect(Collectors.groupingBy(HuzhouProjectinfo::getReformName)); |
|
|
|
//总进度(待补充)
|
|
|
|
Map<String, List<HuzhouProjectinfoOV>> conditionMap=new HashMap<>(); |
|
|
|
Map<String, String> reformTasks = dictService.selectByDictType("reformTasks").stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getLabel())); |
|
|
|
if(Objects.equals(condition, "reformName")){ |
|
|
|
conditionMap = projectinfoOVList.stream().collect(Collectors.groupingBy(HuzhouProjectinfo::getReformName)); |
|
|
|
}else { |
|
|
|
conditionMap = projectinfoOVList.stream().collect(Collectors.groupingBy(HuzhouProjectinfo::getAdminDivision)); |
|
|
|
} |
|
|
|
//总进度
|
|
|
|
String projectProgress = this.getProgress(allProjectIds).getProjectProgress(); |
|
|
|
TotalProgressOV totalProgress = this.countNumByPlan(allProjectIds); |
|
|
|
totalProgress.setProgress(projectProgress); |
|
|
|
|
|
|
|
List<ProjectProgressOV> progressResponse = new ArrayList<>(); |
|
|
|
List<FundByConditionOV> fundByConditionResponse = new ArrayList<>(); |
|
|
|
for (String key : reformMap.keySet()) { |
|
|
|
List<String> keyProjectIdsList = reformMap.get(key).stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
for (String key : conditionMap.keySet()) { |
|
|
|
List<String> keyProjectIdsList = conditionMap.get(key).stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
//进度
|
|
|
|
ProjectProgressOV progress = this.getProgress(keyProjectIdsList); |
|
|
|
progressResponse.add(ProjectProgressOV.builder().name(key).projectProgress(String.valueOf(progress.getProjectProgress())).build()); |
|
|
|
if(Objects.equals(condition, "reformName")){ |
|
|
|
progressResponse.add(ProjectProgressOV.builder().name(reformTasks.get(key)).projectProgress(String.valueOf(progress.getProjectProgress())).build()); |
|
|
|
}else { |
|
|
|
progressResponse.add(ProjectProgressOV.builder().name(key).projectProgress(String.valueOf(progress.getProjectProgress())).build()); |
|
|
|
} |
|
|
|
|
|
|
|
//所属改革总金额、执行率、上级资金执行率
|
|
|
|
NewFundOV fund = this.getFund(keyProjectIdsList); |
|
|
|
fundByConditionResponse.add(FundByConditionOV.builder().name(key).totalMoney(fund.getTotalMoney()) |
|
|
|
.paymentExecutionRate(fund.getPaymentExecutionRate()) |
|
|
|
.superiorFundExecutionRate(fund.getSuperiorFundExecutionRate()).build()); |
|
|
|
if(Objects.equals(condition, "reformName")){ |
|
|
|
fundByConditionResponse.add(FundByConditionOV.builder().name(reformTasks.get(key)).totalMoney(fund.getTotalMoney()) |
|
|
|
.paymentExecutionRate(fund.getPaymentExecutionRate()) |
|
|
|
.superiorFundExecutionRate(fund.getSuperiorFundExecutionRate()).build()); |
|
|
|
}else{ |
|
|
|
fundByConditionResponse.add(FundByConditionOV.builder().name(key).totalMoney(fund.getTotalMoney()) |
|
|
|
.paymentExecutionRate(fund.getPaymentExecutionRate()) |
|
|
|
.superiorFundExecutionRate(fund.getSuperiorFundExecutionRate()).build()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//各种类资金总额和执行率,from fund
|
|
|
|
NewFundOV totalFund = this.getFund(allProjectIds); |
|
|
|
FundByKindOV fundByTypeResponse = FundByKindOV.builder().totalMoney(totalFund.getTotalMoney()).payAmount(totalFund.getPayAmount()) |
|
|
|
.paymentExecutionRate(totalFund.getPaymentExecutionRate()) |
|
|
|
.totalCentral(totalFund.getTotalCentral()).payCentral(totalFund.getPayCentral()) |
|
|
|
.payCentralExecutionRate(totalFund.getPayCentralExecutionRate()) |
|
|
|
.totalProvincial(totalFund.getTotalProvincial()).payProvincial(totalFund.getPayProvincial()) |
|
|
|
.payProvincialExecutionRate(totalFund.getPayProvincialExecutionRate()) |
|
|
|
.totalCity(totalFund.getTotalCity()).payCity(totalFund.getPayCity()) |
|
|
|
.payCityExecutionRate(totalFund.getPayCityExecutionRate()) |
|
|
|
.totalCounty(totalFund.getTotalCounty()).payCounty(totalFund.getPayCounty()) |
|
|
|
.payCountyExecutionRate(totalFund.getPayCountyExecutionRate()) |
|
|
|
.totalSelf(totalFund.getTotalSelf()).paySelf(totalFund.getPaySelf()) |
|
|
|
.paySelfExecutionRate(totalFund.getPaySelfExecutionRate()) |
|
|
|
.build(); |
|
|
|
|
|
|
|
CountByConditionOV result = CountByConditionOV.builder().progress(progressResponse) |
|
|
|
FundByKindOV fundByTypeResponse = this.modelChange(totalFund); |
|
|
|
CountByConditionOV result = CountByConditionOV.builder().totalProgress(totalProgress).progress(progressResponse) |
|
|
|
.countFundByCondition(fundByConditionResponse).countFundByFundType(fundByTypeResponse).build(); |
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Map<String,String> countNumByPlan(){ |
|
|
|
List<String> planName=new ArrayList<>(); |
|
|
|
planName.add("合同签订"); |
|
|
|
planName.add("终验阶段"); |
|
|
|
@Override |
|
|
|
public CountBoardOV showCountBoard() { |
|
|
|
HuzhouProjectinfo projectInfo = new HuzhouProjectinfo(); |
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
|
List<HuzhouProjectinfoOV> projectinfoOVList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); |
|
|
|
List<String> projectIds = projectinfoOVList.stream().map(x -> x.getId()).collect(Collectors.toList()); |
|
|
|
//项目数量统计by type
|
|
|
|
Map<String, NumByTypeOV> numByType = projectinfoMapper.getNumByType(projectInfoAuthSelect).stream() |
|
|
|
.collect(Collectors.toMap(x -> x.getType(), o -> o)); |
|
|
|
int total=projectIds.size(); |
|
|
|
int ptNum=0; |
|
|
|
int rkNum=0; |
|
|
|
ptNum=numByType.get("1").getNum(); |
|
|
|
rkNum=numByType.get("2").getNum(); |
|
|
|
CountBoardOV result = CountBoardOV.builder().total(String.valueOf(total)).ptNum(String.valueOf(ptNum)).rkNum(String.valueOf(rkNum)).build(); |
|
|
|
//项目总进度
|
|
|
|
TotalProgressOV totalProgress = this.countNumByPlan(projectIds); |
|
|
|
String projectProgress = this.getProgress(projectIds).getProjectProgress(); |
|
|
|
totalProgress.setProgress(projectProgress); |
|
|
|
////各种类资金总额和执行率
|
|
|
|
NewFundOV totalFund = this.getFund(projectIds); |
|
|
|
FundByKindOV fundByTypeResponse = this.modelChange(totalFund); |
|
|
|
result.setTotalProgress(totalProgress).setCountFundByFundType(fundByTypeResponse); |
|
|
|
return result; |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public TotalProgressOV countNumByPlan(List<String> projectIds) { |
|
|
|
List<String> planName = new ArrayList<>(); |
|
|
|
planName.add("合同签订"); |
|
|
|
planName.add("终验阶段"); |
|
|
|
int notStartedNum = 0; |
|
|
|
int purchasedNum = 0; |
|
|
|
int finishNum = 0; |
|
|
|
if (projectIds.size() > 0) { |
|
|
|
notStartedNum = projectIds.size() - planinfoService.getStartedProjectNum(projectIds); |
|
|
|
purchasedNum = planinfoService.getNumByPlan(projectIds, planName.get(0)); |
|
|
|
finishNum = planinfoService.getNumByPlan(projectIds, planName.get(1)); |
|
|
|
} |
|
|
|
TotalProgressOV result = TotalProgressOV.builder().notStartedNum(String.valueOf(notStartedNum)) |
|
|
|
.purchasedNum(String.valueOf(purchasedNum)).finishNum(String.valueOf(finishNum)).build(); |
|
|
|
return result; |
|
|
|
} |
|
|
|
public FundByKindOV modelChange(NewFundOV newfundOV){ |
|
|
|
FundByKindOV fundByTypeResponse = FundByKindOV.builder().totalMoney(newfundOV.getTotalMoney()).payAmount(newfundOV.getPayAmount()) |
|
|
|
.paymentExecutionRate(newfundOV.getPaymentExecutionRate()) |
|
|
|
.totalCentral(newfundOV.getTotalCentral()).payCentral(newfundOV.getPayCentral()) |
|
|
|
.payCentralExecutionRate(newfundOV.getPayCentralExecutionRate()) |
|
|
|
.totalProvincial(newfundOV.getTotalProvincial()).payProvincial(newfundOV.getPayProvincial()) |
|
|
|
.payProvincialExecutionRate(newfundOV.getPayProvincialExecutionRate()) |
|
|
|
.totalCity(newfundOV.getTotalCity()).payCity(newfundOV.getPayCity()) |
|
|
|
.payCityExecutionRate(newfundOV.getPayCityExecutionRate()) |
|
|
|
.totalCounty(newfundOV.getTotalCounty()).payCounty(newfundOV.getPayCounty()) |
|
|
|
.payCountyExecutionRate(newfundOV.getPayCountyExecutionRate()) |
|
|
|
.totalSelf(newfundOV.getTotalSelf()).paySelf(newfundOV.getPaySelf()) |
|
|
|
.paySelfExecutionRate(newfundOV.getPaySelfExecutionRate()) |
|
|
|
.build(); |
|
|
|
return fundByTypeResponse; |
|
|
|
} |
|
|
|
} |
|
|
|