瀏覽代碼

增加已归还设备

lamphua 1 年之前
父節點
當前提交
7d0af50038

+ 66
- 84
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java 查看文件

@@ -47,48 +47,7 @@ public class CmcDeviceApprovalController extends BaseController
47 47
     public TableDataInfo list(CmcDeviceApproval cmcDeviceApproval)
48 48
     {
49 49
         startPage();
50
-        List<CmcDeviceApproval> list = cmcDeviceApprovalService.selectCmcDeviceApprovalList(cmcDeviceApproval);
51
-        for(CmcDeviceApproval deviceApproval : list) {
52
-            String deviceIds = deviceApproval.getDevices();
53
-            StringBuilder deviceNames = new StringBuilder();
54
-            if (deviceIds != null && !deviceIds.equals("") && deviceIds.split(",").length > 0) {
55
-                for (String deviceId : deviceIds.split(",")) {
56
-                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
57
-                    deviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
58
-                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
59
-                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
60
-                }
61
-                deviceApproval.setDeviceNames(deviceNames.substring(0, deviceNames.length() - 1));
62
-            }
63
-            String modifyDeviceIds = deviceApproval.getModifyDevices();
64
-            StringBuilder modifyDeviceNames = new StringBuilder();
65
-            StringBuilder modifyDeviceNumbers = new StringBuilder();
66
-            if (modifyDeviceIds != null && !modifyDeviceIds.equals("") && modifyDeviceIds.split(",").length > 0) {
67
-                for (String deviceId : modifyDeviceIds.split(",")) {
68
-                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
69
-                    modifyDeviceNumbers.append(device.getDeviceNumber());
70
-                    modifyDeviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
71
-                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
72
-                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
73
-                }
74
-                deviceApproval.setModifyDeviceNumbers(modifyDeviceNumbers.substring(0, modifyDeviceNumbers.length() - 1));
75
-                deviceApproval.setModifyDeviceNames(modifyDeviceNames.substring(0, modifyDeviceNames.length() - 1));
76
-            }
77
-            String repairDeviceIds = deviceApproval.getRepairDevices();
78
-            StringBuilder repairDeviceNames = new StringBuilder();;
79
-            StringBuilder repairDeviceNumbers = new StringBuilder();
80
-            if (repairDeviceIds != null && !repairDeviceIds.equals("") && repairDeviceIds.split(",").length > 0) {
81
-                for (String deviceId : repairDeviceIds.split(",")) {
82
-                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
83
-                    repairDeviceNumbers.append(device.getDeviceNumber());
84
-                    repairDeviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
85
-                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
86
-                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
87
-                }
88
-                deviceApproval.setRepairDeviceNumbers(repairDeviceNumbers.substring(0, repairDeviceNumbers.length() - 1));
89
-                deviceApproval.setRepairDeviceNames(repairDeviceNames.substring(0, repairDeviceNames.length() - 1));
90
-            }
91
-        }
50
+        List<CmcDeviceApproval> list = DeviceId2Name(cmcDeviceApproval);
92 51
         return getDataTable(list);
93 52
     }
94 53
 
@@ -99,48 +58,7 @@ public class CmcDeviceApprovalController extends BaseController
99 58
     @PostMapping("/export")
100 59
     public void export(HttpServletResponse response, CmcDeviceApproval cmcDeviceApproval)
101 60
     {
102
-        List<CmcDeviceApproval> list = cmcDeviceApprovalService.selectCmcDeviceApprovalList(cmcDeviceApproval);
103
-        for(CmcDeviceApproval deviceApproval : list) {
104
-            String deviceIds = deviceApproval.getDevices();
105
-            StringBuilder deviceNames = new StringBuilder();
106
-            if (deviceIds != null && !deviceIds.equals("") && deviceIds.split(",").length > 0) {
107
-                for (String deviceId : deviceIds.split(",")) {
108
-                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
109
-                    deviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
110
-                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
111
-                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
112
-                }
113
-                deviceApproval.setDeviceNames(deviceNames.substring(0, deviceNames.length() - 1));
114
-            }
115
-            String modifyDeviceIds = deviceApproval.getModifyDevices();
116
-            StringBuilder modifyDeviceNames = new StringBuilder();
117
-            StringBuilder modifyDeviceNumbers = new StringBuilder();
118
-            if (modifyDeviceIds != null && !modifyDeviceIds.equals("") && modifyDeviceIds.split(",").length > 0) {
119
-                for (String deviceId : modifyDeviceIds.split(",")) {
120
-                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
121
-                    modifyDeviceNumbers.append(device.getDeviceNumber());
122
-                    modifyDeviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
123
-                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
124
-                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
125
-                }
126
-                deviceApproval.setModifyDeviceNumbers(modifyDeviceNumbers.substring(0, modifyDeviceNumbers.length() - 1));
127
-                deviceApproval.setModifyDeviceNames(modifyDeviceNames.substring(0, modifyDeviceNames.length() - 1));
128
-            }
129
-            String repairDeviceIds = deviceApproval.getRepairDevices();
130
-            StringBuilder repairDeviceNames = new StringBuilder();;
131
-            StringBuilder repairDeviceNumbers = new StringBuilder();
132
-            if (repairDeviceIds != null && !repairDeviceIds.equals("") && repairDeviceIds.split(",").length > 0) {
133
-                for (String deviceId : repairDeviceIds.split(",")) {
134
-                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
135
-                    repairDeviceNumbers.append(device.getDeviceNumber());
136
-                    repairDeviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
137
-                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
138
-                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
139
-                }
140
-                deviceApproval.setRepairDeviceNumbers(repairDeviceNumbers.substring(0, repairDeviceNumbers.length() - 1));
141
-                deviceApproval.setRepairDeviceNames(repairDeviceNames.substring(0, repairDeviceNames.length() - 1));
142
-            }
143
-        }
61
+        List<CmcDeviceApproval> list = DeviceId2Name(cmcDeviceApproval);
144 62
         ExcelUtil<CmcDeviceApproval> util = new ExcelUtil<CmcDeviceApproval>(CmcDeviceApproval.class);
145 63
         util.exportExcel(response, list, "cmc设备审批数据");
146 64
     }
