| | |
| | | @PostMapping(value = "/addContract") |
| | | @PreAuthorize("@ss.hasPermi('contract:list:add')") |
| | | public R<Boolean> addContract(@Validated @RequestBody TContractDTO dto) { |
| | | LocalDateTime changeTime = dto.getChangeTime(); |
| | | long count = contractService.count(new LambdaQueryWrapper<TContract>().eq(TContract::getContractNumber, dto.getContractNumber())); |
| | | if (count!=0){ |
| | | return R.fail("合同编号不可重复"); |
| | | } |
| | | dto.setChangeRent(dto.getMonthRent()); |
| | | |
| | | dto.setChangeTime(null); |
| | | contractService.save(dto); |
| | | if (dto.getStatus().equals("2")){ |
| | | //发起合同新增审批 |
| | |
| | | tContractRentType.setIncreasingDecreasing(dto.getIncreasingDecreasing()); |
| | | tContractRentType.setIncreasingDecreasingType(dto.getIncreasingDecreasingType()); |
| | | tContractRentType.setNumericalValue(dto.getNumericalValue()); |
| | | tContractRentType.setChangeTime(dto.getChangeTime()); |
| | | tContractRentType.setChangeTime(changeTime); |
| | | tContractRentType.setCycleTime(dto.getCycleTime()); |
| | | contractRentTypeService.save(tContractRentType); |
| | | } |
| | |
| | | @PostMapping(value = "/updateContract") |
| | | @PreAuthorize("@ss.hasPermi('contract:list:edit')") |
| | | public R<Boolean> updateContract(@Validated @RequestBody TContractDTO dto) { |
| | | dto.setChangeTime(null); |
| | | contractService.updateById(dto); |
| | | contractRentTypeService.remove(new LambdaQueryWrapper<TContractRentType>() |
| | | .eq(TContractRentType::getContractId,dto.getId())); |
| | |
| | | res.setHouse(house); |
| | | List<TBill> list = billService.lambdaQuery() |
| | | .eq(TBill::getContractId, id) |
| | | .in(TBill::getPayFeesStatus, Arrays.asList("1,4")) |
| | | .ne(TBill::getPayFeesStatus, 3) |
| | | .list(); |
| | | BigDecimal payMoney = new BigDecimal("0"); |
| | | for (TBill tBill : list) { |
| | | payMoney = payMoney.add(tBill.getOutstandingMoney()).add(tBill.getPayableFeesPenalty()); |
| | | } |
| | | TCheckAcceptRecord tCheckAcceptRecord = checkAcceptRecordService.lambdaQuery().eq(TCheckAcceptRecord::getContractId, id).one(); |
| | | res.setCheckResult(Objects.nonNull(tCheckAcceptRecord)&&Objects.nonNull(tCheckAcceptRecord.getCheckResult())?tCheckAcceptRecord.getCheckResult():false); |
| | | res.setCheckResult(Objects.nonNull(tCheckAcceptRecord)&&Objects.nonNull(tCheckAcceptRecord.getCheckResult())?tCheckAcceptRecord.getCheckResult():null); |
| | | res.setPayMoney(payMoney); |
| | | |
| | | return R.ok(res); |