yangyj 3 недель назад
Родитель
Сommit
639ea1f97e

+ 6 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -1329,6 +1329,7 @@ public class ExecutorMeter extends FormulaExecutor {
                      /*分行合计列,合计的时候需要计入手填部分*/
                      fieldGetSet(x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
                      InterimPaymentCertificate finalBlj = blj;
+                     final  InterimPayCertificateItem preBlj=previousMap.get("保留金");
                      dataList.stream().filter(e-> "合计".equals(e.getChapterSeq())).findFirst().ifPresent(t->{
                          AtomicReference<String> currentPay= new AtomicReference<>("0");
                          AtomicReference<String> previousPay= new AtomicReference<>("0");
@@ -1342,7 +1343,11 @@ public class ExecutorMeter extends FormulaExecutor {
                          currentPay.set(addFc.apply(t.getCurrentPeriodPay(), String.valueOf(currentPay.get())));
                          previousPay.set(addFc.apply(t.getPreviousPeriodEndPay(), String.valueOf(previousPay.get())));
                          finalBlj.setCurrentPeriodPay(StringUtils.number2String(multiFc.apply(currentPay.get(),"0.1"),0));
-                         if(BaseUtils.obj2DoubleZero(t.getPreviousPeriodEndPay())>0) {
+                         if(preBlj!=null&&BaseUtils.obj2DoubleZero(preBlj.getCurrentPeriodEndPay())>0){
+                             /*如果上期存在保留金,且保留金的累计值大于零,则直接用来设置成本期保留金的上期末累计*/
+                             finalBlj.setPreviousPeriodEndPay(preBlj.getCurrentPeriodEndPay());
+                         }else if(BaseUtils.obj2DoubleZero(t.getPreviousPeriodEndPay())>0) {
+                             /*存在材料调差,需要获直接取上一期末支付,而不是简单的比例相乘*/
                              finalBlj.setPreviousPeriodEndPay(StringUtils.number2String(multiFc.apply(previousPay.get(), "0.1"),0));
                          }
                          finalBlj.setCurrentPeriodEndPay(addFc.apply(finalBlj.getCurrentPeriodPay(),finalBlj.getPreviousPeriodEndPay()));