From 7d1c6e902de71861706d1933b59882592d889301 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 27 二月 2025 09:51:52 +0800
Subject: [PATCH] 审批流

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
index c0e4618..58982f4 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
@@ -179,7 +179,6 @@
     @ApiOperation(value = "获取合同分页列表")
     @PostMapping(value = "/contractList")
     @PreAuthorize("@ss.hasPermi('system:contract:list')")
-
     public R<PageInfo<TContract>> contractList(@RequestBody TContractQuery query) {
         return R.ok(contractService.contractList(query));
     }
@@ -190,16 +189,7 @@
     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());
@@ -215,13 +205,22 @@
             //开启工作流程
             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();
     }
     @Log(title = "合同管理-编辑合同", businessType =  BusinessType.UPDATE)
     @ApiOperation(value = "编辑合同")
     @PostMapping(value = "/updateContract")
     @PreAuthorize("@ss.hasPermi('system:contract:update')")
-
     public R<Boolean> updateContract(@Validated @RequestBody TContractDTO dto) {
         contractService.updateById(dto);
         contractRentTypeService.remove(new LambdaQueryWrapper<TContractRentType>()
@@ -253,7 +252,6 @@
     @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);
@@ -322,7 +320,6 @@
     @PreAuthorize("@ss.hasPermi('system:contract:terminate')")
     public R terminateContract(@RequestBody TerminateContractDTO dto) {
         contractService.terminateContract(dto);
-        // 生成房屋验收记录 待验收
         return R.ok();
     }
     @ApiOperation(value = "根据合同id查看验收记录")

--
Gitblit v1.7.1