| | |
| | | if (ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()==1){ |
| | | //最后阶段生效时间 |
| | | ContractPaymentSchedule endSchedule = afterSchedule.get(0); |
| | | if (StrUtil.equals(endSchedule.getStageName(),"质保金")) { |
| | | endSchedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getProcessDate(),endSchedule.getAgreedDays())); |
| | | endSchedule.setEffectiveEndDate(contract.getExpirationDate()); |
| | | contractPaymentScheduleMapper.updateById(endSchedule); |
| | |
| | | } |
| | | newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount())); |
| | | paymentConfirmMapper.insert(newConfim); |
| | | }else { |
| | | } |
| | | //更新合同下个阶段 |
| | | contract.setNextScheduleName(endSchedule.getStageName()); |
| | | contractMapper.updateById(contract); |
| | | } |
| | | if(ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()>1){ |
| | | //更新合同下个阶段 |
| | | contract.setNextScheduleName(afterSchedule.get(0).getStageName()); |
| | | contractMapper.updateById(contract); |
| | | } |
| | | if(ArrayUtil.isEmpty(afterSchedule.toArray())){ |
| | | schedule.setEffectiveEndDate(contract.getExpirationDate()); |
| | | contractPaymentScheduleMapper.updateById(schedule); |
| | | //更新合同下个阶段 |
| | | contract.setNextScheduleName("无"); |
| | | contractMapper.updateById(contract); |
| | | } |
| | | return R.ok(); |
| | | } |