Selaa lähdekoodia

统计

tags/24080901
PoffyZhang 1 vuosi sitten
vanhempi
commit
66101f7312
2 muutettua tiedostoa jossa 77 lisäystä ja 55 poistoa
  1. +49
    -35
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/FundStatisticsManage.java
  2. +28
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java

+ 49
- 35
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/FundStatisticsManage.java Näytä tiedosto

@@ -156,28 +156,32 @@ public class FundStatisticsManage {
FundStatisticsVO.HeJianAmount heJianAmount = new FundStatisticsVO.HeJianAmount();

//申报的申报金额(申报项目:初步方案申报金额 项目归集:项目总投资)
BigDecimal declaredAmountApprove = projects.stream().map(p -> {
final BigDecimal[] declaredAmountApprove = {BigDecimal.ZERO};
projects.stream().map(p -> {
BigDecimal declareAmount = Objects.nonNull(p.getDeclareAmount()) ?
p.getDeclareAmount() : BigDecimal.ZERO;
return declareAmount;
}).reduce(BigDecimal::add).get();
BigDecimal declaredAmountApproveGov = applies.stream().map(g -> {
}).reduce(BigDecimal::add).ifPresent(b -> declaredAmountApprove[0] = b);
final BigDecimal[] declaredAmountApproveGov = {BigDecimal.ZERO};
applies.stream().map(g -> {
BigDecimal totalAmount = Objects.nonNull(g.getBaseProjTotalAmount()) ? g.getBaseProjTotalAmount() : BigDecimal.ZERO;
return totalAmount;
}).reduce(BigDecimal::add).get();
BigDecimal declaredAmountApproveTotal = declaredAmountApprove.add(declaredAmountApproveGov);
}).reduce(BigDecimal::add).ifPresent(b -> declaredAmountApproveGov[0] = b);
BigDecimal declaredAmountApproveTotal = declaredAmountApprove[0].add(declaredAmountApproveGov[0]);
heJianAmount.setApprove(declaredAmountApproveTotal);

//申报的批复金额(申报项目:建设方案申报金额 项目归集:建议总投资)
BigDecimal approvalAmountApprove = projects.stream().map(p -> {
final BigDecimal[] approvalAmountApprove = {BigDecimal.ZERO};
projects.stream().map(p -> {
BigDecimal declareAmount = Objects.nonNull(p.getApprovalAmount()) ? p.getApprovalAmount() : BigDecimal.ZERO;
return declareAmount;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApproveGov = approves.stream().map(p -> {
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApprove[0] = b);
final BigDecimal[] approvalAmountApproveGov = {BigDecimal.ZERO};
approves.stream().map(p -> {
BigDecimal expertTotalMoney = Objects.nonNull(p.getBaseExpertTotalMoney()) ? p.getBaseExpertTotalMoney() : BigDecimal.ZERO;
return expertTotalMoney;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApproveTotal = approvalAmountApprove.add(approvalAmountApproveGov);
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApproveGov[0] = b);
BigDecimal approvalAmountApproveTotal = approvalAmountApprove[0].add(approvalAmountApproveGov[0]);
heJianAmount.setApproval(approvalAmountApproveTotal);
//申报的差额
BigDecimal subtractApprove = declaredAmountApproveTotal.subtract(approvalAmountApproveTotal);
@@ -191,15 +195,17 @@ public class FundStatisticsManage {
FundStatisticsVO.HeJianAmount approvalHejian = new FundStatisticsVO.HeJianAmount();
approvalHejian.setApprove(approvalAmountApproveTotal);
//批复的批复金额(申报项目:归集信息建议批复总投资 项目归集:建议批复总投资)
BigDecimal approvalAmountApproval = projects.stream().map(p -> {
final BigDecimal[] approvalAmountApproval = {BigDecimal.ZERO};
projects.stream().map(p -> {
BigDecimal proposeTotalInvest = Objects.nonNull(p.getProposeTotalInvest()) ? p.getProposeTotalInvest() : BigDecimal.ZERO;
return proposeTotalInvest;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApprovalGov = approves.stream().map(p -> {
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApproval[0] = b);
final BigDecimal[] approvalAmountApprovalGov = {BigDecimal.ZERO};
approves.stream().map(p -> {
BigDecimal reviewTotalMoney = Objects.nonNull(p.getBaseInitialReviewTotalMoney()) ? p.getBaseInitialReviewTotalMoney() : BigDecimal.ZERO;
return reviewTotalMoney;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApprovalTotal = approvalAmountApproval.add(approvalAmountApprovalGov);
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApprovalGov[0] = b);
BigDecimal approvalAmountApprovalTotal = approvalAmountApproval[0].add(approvalAmountApprovalGov[0]);
approvalHejian.setApproval(approvalAmountApprovalTotal);
//批复的差额
BigDecimal subtractApproval = approvalAmountApproveTotal.subtract(approvalAmountApprovalTotal);
@@ -213,16 +219,18 @@ public class FundStatisticsManage {
FundStatisticsVO.HeJianAmount contractHejian = new FundStatisticsVO.HeJianAmount();
contractHejian.setApprove(approvalAmountApprovalTotal);
//合同的批复金额(申报项目:成交金额 项目归集:成交金额)
BigDecimal approvalAmountContract = projects.stream().map(p -> {
final BigDecimal[] approvalAmountContract = {BigDecimal.ZERO};
projects.stream().map(p -> {
BigDecimal transactionAmount = Objects.nonNull(p.getTransactionAmount()) ? p.getTransactionAmount() : BigDecimal.ZERO;
return transactionAmount;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountContractGov = procures.stream().map(p -> {
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountContract[0] = b);
final BigDecimal[] approvalAmountContractGov = {BigDecimal.ZERO};
procures.stream().map(p -> {
BigDecimal purchaseAmount = Objects.nonNull(p.getBaseProjPurchaseAmount()) ?
p.getBaseProjPurchaseAmount() : BigDecimal.ZERO;
return purchaseAmount;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountContractTotal = approvalAmountContract.add(approvalAmountContractGov);
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountContractGov[0] = b);
BigDecimal approvalAmountContractTotal = approvalAmountContract[0].add(approvalAmountContractGov[0]);
contractHejian.setApproval(approvalAmountContractTotal);
//合同的差额
BigDecimal subtractContract = approvalAmountApprovalTotal.subtract(approvalAmountContractTotal);
@@ -349,29 +357,35 @@ public class FundStatisticsManage {
}
//2
//2.1 总申请金额
BigDecimal declaredTotalAmount = projects.stream()
final BigDecimal[] declaredTotalAmount = {BigDecimal.ZERO};
projects.stream()
.map(p -> Objects.nonNull(p.getDeclareAmount()) ? p.getDeclareAmount() : BigDecimal.ZERO)
.reduce(BigDecimal::add).get();
BigDecimal declaredTotalAmountGov = applies.stream()
.reduce(BigDecimal::add).ifPresent(b -> declaredTotalAmount[0] = b);
final BigDecimal[] declaredTotalAmountGov = {BigDecimal.ZERO};
applies.stream()
.map(a -> Objects.nonNull(a.getBaseProjTotalAmount()) ? a.getBaseProjTotalAmount() : BigDecimal.ZERO)
.reduce(BigDecimal::add).get();
res.setDeclaredTotalAmount(declaredTotalAmount.add(declaredTotalAmountGov));
.reduce(BigDecimal::add).ifPresent(b -> declaredTotalAmountGov[0] = b);
res.setDeclaredTotalAmount(declaredTotalAmount[0].add(declaredTotalAmountGov[0]));
//2.2 总批复金额
BigDecimal approvalTotalAmount = projects.stream()
final BigDecimal[] approvalTotalAmount = {BigDecimal.ZERO};
projects.stream()
.map(p -> Objects.nonNull(p.getApprovalAmount()) ? p.getApprovalAmount() : BigDecimal.ZERO)
.reduce(BigDecimal::add).get();
BigDecimal approvalTotalAmountGov = approves.stream()
.reduce(BigDecimal::add).ifPresent(b -> approvalTotalAmount[0] = b);
final BigDecimal[] approvalTotalAmountGov = {BigDecimal.ZERO};
approves.stream()
.map(a -> Objects.nonNull(a.getBaseExpertTotalMoney()) ? a.getBaseExpertTotalMoney() : BigDecimal.ZERO)
.reduce(BigDecimal::add).get();
res.setApprovalTotalAmount(approvalTotalAmount.add(approvalTotalAmountGov));
.reduce(BigDecimal::add).ifPresent(b -> approvalTotalAmountGov[0] = b);
res.setApprovalTotalAmount(approvalTotalAmount[0].add(approvalTotalAmountGov[0]));
//2.3 总合同金额
BigDecimal contractTotalAmount = projects.stream()
final BigDecimal[] contractTotalAmount = {BigDecimal.ZERO};
projects.stream()
.map(p -> Objects.nonNull(p.getContractAmount()) ? p.getContractAmount() : BigDecimal.ZERO)
.reduce(BigDecimal::add).get();
BigDecimal contractTotalAmountGov = procures.stream()
.reduce(BigDecimal::add).ifPresent(b -> contractTotalAmount[0] = b);
final BigDecimal[] contractTotalAmountGov = {BigDecimal.ZERO};
procures.stream()
.map(p -> Objects.nonNull(p.getBaseProjPurchaseAmount()) ? p.getBaseProjPurchaseAmount() : BigDecimal.ZERO)
.reduce(BigDecimal::add).get();
res.setApprovalTotalAmount(contractTotalAmount.add(contractTotalAmountGov));
.reduce(BigDecimal::add).ifPresent(b -> contractTotalAmountGov[0] = b);
res.setApprovalTotalAmount(contractTotalAmount[0].add(contractTotalAmountGov[0]));

//计划核减
FundStatisticsVO.HeJianAmount planHejian = computePlanHeJian(projects,applies,approves);


+ 28
- 20
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java Näytä tiedosto

@@ -697,28 +697,32 @@ public class CockpitStatsStatisticsTask {
}).collect(Collectors.toList());

//申报的申报金额(申报项目:初步方案申报金额 项目归集:项目总投资)
BigDecimal declaredAmountApprove = normalProjects.stream().map(p -> {
final BigDecimal[] declaredAmountApprove = {BigDecimal.ZERO};
normalProjects.stream().map(p -> {
BigDecimal declareAmount = Objects.nonNull(p.getDeclareAmount()) ?
p.getDeclareAmount() : BigDecimal.ZERO;
return declareAmount;
}).reduce(BigDecimal::add).get();
BigDecimal declaredAmountApproveGov = applies.stream().map(g -> {
}).reduce(BigDecimal::add).ifPresent(b -> declaredAmountApprove[0] = b);
final BigDecimal[] declaredAmountApproveGov = {BigDecimal.ZERO};
applies.stream().map(g -> {
BigDecimal totalAmount = Objects.nonNull(g.getBaseProjTotalAmount()) ? g.getBaseProjTotalAmount() : BigDecimal.ZERO;
return totalAmount;
}).reduce(BigDecimal::add).get();
BigDecimal declaredAmountApproveTotal = declaredAmountApprove.add(declaredAmountApproveGov);
}).reduce(BigDecimal::add).ifPresent(b -> declaredAmountApproveGov[0] = b);
BigDecimal declaredAmountApproveTotal = declaredAmountApprove[0].add(declaredAmountApproveGov[0]);
cockpitStats.setDeclaredAmountApprove(declaredAmountApproveTotal);

//申报的批复金额(申报项目:建设方案申报金额 项目归集:建议总投资)
BigDecimal approvalAmountApprove = normalProjects.stream().map(p -> {
final BigDecimal[] approvalAmountApprove = {BigDecimal.ZERO};
normalProjects.stream().map(p -> {
BigDecimal declareAmount = Objects.nonNull(p.getApprovalAmount()) ? p.getApprovalAmount() : BigDecimal.ZERO;
return declareAmount;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApproveGov = approves.stream().map(p -> {
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApprove[0] = b);
final BigDecimal[] approvalAmountApproveGov = {BigDecimal.ZERO};
approves.stream().map(p -> {
BigDecimal expertTotalMoney = Objects.nonNull(p.getBaseExpertTotalMoney()) ? p.getBaseExpertTotalMoney() : BigDecimal.ZERO;
return expertTotalMoney;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApproveTotal = approvalAmountApprove.add(approvalAmountApproveGov);
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApproveGov[0] = b);
BigDecimal approvalAmountApproveTotal = approvalAmountApprove[0].add(approvalAmountApproveGov[0]);
cockpitStats.setApprovalAmountApprove(approvalAmountApproveTotal);
//申报的差额
BigDecimal subtractApprove = declaredAmountApproveTotal.subtract(approvalAmountApproveTotal);
@@ -728,15 +732,17 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setDeclaredAmountApproval(approvalAmountApproveTotal);

//批复的批复金额(申报项目:归集信息建议批复总投资 项目归集:建议批复总投资)
BigDecimal approvalAmountApproval = normalProjects.stream().map(p -> {
final BigDecimal[] approvalAmountApproval = {BigDecimal.ZERO};
normalProjects.stream().map(p -> {
BigDecimal proposeTotalInvest = Objects.nonNull(p.getProposeTotalInvest()) ? p.getProposeTotalInvest() : BigDecimal.ZERO;
return proposeTotalInvest;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApprovalGov = approves.stream().map(p -> {
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApproval[0] = b);
final BigDecimal[] approvalAmountApprovalGov = {BigDecimal.ZERO};
approves.stream().map(p -> {
BigDecimal reviewTotalMoney = Objects.nonNull(p.getBaseInitialReviewTotalMoney()) ? p.getBaseInitialReviewTotalMoney() : BigDecimal.ZERO;
return reviewTotalMoney;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountApprovalTotal = approvalAmountApproval.add(approvalAmountApprovalGov);
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountApprovalGov[0] = b);
BigDecimal approvalAmountApprovalTotal = approvalAmountApproval[0].add(approvalAmountApprovalGov[0]);
cockpitStats.setApprovalAmountApproval(approvalAmountApprovalTotal);

//批复的差额
@@ -747,16 +753,18 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setDeclaredAmountContract(approvalAmountApprovalTotal);

//合同的批复金额(申报项目:成交金额 项目归集:成交金额)
BigDecimal approvalAmountContract = normalProjects.stream().map(p -> {
final BigDecimal[] approvalAmountContract = {BigDecimal.ZERO};
normalProjects.stream().map(p -> {
BigDecimal transactionAmount = Objects.nonNull(p.getTransactionAmount()) ? p.getTransactionAmount() : BigDecimal.ZERO;
return transactionAmount;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountContractGov = procures.stream().map(p -> {
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountContract[0] = b);
final BigDecimal[] approvalAmountContractGov = {BigDecimal.ZERO};
procures.stream().map(p -> {
BigDecimal purchaseAmount = Objects.nonNull(p.getBaseProjPurchaseAmount()) ?
p.getBaseProjPurchaseAmount() : BigDecimal.ZERO;
return purchaseAmount;
}).reduce(BigDecimal::add).get();
BigDecimal approvalAmountContractTotal = approvalAmountContract.add(approvalAmountContractGov);
}).reduce(BigDecimal::add).ifPresent(b -> approvalAmountContractGov[0] = b);
BigDecimal approvalAmountContractTotal = approvalAmountContract[0].add(approvalAmountContractGov[0]);
cockpitStats.setApprovalAmountContract(approvalAmountContractTotal);

//合同的差额


Loading…
Peruuta
Tallenna