Pārlūkot izejas kodu

设备审批流程更新

lamphua 1 gadu atpakaļ
vecāks
revīzija
8cc2e9303f

+ 22
- 5
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java Parādīt failu

@@ -96,6 +96,21 @@ public class CmcDeviceApprovalController extends BaseController
96 96
         cmcDeviceApproval.setBeginDate(formDataJson.getDate("beginDate"));
97 97
         cmcDeviceApproval.setEndDate(formDataJson.getDate("endDate"));
98 98
         cmcDeviceApproval.setDays(formDataJson.getLong("days"));
99
+        cmcDeviceApproval.setState("0");
100
+        if (formDataJson.getJSONArray("devices").size() > 0) {
101
+            String deviceString = formDataJson.getString("devices").substring(1, formDataJson.getString("devices").length() - 1);
102
+            cmcDeviceApproval.setDevices(deviceString);
103
+            String[] devices = deviceString.split(",");
104
+            BigDecimal estimateCost = new BigDecimal(0);
105
+            for (String device : devices) {
106
+                CmcDevice cmcDevice = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(device));
107
+                cmcDevice.setStatus("0");
108
+                cmcDeviceService.updateCmcDevice(cmcDevice);
109
+                if (cmcDevice.getDayCost() != null)
110
+                    estimateCost = estimateCost.add(cmcDevice.getDayCost().multiply(new BigDecimal(cmcDeviceApproval.getDays())));
111
+            }
112
+            cmcDeviceApproval.setEstimateCost(estimateCost);
113
+        }
99 114
         cmcDeviceApprovalService.insertCmcDeviceApproval(cmcDeviceApproval);
100 115
         return AjaxResult.success("提交设备审批表成功");
101 116
     }
