Parcourir la source

项目流转项目id传参到子流程

lamphua il y a 1 an
Parent
révision
de24ab67a5

+ 23
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcProject.java Voir le fichier

@@ -2,6 +2,7 @@ package com.ruoyi.oa.domain;
2 2
 
3 3
 import java.util.Date;
4 4
 import com.fasterxml.jackson.annotation.JsonFormat;
5
+import com.ruoyi.common.core.domain.entity.SysUser;
5 6
 import org.apache.commons.lang3.builder.ToStringBuilder;
6 7
 import org.apache.commons.lang3.builder.ToStringStyle;
7 8
 import com.ruoyi.common.annotation.Excel;
@@ -32,6 +33,8 @@ public class CmcProject extends BaseEntity
32 33
     @Excel(name = "项目负责人")
33 34
     private Long projectLeader;
34 35
 
36
+    private SysUser projectLeaderUser;
37
+
35 38
     /** 项目状态(0进行中、1已结束) */
36 39
     @Excel(name = "项目状态", readConverterExp = "0=进行中、1已结束")
37 40
     private String isFinished;
@@ -68,6 +71,8 @@ public class CmcProject extends BaseEntity
68 71
     @Excel(name = "项目登记人")
69 72
     private Long projectRegistrant;
70 73
 
74
+    private SysUser projectRegistrantUser;
75
+
71 76
     /** 承担部门 */
72 77
     @Excel(name = "承担部门")
73 78
     private String undertakingDept;
@@ -292,6 +297,24 @@ public class CmcProject extends BaseEntity
292 297
     {
293 298
         return technicalId;
294 299
     }
300
+    public void setProjectLeaderUser(SysUser projectLeaderUser)
301
+    {
302
+        this.projectLeaderUser = projectLeaderUser;
303
+    }
304
+
305
+    public SysUser getProjectLeaderUser()
306
+    {
307
+        return projectLeaderUser;
308
+    }
309
+    public void setProjectRegistrantUser(SysUser projectRegistrantUser)
310
+    {
311
+        this.projectRegistrantUser = projectRegistrantUser;
312
+    }
313
+
314
+    public SysUser getProjectRegistrantUser()
315
+    {
316
+        return projectRegistrantUser;
317
+    }
295 318
 
296 319
     @Override
