From 50f57de583268df7ffcb6ec747f7d346405d1558 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 06 三月 2025 13:41:38 +0800
Subject: [PATCH] 权限

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 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 5a0e81a..104d791 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
@@ -158,6 +158,36 @@
             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);
+            //开启工作流程
+            Boolean start = stateProcessTemplateService.start(processStartBO);
+            if(start){
+                FlwTask flwTask = flwTaskMapper.selectOne(Wrappers.lambdaQuery(FlwTask.class)
+                        .like(FlwTask::getVariable, dto.getId())
+                        .orderByDesc(FlwTask::getCreateTime)
+                        .last("LIMIT 1"));
+                if(Objects.nonNull(flwTask)){
+                    // 添加定时任务
+                    Map<String, ? extends Object> maps =
+                            new ImmutableMap.Builder<String, Long>().
+                                    put("id", flwTask.getId())
+                                    .build();
+                    QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+48*60*60*1000L), maps);
+                }
+            }
+        }
         return R.ok();
     }
     @Log(title = "合同管理-批量删除合同", businessType = BusinessType.DELETE)
@@ -178,8 +208,6 @@
         TContractVO res = new TContractVO();
         TContract contract = contractService.getById(id);
         BeanUtils.copyProperties(contract,res);
-        res.setPayType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE,res.getPayType()));
-        res.setStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_STATUS,res.getStatus()));
         TContractRentType contractRentType = contractRentTypeService.lambdaQuery().eq(TContractRentType::getContractId, id).one();
         if (contractRentType!=null){
             BeanUtils.copyProperties(contractRentType,res);

--
Gitblit v1.7.1