瀏覽代碼

判断当前节点是否发起人节点

lamphua 1 年之前
父節點
當前提交
2f75d1106d

+ 6
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowTaskController.java 查看文件

@@ -178,6 +178,12 @@ public class FlowTaskController {
178 178
         return flowTaskService.getNextFlowNodeByStart(flowTaskVo);
179 179
     }
180 180
 
181
+    @ApiOperation(value = "判断当前节点是否发起人节点")
182
+    @PostMapping(value = "/isStartUserNode")
183
+    public AjaxResult checkIsStartUserNode(@RequestBody FlowTaskVo flowTaskVo) {
184
+        return flowTaskService.checkIsStartUserNode(flowTaskVo);
185
+    }
186
+
181 187
     /**
182 188
      * 生成流程图
183 189
      *

+ 7
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowTaskService.java 查看文件

@@ -186,6 +186,13 @@ public interface IFlowTaskService {
186 186
 
187 187
     AjaxResult getNextFlowNodeByStart(FlowTaskVo flowTaskVo);
188 188
 
189
+    /**
190
+     * 判断当前节点是否发起人节点
191
+     * @param flowTaskVo 任务
192
+     * @return
193
+     */
194
+    AjaxResult checkIsStartUserNode(FlowTaskVo flowTaskVo);
195
+
189 196
     /**
190 197
      * 流程初始化表单
191 198
      * @param deployId

+ 41
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java 查看文件

@@ -1089,6 +1089,47 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
1089 1089
         return AjaxResult.success(flowNextDto);
1090 1090
     }
1091 1091
 
1092
+    /**
1093
+     * 根据任务ID判断当前节点是否为开始节点后面的第一个用户任务节点
1094
+     *
1095
+     * @param flowTaskVo 任务
1096
+     * @return
1097
+     */
1098
+    public AjaxResult checkIsStartUserNode(FlowTaskVo flowTaskVo) {
1099
+        //判断当前是否是第一个发起任务节点,若是就put变量isStartNode为True,让相应的表单可以编辑
1100
+        boolean isStartNode= false;
1101
+        // 当前任务 task
1102
+        Task task = taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult();
1103
+        // 获取流程定义信息
1104
+        if (task != null) {
1105
+            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
1106
+                    .processDefinitionId(task.getProcessDefinitionId()).singleResult();
1107
+            // 获取所有节点信息
1108
+            Process process = repositoryService.getBpmnModel(processDefinition.getId()).getProcesses().get(0);
1109
+            // 获取全部节点列表,包含子节点
1110
+            Collection<FlowElement> allElements = FlowableUtils.getAllElements(process.getFlowElements(), null);
1111
+            // 获取当前任务节点元素
1112
+            FlowElement source = null;
1113
+            if (allElements != null) {
1114
+                for (FlowElement flowElement : allElements) {
1115
+                    // 类型为用户节点
1116
+                    if (flowElement.getId().equals(task.getTaskDefinitionKey())) {
1117
+                        // 获取节点信息
1118
+                        source = flowElement;
1119
+                        List<SequenceFlow> inFlows = FlowableUtils.getElementIncomingFlows(source);
1120
+                        if (inFlows.size() == 1) {
1121
+                            FlowElement sourceFlowElement = inFlows.get(0).getSourceFlowElement();
1122
+                            if (sourceFlowElement instanceof StartEvent) {// 源是开始节点
1123
+                                isStartNode = true;
1124
+                            }
1125
+                        }
1126
+                    }
1127
+                }
1128
+            }
1129
+        }
1130
+        return AjaxResult.success(isStartNode);
1131
+    }
1132
+
1092 1133
     /**
1093 1134
      * 流程初始化表单
1094 1135
      *

+ 92
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcAssessContentMapper.xml 查看文件

@@ -0,0 +1,92 @@
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.oa.mapper.CmcAssessContentMapper">
6
+    
7
+    <resultMap type="CmcAssessContent" id="CmcAssessContentResult">
8
+        <result property="contentId"    column="content_id"    />
9
+        <result property="role"    column="role"    />
10
+        <result property="familiar"    column="familiar"    />
11
+        <result property="remark"    column="remark"    />
12
+        <result property="workload"    column="workload"    />
13
+        <result property="skill"    column="skill"    />
14
+        <result property="quality"    column="quality"    />
15
+        <result property="assessment"    column="assessment"    />
16
+        <result property="advice"    column="advice"    />
17
+    </resultMap>
18
+
19
+    <sql id="selectCmcAssessContentVo">
20
+        select content_id, role, familiar, remark, workload, skill, quality, assessment, advice from cmc_assess_content
21
+    </sql>
22
+
23
+    <select id="selectCmcAssessContentList" parameterType="CmcAssessContent" resultMap="CmcAssessContentResult">
24
+        <include refid="selectCmcAssessContentVo"/>
25
+        <where>  
26
+            <if test="role != null  and role != ''"> and role = #{role}</if>
27
+            <if test="familiar != null  and familiar != ''"> and familiar = #{familiar}</if>
28
+            <if test="workload != null  and workload != ''"> and workload = #{workload}</if>
29
+            <if test="skill != null  and skill != ''"> and skill = #{skill}</if>
30
+            <if test="quality != null  and quality != ''"> and quality = #{quality}</if>
31
+            <if test="assessment != null  and assessment != ''"> and assessment = #{assessment}</if>
32
+            <if test="advice != null  and advice != ''"> and advice = #{advice}</if>
33
+        </where>
34
+    </select>
35
+    
36
+    <select id="selectCmcAssessContentByContentId" parameterType="String" resultMap="CmcAssessContentResult">
37
+        <include refid="selectCmcAssessContentVo"/>
38
+        where content_id = #{contentId}
39
+    </select>
40
+        
41
+    <insert id="insertCmcAssessContent" parameterType="CmcAssessContent">
42
+        insert into cmc_assess_content
43
+        <trim prefix="(" suffix=")" suffixOverrides=",">
44
+            <if test="contentId != null">content_id,</if>
45
+            <if test="role != null">role,</if>
46
+            <if test="familiar != null">familiar,</if>
47
+            <if test="remark != null">remark,</if>
48
+            <if test="workload != null">workload,</if>
49
+            <if test="skill != null">skill,</if>
50
+            <if test="quality != null">quality,</if>
51
+            <if test="assessment != null">assessment,</if>
52
+            <if test="advice != null">advice,</if>
53
+         </trim>
54
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
55
+            <if test="contentId != null">#{contentId},</if>
56
+            <if test="role != null">#{role},</if>
57
+            <if test="familiar != null">#{familiar},</if>
58
+            <if test="remark != null">#{remark},</if>
59
+            <if test="workload != null">#{workload},</if>
60
+            <if test="skill != null">#{skill},</if>
61
+            <if test="quality != null">#{quality},</if>
62
+            <if test="assessment != null">#{assessment},</if>
63
+            <if test="advice != null">#{advice},</if>
64
+         </trim>
65
+    </insert>
66
+
67
+    <update id="updateCmcAssessContent" parameterType="CmcAssessContent">
68
+        update cmc_assess_content
69
+        <trim prefix="SET" suffixOverrides=",">
70
+            <if test="role != null">role = #{role},</if>
71
+            <if test="familiar != null">familiar = #{familiar},</if>
72
+            <if test="remark != null">remark = #{remark},</if>
73
+            <if test="workload != null">workload = #{workload},</if>
74
+            <if test="skill != null">skill = #{skill},</if>
75
+            <if test="quality != null">quality = #{quality},</if>
76
+            <if test="assessment != null">assessment = #{assessment},</if>
77
+            <if test="advice != null">advice = #{advice},</if>
78
+        </trim>
79
+        where content_id = #{contentId}
80
+    </update>
81
+
82
+    <delete id="deleteCmcAssessContentByContentId" parameterType="String">
83
+        delete from cmc_assess_content where content_id = #{contentId}
84
+    </delete>
85
+
86
+    <delete id="deleteCmcAssessContentByContentIds" parameterType="String">
87
+        delete from cmc_assess_content where content_id in 
88
+        <foreach item="contentId" collection="array" open="(" separator="," close=")">
89
+            #{contentId}
90
+        </foreach>
91
+    </delete>
92
+</mapper>

+ 58
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcAssessContentWorkMapper.xml 查看文件

@@ -0,0 +1,58 @@
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.oa.mapper.CmcAssessContentWorkMapper">
6
+    
7
+    <resultMap type="CmcAssessContentWork" id="CmcAssessContentWorkResult">
8
+        <result property="workId"    column="work_id"    />
9
+        <result property="workLoad"    column="work_load"    />
10
+    </resultMap>
11
+
12
+    <sql id="selectCmcAssessContentWorkVo">
13
+        select work_id, work_load from cmc_assess_content_work
14
+    </sql>
15
+
16
+    <select id="selectCmcAssessContentWorkList" parameterType="CmcAssessContentWork" resultMap="CmcAssessContentWorkResult">
17
+        <include refid="selectCmcAssessContentWorkVo"/>
18
+        <where>
19
+            <if test="workLoad != null  and workLoad != ''"> and work_load = #{workLoad}</if>
20
+        </where>
21
+    </select>
22
+    
23
+    <select id="selectCmcAssessContentWorkByWorkId" parameterType="String" resultMap="CmcAssessContentWorkResult">
24
+        <include refid="selectCmcAssessContentWorkVo"/>
25
+        where work_id = #{workId}
26
+    </select>
27
+        
28
+    <insert id="insertCmcAssessContentWork" parameterType="CmcAssessContentWork">
29
+        insert into cmc_assess_content_work
30
+        <trim prefix="(" suffix=")" suffixOverrides=",">
31
+            <if test="workId != null">work_id,</if>
32
+            <if test="workLoad != null">work_load,</if>
33
+         </trim>
34
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
35
+            <if test="workId != null">#{workId},</if>
36
+            <if test="workLoad != null">#{workLoad},</if>
37
+         </trim>
38
+    </insert>
39
+
40
+    <update id="updateCmcAssessContentWork" parameterType="CmcAssessContentWork">
41
+        update cmc_assess_content_work
42
+        <trim prefix="SET" suffixOverrides=",">
43
+            <if test="workLoad != null">work_load = #{workLoad},</if>
44
+        </trim>
45
+        where work_id = #{workId}
46
+    </update>
47
+
48
+    <delete id="deleteCmcAssessContentWorkByWorkId" parameterType="String">
49
+        delete from cmc_assess_content_work where work_id = #{workId}
50
+    </delete>
51
+
52
+    <delete id="deleteCmcAssessContentWorkByWorkIds" parameterType="String">
53
+        delete from cmc_assess_content_work where work_id in 
54
+        <foreach item="workId" collection="array" open="(" separator="," close=")">
55
+            #{workId}
56
+        </foreach>
57
+    </delete>
58
+</mapper>

+ 133
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcAssessMapper.xml 查看文件

@@ -0,0 +1,133 @@
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.oa.mapper.CmcAssessMapper">
6
+
7
+    <resultMap type="CmcAssess" id="CmcAssessResult">
8
+        <result property="assessId"    column="assess_id"    />
9
+        <result property="userId"    column="user_id"    />
10
+        <result property="projectId"    column="project_id"    />
11
+        <result property="assessTime"    column="assess_time"    />
12
+        <result property="deptAssessment"    column="dept_assessment"    />
13
+        <result property="deptAdvice"    column="dept_advice"    />
14
+        <result property="deptTime"    column="dept_time"    />
15
+        <result property="deptAssesser"    column="dept_assesser"    />
16
+        <result property="managerAssessment"    column="manager_assessment"    />
17
+        <result property="managerAdvice"    column="manager_advice"    />
18
+        <result property="managerTime"    column="manager_time"    />
19
+        <result property="managerAssesser"    column="manager_assesser"    />
20
+        <result property="selfAssess"    column="self_assess"    />
21
+        <result property="fillTime"    column="fill_time"    />
22
+        <result property="otherWork"    column="other_work"    />
23
+        <result property="otherWorkunit"    column="other_workunit"    />
24
+        <result property="otherWorkload"    column="other_workload"    />
25
+    </resultMap>
26
+
27
+    <sql id="selectCmcAssessVo">
28
+        select assess_id, user_id, project_id, assess_time, dept_assessment, dept_advice, dept_time, dept_assesser, manager_assessment, manager_advice, manager_time, manager_assesser, self_assess, fill_time, other_work, other_workunit, other_workload from cmc_assess
29
+    </sql>
30
+
31
+    <select id="selectCmcAssessList" parameterType="CmcAssess" resultMap="CmcAssessResult">
32
+        <include refid="selectCmcAssessVo"/>
33
+        <where>
34
+            <if test="userId != null "> and user_id = #{userId}</if>
35
+            <if test="projectId != null "> and project_id = #{projectId}</if>
36
+            <if test="assessTime != null "> and assess_time = #{assessTime}</if>
37
+            <if test="deptAssessment != null  and deptAssessment != ''"> and dept_assessment = #{deptAssessment}</if>
38
+            <if test="deptAdvice != null  and deptAdvice != ''"> and dept_advice = #{deptAdvice}</if>
39
+            <if test="deptTime != null "> and dept_time = #{deptTime}</if>
40
+            <if test="deptAssesser != null  and deptAssesser != ''"> and dept_assesser = #{deptAssesser}</if>
41
+            <if test="managerAssessment != null  and managerAssessment != ''"> and manager_assessment = #{managerAssessment}</if>
42
+            <if test="managerAdvice != null  and managerAdvice != ''"> and manager_advice = #{managerAdvice}</if>
43
+            <if test="managerTime != null "> and manager_time = #{managerTime}</if>
44
+            <if test="managerAssesser != null  and managerAssesser != ''"> and manager_assesser = #{managerAssesser}</if>
45
+            <if test="selfAssess != null  and selfAssess != ''"> and self_assess = #{selfAssess}</if>
46
+            <if test="fillTime != null "> and fill_time = #{fillTime}</if>
47
+            <if test="otherWork != null  and otherWork != ''"> and other_work = #{otherWork}</if>
48
+            <if test="otherWorkunit != null  and otherWorkunit != ''"> and other_workunit = #{otherWorkunit}</if>
49
+            <if test="otherWorkload != null  and otherWorkload != ''"> and other_workload = #{otherWorkload}</if>
50
+        </where>
51
+    </select>
52
+
53
+    <select id="selectCmcAssessByAssessId" parameterType="String" resultMap="CmcAssessResult">
54
+        <include refid="selectCmcAssessVo"/>
55
+        where assess_id = #{assessId}
56
+    </select>
57
+
58
+    <insert id="insertCmcAssess" parameterType="CmcAssess">
59
+        insert into cmc_assess
60
+        <trim prefix="(" suffix=")" suffixOverrides=",">
61
+            <if test="assessId != null">assess_id,</if>
62
+            <if test="userId != null">user_id,</if>
63
+            <if test="projectId != null">project_id,</if>
64
+            <if test="assessTime != null">assess_time,</if>
65
+            <if test="deptAssessment != null">dept_assessment,</if>
66
+            <if test="deptAdvice != null">dept_advice,</if>
67
+            <if test="deptTime != null">dept_time,</if>
68
+            <if test="deptAssesser != null">dept_assesser,</if>
69
+            <if test="managerAssessment != null">manager_assessment,</if>
70
+            <if test="managerAdvice != null">manager_advice,</if>
71
+            <if test="managerTime != null">manager_time,</if>
72
+            <if test="managerAssesser != null">manager_assesser,</if>
73
+            <if test="selfAssess != null">self_assess,</if>
74
+            <if test="fillTime != null">fill_time,</if>
75
+            <if test="otherWork != null">other_work,</if>
76
+            <if test="otherWorkunit != null">other_workunit,</if>
77
+            <if test="otherWorkload != null">other_workload,</if>
78
+        </trim>
79
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
80
+            <if test="assessId != null">#{assessId},</if>
81
+            <if test="userId != null">#{userId},</if>
82
+            <if test="projectId != null">#{projectId},</if>
83
+            <if test="assessTime != null">#{assessTime},</if>
84
+            <if test="deptAssessment != null">#{deptAssessment},</if>
85
+            <if test="deptAdvice != null">#{deptAdvice},</if>
86
+            <if test="deptTime != null">#{deptTime},</if>
87
+            <if test="deptAssesser != null">#{deptAssesser},</if>
88
+            <if test="managerAssessment != null">#{managerAssessment},</if>
89
+            <if test="managerAdvice != null">#{managerAdvice},</if>
90
+            <if test="managerTime != null">#{managerTime},</if>
91
+            <if test="managerAssesser != null">#{managerAssesser},</if>
92
+            <if test="selfAssess != null">#{selfAssess},</if>
93
+            <if test="fillTime != null">#{fillTime},</if>
94
+            <if test="otherWork != null">#{otherWork},</if>
95
+            <if test="otherWorkunit != null">#{otherWorkunit},</if>
96
+            <if test="otherWorkload != null">#{otherWorkload},</if>
97
+        </trim>
98
+    </insert>
99
+
100
+    <update id="updateCmcAssess" parameterType="CmcAssess">
101
+        update cmc_assess
102
+        <trim prefix="SET" suffixOverrides=",">
103
+            <if test="userId != null">user_id = #{userId},</if>
104
+            <if test="projectId != null">project_id = #{projectId},</if>
105
+            <if test="assessTime != null">assess_time = #{assessTime},</if>
106
+            <if test="deptAssessment != null">dept_assessment = #{deptAssessment},</if>
107
+            <if test="deptAdvice != null">dept_advice = #{deptAdvice},</if>
108
+            <if test="deptTime != null">dept_time = #{deptTime},</if>
109
+            <if test="deptAssesser != null">dept_assesser = #{deptAssesser},</if>
110
+            <if test="managerAssessment != null">manager_assessment = #{managerAssessment},</if>
111
+            <if test="managerAdvice != null">manager_advice = #{managerAdvice},</if>
112
+            <if test="managerTime != null">manager_time = #{managerTime},</if>
113
+            <if test="managerAssesser != null">manager_assesser = #{managerAssesser},</if>
114
+            <if test="selfAssess != null">self_assess = #{selfAssess},</if>
115
+            <if test="fillTime != null">fill_time = #{fillTime},</if>
116
+            <if test="otherWork != null">other_work = #{otherWork},</if>
117
+            <if test="otherWorkunit != null">other_workunit = #{otherWorkunit},</if>
118
+            <if test="otherWorkload != null">other_workload = #{otherWorkload},</if>
119
+        </trim>
120
+        where assess_id = #{assessId}
121
+    </update>
122
+
123
+    <delete id="deleteCmcAssessByAssessId" parameterType="String">
124
+        delete from cmc_assess where assess_id = #{assessId}
125
+    </delete>
126
+
127
+    <delete id="deleteCmcAssessByAssessIds" parameterType="String">
128
+        delete from cmc_assess where assess_id in
129
+        <foreach item="assessId" collection="array" open="(" separator="," close=")">
130
+            #{assessId}
131
+        </foreach>
132
+    </delete>
133
+</mapper>

+ 15
- 0
oa-back/sql/ry_20231130.sql 查看文件

@@ -720,7 +720,22 @@ create table sys_role_dept (
720 720
 -- ----------------------------
721 721
 insert into sys_role_dept values ('2', '100');
722 722
 insert into sys_role_dept values ('2', '101');
723
+insert into sys_role_dept values ('2', '102');
724
+insert into sys_role_dept values ('2', '103');
725
+insert into sys_role_dept values ('2', '104');
723 726
 insert into sys_role_dept values ('2', '105');
727
+insert into sys_role_dept values ('2', '106');
728
+insert into sys_role_dept values ('2', '107');
729
+insert into sys_role_dept values ('2', '108');
730
+insert into sys_role_dept values ('2', '109');
731
+insert into sys_role_dept values ('2', '110');
732
+insert into sys_role_dept values ('2', '111');
733
+insert into sys_role_dept values ('2', '112');
734
+insert into sys_role_dept values ('2', '113');
735
+insert into sys_role_dept values ('2', '114');
736
+insert into sys_role_dept values ('2', '115');
737
+insert into sys_role_dept values ('2', '116');
738
+insert into sys_role_dept values ('2', '117');
724 739
 
725 740
 
726 741
 -- ----------------------------

+ 9
- 0
oa-ui/src/api/flowable/todo.js 查看文件

@@ -73,6 +73,15 @@ export function getNextFlowNodeByStart(data) {
73 73
   })
74 74
 }
75 75
 
76
+// 判断当前节点是否发起人节点
77
+export function checkIsStartUserNode(data) {
78
+  return request({
79
+    url: '/flowable/task/isStartUserNode',
80
+    method: 'post',
81
+    data: data
82
+  })
83
+}
84
+
76 85
 // 部署流程实例
77 86
 export function deployStart(deployId) {
78 87
   return request({

Loading…
取消
儲存