소스 검색

Merge branch 'feature/master-check-workflow-20260209' into develop

chenshudong 2 달 전
부모
커밋
b0d70b1197

+ 21 - 0
airport-admin/src/main/java/com/sundot/airport/web/controller/check/CheckCorrectionController.java

@@ -5,6 +5,7 @@ import java.util.List;
5 5
 import javax.servlet.http.HttpServletResponse;
6 6
 
7 7
 import cn.hutool.core.collection.CollUtil;
8
+import com.sundot.airport.common.core.domain.ApprovalWorkflowBatchDto;
8 9
 import com.sundot.airport.common.core.domain.DataPermissionResult;
9 10
 import com.sundot.airport.web.core.utils.DataPermissionUtils;
10 11
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -172,4 +173,24 @@ public class CheckCorrectionController extends BaseController {
172 173
     public AjaxResult rejectTask(@RequestBody CheckCorrection checkCorrection) {
173 174
         return success(checkCorrectionService.rejectTask(checkCorrection));
174 175
     }
176
+
177
+    /**
178
+     * 批量审批任务(同意)
179
+     */
180
+    @PreAuthorize("@ss.hasPermi('check:checkCorrection:edit')")
181
+    @Log(title = "批量审批任务(同意)", businessType = BusinessType.UPDATE)
182
+    @PostMapping("/approveTaskBatch")
183
+    public AjaxResult approveTaskBatch(@RequestBody ApprovalWorkflowBatchDto approvalWorkflowBatchDto) {
184
+        return success(checkCorrectionService.approveTaskBatch(approvalWorkflowBatchDto));
185
+    }
186
+
187
+    /**
188
+     * 批量审批任务(驳回)
189
+     */
190
+    @PreAuthorize("@ss.hasPermi('check:checkCorrection:edit')")
191
+    @Log(title = "批量审批任务(驳回)", businessType = BusinessType.UPDATE)
192
+    @PostMapping("/rejectTaskBatch")
193
+    public AjaxResult rejectTaskBatch(@RequestBody ApprovalWorkflowBatchDto approvalWorkflowBatchDto) {
194
+        return success(checkCorrectionService.rejectTaskBatch(approvalWorkflowBatchDto));
195
+    }
175 196
 }

+ 28 - 7
airport-admin/src/main/java/com/sundot/airport/web/controller/check/CheckTaskController.java

@@ -2,15 +2,20 @@ package com.sundot.airport.web.controller.check;
2 2
 
3 3
 import java.util.Collections;
4 4
 import java.util.List;
5
+import java.util.stream.Collectors;
5 6
 import javax.servlet.http.HttpServletResponse;
6 7
 
7 8
 import cn.hutool.core.collection.CollUtil;
8 9
 import cn.hutool.core.util.StrUtil;
9 10
 import com.sundot.airport.common.core.domain.DataPermissionResult;
11
+import com.sundot.airport.common.core.domain.entity.SysDept;
12
+import com.sundot.airport.common.core.domain.entity.SysRole;
10 13
 import com.sundot.airport.common.enums.CheckLevelEnum;
11 14
 import com.sundot.airport.common.enums.CheckTaskStatusEnum;
15
+import com.sundot.airport.common.enums.RoleTypeEnum;
12 16
 import com.sundot.airport.common.enums.SourceTypeEnum;
13 17
 import com.sundot.airport.common.utils.SecurityUtils;
18
+import com.sundot.airport.system.service.ISysDeptService;
14 19
 import com.sundot.airport.web.core.utils.DataPermissionUtils;
15 20
 import org.springframework.security.access.prepost.PreAuthorize;