297 320
     public String toString() {

+ 36
- 22
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcProjectMapper.xml Voir le fichier

@@ -28,41 +28,55 @@
28 28
         <result property="remark"    column="remark"    />
29 29
         <result property="budgetId"    column="budget_id"    />
30 30
         <result property="technicalId"    column="technical_id"    />
31
+        <association property="projectLeaderUser"    javaType="SysUser"         resultMap="ProjectLeaderResult" />
32
+        <association property="projectRegistrantUser"    javaType="SysUser"         resultMap="ProjectRegistrantResult" />
33
+    </resultMap>
34
+
35
+    <resultMap type="SysUser" id="ProjectLeaderResult">
36
+        <result property="userId"    column="user_id"    />
37
+        <result property="nickName"    column="leader_nick_name"    />
38
+    </resultMap>
39
+
40
+    <resultMap type="SysUser" id="ProjectRegistrantResult">
41
+        <result property="userId"    column="user_id"    />
42
+        <result property="nickName"    column="registrant_nick_name"    />
31 43
     </resultMap>
32 44
 
33 45
     <sql id="selectCmcProjectVo">
34
-        select project_id, project_number, project_name, project_leader, is_finished, project_source, party_a, contact_person, telephone, contract_id, project_type, project_level, project_registrant, undertaking_dept, project_planner, site_leader, create_time, plan_time, entry_time, exit_time, remark, budget_id, technical_id from cmc_project
46
+        select p.project_id, p.project_number, p.project_name, p.project_leader, u.nick_name as leader_nick_name, p.is_finished, p.project_source, p.party_a, p.contact_person, p.telephone, p.contract_id, p.project_type, p.project_level, p.project_registrant, u1.nick_name as registrant_nick_name, p.undertaking_dept, p.project_planner, p.site_leader, p.create_time, p.plan_time, p.entry_time, p.exit_time, p.remark, p.budget_id, p.technical_id from cmc_project as p
47
+        left join sys_user as u on u.user_id = p.project_leader
48
+        left join sys_user as u1 on u1.user_id = p.project_registrant
35 49
     </sql>
36 50
 
37 51
     <select id="selectCmcProjectList" parameterType="CmcProject" resultMap="CmcProjectResult">
38 52
         <include refid="selectCmcProjectVo"/>
39 53
         <where>
40
-            <if test="projectNumber != null  and projectNumber != ''"> and project_number = #{projectNumber}</if>
41
-            <if test="projectName != null  and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
42
-            <if test="projectLeader != null "> and project_leader = #{projectLeader}</if>
43
-            <if test="isFinished != null  and isFinished != ''"> and is_finished = #{isFinished}</if>
44
-            <if test="projectSource != null  and projectSource != ''"> and project_source = #{projectSource}</if>
45
-            <if test="partyA != null  and partyA != ''"> and party_a = #{partyA}</if>
46
-            <if test="contactPerson != null  and contactPerson != ''"> and contact_person = #{contactPerson}</if>
47
-            <if test="telephone != null  and telephone != ''"> and telephone = #{telephone}</if>
48
-            <if test="contractId != null  and contractId != ''"> and contract_id = #{contractId}</if>
49
-            <if test="projectType != null  and projectType != ''"> and project_type = #{projectType}</if>
50
-            <if test="projectLevel != null  and projectLevel != ''"> and project_level = #{projectLevel}</if>
51
-            <if test="projectRegistrant != null "> and project_registrant = #{projectRegistrant}</if>
52
-            <if test="undertakingDept != null  and undertakingDept != ''"> and undertaking_dept = #{undertakingDept}</if>
53
-            <if test="projectPlanner != null "> and project_planner = #{projectPlanner}</if>
54
-            <if test="siteLeader != null "> and site_leader = #{siteLeader}</if>
55
-            <if test="planTime != null "> and plan_time = #{planTime}</if>
56
-            <if test="entryTime != null "> and entry_time = #{entryTime}</if>
57
-            <if test="exitTime != null "> and exit_time = #{exitTime}</if>
58
-            <if test="budgetId != null  and budgetId != ''"> and budget_id = #{budgetId}</if>
59
-            <if test="technicalId != null  and technicalId != ''"> and technical_id = #{technicalId}</if>
54
+            <if test="projectNumber != null  and projectNumber != ''"> and p.project_number = #{projectNumber}</if>
55
+            <if test="projectName != null  and projectName != ''"> and p.project_name like concat('%', #{projectName}, '%')</if>
56
+            <if test="projectLeader != null "> and p.project_leader = #{projectLeader}</if>
57
+            <if test="isFinished != null  and isFinished != ''"> and p.is_finished = #{isFinished}</if>
58
+            <if test="projectSource != null  and projectSource != ''"> and p.project_source = #{projectSource}</if>
59
+            <if test="partyA != null  and partyA != ''"> and p.party_a = #{partyA}</if>
60
+            <if test="contactPerson != null  and contactPerson != ''"> and p.contact_person = #{contactPerson}</if>
61
+            <if test="telephone != null  and telephone != ''"> and p.telephone = #{telephone}</if>
62
+            <if test="contractId != null  and contractId != ''"> and p.contract_id = #{contractId}</if>
63
+            <if test="projectType != null  and projectType != ''"> and p.project_type = #{projectType}</if>
64
+            <if test="projectLevel != null  and projectLevel != ''"> and p.project_level = #{projectLevel}</if>
65
+            <if test="projectRegistrant != null "> and p.project_registrant = #{projectRegistrant}</if>
66
+            <if test="undertakingDept != null  and undertakingDept != ''"> and p.undertaking_dept = #{undertakingDept}</if>
67
+            <if test="projectPlanner != null "> and p.project_planner = #{projectPlanner}</if>
68
+            <if test="siteLeader != null "> and p.site_leader = #{siteLeader}</if>
69
+            <if test="planTime != null "> and p.plan_time = #{planTime}</if>
70
+            <if test="entryTime != null "> and p.entry_time = #{entryTime}</if>
71
+            <if test="exitTime != null "> and p.exit_time = #{exitTime}</if>
72
+            <if test="budgetId != null  and budgetId != ''"> and p.budget_id = #{budgetId}</if>
73
+            <if test="technicalId != null  and technicalId != ''"> and p.technical_id = #{technicalId}</if>
60 74
         </where>
61 75
     </select>
62 76
 
63 77
     <select id="selectCmcProjectByProjectId" parameterType="String" resultMap="CmcProjectResult">
64 78
         <include refid="selectCmcProjectVo"/>
65
-        where project_id = #{projectId}
79
+        where p.project_id = #{projectId}
66 80
     </select>
67 81
 
68 82
     <insert id="insertCmcProject" parameterType="CmcProject">

+ 2
- 2
oa-back/sql/sql.sql Voir le fichier

@@ -5412,7 +5412,7 @@ INSERT INTO `ACT_RE_DEPLOYMENT` (`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID
5412 5412
 INSERT INTO `ACT_RE_DEPLOYMENT` (`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID_`, `DEPLOY_TIME_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `PARENT_DEPLOYMENT_ID_`, `ENGINE_VERSION_`) VALUES ('6005', '项目流转', 'project', NULL, '', '2024-04-02 13:23:32.390', NULL, NULL, '6005', NULL);
5413 5413
 INSERT INTO `ACT_RE_DEPLOYMENT` (`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID_`, `DEPLOY_TIME_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `PARENT_DEPLOYMENT_ID_`, `ENGINE_VERSION_`) VALUES ('6009', '安全交底', 'project', NULL, '', '2024-04-02 11:42:24.390', NULL, NULL, '6009', NULL);
5414 5414
 INSERT INTO `ACT_RE_DEPLOYMENT` (`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID_`, `DEPLOY_TIME_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `PARENT_DEPLOYMENT_ID_`, `ENGINE_VERSION_`) VALUES ('6013', '技术交底', 'project', NULL, '', '2024-04-02 11:32:12.390', NULL, NULL, '6013', NULL);
5415
-INSERT INTO `ACT_RE_DEPLOYMENT` (`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID_`, `DEPLOY_TIME_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `PARENT_DEPLOYMENT_ID_`, `ENGINE_VERSION_`) VALUES ('6017', '预算审核', 'project', NULL, '', '2024-04-02 10:02:23.390', NULL, NULL, '6017', NULL);
5415
+INSERT INTO `ACT_RE_DEPLOYMENT` (`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID_`, `DEPLOY_TIME_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `PARENT_DEPLOYMENT_ID_`, `ENGINE_VERSION_`) VALUES ('6017', '项目预算', 'project', NULL, '', '2024-04-02 10:02:23.390', NULL, NULL, '6017', NULL);
5416 5416
 COMMIT;
5417 5417
 
5418 5418
 -- ----------------------------
@@ -5492,7 +5492,7 @@ INSERT INTO `ACT_RE_PROCDEF` (`ID_`, `REV_`, `CATEGORY_`, `NAME_`, `KEY_`, `VERS
5492 5492
 INSERT INTO `ACT_RE_PROCDEF` (`ID_`, `REV_`, `CATEGORY_`, `NAME_`, `KEY_`, `VERSION_`, `DEPLOYMENT_ID_`, `RESOURCE_NAME_`, `DGRM_RESOURCE_NAME_`, `DESCRIPTION_`, `HAS_START_FORM_KEY_`, `HAS_GRAPHICAL_NOTATION_`, `SUSPENSION_STATE_`, `TENANT_ID_`, `ENGINE_VERSION_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `DERIVED_VERSION_`) VALUES ('project_circulation:1:6008', 2, 'project', '项目流转', 'project_circulation', 1, '6005', '项目流转.bpmn', '项目流转.project_circulation.png', NULL, 0, 1, 1, '', NULL, NULL, NULL, 0);
5493 5493
 INSERT INTO `ACT_RE_PROCDEF` (`ID_`, `REV_`, `CATEGORY_`, `NAME_`, `KEY_`, `VERSION_`, `DEPLOYMENT_ID_`, `RESOURCE_NAME_`, `DGRM_RESOURCE_NAME_`, `DESCRIPTION_`, `HAS_START_FORM_KEY_`, `HAS_GRAPHICAL_NOTATION_`, `SUSPENSION_STATE_`, `TENANT_ID_`, `ENGINE_VERSION_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `DERIVED_VERSION_`) VALUES ('safe_disclosure:1:6012', 2, 'project', '安全交底', 'safe_disclosure', 1, '6009', '安全交底.bpmn', '安全交底.safe_disclosure.png', NULL, 0, 1, 1, '', NULL, NULL, NULL, 0);
5494 5494
 INSERT INTO `ACT_RE_PROCDEF` (`ID_`, `REV_`, `CATEGORY_`, `NAME_`, `KEY_`, `VERSION_`, `DEPLOYMENT_ID_`, `RESOURCE_NAME_`, `DGRM_RESOURCE_NAME_`, `DESCRIPTION_`, `HAS_START_FORM_KEY_`, `HAS_GRAPHICAL_NOTATION_`, `SUSPENSION_STATE_`, `TENANT_ID_`, `ENGINE_VERSION_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `DERIVED_VERSION_`) VALUES ('tech_disclosure:1:6016', 2, 'project', '技术交底', 'tech_disclosure', 1, '6013', '技术交底.bpmn', '技术交底.tech_disclosure.png', NULL, 0, 1, 1, '', NULL, NULL, NULL, 0);
5495
-INSERT INTO `ACT_RE_PROCDEF` (`ID_`, `REV_`, `CATEGORY_`, `NAME_`, `KEY_`, `VERSION_`, `DEPLOYMENT_ID_`, `RESOURCE_NAME_`, `DGRM_RESOURCE_NAME_`, `DESCRIPTION_`, `HAS_START_FORM_KEY_`, `HAS_GRAPHICAL_NOTATION_`, `SUSPENSION_STATE_`, `TENANT_ID_`, `ENGINE_VERSION_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `DERIVED_VERSION_`) VALUES ('project_budget:1:6020', 2, 'project', '预算审核', 'project_budget', 1, '6017', '预算审核.bpmn', '预算审核.project_budget.png', NULL, 0, 1, 1, '', NULL, NULL, NULL, 0);
5495
+INSERT INTO `ACT_RE_PROCDEF` (`ID_`, `REV_`, `CATEGORY_`, `NAME_`, `KEY_`, `VERSION_`, `DEPLOYMENT_ID_`, `RESOURCE_NAME_`, `DGRM_RESOURCE_NAME_`, `DESCRIPTION_`, `HAS_START_FORM_KEY_`, `HAS_GRAPHICAL_NOTATION_`, `SUSPENSION_STATE_`, `TENANT_ID_`, `ENGINE_VERSION_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `DERIVED_VERSION_`) VALUES ('project_budget:1:6020', 2, 'project', '项目预算', 'project_budget', 1, '6017', '项目预算.bpmn', '项目预算.project_budget.png', NULL, 0, 1, 1, '', NULL, NULL, NULL, 0);
5496 5496
 COMMIT;
5497 5497
 
5498 5498
 -- ----------------------------

+ 7
- 9
oa-ui/src/views/flowable/form/projectProcess/addproject.vue Voir le fichier

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-02-27 14:49:15
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-04-02 15:56:25
5
+ * @LastEditTime: 2024-04-03 17:05:19
6 6
 -->
7 7
 
8 8
 <template>
@@ -95,7 +95,7 @@
95 95
 </template>
96 96
 
97 97
 <script>
98
-import { listProject, submitProject, modifyProject, delProject } from "@/api/oa/project/project";
98
+import { listProject, addProject, updateProject, delProject } from "@/api/oa/project/project";
99 99
 import { getUser } from '@/api/system/user'
100 100
 import { getUsersDeptLeaderByDept } from '@/api/system/post'
101 101
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
@@ -165,14 +165,12 @@ export default {
165 165
       })
166 166
     },
