Просмотр исходного кода

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

chenshudong месяцев назад: 2
Родитель
Сommit
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
 import javax.servlet.http.HttpServletResponse;
5
 import javax.servlet.http.HttpServletResponse;
6
 
6
 
7
 import cn.hutool.core.collection.CollUtil;
7
 import cn.hutool.core.collection.CollUtil;
8
+import com.sundot.airport.common.core.domain.ApprovalWorkflowBatchDto;
8
 import com.sundot.airport.common.core.domain.DataPermissionResult;
9
 import com.sundot.airport.common.core.domain.DataPermissionResult;
9
 import com.sundot.airport.web.core.utils.DataPermissionUtils;
10
 import com.sundot.airport.web.core.utils.DataPermissionUtils;
10
 import org.springframework.security.access.prepost.PreAuthorize;
11
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -172,4 +173,24 @@ public class CheckCorrectionController extends BaseController {
172
     public AjaxResult rejectTask(@RequestBody CheckCorrection checkCorrection) {
173
     public AjaxResult rejectTask(@RequestBody CheckCorrection checkCorrection) {
173
         return success(checkCorrectionService.rejectTask(checkCorrection));
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
 import java.util.Collections;
3
 import java.util.Collections;
4
 import java.util.List;
4
 import java.util.List;
5
+import java.util.stream.Collectors;
5
 import javax.servlet.http.HttpServletResponse;
6
 import javax.servlet.http.HttpServletResponse;
6
 
7
 
7
 import cn.hutool.core.collection.CollUtil;
8
 import cn.hutool.core.collection.CollUtil;
8
 import cn.hutool.core.util.StrUtil;
9
 import cn.hutool.core.util.StrUtil;
9
 import com.sundot.airport.common.core.domain.DataPermissionResult;
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
 import com.sundot.airport.common.enums.CheckLevelEnum;
13
 import com.sundot.airport.common.enums.CheckLevelEnum;
11
 import com.sundot.airport.common.enums.CheckTaskStatusEnum;
14
 import com.sundot.airport.common.enums.CheckTaskStatusEnum;
15
+import com.sundot.airport.common.enums.RoleTypeEnum;
12
 import com.sundot.airport.common.enums.SourceTypeEnum;
16
 import com.sundot.airport.common.enums.SourceTypeEnum;
13
 import com.sundot.airport.common.utils.SecurityUtils;
17
 import com.sundot.airport.common.utils.SecurityUtils;
18
+import com.sundot.airport.system.service.ISysDeptService;
14
 import com.sundot.airport.web.core.utils.DataPermissionUtils;
19
 import com.sundot.airport.web.core.utils.DataPermissionUtils;
15
 import org.springframework.security.access.prepost.PreAuthorize;
20
 import org.springframework.security.access.prepost.PreAuthorize;
16
 import org.springframework.beans.factory.annotation.Autowired;
21
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +48,8 @@ import com.sundot.airport.common.core.page.TableDataInfo;
43
 public class CheckTaskController extends BaseController {
48
 public class CheckTaskController extends BaseController {
44
     @Autowired
49
     @Autowired
45
     private ICheckTaskService checkTaskService;
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
                     checkTask.setCheckLevel(CheckLevelEnum.STATION_LEVEL.getCode());
69
                     checkTask.setCheckLevel(CheckLevelEnum.STATION_LEVEL.getCode());
63
                     break;
70
                     break;
64
                 case BRIGADE:
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
                     break;
80
                     break;
67
                 case DEPARTMENT:
81
                 case DEPARTMENT:
68
                     checkTask.setCheckLevel(CheckLevelEnum.DEPARTMENT_LEVEL.getCode());
82
                     checkTask.setCheckLevel(CheckLevelEnum.DEPARTMENT_LEVEL.getCode());
69
-                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
83
+                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
70
                     break;
84
                     break;
71
                 case TEAM:
85
                 case TEAM:
72
                     checkTask.setCheckLevel(CheckLevelEnum.TEAM_LEVEL.getCode());
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
                     break;
90
                     break;
75
                 default:
91
                 default:
76
                     return getDataTable(Collections.emptyList());
92
                     return getDataTable(Collections.emptyList());
@@ -83,10 +99,11 @@ public class CheckTaskController extends BaseController {
83
                     list = checkTaskService.selectCheckTaskList(checkTask);
99
                     list = checkTaskService.selectCheckTaskList(checkTask);
84
                     break;
100
                     break;
85
                 case BRIGADE:
101
                 case BRIGADE:
102
+                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
86
                     list = checkTaskService.selectCheckTaskListBrigadeWeb(checkTask);
103
                     list = checkTaskService.selectCheckTaskListBrigadeWeb(checkTask);
87
                     break;
104
                     break;
88
                 case DEPARTMENT:
105
                 case DEPARTMENT:
89
-                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
106
+                    checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
90
                     list = checkTaskService.selectCheckTaskListWeb(checkTask);
107
                     list = checkTaskService.selectCheckTaskListWeb(checkTask);
91
                     break;
108
                     break;
92
                 default:
109
                 default:
@@ -113,10 +130,11 @@ public class CheckTaskController extends BaseController {
113
                 list = checkTaskService.selectCheckTaskList(checkTask);
130
                 list = checkTaskService.selectCheckTaskList(checkTask);
114
                 break;
131
                 break;
115
             case BRIGADE:
132
             case BRIGADE:
133
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
116
                 list = checkTaskService.selectCheckTaskListBrigadeWeb(checkTask);
134
                 list = checkTaskService.selectCheckTaskListBrigadeWeb(checkTask);
117
                 break;
135
                 break;
118
             case DEPARTMENT:
136
             case DEPARTMENT:
119
-                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
137
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
120
                 list = checkTaskService.selectCheckTaskListWeb(checkTask);
138
                 list = checkTaskService.selectCheckTaskListWeb(checkTask);
121
                 break;
139
                 break;
122
             default:
140
             default:
@@ -188,14 +206,17 @@ public class CheckTaskController extends BaseController {
188
                 break;
206
                 break;
189
             case BRIGADE:
207
             case BRIGADE:
190
                 checkTask.setCheckLevel(CheckLevelEnum.BRIGADE_LEVEL.getCode());
208
                 checkTask.setCheckLevel(CheckLevelEnum.BRIGADE_LEVEL.getCode());
209
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
191
                 break;
210
                 break;
192
             case DEPARTMENT:
211
             case DEPARTMENT:
193
                 checkTask.setCheckLevel(CheckLevelEnum.DEPARTMENT_LEVEL.getCode());
212
                 checkTask.setCheckLevel(CheckLevelEnum.DEPARTMENT_LEVEL.getCode());
194
-                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
213
+                checkTask.setSelfCheckDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId());
195
                 break;
214
                 break;
196
             case TEAM:
215
             case TEAM:
197
                 checkTask.setCheckLevel(CheckLevelEnum.TEAM_LEVEL.getCode());
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
                 break;
220
                 break;
200
             default:
221
             default:
201
                 return success(0);
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
     private String ruleTypeDesc;
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
     private Integer isSelfCheck;
157
     private Integer isSelfCheck;
158
 
158
 
159
     /**
159
     /**
@@ -175,15 +175,15 @@ public class CheckTask extends BaseEntity {
175
     private Long updateId;
175
     private Long updateId;
176
 
176
 
177
     /**
177
     /**
178
-     * 自查科室ID
178
+     * 自查大队ID
179
      */
179
      */
180
-    @Excel(name = "自查科室ID")
180
+    @Excel(name = "自查大队ID")
181
     private Long selfCheckDeptId;
181
     private Long selfCheckDeptId;
182
 
182
 
183
     /**
183
     /**
184
-     * 自查科室名称
184
+     * 自查大队名称
185
      */
185
      */
186
-    @Excel(name = "自查科室名称")
186
+    @Excel(name = "自查大队名称")
187
     private String selfCheckDeptName;
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
     public boolean supports(String businessType) {
43
     public boolean supports(String businessType) {
44
         return "PERSONAL_CHECK".equals(businessType)
44
         return "PERSONAL_CHECK".equals(businessType)
45
                 || "GROUP_CHECK".equals(businessType)
45
                 || "GROUP_CHECK".equals(businessType)
46
-                || "SECTION_CHECK".equals(businessType)
46
+                || "DEPARTMENT_CHECK".equals(businessType)
47
                 || "BRIGADE_CHECK".equals(businessType);
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
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.baomidou.mybatisplus.extension.service.IService;
6
 import com.sundot.airport.check.domain.CheckCorrection;
6
 import com.sundot.airport.check.domain.CheckCorrection;
7
+import com.sundot.airport.common.core.domain.ApprovalWorkflowBatchDto;
7
 
8
 
8
 /**
9
 /**
9
  * 问题整改Service接口
10
  * 问题整改Service接口
@@ -75,4 +76,20 @@ public interface ICheckCorrectionService extends IService<CheckCorrection> {
75
      * @return 结果
76
      * @return 结果
76
      */
77
      */
77
     public int rejectTask(CheckCorrection checkCorrection);
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
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
13
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
14
 import com.sundot.airport.check.domain.CheckProjectItem;
14
 import com.sundot.airport.check.domain.CheckProjectItem;
15
 import com.sundot.airport.check.domain.CheckUser;
15
 import com.sundot.airport.check.domain.CheckUser;
16
+import com.sundot.airport.common.core.domain.ApprovalWorkflowBatchDto;
16
 import com.sundot.airport.check.service.ICheckProjectItemService;
17
 import com.sundot.airport.check.service.ICheckProjectItemService;
17
 import com.sundot.airport.check.service.ICheckUserService;
18
 import com.sundot.airport.check.service.ICheckUserService;
18
 import com.sundot.airport.common.constant.Constants;
19
 import com.sundot.airport.common.constant.Constants;
@@ -29,6 +30,9 @@ import com.sundot.airport.common.utils.DateUtils;
29
 import com.sundot.airport.common.utils.SecurityUtils;
30
 import com.sundot.airport.common.utils.SecurityUtils;
30
 import com.sundot.airport.common.utils.StringUtils;
31
 import com.sundot.airport.common.utils.StringUtils;
31
 import com.sundot.airport.system.domain.approval.ApprovalInstance;
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
 import com.sundot.airport.system.service.approval.IApprovalEngineService;
36
 import com.sundot.airport.system.service.approval.IApprovalEngineService;
33
 import com.sundot.airport.system.service.approval.ICheckApprovalService;
37
 import com.sundot.airport.system.service.approval.ICheckApprovalService;
34
 import lombok.SneakyThrows;
38
 import lombok.SneakyThrows;
@@ -63,6 +67,10 @@ public class CheckCorrectionServiceImpl extends ServiceImpl<CheckCorrectionMappe
63
     private ICheckApprovalService checkApprovalService;
67
     private ICheckApprovalService checkApprovalService;
64
     @Autowired
68
     @Autowired
65
     private IApprovalEngineService approvalEngineService;
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
         } else if (StringUtils.equals(CheckLevelEnum.DEPARTMENT_LEVEL.getCode(), checkCorrection.getCheckedLevel())) {
388
         } else if (StringUtils.equals(CheckLevelEnum.DEPARTMENT_LEVEL.getCode(), checkCorrection.getCheckedLevel())) {
381
             Map<String, Object> requestData = new HashMap<>();
389
             Map<String, Object> requestData = new HashMap<>();
382
             requestData.put("businessId", checkCorrection.getId());//业务ID
390
             requestData.put("businessId", checkCorrection.getId());//业务ID
383
-            requestData.put("checkType", "SECURITY_BREACH");//检查类型
391
+            requestData.put("checkType", CheckLevelEnum.DEPARTMENT_LEVEL.getCode());//检查类型
384
             requestData.put("severity", "");//严重程度
392
             requestData.put("severity", "");//严重程度
385
             requestData.put("location", checkCorrection.getChannelName());//位置
393
             requestData.put("location", checkCorrection.getChannelName());//位置
386
             requestData.put("sectionLeaderId", checkCorrection.getResponsibleUserId());//责任人
394
             requestData.put("sectionLeaderId", checkCorrection.getResponsibleUserId());//责任人
@@ -407,4 +415,48 @@ public class CheckCorrectionServiceImpl extends ServiceImpl<CheckCorrectionMappe
407
             throw new ServiceException("被检查级别数据异常");
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
                 dto.setIsSelfCheck(0);
137
                 dto.setIsSelfCheck(0);
138
                 dto.setCreateId(null);
138
                 dto.setCreateId(null);
139
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
139
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
140
-                dto.setIsSelfCheck(0);
140
+                dto.setIsSelfCheck(1);
141
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
141
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
142
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
142
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
143
                 dto.setIsSelfCheck(0);
143
                 dto.setIsSelfCheck(0);
@@ -184,7 +184,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
184
                 dto.setIsSelfCheck(0);
184
                 dto.setIsSelfCheck(0);
185
                 dto.setCreateId(null);
185
                 dto.setCreateId(null);
186
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
186
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
187
-                dto.setIsSelfCheck(0);
187
+                dto.setIsSelfCheck(1);
188
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
188
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
189
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
189
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
190
                 dto.setIsSelfCheck(0);
190
                 dto.setIsSelfCheck(0);
@@ -231,7 +231,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
231
                 dto.setIsSelfCheck(0);
231
                 dto.setIsSelfCheck(0);
232
                 dto.setCreateId(null);
232
                 dto.setCreateId(null);
233
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
233
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
234
-                dto.setIsSelfCheck(0);
234
+                dto.setIsSelfCheck(1);
235
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
235
                 dto.setCreateId(SecurityUtils.getLoginUser().getUserId());
236
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
236
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
237
                 dto.setIsSelfCheck(0);
237
                 dto.setIsSelfCheck(0);
@@ -263,13 +263,13 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
263
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
263
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
264
                 dto.setIsSelfCheck(0);
264
                 dto.setIsSelfCheck(0);
265
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
265
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
266
-                dto.setIsSelfCheck(0);
266
+                dto.setIsSelfCheck(null);
267
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
267
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
268
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
268
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
269
-                dto.setIsSelfCheck(0);
269
+                dto.setIsSelfCheck(null);
270
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
270
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
271
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
271
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
272
-                dto.setIsSelfCheck(0);
272
+                dto.setIsSelfCheck(null);
273
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
273
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
274
             } else {
274
             } else {
275
                 return Collections.emptyList();
275
                 return Collections.emptyList();
@@ -313,15 +313,15 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
313
                 dto.setIsSelfCheck(0);
313
                 dto.setIsSelfCheck(0);
314
                 resultTemp = checkLargeScreenMapper.problemComparisonBrigade(dto);
314
                 resultTemp = checkLargeScreenMapper.problemComparisonBrigade(dto);
315
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
315
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
316
-                dto.setIsSelfCheck(0);
316
+                dto.setIsSelfCheck(null);
317
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
317
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
318
                 resultTemp = checkLargeScreenMapper.problemComparisonBrigade(dto);
318
                 resultTemp = checkLargeScreenMapper.problemComparisonBrigade(dto);
319
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
319
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
320
-                dto.setIsSelfCheck(0);
320
+                dto.setIsSelfCheck(null);
321
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
321
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
322
                 resultTemp = checkLargeScreenMapper.problemComparison(dto);
322
                 resultTemp = checkLargeScreenMapper.problemComparison(dto);
323
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
323
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
324
-                dto.setIsSelfCheck(0);
324
+                dto.setIsSelfCheck(null);
325
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
325
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
326
                 resultTemp = checkLargeScreenMapper.problemComparisonBanZu(dto);
326
                 resultTemp = checkLargeScreenMapper.problemComparisonBanZu(dto);
327
             } else {
327
             } else {
@@ -380,17 +380,17 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
380
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBrigade(dto);
380
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBrigade(dto);
381
                 deptList = checkLargeScreenMapper.getProblemBrigade(dto);
381
                 deptList = checkLargeScreenMapper.getProblemBrigade(dto);
382
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
382
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
383
-                dto.setIsSelfCheck(0);
383
+                dto.setIsSelfCheck(null);
384
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
384
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
385
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBrigade(dto);
385
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBrigade(dto);
386
                 deptList = checkLargeScreenMapper.getProblemBrigade(dto);
386
                 deptList = checkLargeScreenMapper.getProblemBrigade(dto);
387
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
387
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
388
-                dto.setIsSelfCheck(0);
388
+                dto.setIsSelfCheck(null);
389
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
389
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
390
                 resultTemp = checkLargeScreenMapper.problemComparisonTwo(dto);
390
                 resultTemp = checkLargeScreenMapper.problemComparisonTwo(dto);
391
                 deptList = checkLargeScreenMapper.getProblemDepartment(dto);
391
                 deptList = checkLargeScreenMapper.getProblemDepartment(dto);
392
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
392
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
393
-                dto.setIsSelfCheck(0);
393
+                dto.setIsSelfCheck(null);
394
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
394
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
395
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBanZu(dto);
395
                 resultTemp = checkLargeScreenMapper.problemComparisonTwoBanZu(dto);
396
                 deptList = checkLargeScreenMapper.getProblemTeam(dto);
396
                 deptList = checkLargeScreenMapper.getProblemTeam(dto);
@@ -517,13 +517,13 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
517
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
517
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
518
                 dto.setIsSelfCheck(0);
518
                 dto.setIsSelfCheck(0);
519
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
519
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
520
-                dto.setIsSelfCheck(0);
520
+                dto.setIsSelfCheck(null);
521
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getDeptId());
521
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getDeptId());
522
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
522
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
523
-                dto.setIsSelfCheck(0);
523
+                dto.setIsSelfCheck(null);
524
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getDeptId());
524
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getDeptId());
525
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
525
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
526
-                dto.setIsSelfCheck(0);
526
+                dto.setIsSelfCheck(null);
527
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getDeptId());
527
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getDeptId());
528
             } else {
528
             } else {
529
                 return null;
529
                 return null;
@@ -575,15 +575,15 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
575
                 dto.setIsSelfCheck(0);
575
                 dto.setIsSelfCheck(0);
576
                 result = checkLargeScreenMapper.correctionDistributionBrigade(dto);
576
                 result = checkLargeScreenMapper.correctionDistributionBrigade(dto);
577
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
577
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
578
-                dto.setIsSelfCheck(0);
578
+                dto.setIsSelfCheck(null);
579
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getDeptId());
579
                 dto.setCheckedBrigadeId(SecurityUtils.getLoginUser().getDeptId());
580
                 result = checkLargeScreenMapper.correctionDistributionBrigade(dto);
580
                 result = checkLargeScreenMapper.correctionDistributionBrigade(dto);
581
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
581
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
582
-                dto.setIsSelfCheck(0);
582
+                dto.setIsSelfCheck(null);
583
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getDeptId());
583
                 dto.setCheckedDepartmentId(SecurityUtils.getLoginUser().getDeptId());
584
                 result = checkLargeScreenMapper.correctionDistribution(dto);
584
                 result = checkLargeScreenMapper.correctionDistribution(dto);
585
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
585
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
586
-                dto.setIsSelfCheck(0);
586
+                dto.setIsSelfCheck(null);
587
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getDeptId());
587
                 dto.setCheckedTeamId(SecurityUtils.getLoginUser().getDeptId());