16 21
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +48,8 @@ import com.sundot.airport.common.core.page.TableDataInfo;
43 48
 public class CheckTaskController extends BaseController {
44 49
     @Autowired
45 50
     private ICheckTaskService checkTaskService;
51
+    @Autowired
52
+    private ISysDeptService sysDeptService;
46 53
 
47 54
     /**
48 55
      * 查询检查任务列表
@@ -62,15 +69,24 @@ public class CheckTaskController extends BaseController {
62 69
                     checkTask.setCheckLevel(CheckLevelEnum.STATION_LEVEL.getCode());
63 70
                     break;
64 71
                 case BRIGADE:
65
-                    checkTask.setCheckLevel(CheckLevelEnum.BRIGADE_LEVEL.getCode());
72
+                    List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
73
+                    List<String> roleKeyList = roles.stream().map(SysRole::getRoleKey).collect(Collectors.toList());
74
+                    if (roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
75
+                        checkTask.setCheckLevel(CheckLevelEnum.BRIGADE_LEVEL.getCode());
76
+                        checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
77
+                    } else {
78
+                        return getDataTable(Collections.emptyList());
79
+                    }
66 80
                     break;
67 81
                 case DEPARTMENT:
68 82
                     checkTask.setCheckLevel(CheckLevelEnum.DEPARTMENT_LEVEL.getCode());
69
-                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
83
+                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
70 84
                     break;
71 85
                 case TEAM:
72 86
                     checkTask.setCheckLevel(CheckLevelEnum.TEAM_LEVEL.getCode());
73
-                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
87
+                    SysDept teamDept = SecurityUtils.getLoginUser().getUser().getDept();
88
+                    SysDept departmentDept = sysDeptService.selectDeptById(teamDept.getParentId());
89
+                    checkTask.setSelfCheckDeptId(departmentDept.getParentId());
74 90
                     break;
75 91
                 default:
76 92
                     return getDataTable(Collections.emptyList());
@@ -83,10 +99,11 @@ public class CheckTaskController extends BaseController {
83 99
                     list = checkTaskService.selectCheckTaskList(checkTask);
84 100
                     break;
85 101
                 case BRIGADE:
102
+                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
86 103
                     list = checkTaskService.selectCheckTaskListBrigadeWeb(checkTask);
87 104
                     break;
88 105
                 case DEPARTMENT:
89
-                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
106
+                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
90 107
                     list = checkTaskService.selectCheckTaskListWeb(checkTask);
91 108
                     break;
92 109
                 default:
@@ -113,10 +130,11 @@ public class CheckTaskController extends BaseController {
113 130
                 list = checkTaskService.selectCheckTaskList(checkTask);
114 131
                 break;
115 132
             case BRIGADE:
133
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
116 134
                 list = checkTaskService.selectCheckTaskListBrigadeWeb(checkTask);
117 135
                 break;
118 136
             case DEPARTMENT:
119
-                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
137
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
120 138
                 list = checkTaskService.selectCheckTaskListWeb(checkTask);
121 139
                 break;
122 140
             default:
@@ -188,14 +206,17 @@ public class CheckTaskController extends BaseController {
188 206
                 break;
189 207
             case BRIGADE:
190 208
                 checkTask.setCheckLevel(CheckLevelEnum.BRIGADE_LEVEL.getCode());
209
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
191 210
                 break;
192 211
             case DEPARTMENT:
193 212
                 checkTask.setCheckLevel(CheckLevelEnum.DEPARTMENT_LEVEL.getCode());
194
-                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
213
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
195 214
                 break;
196 215
             case TEAM:
197 216
                 checkTask.setCheckLevel(CheckLevelEnum.TEAM_LEVEL.getCode());
198
-                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
217
+                SysDept teamDept = SecurityUtils.getLoginUser().getUser().getDept();
218
+                SysDept departmentDept = sysDeptService.selectDeptById(teamDept.getParentId());
219
+                checkTask.setSelfCheckDeptId(departmentDept.getParentId());
199 220
                 break;
200 221
             default:
201 222
                 return success(0);

+ 6 - 6
airport-check/src/main/java/com/sundot/airport/check/domain/CheckTask.java

@@ -151,9 +151,9 @@ public class CheckTask extends BaseEntity {
151 151
     private String ruleTypeDesc;
152 152
 
153 153
     /**
154
-     * 是否内自查(0=否;1=是)
154
+     * 是否内自查(0=否;1=是)
155 155
      */
156
-    @Excel(name = "是否内自查(0=否;1=是)")
156
+    @Excel(name = "是否内自查(0=否;1=是)")
157 157
     private Integer isSelfCheck;
158 158
 
159 159
     /**
@@ -175,15 +175,15 @@ public class CheckTask extends BaseEntity {
175 175
     private Long updateId;
176 176
 
177 177
     /**
178
-     * 自查科室ID
178
+     * 自查大队ID
179 179
      */
180
-    @Excel(name = "自查科室ID")
180
+    @Excel(name = "自查大队ID")
181 181
     private Long selfCheckDeptId;
182 182
 
183 183
     /**
184
-     * 自查科室名称
184
+     * 自查大队名称
185 185
      */
186
-    @Excel(name = "自查科室名称")
186
+    @Excel(name = "自查大队名称")
187 187
     private String selfCheckDeptName;
188 188
 
189 189
     /**

+ 1 - 1
airport-check/src/main/java/com/sundot/airport/check/handler/CheckCorrectionApprovalHandler.java

@@ -43,7 +43,7 @@ public class CheckCorrectionApprovalHandler implements BusinessApprovalHandler {
43 43
     public boolean supports(String businessType) {
44 44
         return "PERSONAL_CHECK".equals(businessType)
45 45
                 || "GROUP_CHECK".equals(businessType)
46
-                || "SECTION_CHECK".equals(businessType)
46
+                || "DEPARTMENT_CHECK".equals(businessType)
47 47
                 || "BRIGADE_CHECK".equals(businessType);
48 48
     }
49 49
 

+ 17 - 0
airport-check/src/main/java/com/sundot/airport/check/service/ICheckCorrectionService.java

@@ -4,6 +4,7 @@ import java.util.List;
4 4
 
5 5
 import com.baomidou.mybatisplus.extension.service.IService;
6 6
 import com.sundot.airport.check.domain.CheckCorrection;
7
+import com.sundot.airport.common.core.domain.ApprovalWorkflowBatchDto;
7 8
 
8 9
 /**
9 10
  * 问题整改Service接口
@@ -75,4 +76,20 @@ public interface ICheckCorrectionService extends IService<CheckCorrection> {
75 76
      * @return 结果
76 77
      */
77 78
     public int rejectTask(CheckCorrection checkCorrection);
79
+
80
+    /**
81
+     * 批量审批任务(同意)
82
+     *
83
+     * @param approvalWorkflowBatchDto 批量审批参数
84
+     * @return 结果
85
+     */
86
+    public int approveTaskBatch(ApprovalWorkflowBatchDto approvalWorkflowBatchDto);
87
+
88
+    /**
89
+     * 批量审批任务(驳回)
90
+     *
91
+     * @param approvalWorkflowBatchDto 批量审批参数
92
+     * @return 结果
93
+     */
94
+    public int rejectTaskBatch(ApprovalWorkflowBatchDto approvalWorkflowBatchDto);
78 95
 }

