| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | List<TBill> billList = bills.stream().filter(e -> e.getContractId().equals(contract.getId())).collect(Collectors.toList()); |
| | | List<PayListVO> payList = new ArrayList<>(); |
| | | for (TBill tBill : billList) { |
| | | if (tBill.getPayFeesTime()==null){ |
| | | continue; |
| | | } |
| | | PayListVO payListVO = new PayListVO(); |
| | | payListVO.setPayFeesTime(DateUtils.localDateTimeToStringYear(tBill.getPayFeesTime())); |
| | | payListVO.setPayFeesMoney("-" + tBill.getPayFeesMoney() + "元"); |
| | |
| | | @ApiOperation(value = "管理员-新增验收") |
| | | @GetMapping(value = "/addRecord") |
| | | public R<TCheckAcceptRecordVO> getDetailById(@Validated @RequestBody TCheckAcceptRecord dto) { |
| | | |
| | | dto.setAcceptanceTime(LocalDateTime.now()); |
| | | dto.setCheckTime(LocalDateTime.now()); |
| | | LocalDate now = LocalDate.now(); |
| | | String replace = (now + "").replace("-", ""); |
| | | int size = checkAcceptRecordService.list(new LambdaQueryWrapper<TCheckAcceptRecord>() |
| | | .likeRight(TCheckAcceptRecord::getAcceptanceTime, LocalDate.now())).size(); |
| | | dto.setCode(replace.substring(2)+String.format("%03d", size+1)); |
| | | // 添加验收记录 |
| | | checkAcceptRecordService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | } |