| | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.aizuda.bpm.engine.core.FlowCreator; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | |
| | | @PostMapping(value = "/addContract") |
| | | @PreAuthorize("@ss.hasPermi('system:contract:add')") |
| | | public R<Boolean> addContract(@Validated @RequestBody TContractDTO dto) { |
| | | long count = contractService.count(new LambdaQueryWrapper<TContract>().eq(TContract::getContractNumber, dto.getContractNumber())); |
| | | if (count!=0){ |
| | | return R.fail("合同编号不可重复"); |
| | | } |
| | | dto.setChangeRent(dto.getMonthRent()); |
| | | contractService.save(dto); |
| | | if (dto.getStatus().equals("2")){ |
| | |
| | | @Log(title = "合同管理-撤销审批", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "撤销审批") |
| | | @PreAuthorize("@ss.hasPermi('system:contract:revoke')") |
| | | |
| | | @GetMapping(value = "/updateContractStatus") |
| | | public R<Boolean> updateContractStatus(String id) { |
| | | TContract contract = contractService.getById(id); |
| | | @PostMapping(value = "/updateContractStatus") |
| | | public R<Boolean> updateContractStatus(@RequestBody RevokeDTO dto) { |
| | | TContract contract = contractService.getById(dto.getContractId()); |
| | | contract.setStatus("1"); |
| | | contractService.updateById(contract); |
| | | // 撤销审批实例 |
| | | stateProcessTemplateService.revoke(dto.getInstanceId()); |
| | | |
| | | return R.ok(); |
| | | } |
| | | @PreAuthorize("@ss.hasPermi('system:contract:confirm')") |
| | | |
| | | @Log(title = "合同管理-确认结算", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "确认结算") |
| | | @PostMapping(value = "/confirmSettlement") |
| | |
| | | @PreAuthorize("@ss.hasPermi('system:contract:terminate')") |
| | | public R terminateContract(@RequestBody TerminateContractDTO dto) { |
| | | contractService.terminateContract(dto); |
| | | // 生成房屋验收记录 待验收 |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "根据合同id查看验收记录") |