xuhy
2025-02-26 a4b961262680c1bc4ed47a423dfc43c986062769
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
@@ -190,16 +190,6 @@
    public R<Boolean> addContract(@Validated @RequestBody TContractDTO dto) {
        dto.setChangeRent(dto.getMonthRent());
        contractService.save(dto);
        if (dto.getIsIncreasing()){
            TContractRentType tContractRentType = new TContractRentType();
            tContractRentType.setContractId(dto.getId());
            tContractRentType.setIncreasingDecreasing(dto.getIncreasingDecreasing());
            tContractRentType.setIncreasingDecreasingType(dto.getIncreasingDecreasingType());
            tContractRentType.setNumericalValue(dto.getNumericalValue());
            tContractRentType.setChangeTime(dto.getChangeTime());
            tContractRentType.setCycleTime(dto.getCycleTime());
            contractRentTypeService.save(tContractRentType);
            if (dto.getStatus().equals("2")){
                //发起合同新增审批
                ProcessStartBO processStartBO = new ProcessStartBO();
@@ -216,6 +206,15 @@
                //开启工作流程
                stateProcessTemplateService.start(processStartBO);
            }
        if (dto.getIsIncreasing()){
            TContractRentType tContractRentType = new TContractRentType();
            tContractRentType.setContractId(dto.getId());
            tContractRentType.setIncreasingDecreasing(dto.getIncreasingDecreasing());
            tContractRentType.setIncreasingDecreasingType(dto.getIncreasingDecreasingType());
            tContractRentType.setNumericalValue(dto.getNumericalValue());
            tContractRentType.setChangeTime(dto.getChangeTime());
            tContractRentType.setCycleTime(dto.getCycleTime());
            contractRentTypeService.save(tContractRentType);
        }
        return R.ok();
    }