Selaa lähdekoodia

中检计量bug

yangyj 1 vuosi sitten
vanhempi
commit
4bac0bdbfa

+ 15 - 10
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -441,10 +441,12 @@ public class ExecutorMeter extends FormulaExecutor {
             private Integer contractTotal=0;
             /**变更数量*/
             private Integer changeTotal =0;
-            /**本次完成数量*/
+            /**完成数量*/
+            private Integer completed=0;
+/*            本次完成数量
             private Integer currentPeriodCompleted=0;
-            /**累计完成数量*/
-            private Integer currentPeriodEndCompleted =0;
+            累计完成数量
+            private Integer currentPeriodEndCompleted =0;*/
             /**合同金额*/
             private BigDecimal contractMoney =BigDecimal.ZERO;
             /**变更后A金额*/
@@ -465,7 +467,7 @@ public class ExecutorMeter extends FormulaExecutor {
                     this.unit = p.getUnit();
                     this.contractTotal=p.getContractTotal();
                     this.changeTotal = p.getChangeTotal();
-                    this.currentPeriodCompleted =p.getCompleted();
+                    this.completed =p.getCompleted();
                     this.contractMoney =new BigDecimal(p.getContractMoney());
                     this.changeMoney =new BigDecimal(p.getChangeMoney());
                     this.money=p.getMoneyAsBigDecimal();
@@ -477,7 +479,7 @@ public class ExecutorMeter extends FormulaExecutor {
                     this.itemName=next.itemName;
                 }
                 /*本期完成*/
-                this.currentPeriodCompleted =next.getCurrentPeriodCompleted()+this.currentPeriodCompleted;;
+                this.completed =next.completed+this.completed;;
                 return this;
             }
 
@@ -487,15 +489,17 @@ public class ExecutorMeter extends FormulaExecutor {
                      this.currentPeriodPay=this.money.add(BigDecimal.ZERO);
                      this.money=this.money.add(previous.money);
                      this.currentPeriodEndPay=this.money;
+                     this.completed=this.completed+previous.completed;
                  }
                 return this;
             }
         }
 
         /*按清单编号求和*/
-        public  Map<String,Summary> toSummary(List<Payment> payments) {
+        public  LinkedHashMap<String,Summary> toSummary(List<Payment> payments) {
             return payments.stream()
                     .collect(Collectors.groupingBy(Payment::getNumber,
+                            LinkedHashMap::new,
                             Collectors.collectingAndThen(
                                     Collectors.mapping(Summary::new, Collectors.reducing(Summary::add)),
                                     op -> op.orElseGet(Summary::new)
@@ -507,8 +511,8 @@ public class ExecutorMeter extends FormulaExecutor {
         @Override
         public void parse() {
             builderFormDatas(SubprojectInterimPaymentSummary.class);
-            Map<String,Summary> currentSummary = toSummary(current);
-            Map<String,Summary> preSummary = toSummary(previous);
+            LinkedHashMap<String,Summary> currentSummary = toSummary(current);
+            LinkedHashMap<String,Summary> preSummary = toSummary(previous);
             List<SubprojectInterimPaymentSummary> totalList = new ArrayList<>();
             for(Map.Entry<String,Summary> form:currentSummary.entrySet()){
                 SubprojectInterimPaymentSummary sis = new SubprojectInterimPaymentSummary();
@@ -521,10 +525,11 @@ public class ExecutorMeter extends FormulaExecutor {
                 sis.setChangeTotal(summary.getChangeTotal().toString());
                 sis.setContractMoney(summary.getContractMoney().toString());
                 sis.setChangeMoney(summary.getChangeMoney().toString());
-                sis.setCurrentPeriodCompleted(summary.getCurrentPeriodCompleted().toString());
+                sis.setCurrentPeriodCompleted(summary.getCompleted().toString());
+                sis.setCurrentPeriodPay(summary.getCurrentPeriodPay().toString());
                 /*当前期和往期统计*/
                 summary.merge(pre);
-                sis.setCurrentPeriodPay(summary.getCurrentPeriodPay().toString());
+                sis.setCompleted(summary.getCompleted().toString());
                 sis.setCurrentPeriodEndPay(summary.getCurrentPeriodEndPay().toString());
                 sis.setPayRatio(ratioFc.apply(sis.getCurrentPeriodEndPay(),sis.getChangeMoney()));
                 totalList.add(sis);