@@ -279,4 +197,68 @@ public class CmcDeviceApprovalController extends BaseController
279 197
     {
280 198
         return success(cmcDeviceApprovalService.deleteCmcDeviceApprovalByDeviceApplyIds(deviceApplyIds));
281 199
     }
200
+
201
+    private List<CmcDeviceApproval> DeviceId2Name(CmcDeviceApproval cmcDeviceApproval) {
202
+        List<CmcDeviceApproval> list = cmcDeviceApprovalService.selectCmcDeviceApprovalList(cmcDeviceApproval);
203
+        for(CmcDeviceApproval deviceApproval : list) {
204
+            String deviceIds = deviceApproval.getDevices();
205
+            StringBuilder deviceNames = new StringBuilder();
206
+            StringBuilder deviceNumbers = new StringBuilder();
207
+            if (deviceIds != null && !deviceIds.equals("") && deviceIds.split(",").length > 0) {
208
+                for (String deviceId : deviceIds.split(",")) {
209
+                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
210
+                    deviceNumbers.append(device.getDeviceNumber());
211
+                    deviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
212
+                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
213
+                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
214
+                }
215
+                deviceApproval.setDeviceNumbers(deviceNumbers.substring(0, deviceNumbers.length() - 1));
216
+                deviceApproval.setDeviceNames(deviceNames.substring(0, deviceNames.length() - 1));
217
+            }
218
+            String modifyDeviceIds = deviceApproval.getModifyDevices();
219
+            StringBuilder modifyDeviceNames = new StringBuilder();
220
+            StringBuilder modifyDeviceNumbers = new StringBuilder();
221
+            if (modifyDeviceIds != null && !modifyDeviceIds.equals("") && modifyDeviceIds.split(",").length > 0) {
222
+                for (String deviceId : modifyDeviceIds.split(",")) {
223
+                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
224
+                    modifyDeviceNumbers.append(device.getDeviceNumber());
225
+                    modifyDeviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
226
+                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
227
+                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
228
+                }
229
+                deviceApproval.setModifyDeviceNumbers(modifyDeviceNumbers.substring(0, modifyDeviceNumbers.length() - 1));
230
+                deviceApproval.setModifyDeviceNames(modifyDeviceNames.substring(0, modifyDeviceNames.length() - 1));
231
+            }
232
+            String repairDeviceIds = deviceApproval.getRepairDevices();
233
+            StringBuilder repairDeviceNames = new StringBuilder();;
234
+            StringBuilder repairDeviceNumbers = new StringBuilder();
235
+            if (repairDeviceIds != null && !repairDeviceIds.equals("") && repairDeviceIds.split(",").length > 0) {
236
+                for (String deviceId : repairDeviceIds.split(",")) {
237
+                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
238
+                    repairDeviceNumbers.append(device.getDeviceNumber());
239
+                    repairDeviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
240
+                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
241
+                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
242
+                }
243
+                deviceApproval.setRepairDeviceNumbers(repairDeviceNumbers.substring(0, repairDeviceNumbers.length() - 1));
244
+                deviceApproval.setRepairDeviceNames(repairDeviceNames.substring(0, repairDeviceNames.length() - 1));
245
+            }
246
+            String returnDeviceIds = deviceApproval.getReturnDevices();
247
+            StringBuilder returnDeviceNames = new StringBuilder();;
248
+            StringBuilder returnDeviceNumbers = new StringBuilder();
249
+            if (returnDeviceIds != null && !returnDeviceIds.equals("") && returnDeviceIds.split(",").length > 0) {
250
+                for (String deviceId : returnDeviceIds.split(",")) {
251
+                    CmcDevice device = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(deviceId));
252
+                    returnDeviceNumbers.append(device.getDeviceNumber());
253
+                    returnDeviceNames.append(device.getName()).append("【").append(device.getBrand() != null ? device.getBrand() : "")
254
+                            .append(device.getSeries() != null ? "-" + device.getSeries() + "】" : "")
255
+                            .append(device.getCode() != null ? "(设备编号:" + device.getCode() + ")" : "").append(",");
256
+                }
257
+                deviceApproval.setReturnDeviceNumbers(returnDeviceNumbers.substring(0, returnDeviceNumbers.length() - 1));
258
+                deviceApproval.setReturnDeviceNames(returnDeviceNames.substring(0, returnDeviceNames.length() - 1));
259
+            }
260
+        }
261
+        return list;
262
+    }
263
+
282 264
 }

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

