| | |
| | | @PostMapping(value = "/confirmSettlement") |
| | | public R<Boolean> confirmSettlement(String id) { |
| | | TContract contract = contractService.getById(id); |
| | | |
| | | // 查询验收记录 |
| | | long count = checkAcceptRecordService.count(Wrappers.lambdaQuery(TCheckAcceptRecord.class) |
| | | .eq(TCheckAcceptRecord::getStatus,1) |
| | | .eq(TCheckAcceptRecord::getContractId, id)); |
| | | if (count == 0) { |
| | | return R.fail("请先完成验收"); |
| | | } |
| | | |
| | | contract.setStatus("8"); |
| | | contractService.updateById(contract); |
| | | // 将所有未缴费账单设置未已失效 |
| | |
| | | private BigDecimal extracted(TContract contract,TContractDTO dto) { |
| | | TContractRentType tContractRentType = null; |
| | | if (contract.getIsIncreasing()){ |
| | | tContractRentType = new TContractRentType(); |
| | | tContractRentType.setContractId(contract.getId()); |
| | | tContractRentType.setIncreasingDecreasing(dto.getIncreasingDecreasing()); |
| | | tContractRentType.setIncreasingDecreasingType(dto.getIncreasingDecreasingType()); |
| | | tContractRentType.setNumericalValue(dto.getNumericalValue()); |
| | | tContractRentType.setChangeTime(dto.getChangeTime()); |
| | | tContractRentType.setCycleTime(dto.getCycleTime()); |
| | | tContractRentType = contractRentTypeService.lambdaQuery().eq(TContractRentType::getContractId, contract.getId()) |
| | | .last("limit 1").one(); |
| | | if (tContractRentType==null){ |
| | | tContractRentType = new TContractRentType(); |
| | | tContractRentType.setContractId(contract.getId()); |
| | | tContractRentType.setIncreasingDecreasing(dto.getIncreasingDecreasing()); |
| | | tContractRentType.setIncreasingDecreasingType(dto.getIncreasingDecreasingType()); |
| | | tContractRentType.setNumericalValue(dto.getNumericalValue()); |
| | | tContractRentType.setChangeTime(dto.getChangeTime()); |
| | | tContractRentType.setCycleTime(dto.getCycleTime()); |
| | | } |
| | | } |
| | | // 生成第一笔账单 |
| | | // 第一次应缴费日期 |