xuhy
2025-02-20 75f60178b38bbc50f7aec9270fcd9d4c86b9cc43
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java
@@ -29,6 +29,8 @@
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;
@@ -130,6 +132,9 @@
                    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() + "元");
@@ -175,6 +180,9 @@
                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() + "元");
@@ -242,7 +250,15 @@
    @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();
    }
}