+ 53 - 1
airport-check/src/main/java/com/sundot/airport/check/service/impl/CheckCorrectionServiceImpl.java

@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
13 13
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
14 14
 import com.sundot.airport.check.domain.CheckProjectItem;
15 15
 import com.sundot.airport.check.domain.CheckUser;
16
+import com.sundot.airport.common.core.domain.ApprovalWorkflowBatchDto;
16 17
 import com.sundot.airport.check.service.ICheckProjectItemService;
17 18
 import com.sundot.airport.check.service.ICheckUserService;
18 19
 import com.sundot.airport.common.constant.Constants;
@@ -29,6 +30,9 @@ import com.sundot.airport.common.utils.DateUtils;
29 30
 import com.sundot.airport.common.utils.SecurityUtils;
30 31
 import com.sundot.airport.common.utils.StringUtils;
31 32
 import com.sundot.airport.system.domain.approval.ApprovalInstance;
33
+import com.sundot.airport.system.domain.approval.ApprovalTask;
34
+import com.sundot.airport.system.mapper.approval.ApprovalInstanceMapper;
35
+import com.sundot.airport.system.mapper.approval.ApprovalTaskMapper;
32 36
 import com.sundot.airport.system.service.approval.IApprovalEngineService;
33 37
 import com.sundot.airport.system.service.approval.ICheckApprovalService;
34 38
 import lombok.SneakyThrows;
@@ -63,6 +67,10 @@ public class CheckCorrectionServiceImpl extends ServiceImpl<CheckCorrectionMappe
63 67
     private ICheckApprovalService checkApprovalService;
64 68
     @Autowired
65 69
     private IApprovalEngineService approvalEngineService;
70
+    @Autowired
71
+    private ApprovalTaskMapper taskMapper;
72
+    @Autowired
73
+    private ApprovalInstanceMapper instanceMapper;
66 74
 
