From 926253601956c51116e8342b4af9e9ca04ed2c1c Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 27 二月 2025 17:00:51 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/xiaochen991015/xizang

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java |   47 +++++++++++++++++++++++------------------------
 1 files changed, 23 insertions(+), 24 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 c35b38a..f5c0bcb 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
@@ -4,6 +4,7 @@
 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;
@@ -179,7 +180,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,6 +190,22 @@
     public R<Boolean> addContract(@Validated @RequestBody TContractDTO dto) {
         dto.setChangeRent(dto.getMonthRent());
         contractService.save(dto);
+        if (dto.getStatus().equals("2")){
+            //发起合同新增审批
+            ProcessStartBO processStartBO = new ProcessStartBO();
+            processStartBO.setCategory(ProcessCategoryEnum.CATEGORY1.getValue().toString());
+            processStartBO.setModuleName("合同新增审批");
+            processStartBO.setName(dto.getContractName());
+            //需要显示发起申请人所在单位
+//            String cedName = SecurityUtils.getLoginUser().getUser().getDept().getDeptName();
+//            String remark = String.format("【镇/街】:%s,【征收实施单位】:%s,【申请金额】:%s万元", stateProject.getStreet(), cedName, stateApplyRecord.getAmount());
+            processStartBO.setRemark("");
+            Map<String, Object> variable = new HashMap<>();
+            variable.put("projectId", dto.getId());
+            processStartBO.setVariable(variable);
+            //开启工作流程
+            stateProcessTemplateService.start(processStartBO);
+        }
         if (dto.getIsIncreasing()){
             TContractRentType tContractRentType = new TContractRentType();
             tContractRentType.setContractId(dto.getId());
@@ -199,23 +215,6 @@
             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.setModuleName("合同新增审批");
-                processStartBO.setName(dto.getContractName());
-                //需要显示发起申请人所在单位
-//            String cedName = SecurityUtils.getLoginUser().getUser().getDept().getDeptName();
-//            String remark = String.format("【镇/街】:%s,【征收实施单位】:%s,【申请金额】:%s万元", stateProject.getStreet(), cedName, stateApplyRecord.getAmount());
-                processStartBO.setRemark("");
-                Map<String, Object> variable = new HashMap<>();
-                variable.put("projectId", dto.getId());
-                processStartBO.setVariable(variable);
-                //开启工作流程
-                stateProcessTemplateService.start(processStartBO);
-            }
         }
         return R.ok();
     }
@@ -291,16 +290,17 @@
     @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")
@@ -322,7 +322,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