Browse Source

设备申请 增加修改后设备

lamphua 1 year ago
parent
commit
098b9efb79

+ 2
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java View File

153
             cmcDeviceApproval.setDispatchComment(formDataJson.getString("dispatchComment"));
153
             cmcDeviceApproval.setDispatchComment(formDataJson.getString("dispatchComment"));
154
             cmcDeviceApproval.setDispatchTime(new Date());
154
             cmcDeviceApproval.setDispatchTime(new Date());
155
         }
155
         }
156
-        if (formDataJson.getJSONArray("devices").size() > 0) {
156
+        if (formDataJson.getJSONArray("modifyDevices").size() > 0) {
157
             cmcDeviceApproval.setDispatcher(getLoginUser().getUserId());
157
             cmcDeviceApproval.setDispatcher(getLoginUser().getUserId());
158
-            String deviceString = formDataJson.getString("devices").substring(1, formDataJson.getString("devices").length() - 1);
158
+            String deviceString = formDataJson.getString("modifyDevices").substring(1, formDataJson.getString("modifyDevices").length() - 1);
159
             cmcDeviceApproval.setDevices(deviceString);
159
             cmcDeviceApproval.setDevices(deviceString);
160
             String[] devices = deviceString.split(",");
160
             String[] devices = deviceString.split(",");
161
             BigDecimal estimateCost = new BigDecimal(0);
161
             BigDecimal estimateCost = new BigDecimal(0);

+ 5
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcTechnicalController.java View File

84
     @PutMapping
84
     @PutMapping
85
     public AjaxResult edit(@RequestBody CmcTechnical cmcTechnical)
85
     public AjaxResult edit(@RequestBody CmcTechnical cmcTechnical)
86
     {
86
     {
87
-        if (cmcTechnical.getTechnicalDocument() != null) {
87
+        if (cmcTechnical.getTechnicalDocument() != null && cmcTechnical.getTechnicalComment() == null) {
88
+            cmcTechnical.setTechnicalDesigner(getLoginUser().getUserId());
88
             cmcTechnical.setTechnicalUploadTime(new Date());
89
             cmcTechnical.setTechnicalUploadTime(new Date());
89
         }
90
         }
90
-        if (cmcTechnical.getTechnicalComment() != null) {
91
+        if (cmcTechnical.getModifyDocument() != null && cmcTechnical.getManageComment() == null) {
92
+            cmcTechnical.setTechnicalPlanner(getLoginUser().getUserId());
91
             cmcTechnical.setTechApprovalTime(new Date());
93
             cmcTechnical.setTechApprovalTime(new Date());
92
         }
94
         }
93
         if (cmcTechnical.getManageComment() != null) {
95
         if (cmcTechnical.getManageComment() != null) {
96
+            cmcTechnical.setManagerUserId(getLoginUser().getUserId());
94
             cmcTechnical.setManageApprovalTime(new Date());
97
             cmcTechnical.setManageApprovalTime(new Date());
95
         }
98
         }
96
         return toAjax(cmcTechnicalService.updateCmcTechnical(cmcTechnical));
99
         return toAjax(cmcTechnicalService.updateCmcTechnical(cmcTechnical));

+ 14
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java View File

44
     @Excel(name = "设备id")
44
     @Excel(name = "设备id")
45
     private String devices;
45
     private String devices;
46
 
46
 
47
+    /** 修改后设备id */
48
+    @Excel(name = "修改后设备id")
49
+    private String modifyDevices;
50
+
47
     /** 项目id */
51
     /** 项目id */
48
     @Excel(name = "项目id")
52
     @Excel(name = "项目id")
49
     private String projectId;
53
     private String projectId;
190
     {
194
     {
191
         return devices;
195
         return devices;
192
     }
196
     }
197
+    public void setModifyDevices(String modifyDevices)
198
+    {
199
+        this.modifyDevices = modifyDevices;
200
+    }
201
+
202
+    public String getModifyDevices()
203
+    {
204
+        return modifyDevices;
205
+    }
193
     public void setProjectId(String projectId)
206
     public void setProjectId(String projectId)
194
     {
207
     {
195
         this.projectId = projectId;
208
         this.projectId = projectId;
350
             .append("deviceApplyId", getDeviceApplyId())
363
             .append("deviceApplyId", getDeviceApplyId())
351
             .append("applier", getApplier())
364
             .append("applier", getApplier())
352
             .append("devices", getDevices())
365
             .append("devices", getDevices())
366
+            .append("modifyDevices", getModifyDevices())
353
             .append("projectId", getProjectId())
367
             .append("projectId", getProjectId())
354
             .append("applyReason", getApplyReason())
368
             .append("applyReason", getApplyReason())
355
             .append("beginDate", getBeginDate())
369
             .append("beginDate", getBeginDate())

+ 8
- 3
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml View File

9
         <result property="applier"    column="applier"    />
9
         <result property="applier"    column="applier"    />
10
         <result property="useDept"    column="use_dept"    />
10
         <result property="useDept"    column="use_dept"    />
11
         <result property="devices"    column="devices"    />
11
         <result property="devices"    column="devices"    />
12
+        <result property="modifyDevices"    column="modify_devices"    />
12
         <result property="projectId"    column="project_id"    />
13
         <result property="projectId"    column="project_id"    />
13
         <result property="applyReason"    column="apply_reason"    />
14
         <result property="applyReason"    column="apply_reason"    />
14
         <result property="applyDate"    column="apply_date"    />
15
         <result property="applyDate"    column="apply_date"    />
59
     </resultMap>
60
     </resultMap>
60
 
61
 
61
     <sql id="selectCmcDeviceApprovalVo">
62
     <sql id="selectCmcDeviceApprovalVo">
62
-        select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.project_id, p.project_number, p.project_name,
63
-               da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.state, da.manager_user_id, u1.nick_name as manager_nick_name,
64
-               da.manager_comment, da.dispatcher, u2.nick_name as dispatch_nick_name, da.dispatch_comment, da.estimate_cost, da.remark, da.manager_time, da.dispatch_time from cmc_device_approval as da
63
+        select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.modify_devices, da.project_id, p.project_number, p.project_name,
64
+               da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.state, da.manager_user_id, u1.nick_name as manager_nick_name, da.manager_comment,
65
+               da.dispatcher, u2.nick_name as dispatch_nick_name, da.dispatch_comment, da.estimate_cost, da.remark, da.manager_time, da.dispatch_time from cmc_device_approval as da
65
             left join sys_user as u on u.user_id = da.applier
66
             left join sys_user as u on u.user_id = da.applier
66
             left join sys_user as u1 on u1.user_id = da.manager_user_id
67
             left join sys_user as u1 on u1.user_id = da.manager_user_id
67
             left join sys_user as u2 on u2.user_id = da.dispatcher
68
             left join sys_user as u2 on u2.user_id = da.dispatcher
75
             <if test="applier != null "> and da.applier = #{applier}</if>
76
             <if test="applier != null "> and da.applier = #{applier}</if>
76
             <if test="useDept != null "> and da.use_dept = #{useDept}</if>
77
             <if test="useDept != null "> and da.use_dept = #{useDept}</if>
77
             <if test="devices != null  and devices != ''"> and da.devices like concat('%', #{devices}, '%')</if>
78
             <if test="devices != null  and devices != ''"> and da.devices like concat('%', #{devices}, '%')</if>
79
+            <if test="modifyDevices != null  and modifyDevices != ''"> and da.modify_devices like concat('%', #{modifyDevices}, '%')</if>
78
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
80
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
79
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
81
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
80
             <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
82
             <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
104
             <if test="applier != null">applier,</if>
106
             <if test="applier != null">applier,</if>
105
             <if test="useDept != null">use_dept,</if>
107
             <if test="useDept != null">use_dept,</if>
106
             <if test="devices != null">devices,</if>
108
             <if test="devices != null">devices,</if>
109
+            <if test="modifyDevices != null">modify_devices,</if>
107
             <if test="projectId != null">project_id,</if>
110
             <if test="projectId != null">project_id,</if>
108
             <if test="applyReason != null">apply_reason,</if>
111
             <if test="applyReason != null">apply_reason,</if>
109
             <if test="applyDate != null">apply_date,</if>
112
             <if test="applyDate != null">apply_date,</if>
126
             <if test="applier != null">#{applier},</if>
129
             <if test="applier != null">#{applier},</if>
127
             <if test="useDept != null">#{useDept},</if>
130
             <if test="useDept != null">#{useDept},</if>
128
             <if test="devices != null">#{devices},</if>
131
             <if test="devices != null">#{devices},</if>
132
+            <if test="modifyDevices != null">#{modifyDevices},</if>
129
             <if test="projectId != null">#{projectId},</if>
133
             <if test="projectId != null">#{projectId},</if>
130
             <if test="applyReason != null">#{applyReason},</if>
134
             <if test="applyReason != null">#{applyReason},</if>
131
             <if test="applyDate != null">#{applyDate},</if>
135
             <if test="applyDate != null">#{applyDate},</if>
151
             <if test="applier != null">applier = #{applier},</if>
155
             <if test="applier != null">applier = #{applier},</if>
152
             <if test="useDept != null">use_dept = #{useDept},</if>
156
             <if test="useDept != null">use_dept = #{useDept},</if>
153
             <if test="devices != null">devices = #{devices},</if>
157
             <if test="devices != null">devices = #{devices},</if>
158
+            <if test="modifyDevices != null">modify_devices = #{modifyDevices},</if>
154
             <if test="projectId != null">project_id = #{projectId},</if>
159
             <if test="projectId != null">project_id = #{projectId},</if>
155
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
160
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
156
             <if test="applyDate != null">apply_date = #{applyDate},</if>
161
             <if test="applyDate != null">apply_date = #{applyDate},</if>

+ 26
- 16
oa-back/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml View File

95
 	</select>
95
 	</select>
96
 
96
 
97
 	<select id="selectDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">
97
 	<select id="selectDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">
98
-		select u.user_id, u.nick_name from sys_user as u
99
-		left join sys_user_post as up on u.user_id = up.user_id
100
-		left join sys_post as p on up.post_id = p.post_id
101
-		where p.post_name = '主任' and u.user_id = #{param}
98
+		select r.user_id, r.nick_name from
99
+		(select u1.user_id, u1.nick_name, u.dept_id from
100
+		sys_user as u, sys_user as u1 where u.user_id = #{param} and u1.dept_id = u.dept_id) as r
101
+		left join sys_user_post as up on r.user_id = up.user_id
102
+		left join sys_post as p on p.post_id = up.post_id
103
+		where p.post_name = '主任'
102
 	</select>
104
 	</select>
103
 
105
 
104
 	<select id="selectViceDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">
106
 	<select id="selectViceDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">
105
-		select u.user_id, u.nick_name from sys_user as u
106
-		left join sys_user_post as up on u.user_id = up.user_id
107
-		left join sys_post as p on up.post_id = p.post_id
108
-		where p.post_name = '副主任' and u.user_id = #{param} order by u.user_id desc limit 1
107
+		select r.user_id, r.nick_name from
108
+		(select u1.user_id, u1.nick_name, u.dept_id from
109
+		sys_user as u, sys_user as u1 where u.user_id = #{param} and u1.dept_id = u.dept_id) as r
110
+		left join sys_user_post as up on r.user_id = up.user_id
111
+		left join sys_post as p on p.post_id = up.post_id
112
+		where p.post_name = '副主任'
113
+		order by u.user_id desc limit 1
109
 	</select>
114
 	</select>
110
 
115
 
111
 	<select id="selectDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">
116
 	<select id="selectDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">
112
-		select u.user_id, u.nick_name from sys_user as u
113
-		left join sys_user_post as up on u.user_id = up.user_id
114
-		left join sys_post as p on up.post_id = p.post_id
115
-		where p.post_name = '主任' and u.dept_id = #{param}
117
+		select r.user_id, r.nick_name from
118
+		(select user_id, nick_name, dept_id from
119
+		sys_user where dept_id = #{param}) as r
120
+		left join sys_user_post as up on r.user_id = up.user_id
121
+		left join sys_post as p on p.post_id = up.post_id
122
+		where p.post_name = '主任'
116
 	</select>
123
 	</select>
117
 
124
 
118
 	<select id="selectViceDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">
125
 	<select id="selectViceDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">
119
-		select u.user_id, u.nick_name from sys_user as u
120
-		left join sys_user_post as up on u.user_id = up.user_id
121
-		left join sys_post as p on up.post_id = p.post_id
122
-		where p.post_name = '副主任' and u.dept_id = #{param} order by u.user_id desc limit 1
126
+		select r.user_id, r.nick_name from
127
+		(select user_id, nick_name, dept_id from
128
+		sys_user where dept_id = #{param}) as r
129
+		left join sys_user_post as up on r.user_id = up.user_id
130
+		left join sys_post as p on p.post_id = up.post_id
131
+		where p.post_name = '副主任'
132
+		order by u.user_id desc limit 1
123
 	</select>
133
 	</select>
124
 
134
 
125
 	<delete id="deleteUserPostByUserId" parameterType="Long">
135
 	<delete id="deleteUserPostByUserId" parameterType="Long">

+ 4
- 3
oa-back/sql/sql.sql
File diff suppressed because it is too large
View File


+ 28
- 6
oa-ui/src/views/flowable/form/oa/deviceForm.vue View File

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-03-07 13:44:39
3
  * @Date: 2024-03-07 13:44:39
4
  * @LastEditors: wrh
4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-05-23 14:46:21
5
+ * @LastEditTime: 2024-05-23 15:53:29
6
 -->
6
 -->
7
 
7
 
8
 <template>
8
 <template>
58
                   }}</el-descriptions-item>
58
                   }}</el-descriptions-item>
59
                 </el-descriptions>
59
                 </el-descriptions>
60
               </el-form-item>
60
               </el-form-item>
61
+              <el-form-item label="设备选择:">
62
+                <el-select style="width: 100%;" v-model="form.devices" filterable multiple placeholder="请选择"
63
+                  clearable :disabled="taskName != '设备申请'">
64
+                  <el-option v-for="item in deviceList" :key="item.deviceId" 
65
+                    :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
66
+                     + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
67
+                  </el-option>
68
+                </el-select>
69
+              </el-form-item>
61
               <el-form-item label="申领事由:" prop="applyReason">
70
               <el-form-item label="申领事由:" prop="applyReason">
62
                 <el-input type="textarea" :rows="2" placeholder="请输入申领事由" v-model="form.applyReason"
71
                 <el-input type="textarea" :rows="2" placeholder="请输入申领事由" v-model="form.applyReason"
63
                   :disabled="taskName != '设备申请'">
72
                   :disabled="taskName != '设备申请'">
86
               </el-row>
95
               </el-row>
87
               <!-- 安排设备意见 -->
96
               <!-- 安排设备意见 -->
88
               <el-divider></el-divider>
97
               <el-divider></el-divider>
89
-              <el-form-item label-width="120px" label="设备选择:">
90
-                <el-select style="width: 100%;" v-model="form.devices" filterable multiple placeholder="请选择"
91
-                  clearable :disabled="taskName != '安排设备' && taskName != '设备申请'">
92
-                  <el-option v-for="item in deviceList" :key="item.deviceId" :disabled="item.status || item.status != '1'"
98
+              <el-form-item label-width="120px" label="拟发放设备:">
99
+                <el-select style="width: 100%;" v-model="form.modifyDevices" filterable multiple placeholder="请选择"
100
+                  clearable :disabled="taskName != '安排设备'">
101
+                  <el-option v-for="item in deviceList" :key="item.deviceId" 
93
                     :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
102
                     :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
94
                      + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
103
                      + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
95
                   </el-option>
104
                   </el-option>
115
                 </el-col>
124
                 </el-col>
116
               </el-row>
125
               </el-row>
117
               <!-- 分管审核意见 -->
126
               <!-- 分管审核意见 -->
127
+              <el-divider></el-divider>
118
               <el-form-item label="分管审核意见:" prop="managerComment" label-width="120px" v-if="showFormItem('分管审核')">
128
               <el-form-item label="分管审核意见:" prop="managerComment" label-width="120px" v-if="showFormItem('分管审核')">
119
                 <el-input type="textarea" :rows="2" placeholder="请输入分管审核意见" v-model="form.managerComment"
129
                 <el-input type="textarea" :rows="2" placeholder="请输入分管审核意见" v-model="form.managerComment"
120
                   :disabled="taskName != '分管审核'">
130
                   :disabled="taskName != '分管审核'">
233
         },
243
         },
234
         applyDate: new Date(),
244
         applyDate: new Date(),
235
         days: "",
245
         days: "",
236
-        devices: []
246
+        devices: [],
247
+        modifyDevices: [],
237
       },
248
       },
238
       projectList: [],
249
       projectList: [],
239
       chooseProject: {},
250
       chooseProject: {},
280
             }
291
             }
281
             data.devices = arr;
292
             data.devices = arr;
282
           }
293
           }
294
+          if (res.data.modifyDevices == null || res.data.modifyDevices == undefined || res.data.modifyDevices == "") {
295
+            data.modifyDevices = []
296
+          } else {
297
+            data.modifyDevices = data.modifyDevices.split(',');
298
+            let arr = []
299
+            for (let d of data.modifyDevices) {
300
+              arr.push(parseInt(d))
301
+            }
302
+            data.modifyDevices = arr;
303
+          }
283
           this.form = data;
304
           this.form = data;
284
           if (data.projectId) {
305
           if (data.projectId) {
285
             getProject(data.projectId).then(response => {
306
             getProject(data.projectId).then(response => {
391
     // 获取设备列表
412
     // 获取设备列表
392
     getDeviceList() {
413
     getDeviceList() {
393
       listDevice({
414
       listDevice({
415
+        status: "1",
394
         pageNum: 1,
416
         pageNum: 1,
395
         pageSize: 99999999,
417
         pageSize: 99999999,
396
         type: '仪器设备'
418
         type: '仪器设备'

+ 1
- 1
oa-ui/src/views/oa/device/detail.vue View File

346
   },
346
   },
347
   methods: {
347
   methods: {
348
     getList() {
348
     getList() {
349
-      this.queryParams.devices = this.$route.query.deviceId
349
+      this.queryParams.modifyDevices = this.$route.query.deviceId
350
       listDeviceApproval(this.queryParams).then(res => {
350
       listDeviceApproval(this.queryParams).then(res => {
351
         this.approvalList = res.rows;
351
         this.approvalList = res.rows;
352
         this.total = res.total;
352
         this.total = res.total;

Loading…
Cancel
Save