Bläddra i källkod

1通过表单id获取流程节点信息

2修改设备审批流程,取消申请确认
lamphua 10 månader sedan
förälder
incheckning
847fed5317

+ 11
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowTaskController.java Visa fil

@@ -238,6 +238,17 @@ public class FlowTaskController {
238 238
         return flowTaskService.flowXmlAndNode(procInsId, deployId);
239 239
     }
240 240
 
241
+    /**
242
+     * 通过表单id获取流程节点信息
243
+     *
244
+     * @param formId 表单id
245
+     * @return
246
+     */
247
+    @GetMapping("/flowXmlAndNodeByFormId")
248
+    public AjaxResult flowXmlAndNodeByFormId(String formId) {
249
+        return flowTaskService.flowXmlAndNodeByFormId(formId);
250
+    }
251
+
241 252
     /**
242 253
      * 流程节点表单
243 254
      *

+ 7
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowTaskService.java Visa fil

@@ -208,6 +208,13 @@ public interface IFlowTaskService {
208 208
      */
209 209
     AjaxResult flowXmlAndNode(String procInsId,String deployId);
210 210
 
211
+    /**
212
+     * 通过表单id获取流程节点信息
213
+     * @param formId
214
+     * @return
215
+     */
216
+    AjaxResult flowXmlAndNodeByFormId(String formId);
217
+
211 218
     /**
212 219
      * 流程节点表单
213 220
      * @param taskId 流程任务编号

+ 21
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java Visa fil

@@ -27,7 +27,10 @@ import com.ruoyi.flowable.flow.FlowableUtils;
27 27
 import com.ruoyi.flowable.service.IFlowTaskService;
28 28
 import com.ruoyi.flowable.service.ISysDeployFormService;
29 29
 import com.ruoyi.flowable.service.ISysFormService;
30
+import com.ruoyi.system.domain.FlowVarInst;
30 31
 import com.ruoyi.system.domain.SysForm;
32
+import com.ruoyi.system.mapper.FlowDeployMapper;
33
+import com.ruoyi.system.mapper.FlowVarInstMapper;
31 34
 import com.ruoyi.system.service.ISysRoleService;
32 35
 import com.ruoyi.system.service.ISysUserService;
33 36
 import lombok.extern.slf4j.Slf4j;
@@ -87,6 +90,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
87 90
     private ISysDeployFormService sysInstanceFormService;
88 91
     @Resource
89 92
     private ISysFormService sysFormService;
93
+    @Resource
94
+    private FlowVarInstMapper flowVarInstMapper;
90 95
 
91 96
     /**
92 97
      * 完成任务
@@ -1377,6 +1382,22 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
1377 1382
         }
1378 1383
     }
1379 1384
 
1385
+    /**
1386
+     * 通过表单id获取流程节点信息
1387
+     *
1388
+     * @param formId
1389
+     * @return
1390
+     */
1391
+    @Override
1392
+    public AjaxResult flowXmlAndNodeByFormId(String formId) {
1393
+        FlowVarInst flowVarInst =  flowVarInstMapper.selectProcInstByVar(formId);
1394
+        String procInsId = flowVarInst.getProcInstId();
1395
+        String deployId = "";
1396
+        AjaxResult ajaxResult = new AjaxResult();
1397
+        ajaxResult = flowXmlAndNode(procInsId, deployId);
1398
+        return ajaxResult;
1399
+    }
1400
+
1380 1401
     /**
1381 1402
      * 流程节点表单
1382 1403
      *

+ 66
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/FlowVarinst.java Visa fil

@@ -0,0 +1,66 @@
1
+package com.ruoyi.system.domain;
2
+
3
+import org.apache.commons.lang3.builder.ToStringBuilder;
4
+import org.apache.commons.lang3.builder.ToStringStyle;
5
+import com.ruoyi.common.annotation.Excel;
6
+import com.ruoyi.common.core.domain.BaseEntity;
7
+
8
+/**
9
+ * 流程变量对象 act_hi_varinst
10
+ *
11
+ * @author cmc
12
+ * @date 2024-07-26
13
+ */
14
+public class FlowVarInst extends BaseEntity
15
+{
16
+    private static final long serialVersionUID = 1L;
17
+
18
+    /** 流程实例id */
19
+    @Excel(name = "流程实例id")
20
+    private String procInstId;
21
+
22
+    /** 变量名 */
23
+    @Excel(name = "变量名")
24
+    private String name;
25
+
26
+    /** 变量值 */
27
+    @Excel(name = "变量值")
28
+    private String text;
29
+
30
+    public void setProcInstId(String procInstId)
31
+    {
32
+        this.procInstId = procInstId;
33
+    }
34
+
35
+    public String getProcInstId()
36
+    {
37
+        return procInstId;
38
+    }
39
+    public void setName(String name)
40
+    {
41
+        this.name = name;
42
+    }
43
+
44
+    public String getName()
45
+    {
46
+        return name;
47
+    }
48
+    public void setText(String text)
49
+    {
50
+        this.text = text;
51
+    }
52
+
53
+    public String getText()
54
+    {
55
+        return text;
56
+    }
57
+    @Override
58
+    public String toString() {
59
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
60
+                .append("procInstId", getProcInstId())
61
+                .append("name", getName())
62
+                .append("text", getText())
63
+                .append("createTime", getCreateTime())
64
+                .toString();
65
+    }
66
+}

