|
@@ -11,11 +11,17 @@ import java.util.Map;
|
11
|
11
|
import java.util.Optional;
|
12
|
12
|
import java.util.stream.Collectors;
|
13
|
13
|
|
|
14
|
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
15
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
14
|
16
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
15
|
17
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
18
|
+import com.ruoyi.common.constant.HttpStatus;
|
16
|
19
|
import com.ruoyi.common.constant.PostCheckedProblemEnum;
|
|
20
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
21
|
+import com.ruoyi.common.core.domain.model.LoginUser;
|
17
|
22
|
import com.ruoyi.common.exception.base.BaseException;
|
18
|
23
|
import com.ruoyi.common.utils.DateUtils;
|
|
24
|
+import com.ruoyi.common.utils.SecurityUtils;
|
19
|
25
|
import com.ruoyi.postCheck.domain.PostAssessmentRating;
|
20
|
26
|
import com.ruoyi.postCheck.domain.PostAssessmentRules;
|
21
|
27
|
import com.ruoyi.postCheck.domain.PostList;
|
|
@@ -41,7 +47,9 @@ import com.ruoyi.postCheck.mapper.PostListMapper;
|
41
|
47
|
import com.ruoyi.postCheck.mapper.PostPlanInfoMapper;
|
42
|
48
|
import com.ruoyi.postCheck.mapper.PostPlanMapper;
|
43
|
49
|
import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
|
44
|
|
-//import io.swagger.annotations.ApiModelProperty;
|
|
50
|
+import com.ruoyi.system.domain.SysPost;
|
|
51
|
+import com.ruoyi.system.domain.UserPostAuthority;
|
|
52
|
+import com.ruoyi.system.service.ISysPostService;
|
45
|
53
|
import io.swagger.annotations.ApiModelProperty;
|
46
|
54
|
import org.apache.commons.lang3.StringUtils;
|
47
|
55
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -55,14 +63,6 @@ import org.springframework.util.CollectionUtils;
|
55
|
63
|
import org.springframework.web.context.request.FacesWebRequest;
|
56
|
64
|
|
57
|
65
|
|
58
|
|
-
|
59
|
|
-
|
60
|
|
-
|
61
|
|
-
|
62
|
|
-
|
63
|
|
-
|
64
|
|
-
|
65
|
|
-
|
66
|
66
|
/**
|
67
|
67
|
* 岗检问题表Service业务层处理
|
68
|
68
|
*
|
|
@@ -88,6 +88,9 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
88
|
88
|
@Autowired
|
89
|
89
|
private PostAssessmentRatingOtherMapper postAssessmentRatingOtherMapper;
|
90
|
90
|
|
|
91
|
+ @Autowired
|
|
92
|
+ private ISysPostService sysPostService;
|
|
93
|
+
|
91
|
94
|
/**
|
92
|
95
|
* 查询岗检问题表
|
93
|
96
|
*
|
|
@@ -140,10 +143,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
140
|
143
|
int count = 0;
|
141
|
144
|
for (PostCheckedProblem postCheckedProblem : postCheckedProblemList) {
|
142
|
145
|
count++;
|
143
|
|
- //TODO 自增主键修改为-MyBatis-Plus雪花算法(截取5位解决VUE精度丢失BUG)-系统登录日志
|
144
|
|
-// if (postCheckedProblem.getId() == null)
|
145
|
146
|
postCheckedProblem.setId(Long.parseLong(IdWorker.getIdStr().substring(4)));
|
146
|
|
- // postCheckedProblem.setCreateTime(DateUtils.getNowDate());
|
147
|
147
|
postCheckedProblem.setCreateDefault();
|
148
|
148
|
|
149
|
149
|
postCheckedProblem.setProblemNo("GJ-" + DateUtils.getTime());
|
|
@@ -152,6 +152,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
152
|
152
|
postCheckedProblem.setCheckedDeptId(checkedDeptId);
|
153
|
153
|
//检查时间取值=岗检计划的开始时间
|
154
|
154
|
postCheckedProblem.setCheckTime(checkTime);
|
|
155
|
+ postCheckedProblem.setStatus(PostCheckedProblemEnum.ADD.getValue());
|
155
|
156
|
|
156
|
157
|
int insertCount = postCheckedProblemMapper.insertPostCheckedProblem(postCheckedProblem);
|
157
|
158
|
if (insertCount == 0) {
|
|
@@ -161,6 +162,43 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
161
|
162
|
return 1;
|
162
|
163
|
}
|
163
|
164
|
|
|
165
|
+ /**
|
|
166
|
+ * 修改岗检问题表
|
|
167
|
+ *
|
|
168
|
+ * @param postCheckedProblemList 岗检问题集合
|
|
169
|
+ * @return 结果
|
|
170
|
+ */
|
|
171
|
+ @Override
|
|
172
|
+ @Transactional(rollbackFor = Exception.class)
|
|
173
|
+ public int updatePostCheckedProblem(List<PostCheckedProblem> postCheckedProblemList) {
|
|
174
|
+ if (CollectionUtils.isEmpty(postCheckedProblemList)) {
|
|
175
|
+ return 0;
|
|
176
|
+ }
|
|
177
|
+ int count = 0;
|
|
178
|
+ for (PostCheckedProblem postCheckedProblem : postCheckedProblemList) {
|
|
179
|
+ count++;
|
|
180
|
+ //只允许新增状态单据修改
|
|
181
|
+ PostCheckedProblem dataDb = postCheckedProblemMapper.selectById(postCheckedProblem.getId());
|
|
182
|
+ if (dataDb == null) {
|
|
183
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
184
|
+ }
|
|
185
|
+ Integer status = dataDb.getStatus();
|
|
186
|
+ if (status != null && status != PostCheckedProblemEnum.ADD.getValue()) {
|
|
187
|
+ throw new BaseException("当前状态无法修改,请检查!");
|
|
188
|
+ }
|
|
189
|
+
|
|
190
|
+ // postCheckedProblem.setUpdateTime(DateUtils.getNowDate());
|
|
191
|
+
|
|
192
|
+ postCheckedProblem.setUpdateDefault();
|
|
193
|
+ postCheckedProblem.setStatus(PostCheckedProblemEnum.ADD.getValue());
|
|
194
|
+ int updateCount = postCheckedProblemMapper.updatePostCheckedProblem(postCheckedProblem);
|
|
195
|
+ if (updateCount == 0) {
|
|
196
|
+ throw new BaseException("第" + count + "行更新失败请检查!");
|
|
197
|
+ }
|
|
198
|
+ }
|
|
199
|
+ return 1;
|
|
200
|
+ }
|
|
201
|
+
|
164
|
202
|
public void jobInspectionScore(List<PostCheckedProblem> postCheckedProblemList) {
|
165
|
203
|
/**
|
166
|
204
|
* 业务职责有效性 1
|
|
@@ -231,35 +269,6 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
231
|
269
|
|
232
|
270
|
|
233
|
271
|
/**
|
234
|
|
- * 修改岗检问题表
|
235
|
|
- *
|
236
|
|
- * @param postCheckedProblemList 岗检问题集合
|
237
|
|
- * @return 结果
|
238
|
|
- */
|
239
|
|
- @Override
|
240
|
|
- @Transactional(rollbackFor = Exception.class)
|
241
|
|
- public int updatePostCheckedProblem(List<PostCheckedProblem> postCheckedProblemList) {
|
242
|
|
- if (CollectionUtils.isEmpty(postCheckedProblemList)) {
|
243
|
|
- return 0;
|
244
|
|
- }
|
245
|
|
- int count = 0;
|
246
|
|
- for (PostCheckedProblem postCheckedProblem : postCheckedProblemList) {
|
247
|
|
- count++;
|
248
|
|
- if (postCheckedProblem.getId() == null) {
|
249
|
|
- throw new BaseException("id为空请检查!");
|
250
|
|
- }
|
251
|
|
- // postCheckedProblem.setUpdateTime(DateUtils.getNowDate());
|
252
|
|
- postCheckedProblem.setUpdateDefault();
|
253
|
|
- int updateCount = postCheckedProblemMapper.updatePostCheckedProblem(postCheckedProblem);
|
254
|
|
- if (updateCount == 0) {
|
255
|
|
- throw new BaseException("第" + count + "行更新失败请检查!");
|
256
|
|
- }
|
257
|
|
- }
|
258
|
|
- return 1;
|
259
|
|
- }
|
260
|
|
-
|
261
|
|
-
|
262
|
|
- /**
|
263
|
272
|
* 批量删除岗检问题表
|
264
|
273
|
*
|
265
|
274
|
* @param ids 需要删除的岗检问题表主键
|
|
@@ -292,48 +301,153 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
292
|
301
|
@Transactional(rollbackFor = Exception.class)
|
293
|
302
|
public int setRectificationResponsibleUserId(String ids, Long rectificationResponsibleUserId) {
|
294
|
303
|
if (StringUtils.isBlank(ids) || rectificationResponsibleUserId == null) {
|
295
|
|
- return 0;
|
|
304
|
+// return 0;
|
|
305
|
+ throw new BaseException("参数不全,请检查!");
|
296
|
306
|
}
|
|
307
|
+ //TODO 审核权限:部门经理操作
|
|
308
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
309
|
+ Long userId = loginUser.getUserId();
|
|
310
|
+ Long deptId = loginUser.getDeptId();
|
|
311
|
+
|
|
312
|
+
|
297
|
313
|
String[] idArr = ids.split(",");
|
298
|
314
|
if (idArr.length == 0) {
|
299
|
|
- return 0;
|
|
315
|
+ throw new BaseException("id错误或为空,请检查!");
|
300
|
316
|
}
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+ String errorMsg = "";
|
|
320
|
+ List<PostCheckedProblem> dataList = new ArrayList<>(idArr.length);
|
|
321
|
+ int index = 0;
|
|
322
|
+ for (String idStr : idArr) {
|
|
323
|
+ index++;
|
|
324
|
+ Long id = Long.parseLong(idStr);
|
|
325
|
+
|
|
326
|
+ PostCheckedProblem dataDB = postCheckedProblemMapper.selectById(id);
|
|
327
|
+ if (dataDB == null) {
|
|
328
|
+ errorMsg += "【第" + index + "行】id错误或为空,请检查!";
|
|
329
|
+ continue;
|
|
330
|
+ }
|
|
331
|
+ Integer status = dataDB.getStatus();
|
|
332
|
+ if (status != null && status != PostCheckedProblemEnum.ADD.getValue()) {
|
|
333
|
+ errorMsg += "【第" + index + "行】当前状态无法指定整改责任人,请检查!";
|
|
334
|
+ continue;
|
|
335
|
+ }
|
|
336
|
+
|
|
337
|
+ Long checkedDeptId = dataDB.getCheckedDeptId();//责任部门ID
|
|
338
|
+ if (!checkedDeptId.equals(deptId)) {
|
|
339
|
+ errorMsg += "【第" + index + "行】请切换问题责任部门经理操作01!";
|
|
340
|
+ continue;
|
|
341
|
+ }
|
|
342
|
+
|
|
343
|
+ // 当前登录用户是否为部门经理级别
|
|
344
|
+ boolean userHaveAuthority = sysPostService.userHaveAuthority(deptId);
|
|
345
|
+ if (!userHaveAuthority) {
|
|
346
|
+ errorMsg += "【第" + index + "行】请切换问题责任部门经理操作02!";
|
|
347
|
+ continue;
|
|
348
|
+ }
|
|
349
|
+ dataList.add(dataDB);
|
|
350
|
+ }
|
|
351
|
+ if (StringUtils.isNotBlank(errorMsg)) {
|
|
352
|
+ throw new BaseException(errorMsg);
|
|
353
|
+ }
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+ PostCheckedProblem updateData = new PostCheckedProblem();
|
|
357
|
+ updateData.setStatus(PostCheckedProblemEnum.EDIT_WAIT_ONR.getValue());//待填写方案
|
|
358
|
+ updateData.setRectificationResponsibleUserId(rectificationResponsibleUserId);//整改责任人
|
|
359
|
+ LambdaUpdateWrapper<PostCheckedProblem> updateWrapper = new LambdaUpdateWrapper<>();
|
|
360
|
+ updateWrapper.in(PostCheckedProblem::getId, idArr);
|
|
361
|
+ int updateCount = postCheckedProblemMapper.update(updateData, updateWrapper);
|
|
362
|
+ if (updateCount != idArr.length) {
|
|
363
|
+ throw new BaseException("更新行数与请求行数不匹配,请检查!");
|
|
364
|
+ }
|
|
365
|
+ return updateCount;
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+ /*
|
301
|
369
|
int count = 0;
|
302
|
370
|
for (String idStr : idArr) {
|
|
371
|
+ index++;
|
303
|
372
|
Long id = Long.parseLong(idStr);
|
|
373
|
+
|
|
374
|
+ PostCheckedProblem dataDB = postCheckedProblemMapper.selectById(id);
|
|
375
|
+ if (dataDB == null) {
|
|
376
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
377
|
+ }
|
|
378
|
+ Integer status = dataDB.getStatus();
|
|
379
|
+ if (status != null && status != PostCheckedProblemEnum.ADD.getValue()) {
|
|
380
|
+ throw new BaseException("当前状态无法指定整改责任人,请检查!");
|
|
381
|
+ }
|
|
382
|
+
|
|
383
|
+ Long checkedDeptId = dataDB.getCheckedDeptId();//责任部门ID
|
|
384
|
+ if (!checkedDeptId.equals(deptId)) {
|
|
385
|
+ throw new BaseException("请切换问题责任部门经理操作【第" + index + "行】!");
|
|
386
|
+ }
|
|
387
|
+
|
|
388
|
+ // 当前登录用户是否为部门经理级别
|
|
389
|
+ boolean userHaveAuthority = sysPostService.userHaveAuthority(deptId);
|
|
390
|
+ if (!userHaveAuthority) {
|
|
391
|
+ throw new BaseException("请切换问题责任部门经理操作【第" + index + "行】!");
|
|
392
|
+ }
|
|
393
|
+
|
|
394
|
+
|
304
|
395
|
PostCheckedProblem data = new PostCheckedProblem();
|
305
|
396
|
data.setId(id);
|
306
|
|
- data.setStatus(PostCheckedProblemEnum.EDIT_ONE.getValue());//待填写方案
|
|
397
|
+ data.setStatus(PostCheckedProblemEnum.EDIT_WAIT_ONR.getValue());//待填写方案
|
307
|
398
|
data.setRectificationResponsibleUserId(rectificationResponsibleUserId);
|
308
|
399
|
count += postCheckedProblemMapper.updatePostCheckedProblem(data);
|
309
|
400
|
}
|
310
|
401
|
return count;
|
|
402
|
+ * */
|
311
|
403
|
}
|
312
|
404
|
|
313
|
405
|
/**
|
314
|
|
- * 方案整改:整改实施人填写方案
|
|
406
|
+ * 方案整改:整改责任人填写方案
|
315
|
407
|
*
|
316
|
|
- * @param id 问题主键
|
317
|
|
- * @param problemCause 问题原因
|
318
|
|
- * @param isImmediatelyCorrected 是否立行立改(1-Yes;2-No;)
|
319
|
|
- * @param rectificationMeasure 整改措施/建议
|
320
|
|
- * @param rectificationResponsibleUserId 整改责任人ID
|
321
|
|
- * @param rectificationPeriod 整改期限
|
|
408
|
+ * @param id 问题主键
|
|
409
|
+ * @param problemCause 问题原因
|
|
410
|
+ * @param isImmediatelyCorrected 是否立行立改(1-Yes;2-No;)
|
|
411
|
+ * @param rectificationMeasure 整改措施/建议
|
|
412
|
+ * param rectificationResponsibleUserId 整改责任人ID
|
|
413
|
+ * @param rectificationPeriod 整改期限
|
322
|
414
|
* @return
|
323
|
415
|
*/
|
324
|
416
|
@Override
|
325
|
|
- public int updateRectificationMeasure(Long id, String problemCause, Integer isImmediatelyCorrected, String rectificationMeasure, Long rectificationResponsibleUserId, Date rectificationPeriod) {
|
|
417
|
+// public int updateRectificationMeasure(Long id, String problemCause, Integer isImmediatelyCorrected, String rectificationMeasure, Long rectificationResponsibleUserId, Date rectificationPeriod) {
|
|
418
|
+ public int updateRectificationMeasure(Long id, String problemCause, Integer isImmediatelyCorrected, String rectificationMeasure, Date rectificationPeriod) {
|
326
|
419
|
|
327
|
|
- if (id == null || StringUtils.isBlank(problemCause) || isImmediatelyCorrected == null || StringUtils.isBlank(rectificationMeasure) || rectificationResponsibleUserId == null || rectificationPeriod == null) {
|
328
|
|
- return 0;
|
|
420
|
+// if (id == null || StringUtils.isBlank(problemCause) || isImmediatelyCorrected == null || StringUtils.isBlank(rectificationMeasure) || rectificationResponsibleUserId == null || rectificationPeriod == null) {
|
|
421
|
+ if (id == null || StringUtils.isBlank(problemCause) || isImmediatelyCorrected == null || StringUtils.isBlank(rectificationMeasure) || rectificationPeriod == null) {
|
|
422
|
+// return 0;
|
|
423
|
+ throw new BaseException("参数不全,请检查!");
|
|
424
|
+ }
|
|
425
|
+ //TODO 审核权限:部门经理操作
|
|
426
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
427
|
+ Long userId = loginUser.getUserId();
|
|
428
|
+ Long deptId = loginUser.getDeptId();
|
|
429
|
+ PostCheckedProblem dataDB = postCheckedProblemMapper.selectById(id);
|
|
430
|
+ if (dataDB == null) {
|
|
431
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
432
|
+ }
|
|
433
|
+ Integer status = dataDB.getStatus();
|
|
434
|
+ if (status != PostCheckedProblemEnum.EDIT_WAIT_ONR.getValue()) {
|
|
435
|
+ throw new BaseException("当前状态不允许此操作,请检查!【" + status + "】");
|
329
|
436
|
}
|
|
437
|
+
|
|
438
|
+ Long rectificationResponsibleUserId = dataDB.getRectificationResponsibleUserId();
|
|
439
|
+ if (!rectificationResponsibleUserId.equals(userId)) {
|
|
440
|
+ throw new BaseException("请切换整改责任人账号操作!");
|
|
441
|
+ }
|
|
442
|
+
|
330
|
443
|
PostCheckedProblem data = new PostCheckedProblem();
|
331
|
444
|
data.setId(id);
|
332
|
445
|
data.setProblemCause(problemCause);
|
333
|
446
|
data.setIsImmediatelyCorrected(isImmediatelyCorrected);
|
334
|
447
|
data.setRectificationMeasure(rectificationMeasure);
|
335
|
|
- data.setRectificationResponsibleUserId(rectificationResponsibleUserId);
|
|
448
|
+// data.setRectificationResponsibleUserId(rectificationResponsibleUserId);
|
336
|
449
|
data.setRectificationPeriod(rectificationPeriod);
|
|
450
|
+ data.setStatus(PostCheckedProblemEnum.DEPT_WAIT.getValue());//DEPT_WAIT("待部门审核", 10),
|
337
|
451
|
|
338
|
452
|
return postCheckedProblemMapper.updatePostCheckedProblem(data);
|
339
|
453
|
}
|
|
@@ -348,11 +462,34 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
348
|
462
|
@Override
|
349
|
463
|
public int setSpecialityDepartmentReviewerId(Long id, Long specialityDepartmentReviewerId) {
|
350
|
464
|
if (id == null || specialityDepartmentReviewerId == null) {
|
351
|
|
- return 0;
|
|
465
|
+// return 0;
|
|
466
|
+ throw new BaseException("参数不全,请检查!");
|
|
467
|
+ }
|
|
468
|
+ //TODO 审核权限:部门经理操作
|
|
469
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
470
|
+ Long userId = loginUser.getUserId();
|
|
471
|
+ Long deptId = loginUser.getDeptId();
|
|
472
|
+ PostCheckedProblem dataDB = postCheckedProblemMapper.selectById(id);
|
|
473
|
+ if (dataDB == null) {
|
|
474
|
+ throw new BaseException("id错误或为空,请检查!");
|
352
|
475
|
}
|
|
476
|
+ Integer status = dataDB.getStatus();
|
|
477
|
+ if (status != PostCheckedProblemEnum.ADD.getValue()
|
|
478
|
+ && status != PostCheckedProblemEnum.EDIT_WAIT_ONR.getValue()
|
|
479
|
+ && status != PostCheckedProblemEnum.DEPT_WAIT.getValue()
|
|
480
|
+ ) {
|
|
481
|
+ throw new BaseException("当前状态不允许此操作,请检查!【" + status + "】");
|
|
482
|
+ }
|
|
483
|
+ Long rectificationResponsibleUserId = dataDB.getRectificationResponsibleUserId();
|
|
484
|
+ if (!rectificationResponsibleUserId.equals(userId)) {
|
|
485
|
+ throw new BaseException("请切换整改责任人账号操作!");
|
|
486
|
+ }
|
|
487
|
+
|
|
488
|
+
|
353
|
489
|
PostCheckedProblem data = new PostCheckedProblem();
|
354
|
490
|
data.setId(id);
|
355
|
491
|
data.setSpecialityDepartmentReviewerId(specialityDepartmentReviewerId);
|
|
492
|
+// data.setStatus(PostCheckedProblemEnum);
|
356
|
493
|
return postCheckedProblemMapper.updatePostCheckedProblem(data);
|
357
|
494
|
}
|
358
|
495
|
|
|
@@ -368,25 +505,71 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
368
|
505
|
@Override
|
369
|
506
|
public int setDeptApproveTime(Long id, Integer status, String reason) {
|
370
|
507
|
if (id == null || status == null) {
|
371
|
|
- return 0;
|
|
508
|
+// return 0;
|
|
509
|
+ throw new BaseException("参数不全,请检查!");
|
372
|
510
|
}
|
373
|
511
|
|
374
|
512
|
//状态错误
|
375
|
513
|
if (status != PostCheckedProblemEnum.DEPT_PASS.getValue() && status != PostCheckedProblemEnum.DEPT_BACK.getValue()) {
|
376
|
|
- return 0;
|
|
514
|
+// return 0;
|
|
515
|
+ throw new BaseException("状态参数错误,请检查!【" + status + "】");
|
377
|
516
|
}
|
378
|
517
|
|
379
|
|
-
|
380
|
518
|
//驳回时必须填写原因
|
381
|
519
|
if (status == PostCheckedProblemEnum.DEPT_BACK.getValue() && StringUtils.isBlank(reason)) {
|
382
|
|
- return 0;
|
|
520
|
+ throw new BaseException("未通过理由为空,请检查!");
|
383
|
521
|
}
|
384
|
522
|
|
|
523
|
+ //TODO 审核权限:部门经理操作
|
|
524
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
525
|
+ Long userId = loginUser.getUserId();
|
|
526
|
+ Long deptId = loginUser.getDeptId();
|
|
527
|
+ PostCheckedProblem dataDb = postCheckedProblemMapper.selectById(id);
|
|
528
|
+ if (dataDb == null) {
|
|
529
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
530
|
+ }
|
|
531
|
+
|
|
532
|
+ Integer statusDB = dataDb.getStatus();
|
|
533
|
+ if (statusDB != PostCheckedProblemEnum.DEPT_WAIT.getValue()) {
|
|
534
|
+ throw new BaseException("当前状态不允许此操作,请检查!【" + statusDB + "】");
|
|
535
|
+ }
|
|
536
|
+
|
|
537
|
+ Long checkedDeptId = dataDb.getCheckedDeptId();//责任部门ID
|
|
538
|
+ if (!checkedDeptId.equals(deptId)) {
|
|
539
|
+ throw new BaseException("请切换问题责任部门经理操作01!");
|
|
540
|
+ }
|
|
541
|
+
|
|
542
|
+ // 当前登录用户是否为部门经理级别
|
|
543
|
+ boolean userHaveAuthority = sysPostService.userHaveAuthority(deptId);
|
|
544
|
+ if (!userHaveAuthority) {
|
|
545
|
+ throw new BaseException("请切换问题责任部门经理操作02!");
|
|
546
|
+ }
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+ //专业部门的审核人ID
|
|
550
|
+ Long specialityDepartmentReviewerId = dataDb.getSpecialityDepartmentReviewerId();
|
|
551
|
+
|
385
|
552
|
PostCheckedProblem data = new PostCheckedProblem();
|
386
|
553
|
data.setId(id);
|
387
|
|
- data.setStatus(status);
|
388
|
554
|
data.setReason(reason);
|
389
|
555
|
data.setDeptApproveTime(new Date());
|
|
556
|
+ //通过
|
|
557
|
+ if (status == PostCheckedProblemEnum.DEPT_PASS.getValue()) {
|
|
558
|
+ // ZHUAN_ZY_WAIT("待专业部门人审核(非必填)", 20),
|
|
559
|
+ if (specialityDepartmentReviewerId != null) {
|
|
560
|
+ data.setStatus(PostCheckedProblemEnum.ZHUAN_ZY_WAIT.getValue());
|
|
561
|
+ }
|
|
562
|
+ //EDIT_WAIT("待整改人待上传实施(整改人上传实施图片)", 30),
|
|
563
|
+ else {
|
|
564
|
+ data.setStatus(PostCheckedProblemEnum.EDIT_WAIT_TWO.getValue());
|
|
565
|
+ }
|
|
566
|
+ }
|
|
567
|
+ //驳回
|
|
568
|
+ else if (status == PostCheckedProblemEnum.DEPT_BACK.getValue()) {
|
|
569
|
+ data.setStatus(PostCheckedProblemEnum.DEPT_BACK.getValue());
|
|
570
|
+ }
|
|
571
|
+
|
|
572
|
+
|
390
|
573
|
return postCheckedProblemMapper.updatePostCheckedProblem(data);
|
391
|
574
|
}
|
392
|
575
|
|
|
@@ -401,25 +584,54 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
401
|
584
|
@Override
|
402
|
585
|
public int setSpecialityDepartmentReviewTime(Long id, Integer status, String reason) {
|
403
|
586
|
if (id == null || status == null) {
|
404
|
|
- return 0;
|
|
587
|
+// return 0;
|
|
588
|
+ throw new BaseException("参数不全,请检查!");
|
405
|
589
|
}
|
406
|
590
|
|
407
|
591
|
//状态错误
|
408
|
|
- if (status != PostCheckedProblemEnum.ZHUAN_YE_PASS.getValue() && status != PostCheckedProblemEnum.ZHUAN_YE_BACK.getValue()) {
|
409
|
|
- return 0;
|
|
592
|
+ if (status != PostCheckedProblemEnum.ZHUAN_ZY_PASS.getValue() && status != PostCheckedProblemEnum.ZHUAN_ZY_BACK.getValue()) {
|
|
593
|
+// return 0;
|
|
594
|
+ throw new BaseException("状态参数错误,请检查!【" + status + "】");
|
410
|
595
|
}
|
411
|
596
|
|
412
|
597
|
|
413
|
598
|
//驳回时必须填写原因
|
414
|
|
- if (status == PostCheckedProblemEnum.ZHUAN_YE_BACK.getValue() && StringUtils.isBlank(reason)) {
|
415
|
|
- return 0;
|
|
599
|
+ if (status == PostCheckedProblemEnum.ZHUAN_ZY_BACK.getValue() && StringUtils.isBlank(reason)) {
|
|
600
|
+// return 0;
|
|
601
|
+ throw new BaseException("未通过理由为空,请检查!");
|
|
602
|
+ }
|
|
603
|
+
|
|
604
|
+ //TODO 审核权限:部门经理操作
|
|
605
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
606
|
+ Long userId = loginUser.getUserId();
|
|
607
|
+ Long deptId = loginUser.getDeptId();
|
|
608
|
+ PostCheckedProblem dataDb = postCheckedProblemMapper.selectById(id);
|
|
609
|
+ if (dataDb == null) {
|
|
610
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
611
|
+ }
|
|
612
|
+
|
|
613
|
+ Integer statusDB = dataDb.getStatus();
|
|
614
|
+ if (statusDB != PostCheckedProblemEnum.ZHUAN_ZY_WAIT.getValue()) {
|
|
615
|
+ throw new BaseException("当前状态不允许此操作,请检查!【" + statusDB + "】");
|
416
|
616
|
}
|
417
|
617
|
|
|
618
|
+ Long specialityDepartmentReviewerId = dataDb.getSpecialityDepartmentReviewerId();
|
|
619
|
+ if (!specialityDepartmentReviewerId.equals(userId)) {
|
|
620
|
+ throw new BaseException("请切换专业部门审核人操作!");
|
|
621
|
+ }
|
|
622
|
+
|
|
623
|
+
|
418
|
624
|
PostCheckedProblem data = new PostCheckedProblem();
|
419
|
625
|
data.setId(id);
|
420
|
|
- data.setStatus(status);
|
421
|
626
|
data.setReason(reason);
|
422
|
627
|
data.setSpecialityDepartmentReviewTime(new Date());
|
|
628
|
+
|
|
629
|
+ if (status == PostCheckedProblemEnum.ZHUAN_ZY_PASS.getValue()) {
|
|
630
|
+ data.setStatus(PostCheckedProblemEnum.EDIT_WAIT_TWO.getValue());
|
|
631
|
+ } else if (status == PostCheckedProblemEnum.ZHUAN_ZY_BACK.getValue()) {
|
|
632
|
+ data.setStatus(PostCheckedProblemEnum.ZHUAN_ZY_BACK.getValue());
|
|
633
|
+ }
|
|
634
|
+
|
423
|
635
|
return postCheckedProblemMapper.updatePostCheckedProblem(data);
|
424
|
636
|
}
|
425
|
637
|
|
|
@@ -436,16 +648,38 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
436
|
648
|
public int updateRectificationCompletionImg(Long id, Integer isRectificationCompleted, Date rectificationCompletionTime, String rectificationCompletionImg) {
|
437
|
649
|
|
438
|
650
|
if (id == null || isRectificationCompleted == null || StringUtils.isBlank(rectificationCompletionImg)) {
|
439
|
|
- return 0;
|
|
651
|
+// return 0;
|
|
652
|
+ throw new BaseException("参数不全,请检查!");
|
440
|
653
|
}
|
441
|
654
|
if (rectificationCompletionTime == null)
|
442
|
655
|
rectificationCompletionTime = new Date();
|
443
|
656
|
|
|
657
|
+
|
|
658
|
+ //TODO 审核权限:部门经理操作
|
|
659
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
660
|
+ Long userId = loginUser.getUserId();
|
|
661
|
+ Long deptId = loginUser.getDeptId();
|
|
662
|
+ PostCheckedProblem dataDb = postCheckedProblemMapper.selectById(id);
|
|
663
|
+ if (dataDb == null) {
|
|
664
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
665
|
+ }
|
|
666
|
+ Integer status = dataDb.getStatus();
|
|
667
|
+ if (status != PostCheckedProblemEnum.EDIT_WAIT_TWO.getValue()) {
|
|
668
|
+ throw new BaseException("当前状态不允许此操作,请检查!【" + status + "】");
|
|
669
|
+ }
|
|
670
|
+
|
|
671
|
+ Long rectificationResponsibleUserId = dataDb.getRectificationResponsibleUserId();
|
|
672
|
+ if (!rectificationResponsibleUserId.equals(userId)) {
|
|
673
|
+ throw new BaseException("请切换整改责任人账号操作!");
|
|
674
|
+ }
|
|
675
|
+
|
|
676
|
+
|
444
|
677
|
PostCheckedProblem data = new PostCheckedProblem();
|
445
|
678
|
data.setId(id);
|
446
|
679
|
data.setIsRectificationCompleted(isRectificationCompleted);
|
447
|
680
|
data.setRectificationCompletionTime(rectificationCompletionTime);
|
448
|
681
|
data.setRectificationCompletionImg(rectificationCompletionImg);
|
|
682
|
+ data.setStatus(PostCheckedProblemEnum.EDIT_TWO_OVER.getValue());
|
449
|
683
|
|
450
|
684
|
return postCheckedProblemMapper.updatePostCheckedProblem(data);
|
451
|
685
|
}
|
|
@@ -460,11 +694,33 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
460
|
694
|
@Override
|
461
|
695
|
public int setReviewDepartmentReviewerId(Long id, Long reviewDepartmentReviewerId) {
|
462
|
696
|
if (id == null || reviewDepartmentReviewerId == null) {
|
463
|
|
- return 0;
|
|
697
|
+// return 0;
|
|
698
|
+ throw new BaseException("参数不全,请检查!");
|
464
|
699
|
}
|
|
700
|
+
|
|
701
|
+ //TODO 审核权限:部门经理操作
|
|
702
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
703
|
+ Long userId = loginUser.getUserId();
|
|
704
|
+ Long deptId = loginUser.getDeptId();
|
|
705
|
+ PostCheckedProblem dataDb = postCheckedProblemMapper.selectById(id);
|
|
706
|
+ if (dataDb == null) {
|
|
707
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
708
|
+ }
|
|
709
|
+ Integer status = dataDb.getStatus();
|
|
710
|
+ if (status != PostCheckedProblemEnum.EDIT_WAIT_TWO.getValue()
|
|
711
|
+ && status != PostCheckedProblemEnum.EDIT_TWO_OVER.getValue()
|
|
712
|
+ ) {
|
|
713
|
+ throw new BaseException("当前状态不允许此操作,请检查!【" + status + "】");
|
|
714
|
+ }
|
|
715
|
+ Long rectificationResponsibleUserId = dataDb.getRectificationResponsibleUserId();
|
|
716
|
+ if (!rectificationResponsibleUserId.equals(userId)) {
|
|
717
|
+ throw new BaseException("请切换整改责任人账号操作!");
|
|
718
|
+ }
|
|
719
|
+
|
465
|
720
|
PostCheckedProblem data = new PostCheckedProblem();
|
466
|
721
|
data.setId(id);
|
467
|
722
|
data.setReviewDepartmentReviewerId(reviewDepartmentReviewerId);
|
|
723
|
+ data.setStatus(PostCheckedProblemEnum.FU_CHA_WAIT.getValue());
|
468
|
724
|
return postCheckedProblemMapper.updatePostCheckedProblem(data);
|
469
|
725
|
}
|
470
|
726
|
|
|
@@ -479,26 +735,48 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
479
|
735
|
@Override
|
480
|
736
|
public int setReviewDepartmentReviewerTime(Long id, Integer status, String reviewConclusion, String reason) {
|
481
|
737
|
if (id == null || status == null) {
|
482
|
|
- return 0;
|
|
738
|
+// return 0;
|
|
739
|
+ throw new BaseException("参数不全,请检查!");
|
483
|
740
|
}
|
484
|
741
|
|
485
|
742
|
//状态错误
|
486
|
743
|
if (status != PostCheckedProblemEnum.FU_CHA_PASS.getValue() && status != PostCheckedProblemEnum.FU_CHA_BACK.getValue()) {
|
487
|
|
- return 0;
|
|
744
|
+// return 0;
|
|
745
|
+ throw new BaseException("状态参数错误,请检查!【" + status + "】");
|
488
|
746
|
}
|
489
|
747
|
|
490
|
748
|
|
491
|
749
|
//驳回时必须填写原因
|
492
|
750
|
if (status == PostCheckedProblemEnum.FU_CHA_BACK.getValue() && StringUtils.isBlank(reason)) {
|
493
|
|
- return 0;
|
|
751
|
+// return 0;
|
|
752
|
+ throw new BaseException("未通过理由为空,请检查!");
|
|
753
|
+ }
|
|
754
|
+
|
|
755
|
+ //TODO 审核权限:部门经理操作
|
|
756
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
757
|
+ Long userId = loginUser.getUserId();
|
|
758
|
+ Long deptId = loginUser.getDeptId();
|
|
759
|
+ PostCheckedProblem dataDb = postCheckedProblemMapper.selectById(id);
|
|
760
|
+ if (dataDb == null) {
|
|
761
|
+ throw new BaseException("id错误或为空,请检查!");
|
|
762
|
+ }
|
|
763
|
+ Integer statusDB = dataDb.getStatus();
|
|
764
|
+ if (statusDB != PostCheckedProblemEnum.FU_CHA_WAIT.getValue()) {
|
|
765
|
+ throw new BaseException("当前状态不允许此操作,请检查!【" + status + "】");
|
|
766
|
+ }
|
|
767
|
+
|
|
768
|
+ //复查部门的审核人ID
|
|
769
|
+ Long reviewDepartmentReviewerId = dataDb.getReviewDepartmentReviewerId();
|
|
770
|
+ if (!reviewDepartmentReviewerId.equals(userId)) {
|
|
771
|
+ throw new BaseException("请切换复查人账号操作!");
|
494
|
772
|
}
|
495
|
773
|
|
496
|
774
|
PostCheckedProblem data = new PostCheckedProblem();
|
497
|
775
|
data.setId(id);
|
498
|
|
- data.setStatus(status);
|
499
|
776
|
data.setReviewConclusion(reviewConclusion);
|
500
|
777
|
data.setReason(reason);
|
501
|
778
|
data.setReviewDepartmentReviewerTime(new Date());
|
|
779
|
+ data.setStatus(status);
|
502
|
780
|
return postCheckedProblemMapper.updatePostCheckedProblem(data);
|
503
|
781
|
}
|
504
|
782
|
|