@@ -239,14 +239,14 @@ public class FlowTaskController {
239 239
     }
240 240
 
241 241
     /**
242
-     * 通过表单id获取流程节点信息
242
+     * 通过表单id及流程名获取流程节点信息
243 243
      *
244 244
      * @param formId 表单id
245 245
      * @return
246 246
      */
247 247
     @GetMapping("/flowXmlAndNodeByFormId")
248
-    public AjaxResult flowXmlAndNodeByFormId(String formId) {
249
-        return flowTaskService.flowXmlAndNodeByFormId(formId);
248
+    public AjaxResult flowXmlAndNodeByFormIdAndName(String formId, String name) {
249
+        return flowTaskService.flowXmlAndNodeByFormIdAndName(formId, name);
250 250
     }
251 251
 
252 252
     /**

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

@@ -209,11 +209,11 @@ public interface IFlowTaskService {
209 209
     AjaxResult flowXmlAndNode(String procInsId,String deployId);
210 210
 
211 211
     /**
212
-     * 通过表单id获取流程节点信息
212
+     * 通过表单id及流程名获取流程节点信息
213 213
      * @param formId
214 214
      * @return
215 215
      */
216
-    AjaxResult flowXmlAndNodeByFormId(String formId);
216
+    AjaxResult flowXmlAndNodeByFormIdAndName(String formId, String name);
217 217
 
218 218
     /**
219 219
      * 流程节点表单

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

@@ -27,6 +27,7 @@ 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.FlowProcDefDto;
30 31
 import com.ruoyi.system.domain.FlowVarInst;
31 32
 import com.ruoyi.system.domain.SysForm;
32 33
 import com.ruoyi.system.mapper.FlowDeployMapper;
@@ -92,6 +93,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
92 93
     private ISysFormService sysFormService;
93 94
     @Resource
94 95
     private FlowVarInstMapper flowVarInstMapper;
96
+    @Resource
97
+    private FlowDeployMapper flowDeployMapper;
95 98
 
96 99
     /**
97 100
      * 完成任务
@@ -1383,19 +1386,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
1383 1386
     }
1384 1387
 
1385 1388
     /**
1386
-     * 通过表单id获取流程节点信息
1389
+     * 通过表单id及流程名获取流程节点信息
1387 1390
      *
1388 1391
      * @param formId
1389 1392
      * @return
1390 1393
      */
1391 1394
     @Override
1392
-    public AjaxResult flowXmlAndNodeByFormId(String formId) {
1395
+    public AjaxResult flowXmlAndNodeByFormIdAndName(String formId, String name) {
1393 1396
         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;
1397
+        List<FlowProcDefDto> flowProcDefList = flowDeployMapper.selectDeployList(name);
1398
+        return flowXmlAndNode(flowVarInst.getProcInstId(), flowProcDefList.get(0).getDeploymentId());
1399 1399
     }
1400 1400
 
1401 1401
     /**

+ 44
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java 查看文件

@@ -63,6 +63,8 @@ public class CmcDeviceApproval extends BaseEntity
63 63
     /** 设备id */
64 64
     @Excel(name = "申领设备")
65 65
     private String deviceNames;
66
+    @Excel(name = "申领设备序号")
67
+    private String deviceNumbers;
66 68
     private String devices;
67 69
 
68 70
     /** 申请日期 */
@@ -75,7 +77,6 @@ public class CmcDeviceApproval extends BaseEntity
75 77
     private String dispatchComment;
76 78
 
77 79
     /** 修改后设备id */
78
-    @Excel(name = "发放设备")
79 80
     private String modifyDeviceNames;
80 81
     @Excel(name = "发放设备序号")
81 82
     private String modifyDeviceNumbers;
@@ -126,6 +127,12 @@ public class CmcDeviceApproval extends BaseEntity
126 127
     private String repairDeviceNumbers;
127 128
     private String repairDevices;
128 129
 
130
+    /** 已归还设备id */
131
+    private String returnDeviceNames;
132
+    @Excel(name = "已归还设备序号")
133
+    private String returnDeviceNumbers;
134
+    private String returnDevices;
135
+
129 136
     private SysUser applierUser;
130 137
 
131 138
     private SysUser managerUser;
@@ -213,6 +220,15 @@ public class CmcDeviceApproval extends BaseEntity
213 220
     {
214 221
         return devices;
215 222
     }
223
+    public void setDeviceNumbers(String deviceNumbers)
224
+    {
225
+        this.deviceNumbers = deviceNumbers;
226
+    }
227
+
228
+    public String getDeviceNumbers()
229
+    {
230
+        return deviceNumbers;
231
+    }
216 232
     public void setDeviceNames(String deviceNames)
217 233
     {
218 234
         this.deviceNames = deviceNames;
@@ -422,6 +438,33 @@ public class CmcDeviceApproval extends BaseEntity
422 438
     {
423 439
         return repairDeviceNumbers;
424 440
     }
441
+    public void setReturnDevices(String returnDevices)
442
+    {
443
+        this.returnDevices = returnDevices;
444
+    }
445
+
446
+    public String getReturnDevices()
447
+    {
448
+        return returnDevices;
449
+    }
450
+    public void setReturnDeviceNames(String returnDeviceNames)
451
+    {
452
+        this.returnDeviceNames = returnDeviceNames;
453
+    }
454
+
455
+    public String getReturnDeviceNames()
456
+    {
457
+        return returnDeviceNames;
458
+    }
459
+    public void setReturnDeviceNumbers(String returnDeviceNumbers)
460
+    {
461
+        this.returnDeviceNumbers = returnDeviceNumbers;
462
+    }
463
+
464
+    public String getReturnDeviceNumbers()
465
+    {
466
+        return returnDeviceNumbers;
467
+    }
425 468
 
426 469
     @Override
427 470
     public String toString() {

oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/FlowVarinst.java → oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/FlowVarInst.java 查看文件

@@ -16,15 +16,12 @@ public class FlowVarInst extends BaseEntity
16 16
     private static final long serialVersionUID = 1L;
17 17
 
18 18
     /** 流程实例id */
19
-    @Excel(name = "流程实例id")
20 19
     private String procInstId;
21 20
 
22 21
     /** 变量名 */
23
-    @Excel(name = "变量名")
24 22
     private String name;
25 23
 
26 24
     /** 变量值 */
27
-    @Excel(name = "变量值")
28 25
     private String text;
29 26
 
30 27
     public void setProcInstId(String procInstId)

+ 3
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml 查看文件

@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
11 11
         <result property="devices"    column="devices"    />
12 12
         <result property="modifyDevices"    column="modify_devices"    />
13 13
         <result property="repairDevices"    column="repair_devices"    />
14
+        <result property="returnDevices"    column="return_devices"    />
14 15
         <result property="projectId"    column="project_id"    />
15 16
         <result property="applyReason"    column="apply_reason"    />
16 17
         <result property="applyDate"    column="apply_date"    />
@@ -60,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
60 61
     </resultMap>
61 62
 
62 63
     <sql id="selectCmcDeviceApprovalVo">
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
+        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.return_devices, da.project_id, p.project_number, p.project_name,
64 65
                da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.repair_devices, da.manager_user_id, u1.nick_name as manager_nick_name, da.manager_comment,
65 66
                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
66 67
             left join sys_user as u on u.user_id = da.applier
@@ -159,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
159 160
             <if test="devices != null">devices = #{devices},</if>
160 161
             <if test="modifyDevices != null">modify_devices = #{modifyDevices},</if>
161 162
             <if test="repairDevices != null">repair_devices = #{repairDevices},</if>
163
+            <if test="returnDevices != null">return_devices = #{returnDevices},</if>
162 164
             <if test="projectId != null">project_id = #{projectId},</if>
163 165
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
164 166
             <if test="applyDate != null">apply_date = #{applyDate},</if>

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

@@ -95,6 +95,15 @@ export function flowXmlAndNode(query) {
95 95
   })
96 96
 }
97 97
 
98
+// 通过表单id及流程名获取流程节点信息
99
+export function flowXmlAndNodeByFormId(query) {
100
+  return request({
101
+    url: '/flowable/task/flowXmlAndNodeByFormId',
102
+    method: 'get',
103
+    params: query
104
+  })
105
+}
106
+
98 107
 // 读取xml文件
99 108
 export function saveXml(data) {
100 109
   return request({

Loading…
取消
儲存