+ 21
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FlowVarInstMapper.java Visa fil

@@ -0,0 +1,21 @@
1
+package com.ruoyi.system.mapper;
2
+
3
+import com.ruoyi.system.domain.FlowVarInst;
4
+
5
+/**
6
+ * 流程变量Mapper接口
7
+ *
8
+ * @author cmc
9
+ * @date 2024-07-26
10
+ */
11
+public interface FlowVarInstMapper
12
+{
13
+    /**
14
+     * 通过变量值查询流程实例id
15
+     *
16
+     * @param formId 表单id
17
+     * @return 流程变量
18
+     */
19
+    public FlowVarInst selectProcInstByVar(String formId);
20
+
21
+}

+ 24
- 0
oa-back/ruoyi-system/src/main/resources/mapper/flowable/FlowVarInstMapper.xml Visa fil

@@ -0,0 +1,24 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.system.mapper.FlowVarInstMapper">
6
+
7
+    <resultMap type="FlowVarInst" id="FlowVarInstResult">
8
+        <result property="procInstId"    column="PROC_INST_ID_"    />
9
+        <result property="name"    column="NAME_"    />
10
+        <result property="text"    column="TEXT_"    />
11
+    </resultMap>
12
+
13
+    <sql id="selectFlowVarInstVo">
14
+        select PROC_INST_ID_, NAME_, TEXT_ from act_hi_varinst
15
+    </sql>
16
+
17
+    <select id="selectProcInstByVar" parameterType="FlowVarInst" resultMap="FlowVarInstResult">
18
+        <include refid="selectFlowVarInstVo"/>
19
+        <where>
20
+            NAME_ = 'formId' and TEXT_ = #{param}
21
+        </where>
22
+    </select>
23
+
24
+</mapper>

+ 5
- 11
oa-ui/src/views/flowable/form/oa/deviceForm.vue Visa fil

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-07 13:44:39
4
- * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-07-25 14:05:49
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2024-07-26 13:54:55
6 6
 -->
7 7
 
8 8
 <template>
@@ -185,8 +185,7 @@
185 185
               <el-button type="primary" @click="submit">提交申请</el-button>
186 186
             </el-row>
187 187
             <el-row style="text-align: center;" v-else>
188
-              <el-button type="primary" @click="completeApply" v-if="taskName">{{ taskName == '申请确认' ? "确认" : "完成审批"
189
-                }}</el-button>
188
+              <el-button type="primary" @click="completeApply" v-if="taskName">完成审批</el-button>
190 189
             </el-row>
191 190
           </div>
192 191
         </el-card>
@@ -453,11 +452,6 @@ export default {
453 452
           });
454 453
         })
455 454
       } else if (this.taskName == '分管审核') {
456
-        complete(this.taskForm).then(response => {
457
-          this.$modal.msgSuccess(response.msg);
458
-          this.$emit('goBack')
459
-        });
460
-      } else if (this.taskName == '申请确认') {
461 455
         getUserByRole({ roleId: 4 }).then(result => {
462 456
           this.$set(this.taskForm.variables, "approval", result.data[0]);
463 457
           complete(this.taskForm).then(response => {
@@ -531,9 +525,9 @@ export default {
531 525
     showFormItem(name) {
532 526
       let isShow = false;
533 527
       if (name == '分管审核')
534
-        isShow = (this.taskName == '设备申请' || this.taskName == '安排设备' || this.taskName == '分管审核') || ((this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
528
+        isShow = (this.taskName == '设备申请' || this.taskName == '安排设备' || this.taskName == '分管审核') || (this.taskName == '归还确认' && this.form.managerUserId != null);
535 529
       else if (name == '分管审核签名')
536
-        isShow = this.taskName == '分管审核' || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
530
+        isShow = this.taskName == '分管审核' || ((this.taskName == '安排设备' || this.taskName == '归还确认') && this.form.managerUserId != null);
537 531
       return isShow;
538 532
     },
539 533
     confirmProject(val) {

Loading…
Avbryt
Spara