588
                 result = checkLargeScreenMapper.correctionDistributionBanZu(dto);
588
                 result = checkLargeScreenMapper.correctionDistributionBanZu(dto);
589
             } else {
589
             } else {
@@ -1004,21 +1004,21 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
1004
             if (roleKeyList.contains(RoleTypeEnum.admin.getCode())) {
1004
             if (roleKeyList.contains(RoleTypeEnum.admin.getCode())) {
1005
                 dto.setIsSelfCheck(null);
1005
                 dto.setIsSelfCheck(null);
1006
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
1006
             } else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
1007
-                dto.setIsSelfCheck(0);
1007
+                dto.setIsSelfCheck(null);
1008
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
1008
             } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
1009
-                dto.setIsSelfCheck(0);
1009
+                dto.setIsSelfCheck(null);
1010
                 brigadeId = SecurityUtils.getLoginUser().getDeptId();
1010
                 brigadeId = SecurityUtils.getLoginUser().getDeptId();
1011
                 dto.setCheckedBrigadeId(brigadeId);
1011
                 dto.setCheckedBrigadeId(brigadeId);
1012
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
1012
             } else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
1013
-                dto.setIsSelfCheck(0);
1013
+                dto.setIsSelfCheck(null);
1014
                 departmentId = SecurityUtils.getLoginUser().getDeptId();