@@ -119,18 +134,18 @@ public class CmcDeviceApprovalController extends BaseController
119 134
     {
120 135
         JSONObject formDataJson = JSONObject.parse(formData);
121 136
         CmcDeviceApproval cmcDeviceApproval = cmcDeviceApprovalService.selectCmcDeviceApprovalByDeviceApplyId(formDataJson.getString("deviceApplyId"));
122
-        if (formDataJson.getString("deptComment") != null && formDataJson.getString("managerComment") == null) {
123
-            cmcDeviceApproval.setDeptUserId(getLoginUser().getUserId());
124
-            cmcDeviceApproval.setDeptComment(formDataJson.getString("deptComment"));
125
-            cmcDeviceApproval.setDeptTime(new Date());
126
-        }
127 137
         if (formDataJson.getString("managerComment") != null && formDataJson.getString("dispatchComment") == null) {
128 138
             cmcDeviceApproval.setManagerUserId(getLoginUser().getUserId());
129 139
             cmcDeviceApproval.setManagerComment(formDataJson.getString("managerComment"));
130 140
             cmcDeviceApproval.setManagerTime(new Date());
131 141
         }
142
+        if (formDataJson.getDate("confirmDate") != null) {
143
+            cmcDeviceApproval.setState("1");
144
+            cmcDeviceApproval.setConfirmDate(formDataJson.getDate("confirmDate"));
145
+        }
132 146
         if (formDataJson.getDate("returnDate") != null) {
133 147
             cmcDeviceApproval.setRemark(formDataJson.getString("remark"));
148
+            cmcDeviceApproval.setState(formDataJson.getString("state"));
134 149
             cmcDeviceApproval.setReturnDate(formDataJson.getDate("returnDate"));
135 150
         }
136 151
         if (formDataJson.getString("dispatchComment") != null) {
@@ -146,6 +161,8 @@ public class CmcDeviceApprovalController extends BaseController
146 161
             BigDecimal estimateCost = new BigDecimal(0);
147 162
             for (String device : devices) {
148 163
                 CmcDevice cmcDevice = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(device));
164
+                cmcDevice.setStatus("1");
165
+                cmcDeviceService.updateCmcDevice(cmcDevice);
149 166
                 if (cmcDevice.getDayCost() != null)
150 167
                     estimateCost = estimateCost.add(cmcDevice.getDayCost().multiply(new BigDecimal(cmcDeviceApproval.getDays())));
151 168
             }

+ 14
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDevice.java Parādīt failu

@@ -75,6 +75,10 @@ public class CmcDevice extends BaseEntity
75 75
     @Excel(name = "管理部门")
76 76
     private SysDept dept;
77 77
 
78
+    /** 状态 */
79
+    @Excel(name = "状态")
80
+    private String status;
81
+
78 82
     public void setDeviceId(Integer deviceId)
79 83
     {
80 84
         this.deviceId = deviceId;
@@ -201,6 +205,15 @@ public class CmcDevice extends BaseEntity
201 205
     {
202 206
         return dept;
203 207
     }
208
+    public void setStatus(String status)
209
+    {
210
+        this.status = status;
211
+    }
212
+
213
+    public String getStatus()
214
+    {
215
+        return status;
216
+    }
204 217
 
205 218
     @Override
206 219
     public String toString() {
@@ -219,6 +232,7 @@ public class CmcDevice extends BaseEntity
219 232
                 .append("place", getPlace())
220 233
                 .append("remark", getRemark())
221 234
                 .append("manageDept", getManageDept())
235
+                .append("status", getStatus())
222 236
                 .toString();
223 237
     }
224 238
 }

+ 14
- 52
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java Parādīt failu

@@ -30,8 +30,6 @@ public class CmcDeviceApproval extends BaseEntity
30 30
 
31 31
     private SysUser applierUser;
32 32
 
33
-    private SysUser deptUser;
34
-
35 33
     private SysUser managerUser;
36 34
 
37 35
     private SysUser dispatchUser;
@@ -70,14 +68,6 @@ public class CmcDeviceApproval extends BaseEntity
70 68
     @Excel(name = "天数")
71 69
     private Long days;
72 70
 
73
-    /** 部门审批人 */
74
-    @Excel(name = "部门审批人")
75
-    private Long deptUserId;
76
-
77
-    /** 部门审批意见 */
78
-    @Excel(name = "部门审批意见")
79
-    private String deptComment;
80
-
81 71
     /** 分管审批人 */
82 72
     @Excel(name = "分管审批人")
83 73
     private Long managerUserId;
@@ -103,16 +93,16 @@ public class CmcDeviceApproval extends BaseEntity
103 93
     @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
104 94
     private Date applyDate;
105 95
 
96
+    /** 确认日期 */
97
+    @JsonFormat(pattern = "yyyy-MM-dd")
98
+    @Excel(name = "确认日期", width = 30, dateFormat = "yyyy-MM-dd")
99
+    private Date confirmDate;
100
+
106 101
     /** 归还日期 */
107 102
     @JsonFormat(pattern = "yyyy-MM-dd")
108 103
     @Excel(name = "归还日期", width = 30, dateFormat = "yyyy-MM-dd")
109 104
     private Date returnDate;
110 105
 
111
-    /** 部门审批时间 */
112
-    @JsonFormat(pattern = "yyyy-MM-dd")
113
-    @Excel(name = "部门审批时间", width = 30, dateFormat = "yyyy-MM-dd")
114
-    private Date deptTime;
115
-
116 106
     /** 分管审批时间 */
117 107
     @JsonFormat(pattern = "yyyy-MM-dd")
118 108
     @Excel(name = "分管审批时间", width = 30, dateFormat = "yyyy-MM-dd")
@@ -155,15 +145,6 @@ public class CmcDeviceApproval extends BaseEntity
155 145
     {
156 146
         return applierUser;
157 147
     }
158
-    public void setDeptUser(SysUser deptUser)
159
-    {
160
-        this.deptUser = deptUser;
161
-    }
162
-
163
-    public SysUser getDeptUser()
164
-    {
165
-        return deptUser;
166
-    }
167 148
     public void setManagerUser(SysUser managerUser)
168 149
     {
169 150
         this.managerUser = managerUser;
@@ -263,24 +244,6 @@ public class CmcDeviceApproval extends BaseEntity
263 244
     {
264 245
         return days;
265 246
     }
266
-    public void setDeptUserId(Long deptUserId) 
267
-    {
268
-        this.deptUserId = deptUserId;
269
-    }
270
-
271
-    public Long getDeptUserId() 
272
-    {
273
-        return deptUserId;
274
-    }
275
-    public void setDeptComment(String deptComment) 
276
-    {
277
-        this.deptComment = deptComment;
278
-    }
279
-
280
-    public String getDeptComment() 
281
-    {
282
-        return deptComment;
283
-    }
284 247
     public void setManagerUserId(Long managerUserId) 
285 248
     {
286 249
         this.managerUserId = managerUserId;
@@ -335,23 +298,23 @@ public class CmcDeviceApproval extends BaseEntity
335 298
     {
336 299
         return applyDate;
337 300
     }
338
-    public void setReturnDate(Date returnDate)
301
+    public void setConfirmDate(Date confirmDate)
339 302
     {
340
-        this.returnDate = returnDate;
303
+        this.confirmDate = confirmDate;
341 304
     }
342 305
 
343
-    public Date getReturnDate()
306
+    public Date getConfirmDate()
344 307
     {
345
-        return returnDate;
308
+        return confirmDate;
346 309
     }
347
-    public void setDeptTime(Date deptTime)
310
+    public void setReturnDate(Date returnDate)
348 311
     {
349
-        this.deptTime = deptTime;
312
+        this.returnDate = returnDate;
350 313
     }
351 314
 
352
-    public Date getDeptTime()
315
+    public Date getReturnDate()
353 316
     {
354
-        return deptTime;
317
+        return returnDate;
355 318
     }
356 319
     public void setManagerTime(Date managerTime)
357 320
     {
@@ -392,14 +355,13 @@ public class CmcDeviceApproval extends BaseEntity
392 355
             .append("beginDate", getBeginDate())
393 356
             .append("endDate", getEndDate())
394 357
             .append("days", getDays())
395
-            .append("deptUserId", getDeptUserId())
396
-            .append("deptComment", getDeptComment())
397 358
             .append("managerUserId", getManagerUserId())
398 359
             .append("managerComment", getManagerComment())
399 360
             .append("dispatcher", getDispatcher())
400 361
             .append("dispatchComment", getDispatchComment())
401 362
             .append("estimateCost", getEstimateCost())
402 363
             .append("applyDate", getApplyDate())
364
+            .append("confirmDate", getConfirmDate())
403 365
             .append("returnDate", getReturnDate())
404 366
             .toString();
405 367
     }

+ 23
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcTechnical.java Parādīt failu

@@ -76,6 +76,10 @@ public class CmcTechnical extends BaseEntity
76 76
     @Excel(name = "技术审核意见")
77 77
     private String technicalComment;
78 78
 
79
+    /** 总工审批人 */
80
+    @Excel(name = "总工审批人")
81
+    private Long managerUserId;
82
+
79 83
     /** 总工审核意见 */
80 84
     @Excel(name = "总工审核意见")
81 85
     private String manageComment;
@@ -158,6 +162,15 @@ public class CmcTechnical extends BaseEntity
158 162
     {
159 163
         return designUser;
160 164
     }
165
+    public void setManagerUser(SysUser managerUser)
166
+    {
167
+        this.managerUser = managerUser;
168
+    }
169
+
170
+    public SysUser getManagerUser()
171
+    {
172
+        return managerUser;
173
+    }
161 174
     public void setPlanComment(String planComment)
162 175
     {
163 176
         this.planComment = planComment;
@@ -230,6 +243,15 @@ public class CmcTechnical extends BaseEntity
230 243
     {
231 244
         return technicalComment;
232 245
     }
246
+    public void setManagerUserId(Long managerUserId)
247
+    {
248
+        this.managerUserId = managerUserId;
249
+    }
250
+
251
+    public Long getManagerUserId()
252
+    {
253
+        return managerUserId;
254
+    }
233 255
     public void setManageComment(String manageComment)
234 256
     {
235 257
         this.manageComment = manageComment;
@@ -281,6 +303,7 @@ public class CmcTechnical extends BaseEntity
281 303
                 .append("technicalDocument", getTechnicalDocument())
282 304
                 .append("designDescription", getDesignDescription())
283 305
                 .append("technicalComment", getTechnicalComment())
306
+                .append("managerUserId", getManagerUserId())
284 307
                 .append("manageComment", getManageComment())
285 308
                 .append("technicalUploadTime", getTechnicalUploadTime())
286 309
                 .append("techApprovalTime", getTechApprovalTime())

+ 4
- 27
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml Parādīt failu

@@ -16,8 +16,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
16 16
         <result property="beginDate"    column="begin_date"    />
17 17
         <result property="endDate"    column="end_date"    />
18 18
         <result property="days"    column="days"    />
19
-        <result property="deptUserId"    column="dept_user_id"    />
20
-        <result property="deptComment"    column="dept_comment"    />
21 19
         <result property="managerUserId"    column="manager_user_id"    />
22 20
         <result property="managerComment"    column="manager_comment"    />
23 21
         <result property="dispatcher"    column="dispatcher"    />
@@ -25,13 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
25 23
         <result property="estimateCost"    column="estimate_cost"    />
26 24
         <result property="remark"    column="remark"    />
27 25
         <result property="state"    column="state"    />
28
-        <result property="deptTime"    column="dept_time"    />
29 26
         <result property="managerTime"    column="manager_time"    />
30 27
         <result property="dispatchTime"    column="dispatch_time"    />
31 28
         <association property="applierUser"    javaType="SysUser"         resultMap="SysUserResult" />
32 29
         <association property="dept"    javaType="SysDept"         resultMap="SysDeptResult" />
33 30
         <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
34
-        <association property="deptUser"    javaType="SysUser"         resultMap="DeptUserResult" />
35 31
         <association property="managerUser"    javaType="SysUser"         resultMap="ManagerUserResult" />
36 32
         <association property="dispatchUser"    javaType="SysUser"         resultMap="DispatchUserResult" />
37 33
     </resultMap>
@@ -41,11 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
41 37
         <result property="nickName"    column="applier_nick_name"    />
42 38
     </resultMap>
43 39
 
44
-    <resultMap type="SysUser" id="DeptUserResult">
45
-        <result property="userId"    column="user_id"    />
46
-        <result property="nickName"    column="dept_nick_name"    />
47
-    </resultMap>
48
-
49 40
     <resultMap type="SysUser" id="ManagerUserResult">
50 41
         <result property="userId"    column="user_id"    />
51 42
         <result property="nickName"    column="manager_nick_name"    />
@@ -69,13 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
69 60
 
70 61
     <sql id="selectCmcDeviceApprovalVo">
71 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,
72
-               da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.dept_user_id, u1.nick_name as dept_nick_name, da.state,
73
-               da.dept_comment, da.manager_user_id, u2.nick_name as manager_nick_name, da.manager_comment, da.dispatcher, u3.nick_name as dispatch_nick_name, da.dispatch_comment,
74
-               da.estimate_cost, da.remark, da.dept_time, da.manager_time, da.dispatch_time from cmc_device_approval as da
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
75 65
             left join sys_user as u on u.user_id = da.applier
76
-            left join sys_user as u1 on u1.user_id = da.dept_user_id
77
-            left join sys_user as u2 on u2.user_id = da.manager_user_id
78
-            left join sys_user as u3 on u3.user_id = da.dispatcher
66
+            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
79 68
             left join sys_dept as d on d.dept_id = da.use_dept
80 69
             left join cmc_project as p on da.project_id = p.project_id
81 70
     </sql>
@@ -93,14 +82,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
93 82
             <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
94 83
             <if test="endDate != null "> and da.end_date = #{endDate}</if>
95 84
             <if test="days != null "> and da.days = #{days}</if>
96
-            <if test="deptUserId != null "> and da.dept_user_id = #{deptUserId}</if>
97
-            <if test="deptComment != null  and deptComment != ''"> and da.dept_comment = #{deptComment}</if>
98 85
             <if test="managerUserId != null "> and da.manager_user_id = #{managerUserId}</if>
99 86
             <if test="managerComment != null  and managerComment != ''"> and da.manager_comment = #{managerComment}</if>
100 87
             <if test="dispatcher != null "> and da.dispatcher = #{dispatcher}</if>
101 88
             <if test="dispatchComment != null  and dispatchComment != ''"> and da.dispatch_comment = #{dispatchComment}</if>
102 89
             <if test="estimateCost != null "> and da.estimate_cost = #{estimateCost}</if>
103
-            <if test="deptTime != null "> and da.dept_time = #{deptTime}</if>
104 90
             <if test="managerTime != null "> and da.manager_time = #{managerTime}</if>
105 91
             <if test="dispatchTime != null "> and da.dispatch_time = #{dispatchTime}</if>
106 92
         </where>
@@ -125,8 +111,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
125 111
             <if test="beginDate != null">begin_date,</if>
126 112
             <if test="endDate != null">end_date,</if>
127 113
             <if test="days != null">days,</if>
128
-            <if test="deptUserId != null">dept_user_id,</if>
129
-            <if test="deptComment != null">dept_comment,</if>
130 114
             <if test="managerUserId != null">manager_user_id,</if>
131 115
             <if test="managerComment != null">manager_comment,</if>
132 116
             <if test="dispatcher != null">dispatcher,</if>
@@ -134,7 +118,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
134 118
             <if test="estimateCost != null">estimate_cost,</if>
135 119
             <if test="remark != null">remark,</if>
136 120
             <if test="state != null">state,</if>
137
-            <if test="deptTime != null">dept_time,</if>
138 121
             <if test="managerTime != null">manager_time,</if>
139 122
             <if test="dispatchTime != null">dispatch_time,</if>
140 123
          </trim>
@@ -150,8 +133,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
150 133
             <if test="beginDate != null">#{beginDate},</if>
151 134
             <if test="endDate != null">#{endDate},</if>
152 135
             <if test="days != null">#{days},</if>
153
-            <if test="deptUserId != null">#{deptUserId},</if>
154
-            <if test="deptComment != null">#{deptComment},</if>
155 136
             <if test="managerUserId != null">#{managerUserId},</if>
156 137
             <if test="managerComment != null">#{managerComment},</if>
157 138
             <if test="dispatcher != null">#{dispatcher},</if>
@@ -159,7 +140,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
159 140
             <if test="estimateCost != null">#{estimateCost},</if>
160 141
             <if test="remark != null">#{remark},</if>
161 142
             <if test="state != null">#{state},</if>
162
-            <if test="deptTime != null">#{deptTime},</if>
163 143
             <if test="managerTime != null">#{managerTime},</if>
164 144
             <if test="dispatchTime != null">#{dispatchTime},</if>
165 145
          </trim>
@@ -178,8 +158,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
178 158
             <if test="beginDate != null">begin_date = #{beginDate},</if>
179 159
             <if test="endDate != null">end_date = #{endDate},</if>
180 160
             <if test="days != null">days = #{days},</if>
181
-            <if test="deptUserId != null">dept_user_id = #{deptUserId},</if>
182
-            <if test="deptComment != null">dept_comment = #{deptComment},</if>
183 161
             <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
184 162
             <if test="managerComment != null">manager_comment = #{managerComment},</if>
185 163
             <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
@@ -187,7 +165,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
187 165
             <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
188 166
             <if test="remark != null">remark = #{remark},</if>
189 167
             <if test="state != null">state = #{state},</if>
190
-            <if test="deptTime != null">dept_time = #{deptTime},</if>
191 168
             <if test="managerTime != null">manager_time = #{managerTime},</if>
192 169
             <if test="dispatchTime != null">dispatch_time = #{dispatchTime},</if>
193 170
         </trim>

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceMapper.xml Parādīt failu

@@ -19,6 +19,7 @@
19 19
         <result property="place"    column="place"    />
20 20
         <result property="remark"    column="remark"    />
21 21
         <result property="manageDept"    column="manage_dept"    />
22
+        <result property="status"    column="status"    />
22 23
         <association property="dept"    javaType="SysDept"         resultMap="deptResult" />
23 24
     </resultMap>
24 25
 
@@ -28,7 +29,7 @@
28 29
     </resultMap>
29 30
 
30 31
     <sql id="selectCmcDeviceVo">
31
-        select d.device_id, d.device_number, d.code, d.name, d.type, d.acquisition_time, d.cost, d.expect_life, d.series, d.brand, d.day_cost, d.place, d.remark, d.manage_dept, dept.dept_name from cmc_device as d left join sys_dept as dept
32
+        select d.device_id, d.device_number, d.code, d.name, d.type, d.acquisition_time, d.cost, d.expect_life, d.series, d.brand, d.day_cost, d.place, d.remark, d.manage_dept, d.status, dept.dept_name from cmc_device as d left join sys_dept as dept
32 33
     </sql>
33 34
 
34 35
     <select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
@@ -47,6 +48,7 @@
47 48
             <if test="dayCost != null "> and d.day_cost = #{dayCost}</if>
48 49
             <if test="place != null  and place != ''"> and d.place like concat('%', #{place}, '%')</if>
49 50
             <if test="manageDept != null "> and d.manage_dept = #{manageDept}</if>
51
+            <if test="status != null "> and d.status = #{status}</if>
50 52
         </where>
51 53
     </select>
52 54
 
@@ -76,6 +78,7 @@
76 78
             <if test="place != null">place,</if>
77 79
             <if test="remark != null">remark,</if>
78 80
             <if test="manageDept != null">manage_dept,</if>
81
+            <if test="status != null">status,</if>
79 82
         </trim>
80 83
         <trim prefix="values (" suffix=")" suffixOverrides=",">
81 84
             <if test="deviceNumber != null">#{deviceNumber},</if>
@@ -91,6 +94,7 @@
91 94
             <if test="place != null">#{place},</if>
92 95
             <if test="remark != null">#{remark},</if>
93 96
             <if test="manageDept != null">#{manageDept},</if>
97
+            <if test="status != null">#{status},</if>
94 98
         </trim>
95 99
     </insert>
96 100
 
@@ -110,6 +114,7 @@
110 114
             <if test="place != null">place = #{place},</if>
111 115
             <if test="remark != null">remark = #{remark},</if>
112 116
             <if test="manageDept != null">manage_dept = #{manageDept},</if>
117
+            <if test="status != null">status = #{status},</if>
113 118
         </trim>
114 119
         where device_id = #{deviceId}
115 120
     </update>

+ 12
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcTechnicalMapper.xml Parādīt failu

@@ -24,6 +24,7 @@
24 24
         <result property="manageApprovalTime"    column="manage_approval_time"    />
25 25
         <association property="planUser"    javaType="SysUser"         resultMap="PlanUserResult" />
26 26
         <association property="designUser"    javaType="SysUser"         resultMap="DesignUserResult" />
27
+        <association property="managerUser"    javaType="SysUser"         resultMap="ManagerUserResult" />
27 28
     </resultMap>
28 29
 
29 30
     <resultMap type="SysUser" id="PlanUserResult">
@@ -36,12 +37,19 @@
36 37
         <result property="nickName"    column="design_nick_name"    />
37 38
     </resultMap>
38 39
 
40
+    <resultMap type="SysUser" id="ManagerUserResult">
41
+        <result property="userId"    column="user_id"    />
42
+        <result property="nickName"    column="manager_nick_name"    />
43
+    </resultMap>
44
+
39 45
     <sql id="selectCmcTechnicalVo">
40 46
         select t.technical_id, t.project_id, t.technical_director, t.technical_designer, u.nick_name as design_nick_name, t.technical_planner, u1.nick_name as plan_nick_name,
41 47
                t.plan_comment, t.quality_inspector, t.technical_time, t.technical_document, t.modify_document, t.final_document, t.design_description, t.technical_comment,
48
+               t.manager_user_id, u2.nick_name as manager_nick_name,
42 49
                t.manage_comment, t.technical_upload_time, t.tech_approval_time, t.manage_approval_time from cmc_technical as t
43 50
          left join sys_user as u on u.user_id = t.technical_designer
44 51
          left join sys_user as u1 on u1.user_id = t.technical_planner
52
+         left join sys_user as u2 on u2.user_id = t.manager_user_id
45 53
     </sql>
46 54
 
47 55
     <select id="selectCmcTechnicalList" parameterType="CmcTechnical" resultMap="CmcTechnicalResult">
@@ -57,6 +65,7 @@
57 65
             <if test="technicalDocument != null  and technicalDocument != ''"> and t.technical_document = #{technicalDocument}</if>
58 66
             <if test="designDescription != null  and designDescription != ''"> and t.design_description = #{designDescription}</if>
59 67
             <if test="technicalComment != null  and technicalComment != ''"> and t.technical_comment = #{technicalComment}</if>
68
+            <if test="managerUserId != null "> and t.manager_user_id = #{managerUserId}</if>
60 69
             <if test="manageComment != null  and manageComment != ''"> and t.manage_comment = #{manageComment}</if>
61 70
             <if test="technicalUploadTime != null "> and t.technical_upload_time = #{technicalUploadTime}</if>
62 71
             <if test="techApprovalTime != null "> and t.tech_approval_time = #{techApprovalTime}</if>
@@ -85,6 +94,7 @@
85 94
             <if test="finalDocument != null">final_document,</if>
86 95
             <if test="designDescription != null">design_description,</if>
87 96
             <if test="technicalComment != null">technical_comment,</if>
97
+            <if test="managerUserId != null">manager_user_id,</if>
88 98
             <if test="manageComment != null">manage_comment,</if>
89 99
             <if test="technicalUploadTime != null">technical_upload_time,</if>
90 100
             <if test="techApprovalTime != null">tech_approval_time,</if>
@@ -104,6 +114,7 @@
104 114
             <if test="finalDocument != null">#{finalDocument},</if>
105 115
             <if test="designDescription != null">#{designDescription},</if>
106 116
             <if test="technicalComment != null">#{technicalComment},</if>
117
+            <if test="managerUserId != null">#{managerUserId},</if>
107 118
             <if test="manageComment != null">#{manageComment},</if>
108 119
             <if test="technicalUploadTime != null">#{technicalUploadTime},</if>
109 120
             <if test="techApprovalTime != null">#{techApprovalTime},</if>
@@ -126,6 +137,7 @@
126 137
             <if test="finalDocument != null">final_document = #{finalDocument},</if>
127 138
             <if test="designDescription != null">design_description = #{designDescription},</if>
128 139
             <if test="technicalComment != null">technical_comment = #{technicalComment},</if>
140
+            <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
129 141
             <if test="manageComment != null">manage_comment = #{manageComment},</if>
130 142
             <if test="technicalUploadTime != null">technical_upload_time = #{technicalUploadTime},</if>
131 143
             <if test="techApprovalTime != null">tech_approval_time = #{techApprovalTime},</if>

+ 1
- 1
oa-back/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml Parādīt failu

@@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
112 112
 		select u.user_id, u.nick_name from sys_user as u
113 113
 		left join sys_user_post as up on u.user_id = up.user_id
114 114
 		left join sys_post as p on up.post_id = p.post_id
115
-		where p.post_name = '主任' and u.dept_id = #{param}
115
+		where p.post_name = '主任' and u.dept_id = #{param}
116 116
 	</select>
117 117
 
118 118
 	<select id="selectViceDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">

+ 603
- 602
oa-back/sql/sql.sql
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 31
- 94
oa-ui/src/views/flowable/form/oa/deviceForm.vue Parādīt failu

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-07 13:44:39
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-05-22 19:15:50
5
+ * @LastEditTime: 2024-05-23 14:46:21
6 6
 -->
7 7
 
8 8
 <template>
@@ -84,23 +84,33 @@
84 84
                   </el-form-item>
85 85
                 </el-col>
86 86
               </el-row>
87
+              <!-- 安排设备意见 -->
87 88
               <el-divider></el-divider>
88
-
89
-              <!-- 部门审核意见 -->
90
-              <el-form-item label="部门审核意见:" prop="deptComment" label-width="120px" v-if="showFormItem('部门审核')">
91
-                <el-input type="textarea" :rows="2" placeholder="请输入部门审核意见" v-model="form.deptComment"
92
-                  :disabled="taskName != '部门审核'">
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'"
93
+                    :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
94
+                     + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
95
+                  </el-option>
96
+                </el-select>
97
+              </el-form-item>
98
+              <el-form-item label="安排设备意见:" prop="dispatchComment" label-width="120px">
99
+                <el-input type="textarea" :rows="2" placeholder="请输入安排设备意见" v-model="form.dispatchComment"
100
+                  :disabled="taskName != '安排设备'">
93 101
                 </el-input>
94 102
               </el-form-item>
95 103
               <el-row>
96 104
                 <el-col :span="6" :xs="24" :offset="12">
97
-                  <el-form-item label="签名:" label-width="120px" v-if="showFormItem('部门审核签名')">
98
-                    <span class="auditor"> {{ form.deptUser ? form.deptUser.nickName : deptUser }} </span>
105
+                  <el-form-item label="签名:" label-width="120px"
106
+                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
107
+                    <span class="auditor"> {{ form.dispatchUser ? form.dispatchUser.nickName : dispatchUser }} </span>
99 108
                   </el-form-item>
100 109
                 </el-col>
101 110
                 <el-col :span="6">
102
-                  <el-form-item label="日期:" label-width="120px" v-if="showFormItem('部门审核签名')">
103
-                    <span> {{ form.deptTime ? form.deptTime : deptTime }} </span>
111
+                  <el-form-item label="日期:" label-width="120px"
112
+                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
113
+                    <span> {{ form.dispatchTime ? form.dispatchTime : dispatchTime }} </span>
104 114
                   </el-form-item>
105 115
                 </el-col>
106 116
               </el-row>
@@ -122,53 +132,12 @@
122 132
                   </el-form-item>
123 133
                 </el-col>
124 134
               </el-row>
125
-              <!-- 安排设备意见 -->
126
-              <el-divider></el-divider>
127
-              <el-form-item label="安排设备意见:" prop="dispatchComment" label-width="120px">
128
-                <el-input type="textarea" :rows="2" placeholder="请输入安排设备意见" v-model="form.dispatchComment"
129
-                  :disabled="taskName != '安排设备'">
130
-                </el-input>
131
-              </el-form-item>
132
-              <el-row>
133
-                <el-col :span="6" :xs="24" :offset="12">
134
-                  <el-form-item label="签名:" label-width="120px"
135
-                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
136
-                    <span class="auditor"> {{ form.dispatchUser ? form.dispatchUser.nickName : dispatchUser }} </span>
137
-                  </el-form-item>
138
-                </el-col>
139
-                <el-col :span="6">
140
-                  <el-form-item label="日期:" label-width="120px"
141
-                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
142
-                    <span> {{ form.dispatchTime ? form.dispatchTime : dispatchTime }} </span>
143
-                  </el-form-item>
144
-                </el-col>
145
-              </el-row>
146
-              <!-- 设备安排 -->
147
-              <el-form-item label-width="120px" label="设备选择:">
148
-                <el-select style="width: 300px;" v-model="form.devices" filterable multiple placeholder="请选择"
149
-                  @change="handleSelectDevice" clearable :disabled="taskName != '安排设备'">
150
-                  <el-option v-for="item in deviceList" :key="item.deviceId"
151
-                    :label="item.brand + item.series + item.name + item.code" :value="item.deviceId">
152
-                  </el-option>
153
-                </el-select>
154
-                <el-descriptions border v-if="isDeviceSelect" style="margin-top: 10px;" :column="1">
155
-                  <el-descriptions-item label="出厂编号" label-class-name="my-label">{{ chooseDevice.code
156
-                  }}</el-descriptions-item>
157
-                  <el-descriptions-item label="设备名称" label-class-name="my-label">{{ chooseDevice.name
158
-                  }}</el-descriptions-item>
159
-                  <el-descriptions-item label="设备品牌" label-class-name="my-label">{{ chooseDevice.brand
160
-                  }}</el-descriptions-item>
161
-                  <el-descriptions-item label="规格型号" label-class-name="my-label">{{ chooseDevice.series
162
-                  }}</el-descriptions-item>
163
-                  <el-descriptions-item label="存放地点" label-class-name="my-label">{{ chooseDevice.place
164
-                  }}</el-descriptions-item>
165
-                </el-descriptions>
166
-              </el-form-item>
135
+              <!-- 归还确认 -->
167 136
               <el-divider></el-divider>
168 137
               <el-form-item label="设备状况:" prop="state" label-width="120px">                
169 138
                 <el-radio-group v-model="form.state" size="small" :disabled="taskName != '归还确认'">
170
-                  <el-radio label="0">完好</el-radio>
171
-                  <el-radio label="1">需维修</el-radio>
139
+                  <el-radio label="2">完好</el-radio>
140
+                  <el-radio label="3">需维修</el-radio>
172 141
                 </el-radio-group>
173 142
               </el-form-item>
174 143
               <el-form-item label="备注:" prop="remark" label-width="120px">
@@ -214,7 +183,7 @@ import { listDeviceApproval, getDeviceApproval, updateDeviceApproval, submitDevi
214 183
 import {
215 184
   complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm,
216 185
 } from "@/api/flowable/todo";
217
-import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
186
+import { getUsersManageLeader } from '@/api/system/post.js'
218 187
 import flow from '@/views/flowable/task/todo/detail/flow'
219 188
 import { flowXmlAndNode } from "@/api/flowable/definition";
220 189
 import { getUserByRole } from "@/api/system/role";
@@ -233,10 +202,6 @@ export default {
233 202
     }
234 203
   },
235 204
   created() {
236
-    if (this.taskName == '部门审核') {
237
-      this.deptUser = this.$store.getters.name;
238
-      this.deptTime = parseTime(new Date(), '{y}-{m}-{d}')
239
-    }
240 205
     if (this.taskName == '分管审核') {
241 206
       this.managerUser = this.$store.getters.name;
242 207
       this.managerTime = parseTime(new Date(), '{y}-{m}-{d}')
@@ -255,10 +220,8 @@ export default {
255 220
   },
256 221
   data() {
257 222
     return {
258
-      deptUser: '',
259 223
       managerUser: '',
260 224
       dispatchUser: '',
261
-      deptTime: undefined,
262 225
       managerTime: undefined,
263 226
       dispatchTime: undefined,
264 227
       form: {
@@ -288,8 +251,6 @@ export default {
288 251
         ],
289 252
       },
290 253
       deviceList: [],
291
-      chooseDevice: {},
292
-      isDeviceSelect: false,
293 254
       formTotal: 0
294 255
     }
295 256
   },
@@ -368,17 +329,16 @@ export default {
368 329
     },
369 330
     // 获取下一个审批人
370 331
     getNextFlowNodeApproval() {
371
-      if (this.taskName == '设备申请') {
372
-        getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
373
-          let userId = res.data.userId;
374
-          this.$set(this.taskForm.variables, "approval", userId);
332
+      if (this.taskName == '设备申请') {        
333
+        getUserByRole({ roleId: 5 }).then(result => {
334
+          this.$set(this.taskForm.variables, "approval", result.data[0]);
375 335
           complete(this.taskForm).then(response => {
376 336
             this.$modal.msgSuccess(response.msg);
377 337
             this.$emit('goBack')
378 338
           });
379
-        })
380
-      } else if (this.taskName == '部门审核') {
381
-        getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
339
+        });
340
+      } else if (this.taskName == '安排设备') {
341
+        getUsersManageLeader({ userId: this.form.applier }).then(res => {
382 342
           let userId = res.data.userId;
383 343
           this.$set(this.taskForm.variables, "approval", userId);
384 344
           complete(this.taskForm).then(response => {
@@ -387,14 +347,6 @@ export default {
387 347
           });
388 348
         })
389 349
       } else if (this.taskName == '分管审核') {
390
-        getUserByRole({ roleId: 5 }).then(result => {
391
-          this.$set(this.taskForm.variables, "approval", result.data[0]);
392
-          complete(this.taskForm).then(response => {
393
-            this.$modal.msgSuccess(response.msg);
394
-            this.$emit('goBack')
395
-          });
396
-        });
397
-      } else if (this.taskName == '安排设备') {
398 350
         complete(this.taskForm).then(response => {
399 351
           this.$modal.msgSuccess(response.msg);
400 352
           this.$emit('goBack')
@@ -446,17 +398,6 @@ export default {
446 398
         this.deviceList = res.rows
447 399
       })
448 400
     },
449
-    // 选择设备
450
-    handleSelectDevice(val) {
451
-      if (val != "" && val != undefined && val != null) {
452
-        getDevice(val[val.length - 1]).then(res => {
453
-          this.chooseDevice = res.data;
454
-          this.isDeviceSelect = true
455
-        })
456
-      } else {
457
-        this.isDeviceSelect = false
458
-      }
459
-    },
460 401
     // 计算天数
461 402
     calculateDay() {
462 403
       if (this.form.beginDate && this.form.endDate) {
@@ -483,12 +424,8 @@ export default {
483 424
     },
484 425
     showFormItem(name) {
485 426
       let isShow = false;
486
-      if (name == '部门审核')
487
-        isShow = (this.taskName == '设备申请' || this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.deptUserId != null);
488
-      else if (name == '分管审核')
427
+      if (name == '分管审核')
489 428
         isShow = (this.taskName == '设备申请' || this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
490
-      else if (name == '部门审核签名')
491
-        isShow = (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.deptUserId != null);
492 429
       else if (name == '分管审核签名')
493 430
         isShow = this.taskName == '分管审核' || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
494 431
       return isShow;

+ 37
- 3
oa-ui/src/views/oa/device/detail.vue Parādīt failu

@@ -117,7 +117,7 @@
117 117
             <el-table-column type="index" width="55" align="center" label="序号" />
118 118
             <el-table-column label="费用类型" align="center" prop="expenseType">
119 119
               <template slot-scope="scope">
120
-                <el-tag :type="typeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType) }}</el-tag>
120
+                <el-tag :type="expenseTypeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType) }}</el-tag>
121 121
               </template>
122 122
             </el-table-column>
123 123
             <el-table-column label="费用金额" align="center" prop="expense">
@@ -200,10 +200,16 @@
200 200
                 {{ scope.row.beginDate }}
201 201
               </template>
202 202
             </el-table-column>
203
-            <el-table-column label="归还时间" align="center" prop="returnDate" width="180">
203
+            <el-table-column label="归还时间" align="center" prop="returnDate">
204 204
               <template slot-scope="scope">
205 205
                 {{ scope.row.returnDate }}
206 206
               </template>
207
+            </el-table-column>            
208
+            <el-table-column label="设备状况" align="center" prop="state">
209
+              <template slot-scope="scope">
210
+                <el-tag :type="stateTypeStyle(scope.row.state)">{{ stateTypeText(scope.row.state) }}</el-tag>
211
+                {{ scope.row.state ? (scope.row.state == '0' ? '完好' : '需维修') : '使用中' }}
212
+              </template>
207 213
             </el-table-column>
208 214
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
209 215
               <template slot-scope="scope">
@@ -454,7 +460,7 @@ export default {
454 460
         return '检定费'
455 461
       }
456 462
     },
457
-    typeStyle(row) {
463
+    expenseTypeStyle(row) {
458 464
       if (row == '0') {
459 465
         return 'primary'
460 466
       }
@@ -464,6 +470,34 @@ export default {
464 470
       if (row == '2') {
465 471
         return 'success'
466 472
       }
473
+    },
474
+    stateTypeText(row) {
475
+      if (row == '0') {
476
+        return '申领中'
477
+      }
478
+      if (row == '1') {
479
+        return '被领取'
480
+      }
481
+      if (row == '2') {
482
+        return '完好'
483
+      }
484
+      if (row == '3') {
485
+        return '需维修'
486
+      }
487
+    },
488
+    stateTypeStyle(row) {
489
+      if (row == '0') {
490
+        return 'primary'
491
+      }
492
+      if (row == '1') {
493
+        return 'warning'
494
+      }
495
+      if (row == '2') {
496
+        return 'success'
497
+      }
498
+      if (row == '3') {
499
+        return 'danger'
500
+      }
467 501
     }
468 502
   },
469 503
 }

+ 27
- 0
oa-ui/src/views/oa/device/index.vue Parādīt failu

@@ -37,6 +37,11 @@
37 37
     <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
38 38
       <el-table-column type="selection" width="55" align="center" />
39 39
       <!-- <el-table-column label="设备id" align="center" prop="deviceId" /> -->
40
+      <el-table-column label="设备状态" align="center" prop="status" >
41
+        <template slot-scope="scope">
42
+                <el-tag :type="stateTypeStyle(scope.row.status)">{{ stateTypeText(scope.row.status) }}</el-tag>
43
+              </template>
44
+      </el-table-column>
40 45
       <el-table-column label="出厂编号" align="center" prop="code" />
41 46
       <el-table-column label="设备名称" align="center" prop="name" />
42 47
       <el-table-column label="设备类别" align="center" prop="type" />
@@ -308,6 +313,28 @@ export default {
308 313
       this.download('oa/device/export', {
309 314
         ...this.queryParams
310 315
       }, `device_${new Date().getTime()}.xlsx`)
316
+    },
317
+    stateTypeText(row) {
318
+      if (row == '0') {
319
+        return '被领用'
320
+      }
321
+      if (row == '1') {
322
+        return '可领用'
323
+      }
324
+      if (row == '2') {
325
+        return '已停用'
326
+      }
327
+    },
328
+    stateTypeStyle(row) {
329
+      if (row == '0') {
330
+        return 'warning'
331
+      }
332
+      if (row == '1') {
333
+        return 'success'
334
+      }
335
+      if (row == '2') {
336
+        return 'info'
337
+      }
311 338
     }
312 339
   }
313 340
 };

Notiek ielāde…
Atcelt
Saglabāt