67 75
     /**
68 76
      * 查询问题整改
@@ -380,7 +388,7 @@ public class CheckCorrectionServiceImpl extends ServiceImpl<CheckCorrectionMappe
380 388
         } else if (StringUtils.equals(CheckLevelEnum.DEPARTMENT_LEVEL.getCode(), checkCorrection.getCheckedLevel())) {
381 389
             Map<String, Object> requestData = new HashMap<>();
382 390
             requestData.put("businessId", checkCorrection.getId());//业务ID
383
-            requestData.put("checkType", "SECURITY_BREACH");//检查类型
391
+            requestData.put("checkType", CheckLevelEnum.DEPARTMENT_LEVEL.getCode());//检查类型
384 392
             requestData.put("severity", "");//严重程度
385 393
             requestData.put("location", checkCorrection.getChannelName());//位置
386 394
             requestData.put("sectionLeaderId", checkCorrection.getResponsibleUserId());//责任人
@@ -407,4 +415,48 @@ public class CheckCorrectionServiceImpl extends ServiceImpl<CheckCorrectionMappe
407 415
             throw new ServiceException("被检查级别数据异常");
408 416
         }
409 417
     }
418
+
419
+    /**
420
+     * 批量审批任务(同意)
421
+     *
422
+     * @param approvalWorkflowBatchDto 批量审批参数
423
+     * @return 结果
424
+     */
425
+    @SneakyThrows
426
+    @Transactional(rollbackFor = Exception.class)
427
+    @Override
428
+    public int approveTaskBatch(ApprovalWorkflowBatchDto approvalWorkflowBatchDto) {
429
+        approvalWorkflowBatchDto.getTaskIdList().forEach(taskId -> {
430
+            ApprovalTask task = taskMapper.selectApprovalTaskById(taskId);
431
+            ApprovalInstance instance = instanceMapper.selectApprovalInstanceById(task.getInstanceId());
432
+            CheckCorrection checkCorrection = selectCheckCorrectionById(instance.getBusinessId());
433
+            Map<String, Object> formData = BeanUtil.beanToMap(checkCorrection);
434
+            try {
435
+                checkApprovalService.approveTask(taskId, approvalWorkflowBatchDto.getComment(), formData, SecurityUtils.getLoginUser().getUserId(), SecurityUtils.getLoginUser().getUsername());
436
+            } catch (Exception e) {
437
+                throw new ServiceException("审批失败");
438
+            }
439
+        });
440
+        return 1;
441
+    }
442
+
443
+    /**
444
+     * 批量审批任务(驳回)
445
+     *
446
+     * @param approvalWorkflowBatchDto 批量审批参数
447
+     * @return 结果
448
+     */
449
+    @SneakyThrows
450
+    @Transactional(rollbackFor = Exception.class)
451
+    @Override
452
+    public int rejectTaskBatch(ApprovalWorkflowBatchDto approvalWorkflowBatchDto) {
453
+        approvalWorkflowBatchDto.getTaskIdList().forEach(taskId -> {
454
+            try {
455
+                checkApprovalService.rejectTask(taskId, approvalWorkflowBatchDto.getComment(), SecurityUtils.getLoginUser().getUserId(), SecurityUtils.getLoginUser().getUsername());
456
+            } catch (Exception e) {
457
+                throw new ServiceException("审批失败");
458
+            }
459
+        });
460
+        return 1;
461
+    }
410 462
 }

+ 23 - 23
airport-check/src/main/java/com/sundot/airport/check/service/impl/CheckLargeScreenServiceImpl.java

@@ -137,7 +137,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
137 137
                 dto.setIsSelfCheck(0);
138 138
                 dto.setCreateId(null);
139 139
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
140
-                dto.setIsSelfCheck(0);
140
+                dto.setIsSelfCheck(1);
141 141
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
142 142
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
143 143
                 dto.setIsSelfCheck(0);
@@ -184,7 +184,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
184 184
                 dto.setIsSelfCheck(0);
185 185
                 dto.setCreateId(null);
186 186
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
187
-                dto.setIsSelfCheck(0);
187
+                dto.setIsSelfCheck(1);
188 188
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
189 189
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
190 190
                 dto.setIsSelfCheck(0);
@@ -231,7 +231,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
231 231
                 dto.setIsSelfCheck(0);
232 232
                 dto.setCreateId(null);
233 233
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
234
-                dto.setIsSelfCheck(0);
234
+                dto.setIsSelfCheck(1);
235 235
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
236 236
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
237 237
                 dto.setIsSelfCheck(0);
@@ -263,13 +263,13 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
263 263
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
264 264
                 dto.setIsSelfCheck(0);
