| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //查询是否有后续阶段 |
| | |
| | | newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount())); |
| | | if (endSchedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) { |
| | | paymentConfirmMapper.insert(newConfim); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //查询是否有后续阶段 |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |