shiyunteng
2026-05-26 5b1c84423d590c7240209fa9a68d33c0116457af
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
@@ -176,6 +176,18 @@
               currentConfim.setTotalAmount(lastTotal.subtract(currentConfim.getReceivableAmount()));
               if (schedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
                  paymentConfirmMapper.insert(currentConfim);
                  //更新当前阶段付款情况
                  if (lastTotal.compareTo(new BigDecimal("0"))>0){
                     if (currentConfim.getTotalAmount().compareTo(new BigDecimal("0"))>=0) {
                        schedule.setPaymentStatus(2);
                        schedule.setPlannedAmount(schedule.getPlannedAmount());
                        contractPaymentScheduleMapper.updateById(schedule);
                     }else {
                        schedule.setPaymentStatus(1);
                        schedule.setPlannedAmount(lastTotal);
                     }
                  }
               }
               //查询是否有后续阶段
@@ -213,6 +225,7 @@
                     newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
                     if (endSchedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
                        paymentConfirmMapper.insert(newConfim);
                     }
                  }
@@ -265,6 +278,17 @@
         currentConfim.setTotalAmount(lastTotal.subtract(currentConfim.getReceivableAmount()));
         if (schedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
            paymentConfirmMapper.insert(currentConfim);
            //更新当前阶段付款情况
            if (lastTotal.compareTo(new BigDecimal("0"))>0){
               if (currentConfim.getTotalAmount().compareTo(new BigDecimal("0"))>=0) {
                  schedule.setPaymentStatus(2);
                  schedule.setPlannedAmount(schedule.getPlannedAmount());
                  contractPaymentScheduleMapper.updateById(schedule);
               }else {
                  schedule.setPaymentStatus(1);
                  schedule.setPlannedAmount(lastTotal);
               }
            }
         }
         //查询是否有后续阶段
@@ -302,6 +326,17 @@
               newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
               if (endSchedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
                  paymentConfirmMapper.insert(newConfim);
                  //更新当前阶段付款情况
                  if (lastNewTotal.compareTo(new BigDecimal("0"))>0){
                     if (newConfim.getTotalAmount().compareTo(new BigDecimal("0"))>=0) {
                        schedule.setPaymentStatus(2);
                        schedule.setPlannedAmount(schedule.getPlannedAmount());
                        contractPaymentScheduleMapper.updateById(schedule);
                     }else {
                        schedule.setPaymentStatus(1);
                        schedule.setPlannedAmount(lastNewTotal);
                     }
                  }
               }
            }