265 265
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
266
-                dto.setIsSelfCheck(0);
266
+                dto.setIsSelfCheck(null);
267 267
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
268 268
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
269
-                dto.setIsSelfCheck(0);
269
+                dto.setIsSelfCheck(null);
270 270
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
271 271
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
272
-                dto.setIsSelfCheck(0);
272
+                dto.setIsSelfCheck(null);
273 273
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
274 274
             } else {
275 275
                 return Collections.emptyList();
@@ -313,15 +313,15 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
313 313
                 dto.setIsSelfCheck(0);
314 314
                 resultTemp = checkLargeScreenMapper.problemComparisonBrigade(dto);
315 315
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
316
-                dto.setIsSelfCheck(0);
316
+                dto.setIsSelfCheck(null);
317 317
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
318 318
                 resultTemp = checkLargeScreenMapper.problemComparisonBrigade(dto);
319 319
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
320
-                dto.setIsSelfCheck(0);
320
+                dto.setIsSelfCheck(null);
321 321
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
322 322
                 resultTemp = checkLargeScreenMapper.problemComparison(dto);
323 323
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
324
-                dto.setIsSelfCheck(0);
324
+                dto.setIsSelfCheck(null);
325 325
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
326 326
                 resultTemp = checkLargeScreenMapper.problemComparisonBanZu(dto);
327 327
             } else {
@@ -380,17 +380,17 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
380 380
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBrigade(dto);
381 381
                 deptList = checkLargeScreenMapper.getProblemBrigade(dto);
382 382
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
383
-                dto.setIsSelfCheck(0);
383
+                dto.setIsSelfCheck(null);
384 384
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
385 385
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBrigade(dto);
386 386
                 deptList = checkLargeScreenMapper.getProblemBrigade(dto);
387 387
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
388
-                dto.setIsSelfCheck(0);
388
+                dto.setIsSelfCheck(null);
389 389
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
390 390
                 resultTemp = checkLargeScreenMapper.problemComparisonTwo(dto);
391 391
                 deptList = checkLargeScreenMapper.getProblemDepartment(dto);
392 392
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
393
-                dto.setIsSelfCheck(0);
393
+                dto.setIsSelfCheck(null);
394 394
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
395 395
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBanZu(dto);
396 396
                 deptList = checkLargeScreenMapper.getProblemTeam(dto);
@@ -517,13 +517,13 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
517 517
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
518 518
                 dto.setIsSelfCheck(0);
519 519
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
520
-                dto.setIsSelfCheck(0);
520
+                dto.setIsSelfCheck(null);
521 521
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getDeptId());
522 522
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
523
-                dto.setIsSelfCheck(0);
523
+                dto.setIsSelfCheck(null);
524 524
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getDeptId());
525 525
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
526
-                dto.setIsSelfCheck(0);
526
+                dto.setIsSelfCheck(null);
527 527
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getDeptId());
528 528
             } else {
529 529
                 return null;
@@ -575,15 +575,15 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
575 575
                 dto.setIsSelfCheck(0);
576 576
                 result = checkLargeScreenMapper.correctionDistributionBrigade(dto);
577 577
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
578
-                dto.setIsSelfCheck(0);
578
+                dto.setIsSelfCheck(null);
579 579
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getDeptId());
580 580
                 result = checkLargeScreenMapper.correctionDistributionBrigade(dto);
581 581
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
582
-                dto.setIsSelfCheck(0);
582
+                dto.setIsSelfCheck(null);
583 583
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getDeptId());
584 584
                 result = checkLargeScreenMapper.correctionDistribution(dto);
585 585
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
586
-                dto.setIsSelfCheck(0);
586
+                dto.setIsSelfCheck(null);
587 587
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getDeptId());
588 588
                 result = checkLargeScreenMapper.correctionDistributionBanZu(dto);