167 167
     confirmAddForm() {
168
+      this.addForm.projectId = this.taskForm.formId;
168 169
       this.addForm.workList = this.workList;
169
-      let formData = new FormData();
170
-      let form = JSON.stringify(this.addForm);
171
-      formData.append("form", form);
172
-      // submitProject(formData).then(response => {
173
-      //   this.$modal.msgSuccess("新增成功");
174
-      //   this.getList();
175
-      // });
170
+      addProject(this.addForm).then(response => {
171
+        this.$modal.msgSuccess("新增成功");
172
+        this.getList();
173
+      });
176 174
       const params = { taskId: this.taskForm.taskId };
177 175
       // 获取下一个流程节点
178 176
       getNextFlowNode(params).then(res => {

+ 3
- 1
oa-ui/src/views/flowable/form/projectProcess/arrangeProject.vue Voir le fichier

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-19 09:24:06
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-04-03 10:13:04
5
+ * @LastEditTime: 2024-04-03 16:53:59
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -102,6 +102,7 @@ export default {
102 102
     }
103 103
   },
104 104
   created() {
105
+    this.form.projectId = this.taskForm.formId;
105 106
     this.getDeptList();
106 107
     this.getUserList();
107 108
   },
@@ -169,6 +170,7 @@ export default {
169 170
       const params = { taskId: this.taskForm.taskId };
170 171
       // 获取下一个流程节点
171 172
       getNextFlowNode(params).then(res => {
173
+        this.$set(this.taskForm.variables, "formId", this.taskForm.formId);
172 174
         this.$set(this.taskForm.variables, "budgetInitiator", this.peopleForm.userId);
173 175
         getUsersDeptLeaderByDept({ deptId: 105 }).then(res => {
174 176
           let userId = res.data.userId;

Loading…
Annuler
Enregistrer