1014
                 departmentId = SecurityUtils.getLoginUser().getDeptId();
1015
                 dto.setCheckedDepartmentId(departmentId);
1015
                 dto.setCheckedDepartmentId(departmentId);
1016
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
1016
             } else if (roleKeyList.contains(RoleTypeEnum.banzuzhang.getCode())) {
1017
-                dto.setIsSelfCheck(0);
1017
+                dto.setIsSelfCheck(null);
1018
                 teamId = SecurityUtils.getLoginUser().getDeptId();
1018
                 teamId = SecurityUtils.getLoginUser().getDeptId();
1019
                 dto.setCheckedTeamId(teamId);
1019
                 dto.setCheckedTeamId(teamId);
1020
             } else if (roleKeyList.contains(RoleTypeEnum.SecurityCheck.getCode())) {
1020
             } else if (roleKeyList.contains(RoleTypeEnum.SecurityCheck.getCode())) {
1021
-                dto.setIsSelfCheck(0);
1021
+                dto.setIsSelfCheck(null);
1022
                 userId = SecurityUtils.getLoginUser().getUserId();
1022
                 userId = SecurityUtils.getLoginUser().getUserId();
1023
                 dto.setCheckedUserId(userId);
1023
                 dto.setCheckedUserId(userId);
1024
             } else {
1024
             } else {

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

@@ -304,7 +304,8 @@
304
                 </otherwise>
304
                 </otherwise>
305
             </choose>
305
             </choose>
306
             <if test="checkedLevel != null  and checkedLevel != ''">and checked_level = #{checkedLevel}</if>
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
         </where>
309
         </where>
309
         order by create_time desc
310
         order by create_time desc
310
     </select>
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
 import java.util.regex.Pattern;
9
 import java.util.regex.Pattern;
10
 import java.util.regex.Matcher;
10
 import java.util.regex.Matcher;
11
 
11
 
12
+import cn.hutool.core.collection.CollUtil;
12
 import cn.hutool.core.util.ObjectUtil;
13
 import cn.hutool.core.util.ObjectUtil;
14
+import com.sundot.airport.common.core.domain.entity.SysDept;
13
 import com.sundot.airport.common.enums.RoleTypeEnum;
15
 import com.sundot.airport.common.enums.RoleTypeEnum;
16
+import com.sundot.airport.system.service.ISysDeptService;
14
 import org.slf4j.Logger;
17
 import org.slf4j.Logger;
15
 import org.slf4j.LoggerFactory;
18
 import org.slf4j.LoggerFactory;
16
 import com.sundot.airport.common.utils.DateUtils;
19
 import com.sundot.airport.common.utils.DateUtils;
@@ -23,7 +26,6 @@ import org.springframework.stereotype.Service;
23
 import org.springframework.transaction.annotation.Transactional;
26
 import org.springframework.transaction.annotation.Transactional;
24
 import com.fasterxml.jackson.databind.ObjectMapper;
27
 import com.fasterxml.jackson.databind.ObjectMapper;
25
 import com.sundot.airport.system.domain.approval.*;
28
 import com.sundot.airport.system.domain.approval.*;
26
-import com.sundot.airport.system.domain.approval.constants.ApprovalConstants;
27
 import com.sundot.airport.system.mapper.approval.*;
29
 import com.sundot.airport.system.mapper.approval.*;
28
 import com.sundot.airport.system.service.approval.IApprovalEngineService;
30
 import com.sundot.airport.system.service.approval.IApprovalEngineService;
29
 import com.sundot.airport.common.core.domain.entity.SysUser;
31
 import com.sundot.airport.common.core.domain.entity.SysUser;
@@ -68,6 +70,10 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
68
 
70
 
69
     private ObjectMapper objectMapper = new ObjectMapper();
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
         // 5. 查找任务的原始创建者或更新者
210
         // 5. 查找任务的原始创建者或更新者
205
         Long originalUserId = approvalUserService.getTaskCreatorOrUpdaterByTaskId(taskId);
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
             // 5.1. 不结束流程,而是创建回流任务给原始操作者
217
             // 5.1. 不结束流程,而是创建回流任务给原始操作者
209
             instance.setStatus("RUNNING"); // 保持运行状态
218
             instance.setStatus("RUNNING"); // 保持运行状态
210
             instance.setUpdateBy(SecurityUtils.getUsername());
219
             instance.setUpdateBy(SecurityUtils.getUsername());
@@ -414,9 +423,9 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
414
     public ApprovalInstance startSectionLevelProcess(String businessType, Long businessId, String title,
423
     public ApprovalInstance startSectionLevelProcess(String businessType, Long businessId, String title,
415
                                                      Long submitterId, String submitterName, Long sectionLeaderId,
424
                                                      Long submitterId, String submitterName, Long sectionLeaderId,
416
                                                      Map<String, Object> formData, Map<String, Object> businessData) {
425
                                                      Map<String, Object> formData, Map<String, Object> businessData) {
417
-        ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode("SECTION_LEVEL");
426
+        ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode("DEPARTMENT_LEVEL");
418
         if (workflow == null) {
427
         if (workflow == null) {
419
-            throw new RuntimeException("流程定义不存在: SECTION_LEVEL");
428
+            throw new RuntimeException("流程定义不存在: DEPARTMENT_LEVEL");
420
         }
429
         }
421
 
430
 
422
         ApprovalInstance instance = new ApprovalInstance();
431
         ApprovalInstance instance = new ApprovalInstance();
@@ -753,7 +762,11 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
753
                 }
762
                 }
754
                 // 科级检查流程的特殊处理
763
                 // 科级检查流程的特殊处理
755
                 else if (isSectionCheckWorkflow(instance)) {
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
                 else if (isSeizureReportWorkflow(instance) && "SECTION_KEZHANG".equals(nextNode.getApproverType())) {
772
                 else if (isSeizureReportWorkflow(instance) && "SECTION_KEZHANG".equals(nextNode.getApproverType())) {
@@ -1154,7 +1167,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
1154
      * 检查是否为科级检查流程
1167
      * 检查是否为科级检查流程
1155
      */
1168
      */
1156
     private boolean isSectionCheckWorkflow(ApprovalInstance instance) {
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
         String nodeCode = nextNode.getNodeCode();
1200
         String nodeCode = nextNode.getNodeCode();
1187
 
1201
 
1188
         switch (nodeCode) {
1202
         switch (nodeCode) {
@@ -1203,11 +1217,35 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
1203
                 // 责任人审批后 → 发起人审批
1217
                 // 责任人审批后 → 发起人审批
1204
                 createTaskForInitiatorFinalReview(instance, nextNode, formData);
1218
                 createTaskForInitiatorFinalReview(instance, nextNode, formData);
1205
                 break;
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
             default:
1243
             default:
1207
                 // 使用默认分配逻辑
1244
                 // 使用默认分配逻辑
1208
                 createTasksForNode(instance, nextNode, formData, null);
1245
                 createTasksForNode(instance, nextNode, formData, null);
1209
                 break;
1246
                 break;
1210
         }
1247
         }
1248
+        return isNext;
1211
     }
1249
     }
1212
 
1250
 
1213
     /**
1251
     /**
@@ -1772,4 +1810,38 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
1772
             throw new RuntimeException("创建违禁品审批任务失败:" + e.getMessage(), e);
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
         //Long businessId = System.currentTimeMillis();
184
         //Long businessId = System.currentTimeMillis();
185
 
185
 
186
         Map<String, Object> params = new HashMap<>();
186
         Map<String, Object> params = new HashMap<>();
187
-        params.put("businessType", "SECTION_CHECK");
187
+        params.put("businessType", "DEPARTMENT_CHECK");
188
         params.put("businessId", businessId);
188
         params.put("businessId", businessId);
189
-        params.put("title", "级检查");
189
+        params.put("title", "被检查级别为主管级检查");
190
         params.put("checkType", checkType);
190
         params.put("checkType", checkType);
191
         params.put("severity", severity);
191
         params.put("severity", severity);
192
         params.put("targetDeptId", targetDeptId);
192
         params.put("targetDeptId", targetDeptId);
@@ -199,9 +199,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
199
         Map<String, Object> businessData = new HashMap<>();
199
         Map<String, Object> businessData = new HashMap<>();
200
         businessData.put("checkType", checkType);
200
         businessData.put("checkType", checkType);
201
         businessData.put("severity", severity);
201
         businessData.put("severity", severity);
202
-        if (targetDeptId != null) {
203
-            businessData.put("targetDeptId", targetDeptId);
204
-        }
202
+        businessData.put("targetDeptId", targetDeptId);
205
         businessData.put("sectionLeaderId", sectionLeaderId);
203
         businessData.put("sectionLeaderId", sectionLeaderId);
206
         params.put("businessData", businessData);
204
         params.put("businessData", businessData);
207
 
205
 
@@ -267,7 +265,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
267
         Map<String, Object> params = new HashMap<>();
265
         Map<String, Object> params = new HashMap<>();
268
         params.put("businessType", "BRIGADE_CHECK");
266
         params.put("businessType", "BRIGADE_CHECK");
269
         params.put("businessId", businessId);
267
         params.put("businessId", businessId);
270
-        params.put("title", "大队级检查");
268
+        params.put("title", "被检查级别为大队级检查");
271
         params.put("checkType", checkType);
269
         params.put("checkType", checkType);
272
         params.put("severity", severity);
270
         params.put("severity", severity);
273
         params.put("targetDeptId", targetDeptId);
271
         params.put("targetDeptId", targetDeptId);