589 589
             } else {
@@ -1004,21 +1004,21 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
1004 1004
             if (roleKeyList.contains(RoleTypeEnum.admin.getCode())) {
1005 1005
                 dto.setIsSelfCheck(null);
1006 1006
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
1007
-                dto.setIsSelfCheck(0);
1007
+                dto.setIsSelfCheck(null);
1008 1008
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
1009
-                dto.setIsSelfCheck(0);
1009
+                dto.setIsSelfCheck(null);
1010 1010
                 brigadeId = SecurityUtils.getLoginUser().getDeptId();
1011 1011
                 dto.setCheckedBrigadeId(brigadeId);
1012 1012
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
1013
-                dto.setIsSelfCheck(0);
1013
+                dto.setIsSelfCheck(null);
1014 1014
                 departmentId = SecurityUtils.getLoginUser().getDeptId();
1015 1015
                 dto.setCheckedDepartmentId(departmentId);
1016 1016
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
1017
-                dto.setIsSelfCheck(0);
1017
+                dto.setIsSelfCheck(null);
1018 1018
                 teamId = SecurityUtils.getLoginUser().getDeptId();
1019 1019
                 dto.setCheckedTeamId(teamId);
1020 1020
             } else if (roleKeyList.contains(RoleTypeEnum.SecurityCheck.getCode())) {
1021
-                dto.setIsSelfCheck(0);
1021
+                dto.setIsSelfCheck(null);
1022 1022
                 userId = SecurityUtils.getLoginUser().getUserId();
1023 1023
                 dto.setCheckedUserId(userId);
1024 1024
             } else {

+ 2 - 1
airport-check/src/main/resources/mapper/check/CheckTaskMapper.xml

@@ -304,7 +304,8 @@
304 304
                 </otherwise>
305 305
             </choose>
306 306
             <if test="checkedLevel != null  and checkedLevel != ''">and checked_level = #{checkedLevel}</if>
307
-            and check_level in ('BRIGADE_LEVEL','DEPARTMENT_LEVEL', 'TEAM_LEVEL')
307
+            and ((is_self_check = 0 and check_level in ('BRIGADE_LEVEL','DEPARTMENT_LEVEL', 'TEAM_LEVEL'))
308
+            or (is_self_check = 1 and self_check_dept_id = #{selfCheckDeptId}))
308 309
         </where>
309 310
         order by create_time desc
310 311
     </select>

+ 26 - 0
airport-common/src/main/java/com/sundot/airport/common/core/domain/ApprovalWorkflowBatchDto.java

@@ -0,0 +1,26 @@
1
+package com.sundot.airport.common.core.domain;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * 批量审批参数
9
+ *
10
+ * @author ruoyi
11
+ * @date 2025-09-07
12
+ */
13
+@Data
14
+public class ApprovalWorkflowBatchDto {
15
+
16
+    /**
17
+     * 任务ID列表
18
+     */
19
+    private List<Long> taskIdList;
20
+
21
+    /**
22
+     * 审批意见
23
+     */
24
+    private String comment;
25
+
26
+}

+ 79 - 7
airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/ApprovalEngineServiceImpl.java

@@ -9,8 +9,11 @@ import java.util.stream.Collectors;
9 9
 import java.util.regex.Pattern;
10 10
 import java.util.regex.Matcher;
11 11
 
12
+import cn.hutool.core.collection.CollUtil;
12 13
 import cn.hutool.core.util.ObjectUtil;
14
+import com.sundot.airport.common.core.domain.entity.SysDept;
13 15
 import com.sundot.airport.common.enums.RoleTypeEnum;
16
+import com.sundot.airport.system.service.ISysDeptService;
14 17
 import org.slf4j.Logger;
15 18
 import org.slf4j.LoggerFactory;
16 19
 import com.sundot.airport.common.utils.DateUtils;
@@ -23,7 +26,6 @@ import org.springframework.stereotype.Service;
23 26
 import org.springframework.transaction.annotation.Transactional;
24 27
 import com.fasterxml.jackson.databind.ObjectMapper;
25 28
 import com.sundot.airport.system.domain.approval.*;
26
-import com.sundot.airport.system.domain.approval.constants.ApprovalConstants;
27 29
 import com.sundot.airport.system.mapper.approval.*;
28 30
 import com.sundot.airport.system.service.approval.IApprovalEngineService;
29 31
 import com.sundot.airport.common.core.domain.entity.SysUser;
@@ -68,6 +70,10 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
68 70
 
69 71
     private ObjectMapper objectMapper = new ObjectMapper();
70 72
 
73
+    @Autowired
74
+    private ISysDeptService sysDeptService;
75
+
76
+
71 77
     /**
72 78
      * 启动审批流程
73 79
      */
@@ -204,7 +210,10 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
204 210
         // 5. 查找任务的原始创建者或更新者
205 211
         Long originalUserId = approvalUserService.getTaskCreatorOrUpdaterByTaskId(taskId);
206 212
 
207
-        if (originalUserId != null) {
213
+        if (isSectionCheckWorkflow(instance) && ("DEPARTMENT_LEVEL_LEADER_XINGZHENG".equals(currentNode.getNodeCode()) || "DEPARTMENT_LEVEL_LEADER_JINGLI_ONE".equals(currentNode.getNodeCode()) || "DEPARTMENT_LEVEL_LEADER_JINGLI_TWO".equals(currentNode.getNodeCode()))) {
214
+            currentNode.setSortOrder(1);
215
+            moveToNextNode(instance, currentNode, operatorId, operatorName, comment, null, task);
216
+        } else if (originalUserId != null) {
208 217
             // 5.1. 不结束流程,而是创建回流任务给原始操作者
209 218
             instance.setStatus("RUNNING"); // 保持运行状态
210 219
             instance.setUpdateBy(SecurityUtils.getUsername());
@@ -414,9 +423,9 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
414 423
     public ApprovalInstance startSectionLevelProcess(String businessType, Long businessId, String title,
415 424
                                                      Long submitterId, String submitterName, Long sectionLeaderId,
416 425
                                                      Map<String, Object> formData, Map<String, Object> businessData) {
417
-        ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode("SECTION_LEVEL");
426
+        ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode("DEPARTMENT_LEVEL");
418 427
         if (workflow == null) {
419
-            throw new RuntimeException("流程定义不存在: SECTION_LEVEL");
428
+            throw new RuntimeException("流程定义不存在: DEPARTMENT_LEVEL");
420 429
         }
421 430
 
422 431
         ApprovalInstance instance = new ApprovalInstance();
@@ -753,7 +762,11 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
753 762
                 }
754 763
                 // 科级检查流程的特殊处理
755 764
                 else if (isSectionCheckWorkflow(instance)) {
756
-                    handleSectionCheckNodeAssignment(instance, nextNode, formData);
765
+                    boolean isNext = handleSectionCheckNodeAssignment(instance, nextNode, formData);
766
+                    if (isNext) {
767
+                        currentNode.setSortOrder(nextNode.getSortOrder() + 1);
768
+                        moveToNextNode(instance, currentNode, operatorId, operatorName, comment, formData, currentTask);
769
+                    }
757 770
                 }
758 771
                 // 检查下一节点是否需要动态分配
759 772
                 else if (isSeizureReportWorkflow(instance) && "SECTION_KEZHANG".equals(nextNode.getApproverType())) {
@@ -1154,7 +1167,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
1154 1167
      * 检查是否为科级检查流程
1155 1168
      */
1156 1169
     private boolean isSectionCheckWorkflow(ApprovalInstance instance) {
1157
-        return "SECTION_CHECK".equals(instance.getBusinessType());
1170
+        return "DEPARTMENT_CHECK".equals(instance.getBusinessType());
1158 1171
     }
1159 1172
 
1160 1173
     /**
@@ -1182,7 +1195,8 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
1182 1195
     /**
1183 1196
      * 处理科级检查流程的节点分配
1184 1197
      */
1185
-    private void handleSectionCheckNodeAssignment(ApprovalInstance instance, ApprovalNodeDefinition nextNode, Map<String, Object> formData) {
1198
+    private boolean handleSectionCheckNodeAssignment(ApprovalInstance instance, ApprovalNodeDefinition nextNode, Map<String, Object> formData) {
1199
+        boolean isNext = false;
1186 1200
         String nodeCode = nextNode.getNodeCode();
1187 1201
 
1188 1202
         switch (nodeCode) {
@@ -1203,11 +1217,35 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
1203 1217
                 // 责任人审批后 → 发起人审批
1204 1218
                 createTaskForInitiatorFinalReview(instance, nextNode, formData);
1205 1219
                 break;
1220
+            case "DEPARTMENT_LEVEL_LEADER_KEZHANG":
1221
+                // 开始 → 责任人(主管)审批
1222
+                createTaskForResponsiblePerson(instance, nextNode, formData);
1223
+                break;
1224
+            case "DEPARTMENT_LEVEL_LEADER_XINGZHENG":
1225
+                // 责任人(主管)审批 → 发起人(大队行政)审批
1226
+                createTaskForInitiator(instance, nextNode, formData);
1227
+                break;
1228
+            case "DEPARTMENT_LEVEL_LEADER_JINGLI_ONE":
1229
+                // 大队行政审批 → 大队经理1审批
1230
+                createTaskForDept(instance, nextNode, formData);
1231
+                break;
1232
+            case "DEPARTMENT_LEVEL_LEADER_JINGLI_TWO":
1233
+                // 发起人(大队行政)审批 → 大队经理1审批
1234
+                Long deptId = extractTargetDeptIdFromBusinessData(instance.getBusinessData());
1235
+                SysDept sysDept = sysDeptService.selectDeptById(deptId);
1236
+                List<SysUser> sysUserList = sysUserMapper.selectUserByDeptIdAndRoleKeyList(sysDept.getParentId(), Arrays.asList(RoleTypeEnum.jingli.getCode()));
1237
+                if (CollUtil.isNotEmpty(sysUserList) && sysUserList.size() > 1) {
1238
+                    createTaskForDeptTwo(instance, nextNode, formData);
1239
+                } else {
1240
+                    isNext = true;
1241
+                }
1242
+                break;
1206 1243
             default:
1207 1244
                 // 使用默认分配逻辑
1208 1245
                 createTasksForNode(instance, nextNode, formData, null);
1209 1246
                 break;
1210 1247
         }
1248
+        return isNext;
1211 1249
     }
1212 1250
 
1213 1251
     /**
@@ -1772,4 +1810,38 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
1772 1810
             throw new RuntimeException("创建违禁品审批任务失败:" + e.getMessage(), e);
1773 1811
         }
1774 1812
     }
1813
+
1814
+    /**
1815
+     * 为大队经理1创建审批任务
1816
+     */
1817
+    private void createTaskForDept(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData) {
1818
+        try {
1819
+            Long deptId = extractTargetDeptIdFromBusinessData(instance.getBusinessData());
1820
+            SysDept sysDept = sysDeptService.selectDeptById(deptId);
1821
+            List<SysUser> sysUserList = sysUserMapper.selectUserByDeptIdAndRoleKeyList(sysDept.getParentId(), Arrays.asList(RoleTypeEnum.jingli.getCode()));
1822
+            if (CollUtil.isEmpty(sysUserList)) {
1823
+                throw new RuntimeException("未找到部门上级领导,无法分配审批任务");
1824
+            }
1825
+            createSingleApprovalTaskForNode(instance, node, sysUserList.get(0).getUserId(), sysUserList.get(0).getNickName());
1826
+        } catch (Exception e) {
1827
+            logger.error("创建经理1审批任务失败", e);
1828
+        }
1829
+    }
1830
+
1831
+    /**
1832
+     * 为大队经理2创建审批任务
1833
+     */
1834
+    private void createTaskForDeptTwo(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData) {
1835
+        try {
1836
+            Long deptId = extractTargetDeptIdFromBusinessData(instance.getBusinessData());
1837
+            SysDept sysDept = sysDeptService.selectDeptById(deptId);
1838
+            List<SysUser> sysUserList = sysUserMapper.selectUserByDeptIdAndRoleKeyList(sysDept.getParentId(), Arrays.asList(RoleTypeEnum.jingli.getCode()));
1839
+            if (CollUtil.isEmpty(sysUserList) || sysUserList.size() < 2) {
1840
+                throw new RuntimeException("未找到部门上级领导,无法分配审批任务");
1841
+            }
1842
+            createSingleApprovalTaskForNode(instance, node, sysUserList.get(1).getUserId(), sysUserList.get(1).getNickName());
1843
+        } catch (Exception e) {
1844
+            logger.error("创建经理1审批任务失败", e);
1845
+        }
1846
+    }
1775 1847
 }

+ 4 - 6
airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/CheckApprovalServiceImpl.java

@@ -184,9 +184,9 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
184 184
         //Long businessId = System.currentTimeMillis();
185 185
 
186 186
         Map<String, Object> params = new HashMap<>();
187
-        params.put("businessType", "SECTION_CHECK");
187
+        params.put("businessType", "DEPARTMENT_CHECK");
188 188
         params.put("businessId", businessId);
189
-        params.put("title", "级检查");
189
+        params.put("title", "被检查级别为主管级检查");
190 190
         params.put("checkType", checkType);
191 191
         params.put("severity", severity);
192 192
         params.put("targetDeptId", targetDeptId);
@@ -199,9 +199,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
199 199
         Map<String, Object> businessData = new HashMap<>();
200 200
         businessData.put("checkType", checkType);
201 201
         businessData.put("severity", severity);
202
-        if (targetDeptId != null) {
203
-            businessData.put("targetDeptId", targetDeptId);
204
-        }
202
+        businessData.put("targetDeptId", targetDeptId);
205 203
         businessData.put("sectionLeaderId", sectionLeaderId);
206 204
         params.put("businessData", businessData);
207 205
 
@@ -267,7 +265,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
267 265
         Map<String, Object> params = new HashMap<>();
268 266
         params.put("businessType", "BRIGADE_CHECK");
269 267
         params.put("businessId", businessId);
270
-        params.put("title", "大队级检查");
268
+        params.put("title", "被检查级别为大队级检查");
271 269
         params.put("checkType", checkType);
272 270
         params.put("severity", severity);
273 271
         params.put("targetDeptId", targetDeptId);