chenr 3 mesiacov pred
rodič
commit
47dc5ec3e8

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

@@ -1789,10 +1789,13 @@ public class ExecutorMeter extends FormulaExecutor {
                 sis.setContractMoney(itf.getContractMoney());
                 sis.setChangeMoney(itf.getChangeMoney());
                 sis.setPrice(itf.getBidPrice());
-                if(sis.getFormNumber().equals("202-3-3")){
-                    System.out.println("111");
-                }
                 /*只要存在累计就显示*/
+                if(end==null){
+                    FormEndPay formEndPay =FormEndPayUtil.selectFormEndPay(periodId,contractId, sis.getFormNumber());
+                    if(formEndPay!=null){
+                        FormEndPayUtil.delFormEndPay(periodId,contractId, sis.getFormNumber());
+                    }
+                }
                 if(end!=null&&end.getContractMoney()!=null) {
                     if(cur!=null) {
                         /*根据单位保留小数位,同时对总金额进行取整*/
@@ -1829,7 +1832,7 @@ public class ExecutorMeter extends FormulaExecutor {
                         sis.setPreviousPeriodCompleted(pre.getCompleted().toPlainString());
                     }
                     if(finalPrePeriodId !=null){
-                        FormEndPay preFormEndPay = FormEndPayUtil.selectFoemEndPay(finalPrePeriodId,contractId,sis.getFormNumber());
+                        FormEndPay preFormEndPay = FormEndPayUtil.selectFormEndPay(finalPrePeriodId,contractId,sis.getFormNumber());
                         if(ObjectUtil.isNotEmpty(preFormEndPay)){
                             if (preFormEndPay.getCurrentPeriodEndPay() != null) {
                                 sis.setPreviousPeriodPay(preFormEndPay.getCurrentPeriodEndPay().toPlainString());
@@ -1849,7 +1852,7 @@ public class ExecutorMeter extends FormulaExecutor {
                         add=end.getMoney();
                     }
                     sis.setCurrentPeriodEndPay(add.toPlainString());
-                    FormEndPay formEndPay =FormEndPayUtil.selectFoemEndPay(periodId,contractId, sis.getFormNumber());
+                    FormEndPay formEndPay =FormEndPayUtil.selectFormEndPay(periodId,contractId, sis.getFormNumber());
                     if(ObjectUtil.isNotEmpty(formEndPay)){
                         if(!add.equals(formEndPay.getCurrentPeriodEndPay())){
                             formEndPay.setCurrentPeriodEndPay(add);
@@ -1930,8 +1933,12 @@ public class ExecutorMeter extends FormulaExecutor {
                         ChapterEndPay chapterEndPay = FormEndPayUtil.selectChapterEndPay(periodId, contractId, k);
                         SubprojectInterimPaymentSummary sm = tmp.get(tmp.size() - 1);
                         BigDecimal money=BigDecimal.ZERO;
-                        if(null!=sm.getCurrentPeriodEndPay()){
+                        if(null!=sm.getCurrentPeriodEndPay()&&!sm.getCurrentPeriodEndPay().equals("0")){
                             money=new BigDecimal(sm.getCurrentPeriodEndPay());
+                        }else {
+                            if(chapterEndPay!=null){
+                                FormEndPayUtil.delChapterEndPay(periodId, contractId, k);
+                            }
                         }
                         if(money.compareTo(BigDecimal.ZERO)!=0){
                             if(ObjectUtil.isNotEmpty(chapterEndPay)){