| | |
| | | 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(); |
| | | processStartBO.setCategory(ProcessCategoryEnum.CATEGORY1.getValue().toString()); |
| | |
| | | processStartBO.setVariable(variable); |
| | | //开启工作流程 |
| | | 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(); |
| | | } |
| | |
| | | @ApiOperation(value = "查询合同信息信息") |
| | | @GetMapping(value = "/getContractById") |
| | | @PreAuthorize("@ss.hasPermi('system:contract:detail')") |
| | | |
| | | public R<TContractVO> getContractById(@RequestParam String id) { |
| | | TContractVO res = new TContractVO(); |
| | | TContract contract = contractService.getById(id); |