Browse Source

格式化代码

chenshudong 5 months ago
parent
commit
06b75a90fd
28 changed files with 1378 additions and 1240 deletions
  1. 44 56
      airport-admin/src/main/java/com/sundot/airport/web/controller/approval/ApprovalController.java
  2. 45 46
      airport-admin/src/main/java/com/sundot/airport/web/controller/approval/CheckApprovalController.java
  3. 49 26
      airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/ApprovalDTO.java
  4. 21 12
      airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/PersonalCheckDTO.java
  5. 5 4
      airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/RejectDTO.java
  6. 21 12
      airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/SectionCheckDTO.java
  7. 25 14
      airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/SeizureReportDTO.java
  8. 17 18
      airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalCcMapper.java
  9. 13 14
      airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalHistoryMapper.java
  10. 18 19
      airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalInstanceMapper.java
  11. 17 18
      airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalNodeDefinitionMapper.java
  12. 18 19
      airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalTaskMapper.java
  13. 10 11
      airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalWorkflowDefinitionMapper.java
  14. 5 1
      airport-system/src/main/java/com/sundot/airport/system/service/approval/BusinessApprovalHandler.java
  15. 72 71
      airport-system/src/main/java/com/sundot/airport/system/service/approval/IApprovalEngineService.java
  16. 19 20
      airport-system/src/main/java/com/sundot/airport/system/service/approval/IApprovalUserService.java
  17. 11 11
      airport-system/src/main/java/com/sundot/airport/system/service/approval/IApprovalWorkflowService.java
  18. 49 49
      airport-system/src/main/java/com/sundot/airport/system/service/approval/ICheckApprovalService.java
  19. 164 191
      airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/ApprovalEngineServiceImpl.java
  20. 89 109
      airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/ApprovalUserServiceImpl.java
  21. 19 27
      airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/ApprovalWorkflowServiceImpl.java
  22. 117 117
      airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/CheckApprovalServiceImpl.java
  23. 102 73
      airport-system/src/main/resources/mapper/approval/ApprovalCcMapper.xml
  24. 49 36
      airport-system/src/main/resources/mapper/approval/ApprovalHistoryMapper.xml
  25. 114 92
      airport-system/src/main/resources/mapper/approval/ApprovalInstanceMapper.xml
  26. 65 44
      airport-system/src/main/resources/mapper/approval/ApprovalNodeDefinitionMapper.xml
  27. 135 85
      airport-system/src/main/resources/mapper/approval/ApprovalTaskMapper.xml
  28. 65 45
      airport-system/src/main/resources/mapper/approval/ApprovalWorkflowDefinitionMapper.xml

+ 44 - 56
airport-admin/src/main/java/com/sundot/airport/web/controller/approval/ApprovalController.java

@@ -27,14 +27,13 @@ import com.sundot.airport.common.core.page.TableDataInfo;
27
 
27
 
28
 /**
28
 /**
29
  * 审批流程Controller
29
  * 审批流程Controller
30
- * 
30
+ *
31
  * @author simon lin
31
  * @author simon lin
32
  * @date 2025-09-06
32
  * @date 2025-09-06
33
  */
33
  */
34
 @RestController
34
 @RestController
35
 @RequestMapping("/system/approval")
35
 @RequestMapping("/system/approval")
36
-public class ApprovalController extends BaseController
37
-{
36
+public class ApprovalController extends BaseController {
38
     @Autowired
37
     @Autowired
39
     private IApprovalEngineService approvalEngineService;
38
     private IApprovalEngineService approvalEngineService;
40
 
39
 
@@ -44,8 +43,7 @@ public class ApprovalController extends BaseController
44
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
43
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
45
     @Log(title = "启动审批流程", businessType = BusinessType.INSERT)
44
     @Log(title = "启动审批流程", businessType = BusinessType.INSERT)
46
     @PostMapping("/start")
45
     @PostMapping("/start")
47
-    public AjaxResult startProcess(@RequestBody Map<String, Object> params)
48
-    {
46
+    public AjaxResult startProcess(@RequestBody Map<String, Object> params) {
49
         String workflowCode = (String) params.get("workflowCode");
47
         String workflowCode = (String) params.get("workflowCode");
50
         String businessType = (String) params.get("businessType");
48
         String businessType = (String) params.get("businessType");
51
         Long businessId = Long.valueOf(params.get("businessId").toString());
49
         Long businessId = Long.valueOf(params.get("businessId").toString());
@@ -54,11 +52,11 @@ public class ApprovalController extends BaseController
54
         String submitterName = SecurityUtils.getUsername();
52
         String submitterName = SecurityUtils.getUsername();
55
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
53
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
56
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
54
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
57
-        
55
+
58
         ApprovalInstance instance = approvalEngineService.startProcess(
56
         ApprovalInstance instance = approvalEngineService.startProcess(
59
-            workflowCode, businessType, businessId, title, 
60
-            submitterId, submitterName, formData, businessData);
61
-            
57
+                workflowCode, businessType, businessId, title,
58
+                submitterId, submitterName, formData, businessData);
59
+
62
         return AjaxResult.success("流程启动成功", instance);
60
         return AjaxResult.success("流程启动成功", instance);
63
     }
61
     }
64
 
62
 
@@ -68,14 +66,13 @@ public class ApprovalController extends BaseController
68
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
66
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
69
     @Log(title = "启动个人级别审批流程", businessType = BusinessType.INSERT)
67
     @Log(title = "启动个人级别审批流程", businessType = BusinessType.INSERT)
70
     @PostMapping("/start/personal")
68
     @PostMapping("/start/personal")
71
-    public AjaxResult startPersonalLevelProcess(@RequestBody Map<String, Object> params)
72
-    {
69
+    public AjaxResult startPersonalLevelProcess(@RequestBody Map<String, Object> params) {
73
         String businessType = (String) params.get("businessType");
70
         String businessType = (String) params.get("businessType");
74
         Long businessId = Long.valueOf(params.get("businessId").toString());
71
         Long businessId = Long.valueOf(params.get("businessId").toString());
75
         String title = (String) params.get("title");
72
         String title = (String) params.get("title");
76
         Long submitterId = SecurityUtils.getUserId();
73
         Long submitterId = SecurityUtils.getUserId();
77
         String submitterName = SecurityUtils.getUsername();
74
         String submitterName = SecurityUtils.getUsername();
78
-        
75
+
79
         // 新的个人级别检查流程参数
76
         // 新的个人级别检查流程参数
80
         Long sectionLeaderId = null;
77
         Long sectionLeaderId = null;
81
         Object sectionLeaderIdObj = params.get("sectionLeaderId");
78
         Object sectionLeaderIdObj = params.get("sectionLeaderId");
@@ -86,18 +83,18 @@ public class ApprovalController extends BaseController
86
                 sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
83
                 sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
87
             }
84
             }
88
         }
85
         }
89
-        
86
+
90
         if (sectionLeaderId == null) {
87
         if (sectionLeaderId == null) {
91
             return AjaxResult.error("sectionLeaderId参数不能为空");
88
             return AjaxResult.error("sectionLeaderId参数不能为空");
92
         }
89
         }
93
-        
90
+
94
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
91
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
95
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
92
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
96
-        
93
+
97
         ApprovalInstance instance = approvalEngineService.startPersonalLevelProcess(
94
         ApprovalInstance instance = approvalEngineService.startPersonalLevelProcess(
98
-            businessType, businessId, title, submitterId, submitterName, 
99
-            sectionLeaderId, formData, businessData);
100
-            
95
+                businessType, businessId, title, submitterId, submitterName,
96
+                sectionLeaderId, formData, businessData);
97
+
101
         return AjaxResult.success("个人级别流程启动成功", instance);
98
         return AjaxResult.success("个人级别流程启动成功", instance);
102
     }
99
     }
103
 
100
 
@@ -107,14 +104,13 @@ public class ApprovalController extends BaseController
107
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
104
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
108
     @Log(title = "启动科级审批流程", businessType = BusinessType.INSERT)
105
     @Log(title = "启动科级审批流程", businessType = BusinessType.INSERT)
109
     @PostMapping("/start/section")
106
     @PostMapping("/start/section")
110
-    public AjaxResult startSectionLevelProcess(@RequestBody Map<String, Object> params)
111
-    {
107
+    public AjaxResult startSectionLevelProcess(@RequestBody Map<String, Object> params) {
112
         String businessType = (String) params.get("businessType");
108
         String businessType = (String) params.get("businessType");
113
         Long businessId = Long.valueOf(params.get("businessId").toString());
109
         Long businessId = Long.valueOf(params.get("businessId").toString());
114
         String title = (String) params.get("title");
110
         String title = (String) params.get("title");
115
         Long submitterId = SecurityUtils.getUserId();
111
         Long submitterId = SecurityUtils.getUserId();
116
         String submitterName = SecurityUtils.getUsername();
112
         String submitterName = SecurityUtils.getUsername();
117
-        
113
+
118
         // 新的科级审批流程参数
114
         // 新的科级审批流程参数
119
         Long sectionLeaderId = null;
115
         Long sectionLeaderId = null;
120
         Object sectionLeaderIdObj = params.get("sectionLeaderId");
116
         Object sectionLeaderIdObj = params.get("sectionLeaderId");
@@ -125,17 +121,17 @@ public class ApprovalController extends BaseController
125
                 sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
121
                 sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
126
             }
122
             }
127
         }
123
         }
128
-        
124
+
129
         if (sectionLeaderId == null) {
125
         if (sectionLeaderId == null) {
130
             return AjaxResult.error("sectionLeaderId参数不能为空");
126
             return AjaxResult.error("sectionLeaderId参数不能为空");
131
         }
127
         }
132
-        
128
+
133
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
129
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
134
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
130
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
135
-        
131
+
136
         ApprovalInstance instance = approvalEngineService.startSectionLevelProcess(
132
         ApprovalInstance instance = approvalEngineService.startSectionLevelProcess(
137
-            businessType, businessId, title, submitterId, submitterName, sectionLeaderId, formData, businessData);
138
-            
133
+                businessType, businessId, title, submitterId, submitterName, sectionLeaderId, formData, businessData);
134
+
139
         return AjaxResult.success("科级审批流程启动成功", instance);
135
         return AjaxResult.success("科级审批流程启动成功", instance);
140
     }
136
     }
141
 
137
 
@@ -145,8 +141,7 @@ public class ApprovalController extends BaseController
145
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
141
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
146
     @Log(title = "启动班组级审批流程", businessType = BusinessType.INSERT)
142
     @Log(title = "启动班组级审批流程", businessType = BusinessType.INSERT)
147
     @PostMapping("/start/group")
143
     @PostMapping("/start/group")
148
-    public AjaxResult startGroupLevelProcess(@RequestBody Map<String, Object> params)
149
-    {
144
+    public AjaxResult startGroupLevelProcess(@RequestBody Map<String, Object> params) {
150
         String businessType = (String) params.get("businessType");
145
         String businessType = (String) params.get("businessType");
151
         Long businessId = Long.valueOf(params.get("businessId").toString());
146
         Long businessId = Long.valueOf(params.get("businessId").toString());
152
         String title = (String) params.get("title");
147
         String title = (String) params.get("title");
@@ -154,10 +149,10 @@ public class ApprovalController extends BaseController
154
         String submitterName = SecurityUtils.getUsername();
149
         String submitterName = SecurityUtils.getUsername();
155
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
150
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
156
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
151
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
157
-        
152
+
158
         ApprovalInstance instance = approvalEngineService.startGroupLevelProcess(
153
         ApprovalInstance instance = approvalEngineService.startGroupLevelProcess(
159
-            businessType, businessId, title, submitterId, submitterName, formData, businessData);
160
-            
154
+                businessType, businessId, title, submitterId, submitterName, formData, businessData);
155
+
161
         return AjaxResult.success("班组级审批流程启动成功", instance);
156
         return AjaxResult.success("班组级审批流程启动成功", instance);
162
     }
157
     }
163
 
158
 
@@ -167,8 +162,7 @@ public class ApprovalController extends BaseController
167
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
162
     @PreAuthorize("@ss.hasPermi('system:approval:start')")
168
     @Log(title = "启动查获上报审批流程", businessType = BusinessType.INSERT)
163
     @Log(title = "启动查获上报审批流程", businessType = BusinessType.INSERT)
169
     @PostMapping("/start/seizure")
164
     @PostMapping("/start/seizure")
170
-    public AjaxResult startSeizureReportProcess(@RequestBody Map<String, Object> params)
171
-    {
165
+    public AjaxResult startSeizureReportProcess(@RequestBody Map<String, Object> params) {
172
         String businessType = (String) params.get("businessType");
166
         String businessType = (String) params.get("businessType");
173
         Long businessId = Long.valueOf(params.get("businessId").toString());
167
         Long businessId = Long.valueOf(params.get("businessId").toString());
174
         String title = (String) params.get("title");
168
         String title = (String) params.get("title");
@@ -177,11 +171,11 @@ public class ApprovalController extends BaseController
177
         String submitterRole = (String) params.get("submitterRole");
171
         String submitterRole = (String) params.get("submitterRole");
178
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
172
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
179
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
173
         Map<String, Object> businessData = (Map<String, Object>) params.get("businessData");
180
-        
174
+
181
         ApprovalInstance instance = approvalEngineService.startSeizureReportProcess(
175
         ApprovalInstance instance = approvalEngineService.startSeizureReportProcess(
182
-            businessType, businessId, title, submitterId, submitterName, 
183
-            submitterRole, formData, businessData);
184
-            
176
+                businessType, businessId, title, submitterId, submitterName,
177
+                submitterRole, formData, businessData);
178
+
185
         return AjaxResult.success("查获上报审批流程启动成功", instance);
179
         return AjaxResult.success("查获上报审批流程启动成功", instance);
186
     }
180
     }
187
 
181
 
@@ -191,13 +185,12 @@ public class ApprovalController extends BaseController
191
     @PreAuthorize("@ss.hasPermi('system:approval:approve')")
185
     @PreAuthorize("@ss.hasPermi('system:approval:approve')")
192
     @Log(title = "审批任务", businessType = BusinessType.UPDATE)
186
     @Log(title = "审批任务", businessType = BusinessType.UPDATE)
193
     @PutMapping("/approve/{taskId}")
187
     @PutMapping("/approve/{taskId}")
194
-    public AjaxResult approveTask(@PathVariable("taskId") Long taskId, @RequestBody Map<String, Object> params)
195
-    {
188
+    public AjaxResult approveTask(@PathVariable("taskId") Long taskId, @RequestBody Map<String, Object> params) {
196
         Long operatorId = SecurityUtils.getUserId();
189
         Long operatorId = SecurityUtils.getUserId();
197
         String operatorName = SecurityUtils.getUsername();
190
         String operatorName = SecurityUtils.getUsername();
198
         String comment = (String) params.get("comment");
191
         String comment = (String) params.get("comment");
199
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
192
         Map<String, Object> formData = (Map<String, Object>) params.get("formData");
200
-        
193
+
201
         boolean result = approvalEngineService.approveTask(taskId, operatorId, operatorName, comment, formData);
194
         boolean result = approvalEngineService.approveTask(taskId, operatorId, operatorName, comment, formData);
202
         return result ? AjaxResult.success("审批成功") : AjaxResult.error("审批失败");
195
         return result ? AjaxResult.success("审批成功") : AjaxResult.error("审批失败");
203
     }
196
     }
@@ -208,12 +201,11 @@ public class ApprovalController extends BaseController
208
     @PreAuthorize("@ss.hasPermi('system:approval:reject')")
201
     @PreAuthorize("@ss.hasPermi('system:approval:reject')")
209
     @Log(title = "驳回任务", businessType = BusinessType.UPDATE)
202
     @Log(title = "驳回任务", businessType = BusinessType.UPDATE)
210
     @PutMapping("/reject/{taskId}")
203
     @PutMapping("/reject/{taskId}")
211
-    public AjaxResult rejectTask(@PathVariable("taskId") Long taskId, @RequestBody Map<String, Object> params)
212
-    {
204
+    public AjaxResult rejectTask(@PathVariable("taskId") Long taskId, @RequestBody Map<String, Object> params) {
213
         Long operatorId = SecurityUtils.getUserId();
205
         Long operatorId = SecurityUtils.getUserId();
214
         String operatorName = SecurityUtils.getUsername();
206
         String operatorName = SecurityUtils.getUsername();
215
         String comment = (String) params.get("comment");
207
         String comment = (String) params.get("comment");
216
-        
208
+
217
         boolean result = approvalEngineService.rejectTask(taskId, operatorId, operatorName, comment);
209
         boolean result = approvalEngineService.rejectTask(taskId, operatorId, operatorName, comment);
218
         return result ? AjaxResult.success("驳回成功") : AjaxResult.error("驳回失败");
210
         return result ? AjaxResult.success("驳回成功") : AjaxResult.error("驳回失败");
219
     }
211
     }
@@ -224,12 +216,11 @@ public class ApprovalController extends BaseController
224
     @PreAuthorize("@ss.hasPermi('system:approval:cancel')")
216
     @PreAuthorize("@ss.hasPermi('system:approval:cancel')")
225
     @Log(title = "取消审批流程", businessType = BusinessType.UPDATE)
217
     @Log(title = "取消审批流程", businessType = BusinessType.UPDATE)
226
     @PutMapping("/cancel/{instanceId}")
218
     @PutMapping("/cancel/{instanceId}")
227
-    public AjaxResult cancelProcess(@PathVariable("instanceId") Long instanceId, @RequestBody Map<String, Object> params)
228
-    {
219
+    public AjaxResult cancelProcess(@PathVariable("instanceId") Long instanceId, @RequestBody Map<String, Object> params) {
229
         Long operatorId = SecurityUtils.getUserId();
220
         Long operatorId = SecurityUtils.getUserId();
230
         String operatorName = SecurityUtils.getUsername();
221
         String operatorName = SecurityUtils.getUsername();
231
         String comment = (String) params.get("comment");
222
         String comment = (String) params.get("comment");
232
-        
223
+
233
         boolean result = approvalEngineService.cancelProcess(instanceId, operatorId, operatorName, comment);
224
         boolean result = approvalEngineService.cancelProcess(instanceId, operatorId, operatorName, comment);
234
         return result ? AjaxResult.success("取消成功") : AjaxResult.error("取消失败");
225
         return result ? AjaxResult.success("取消成功") : AjaxResult.error("取消失败");
235
     }
226
     }
@@ -239,8 +230,7 @@ public class ApprovalController extends BaseController
239
      */
230
      */
240
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
231
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
241
     @GetMapping("/tasks/pending")
232
     @GetMapping("/tasks/pending")
242
-    public TableDataInfo getPendingTasks()
243
-    {
233
+    public TableDataInfo getPendingTasks() {
244
         Long userId = SecurityUtils.getUserId();
234
         Long userId = SecurityUtils.getUserId();
245
         List<ApprovalTask> list = approvalEngineService.getUserPendingTasks(userId);
235
         List<ApprovalTask> list = approvalEngineService.getUserPendingTasks(userId);
246
         return getDataTable(list);
236
         return getDataTable(list);
@@ -251,8 +241,7 @@ public class ApprovalController extends BaseController
251
      */
241
      */
252
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
242
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
253
     @GetMapping("/tasks/completed")
243
     @GetMapping("/tasks/completed")
254
-    public TableDataInfo getCompletedTasks()
255
-    {
244
+    public TableDataInfo getCompletedTasks() {
256
         Long userId = SecurityUtils.getUserId();
245
         Long userId = SecurityUtils.getUserId();
257
         List<ApprovalTask> list = approvalEngineService.getUserCompletedTasks(userId);
246
         List<ApprovalTask> list = approvalEngineService.getUserCompletedTasks(userId);
258
         return getDataTable(list);
247
         return getDataTable(list);
@@ -263,8 +252,7 @@ public class ApprovalController extends BaseController
263
      */
252
      */
264
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
253
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
265
     @GetMapping("/instances/submitted")
254
     @GetMapping("/instances/submitted")
266
-    public TableDataInfo getSubmittedInstances(String status)
267
-    {
255
+    public TableDataInfo getSubmittedInstances(String status) {
268
         Long userId = SecurityUtils.getUserId();
256
         Long userId = SecurityUtils.getUserId();
269
         List<ApprovalInstance> list = approvalEngineService.getUserSubmittedInstances(userId, status);
257
         List<ApprovalInstance> list = approvalEngineService.getUserSubmittedInstances(userId, status);
270
         return getDataTable(list);
258
         return getDataTable(list);
@@ -274,8 +262,7 @@ public class ApprovalController extends BaseController
274
      * 根据业务类型和级别获取流程代码
262
      * 根据业务类型和级别获取流程代码
275
      */
263
      */
276
     @GetMapping("/workflow/code")
264
     @GetMapping("/workflow/code")
277
-    public AjaxResult getWorkflowCode(String businessType, String level, String submitterRole)
278
-    {
265
+    public AjaxResult getWorkflowCode(String businessType, String level, String submitterRole) {
279
         String workflowCode = approvalEngineService.getWorkflowCodeByBusinessAndLevel(businessType, level, submitterRole);
266
         String workflowCode = approvalEngineService.getWorkflowCodeByBusinessAndLevel(businessType, level, submitterRole);
280
         return AjaxResult.success(workflowCode);
267
         return AjaxResult.success(workflowCode);
281
     }
268
     }
@@ -284,8 +271,7 @@ public class ApprovalController extends BaseController
284
      * 统计用户待办任务数量
271
      * 统计用户待办任务数量
285
      */
272
      */
286
     @GetMapping("/tasks/pending/count")
273
     @GetMapping("/tasks/pending/count")
287
-    public AjaxResult getPendingTasksCount()
288
-    {
274
+    public AjaxResult getPendingTasksCount() {
289
         Long userId = SecurityUtils.getUserId();
275
         Long userId = SecurityUtils.getUserId();
290
         List<ApprovalTask> tasks = approvalEngineService.getUserPendingTasks(userId);
276
         List<ApprovalTask> tasks = approvalEngineService.getUserPendingTasks(userId);
291
         return AjaxResult.success(tasks.size());
277
         return AjaxResult.success(tasks.size());
@@ -293,6 +279,7 @@ public class ApprovalController extends BaseController
293
 
279
 
294
     /**
280
     /**
295
      * 批量审批任务(同意)
281
      * 批量审批任务(同意)
282
+     *
296
      * @param ids 任务ID列表
283
      * @param ids 任务ID列表
297
      */
284
      */
298
     @PreAuthorize("@ss.hasPermi('system:approval:approve')")
285
     @PreAuthorize("@ss.hasPermi('system:approval:approve')")
@@ -308,6 +295,7 @@ public class ApprovalController extends BaseController
308
 
295
 
309
     /**
296
     /**
310
      * 批量驳回任务
297
      * 批量驳回任务
298
+     *
311
      * @param ids 任务ID列表
299
      * @param ids 任务ID列表
312
      */
300
      */
313
     @PreAuthorize("@ss.hasPermi('system:approval:reject')")
301
     @PreAuthorize("@ss.hasPermi('system:approval:reject')")

+ 45 - 46
airport-admin/src/main/java/com/sundot/airport/web/controller/approval/CheckApprovalController.java

@@ -25,20 +25,19 @@ import com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO;
25
 
25
 
26
 /**
26
 /**
27
  * 安检审批流程Controller
27
  * 安检审批流程Controller
28
- * 
28
+ *
29
  * @author simon lin
29
  * @author simon lin
30
  * @date 2025-09-06
30
  * @date 2025-09-06
31
  */
31
  */
32
 @RestController
32
 @RestController
33
 @RequestMapping("/system/check")
33
 @RequestMapping("/system/check")
34
-public class CheckApprovalController extends BaseController
35
-{
34
+public class CheckApprovalController extends BaseController {
36
     @Autowired
35
     @Autowired
37
     private IApprovalEngineService approvalEngineService;
36
     private IApprovalEngineService approvalEngineService;
38
-    
37
+
39
     @Autowired
38
     @Autowired
40
     private IApprovalUserService approvalUserService;
39
     private IApprovalUserService approvalUserService;
41
-    
40
+
42
     @Autowired
41
     @Autowired
43
     private ICheckApprovalService checkApprovalService;
42
     private ICheckApprovalService checkApprovalService;
44
 
43
 
@@ -51,13 +50,13 @@ public class CheckApprovalController extends BaseController
51
     public AjaxResult submitPersonalCheck(@RequestBody Map<String, Object> requestData) {
50
     public AjaxResult submitPersonalCheck(@RequestBody Map<String, Object> requestData) {
52
         // 获取备注参数
51
         // 获取备注参数
53
         String remark = (String) requestData.get("remark");
52
         String remark = (String) requestData.get("remark");
54
-        
53
+
55
         try {
54
         try {
56
             ApprovalInstance instance = checkApprovalService.submitPersonalCheck(
55
             ApprovalInstance instance = checkApprovalService.submitPersonalCheck(
57
-                requestData, 
58
-                SecurityUtils.getUserId(), 
59
-                SecurityUtils.getUsername(), 
60
-                remark
56
+                    requestData,
57
+                    SecurityUtils.getUserId(),
58
+                    SecurityUtils.getUsername(),
59
+                    remark
61
             );
60
             );
62
             return AjaxResult.success("个人级别检查流程启动成功", instance);
61
             return AjaxResult.success("个人级别检查流程启动成功", instance);
63
         } catch (Exception e) {
62
         } catch (Exception e) {
@@ -75,13 +74,13 @@ public class CheckApprovalController extends BaseController
75
     public AjaxResult submitSectionCheck(@RequestBody Map<String, Object> requestData) {
74
     public AjaxResult submitSectionCheck(@RequestBody Map<String, Object> requestData) {
76
         // 获取备注参数
75
         // 获取备注参数
77
         String remark = (String) requestData.get("remark");
76
         String remark = (String) requestData.get("remark");
78
-        
77
+
79
         try {
78
         try {
80
             ApprovalInstance instance = checkApprovalService.submitSectionCheck(
79
             ApprovalInstance instance = checkApprovalService.submitSectionCheck(
81
-                requestData, 
82
-                SecurityUtils.getUserId(), 
83
-                SecurityUtils.getUsername(), 
84
-                remark
80
+                    requestData,
81
+                    SecurityUtils.getUserId(),
82
+                    SecurityUtils.getUsername(),
83
+                    remark
85
             );
84
             );
86
             return AjaxResult.success("科级检查流程启动成功", instance);
85
             return AjaxResult.success("科级检查流程启动成功", instance);
87
         } catch (Exception e) {
86
         } catch (Exception e) {
@@ -99,13 +98,13 @@ public class CheckApprovalController extends BaseController
99
     public AjaxResult submitGroupCheck(@RequestBody Map<String, Object> requestData) {
98
     public AjaxResult submitGroupCheck(@RequestBody Map<String, Object> requestData) {
100
         // 获取备注参数
99
         // 获取备注参数
101
         String remark = (String) requestData.get("remark");
100
         String remark = (String) requestData.get("remark");
102
-        
101
+
103
         try {
102
         try {
104
             ApprovalInstance instance = checkApprovalService.submitGroupCheck(
103
             ApprovalInstance instance = checkApprovalService.submitGroupCheck(
105
-                requestData, 
106
-                SecurityUtils.getUserId(), 
107
-                SecurityUtils.getUsername(), 
108
-                remark
104
+                    requestData,
105
+                    SecurityUtils.getUserId(),
106
+                    SecurityUtils.getUsername(),
107
+                    remark
109
             );
108
             );
110
             return AjaxResult.success("班组级检查流程启动成功", instance);
109
             return AjaxResult.success("班组级检查流程启动成功", instance);
111
         } catch (Exception e) {
110
         } catch (Exception e) {
@@ -123,13 +122,13 @@ public class CheckApprovalController extends BaseController
123
     public AjaxResult submitSeizureReport(@RequestBody Map<String, Object> requestData) {
122
     public AjaxResult submitSeizureReport(@RequestBody Map<String, Object> requestData) {
124
         // 获取备注参数
123
         // 获取备注参数
125
         String remark = (String) requestData.get("remark");
124
         String remark = (String) requestData.get("remark");
126
-        
125
+
127
         try {
126
         try {
128
             ApprovalInstance instance = checkApprovalService.submitSeizureReport(
127
             ApprovalInstance instance = checkApprovalService.submitSeizureReport(
129
-                requestData, 
130
-                SecurityUtils.getUserId(), 
131
-                SecurityUtils.getUsername(), 
132
-                remark
128
+                    requestData,
129
+                    SecurityUtils.getUserId(),
130
+                    SecurityUtils.getUsername(),
131
+                    remark
133
             );
132
             );
134
             return AjaxResult.success("查获上报流程启动成功", instance);
133
             return AjaxResult.success("查获上报流程启动成功", instance);
135
         } catch (Exception e) {
134
         } catch (Exception e) {
@@ -147,11 +146,11 @@ public class CheckApprovalController extends BaseController
147
     public AjaxResult approveTask(@PathVariable Long taskId, @Valid @RequestBody ApprovalDTO approvalData) {
146
     public AjaxResult approveTask(@PathVariable Long taskId, @Valid @RequestBody ApprovalDTO approvalData) {
148
         try {
147
         try {
149
             ApprovalTask task = checkApprovalService.approveTask(
148
             ApprovalTask task = checkApprovalService.approveTask(
150
-                taskId, 
151
-                approvalData.getComment(), 
152
-                approvalData.getFormData(), 
153
-                SecurityUtils.getUserId(), 
154
-                SecurityUtils.getUsername()
149
+                    taskId,
150
+                    approvalData.getComment(),
151
+                    approvalData.getFormData(),
152
+                    SecurityUtils.getUserId(),
153
+                    SecurityUtils.getUsername()
155
             );
154
             );
156
             return AjaxResult.success("任务审批成功", task);
155
             return AjaxResult.success("任务审批成功", task);
157
         } catch (Exception e) {
156
         } catch (Exception e) {
@@ -169,10 +168,10 @@ public class CheckApprovalController extends BaseController
169
     public AjaxResult rejectTask(@PathVariable Long taskId, @Valid @RequestBody RejectDTO rejectData) {
168
     public AjaxResult rejectTask(@PathVariable Long taskId, @Valid @RequestBody RejectDTO rejectData) {
170
         try {
169
         try {
171
             ApprovalTask task = checkApprovalService.rejectTask(
170
             ApprovalTask task = checkApprovalService.rejectTask(
172
-                taskId, 
173
-                rejectData.getRejectReason(), 
174
-                SecurityUtils.getUserId(), 
175
-                SecurityUtils.getUsername()
171
+                    taskId,
172
+                    rejectData.getRejectReason(),
173
+                    SecurityUtils.getUserId(),
174
+                    SecurityUtils.getUsername()
176
             );
175
             );
177
             return AjaxResult.success("任务驳回成功", task);
176
             return AjaxResult.success("任务驳回成功", task);
178
         } catch (Exception e) {
177
         } catch (Exception e) {
@@ -251,8 +250,8 @@ public class CheckApprovalController extends BaseController
251
      */
250
      */
252
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
251
     @PreAuthorize("@ss.hasPermi('system:approval:query')")
253
     @GetMapping("/approval/workflow-code")
252
     @GetMapping("/approval/workflow-code")
254
-    public AjaxResult getWorkflowCode(@RequestParam String businessType, 
255
-                                     @RequestParam(required = false) String submitterRole) {
253
+    public AjaxResult getWorkflowCode(@RequestParam String businessType,
254
+                                      @RequestParam(required = false) String submitterRole) {
256
         try {
255
         try {
257
             // 暂时返回空值,需要实现该方法
256
             // 暂时返回空值,需要实现该方法
258
             String workflowCode = null;
257
             String workflowCode = null;
@@ -293,7 +292,7 @@ public class CheckApprovalController extends BaseController
293
             return getDataTable(null);
292
             return getDataTable(null);
294
         }
293
         }
295
     }
294
     }
296
-    
295
+
297
     /**
296
     /**
298
      * 14. 根据实例ID获取审批历史
297
      * 14. 根据实例ID获取审批历史
299
      */
298
      */
@@ -301,15 +300,15 @@ public class CheckApprovalController extends BaseController
301
     @GetMapping("/approval/history/instance/{instanceId}")
300
     @GetMapping("/approval/history/instance/{instanceId}")
302
     public TableDataInfo getApprovalHistoryByInstanceId(@PathVariable Long instanceId) {
301
     public TableDataInfo getApprovalHistoryByInstanceId(@PathVariable Long instanceId) {
303
         try {
302
         try {
304
-            List<com.sundot.airport.system.domain.approval.ApprovalHistory> list = 
305
-                checkApprovalService.getApprovalHistoryByInstanceId(instanceId);
303
+            List<com.sundot.airport.system.domain.approval.ApprovalHistory> list =
304
+                    checkApprovalService.getApprovalHistoryByInstanceId(instanceId);
306
             return getDataTable(list);
305
             return getDataTable(list);
307
         } catch (Exception e) {
306
         } catch (Exception e) {
308
             logger.error("根据实例ID获取审批历史失败", e);
307
             logger.error("根据实例ID获取审批历史失败", e);
309
             return getDataTable(null);
308
             return getDataTable(null);
310
         }
309
         }
311
     }
310
     }
312
-    
311
+
313
     /**
312
     /**
314
      * 15. 根据任务ID获取审批历史
313
      * 15. 根据任务ID获取审批历史
315
      */
314
      */
@@ -317,15 +316,15 @@ public class CheckApprovalController extends BaseController
317
     @GetMapping("/approval/history/task/{taskId}")
316
     @GetMapping("/approval/history/task/{taskId}")
318
     public TableDataInfo getApprovalHistoryByTaskId(@PathVariable Long taskId) {
317
     public TableDataInfo getApprovalHistoryByTaskId(@PathVariable Long taskId) {
319
         try {
318
         try {
320
-            List<com.sundot.airport.system.domain.approval.ApprovalHistory> list = 
321
-                checkApprovalService.getApprovalHistoryByTaskId(taskId);
319
+            List<com.sundot.airport.system.domain.approval.ApprovalHistory> list =
320
+                    checkApprovalService.getApprovalHistoryByTaskId(taskId);
322
             return getDataTable(list);
321
             return getDataTable(list);
323
         } catch (Exception e) {
322
         } catch (Exception e) {
324
             logger.error("根据任务ID获取审批历史失败", e);
323
             logger.error("根据任务ID获取审批历史失败", e);
325
             return getDataTable(null);
324
             return getDataTable(null);
326
         }
325
         }
327
     }
326
     }
328
-    
327
+
329
     /**
328
     /**
330
      * 16. 获取用户的审批历史记录
329
      * 16. 获取用户的审批历史记录
331
      */
330
      */
@@ -333,15 +332,15 @@ public class CheckApprovalController extends BaseController
333
     @GetMapping("/approval/history/user")
332
     @GetMapping("/approval/history/user")
334
     public TableDataInfo getUserApprovalHistory(@RequestParam(required = false) String action) {
333
     public TableDataInfo getUserApprovalHistory(@RequestParam(required = false) String action) {
335
         try {
334
         try {
336
-            List<com.sundot.airport.system.domain.approval.ApprovalHistory> list = 
337
-                checkApprovalService.getUserApprovalHistory(SecurityUtils.getUserId(), action);
335
+            List<com.sundot.airport.system.domain.approval.ApprovalHistory> list =
336
+                    checkApprovalService.getUserApprovalHistory(SecurityUtils.getUserId(), action);
338
             return getDataTable(list);
337
             return getDataTable(list);
339
         } catch (Exception e) {
338
         } catch (Exception e) {
340
             logger.error("获取用户审批历史失败", e);
339
             logger.error("获取用户审批历史失败", e);
341
             return getDataTable(null);
340
             return getDataTable(null);
342
         }
341
         }
343
     }
342
     }
344
-    
343
+
345
     /**
344
     /**
346
      * 17. 批量更新抄送消息已读状态
345
      * 17. 批量更新抄送消息已读状态
347
      */
346
      */

+ 49 - 26
airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/ApprovalDTO.java

@@ -6,47 +6,70 @@ import java.util.Map;
6
 
6
 
7
 /**
7
 /**
8
  * 审批DTO
8
  * 审批DTO
9
- * 
9
+ *
10
  * @author simon lin
10
  * @author simon lin
11
  * @date 2025-09-06
11
  * @date 2025-09-06
12
  */
12
  */
13
-public class ApprovalDTO
14
-{
15
-    /** 审批意见 */
13
+public class ApprovalDTO {
14
+    /**
15
+     * 审批意见
16
+     */
16
     @NotBlank(message = "审批意见不能为空")
17
     @NotBlank(message = "审批意见不能为空")
17
     private String comment;
18
     private String comment;
18
-    
19
-    /** 节点类型 */
19
+
20
+    /**
21
+     * 节点类型
22
+     */
20
     private String nodeType;
23
     private String nodeType;
21
-    
22
-    /** 目标班组ID */
24
+
25
+    /**
26
+     * 目标班组ID
27
+     */
23
     private Long targetGroupId;
28
     private Long targetGroupId;
24
-    
25
-    /** 整改要求 */
29
+
30
+    /**
31
+     * 整改要求
32
+     */
26
     private String rectificationRequirement;
33
     private String rectificationRequirement;
27
-    
28
-    /** 整改详情 */
34
+
35
+    /**
36
+     * 整改详情
37
+     */
29
     private String rectificationDetail;
38
     private String rectificationDetail;
30
-    
31
-    /** 整改时间 */
39
+
40
+    /**
41
+     * 整改时间
42
+     */
32
     private Date rectificationTime;
43
     private Date rectificationTime;
33
-    
34
-    /** 整改结果 */
44
+
45
+    /**
46
+     * 整改结果
47
+     */
35
     private String rectificationResult;
48
     private String rectificationResult;
36
-    
37
-    /** 复查结果 */
49
+
50
+    /**
51
+     * 复查结果
52
+     */
38
     private String reviewResult;
53
     private String reviewResult;
39
-    
40
-    /** 复查意见 */
54
+
55
+    /**
56
+     * 复查意见
57
+     */
41
     private String reviewComment;
58
     private String reviewComment;
42
-    
43
-    /** 最终决定 */
59
+
60
+    /**
61
+     * 最终决定
62
+     */
44
     private String finalDecision;
63
     private String finalDecision;
45
-    
46
-    /** 复查时间 */
64
+
65
+    /**
66
+     * 复查时间
67
+     */
47
     private Date reviewTime;
68
     private Date reviewTime;
48
-    
49
-    /** 表单数据 */
69
+
70
+    /**
71
+     * 表单数据
72
+     */
50
     private Map<String, Object> formData;
73
     private Map<String, Object> formData;
51
 
74
 
52
     public String getComment() {
75
     public String getComment() {

+ 21 - 12
airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/PersonalCheckDTO.java

@@ -6,27 +6,36 @@ import java.util.List;
6
 
6
 
7
 /**
7
 /**
8
  * 个人级别检查DTO
8
  * 个人级别检查DTO
9
- * 
9
+ *
10
  * @author simon lin
10
  * @author simon lin
11
  * @date 2025-09-06
11
  * @date 2025-09-06
12
  */
12
  */
13
-public class PersonalCheckDTO
14
-{
15
-    /** 业务ID */
13
+public class PersonalCheckDTO {
14
+    /**
15
+     * 业务ID
16
+     */
16
     @NotNull(message = "业务ID不能为空")
17
     @NotNull(message = "业务ID不能为空")
17
     private Long id;
18
     private Long id;
18
-    
19
-    /** 检查描述 */
19
+
20
+    /**
21
+     * 检查描述
22
+     */
20
     @NotBlank(message = "检查描述不能为空")
23
     @NotBlank(message = "检查描述不能为空")
21
     private String description;
24
     private String description;
22
-    
23
-    /** 检查类型 */
25
+
26
+    /**
27
+     * 检查类型
28
+     */
24
     private String checkType;
29
     private String checkType;
25
-    
26
-    /** 检查位置 */
30
+
31
+    /**
32
+     * 检查位置
33
+     */
27
     private String location;
34
     private String location;
28
-    
29
-    /** 目标用户ID列表 */
35
+
36
+    /**
37
+     * 目标用户ID列表
38
+     */
30
     @NotNull(message = "目标用户ID列表不能为空")
39
     @NotNull(message = "目标用户ID列表不能为空")
31
     private Long[] targetUserIds;
40
     private Long[] targetUserIds;
32
 
41
 

+ 5 - 4
airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/RejectDTO.java

@@ -4,13 +4,14 @@ import javax.validation.constraints.NotBlank;
4
 
4
 
5
 /**
5
 /**
6
  * 驳回DTO
6
  * 驳回DTO
7
- * 
7
+ *
8
  * @author simon lin
8
  * @author simon lin
9
  * @date 2025-09-06
9
  * @date 2025-09-06
10
  */
10
  */
11
-public class RejectDTO
12
-{
13
-    /** 驳回理由 */
11
+public class RejectDTO {
12
+    /**
13
+     * 驳回理由
14
+     */
14
     @NotBlank(message = "驳回理由不能为空")
15
     @NotBlank(message = "驳回理由不能为空")
15
     private String rejectReason;
16
     private String rejectReason;
16
 
17
 

+ 21 - 12
airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/SectionCheckDTO.java

@@ -5,27 +5,36 @@ import javax.validation.constraints.NotNull;
5
 
5
 
6
 /**
6
 /**
7
  * 科级检查DTO
7
  * 科级检查DTO
8
- * 
8
+ *
9
  * @author simon lin
9
  * @author simon lin
10
  * @date 2025-09-06
10
  * @date 2025-09-06
11
  */
11
  */
12
-public class SectionCheckDTO
13
-{
14
-    /** 业务ID */
12
+public class SectionCheckDTO {
13
+    /**
14
+     * 业务ID
15
+     */
15
     @NotNull(message = "业务ID不能为空")
16
     @NotNull(message = "业务ID不能为空")
16
     private Long id;
17
     private Long id;
17
-    
18
-    /** 检查描述 */
18
+
19
+    /**
20
+     * 检查描述
21
+     */
19
     @NotBlank(message = "检查描述不能为空")
22
     @NotBlank(message = "检查描述不能为空")
20
     private String description;
23
     private String description;
21
-    
22
-    /** 检查类型 */
24
+
25
+    /**
26
+     * 检查类型
27
+     */
23
     private String checkType;
28
     private String checkType;
24
-    
25
-    /** 严重程度 */
29
+
30
+    /**
31
+     * 严重程度
32
+     */
26
     private String severity;
33
     private String severity;
27
-    
28
-    /** 目标部门ID */
34
+
35
+    /**
36
+     * 目标部门ID
37
+     */
29
     private Long targetDeptId;
38
     private Long targetDeptId;
30
 
39
 
31
     public Long getId() {
40
     public Long getId() {

+ 25 - 14
airport-admin/src/main/java/com/sundot/airport/web/controller/approval/dto/SeizureReportDTO.java

@@ -6,30 +6,41 @@ import java.util.Date;
6
 
6
 
7
 /**
7
 /**
8
  * 查获上报DTO
8
  * 查获上报DTO
9
- * 
9
+ *
10
  * @author simon lin
10
  * @author simon lin
11
  * @date 2025-09-06
11
  * @date 2025-09-06
12
  */
12
  */
13
-public class SeizureReportDTO
14
-{
15
-    /** 业务ID */
13
+public class SeizureReportDTO {
14
+    /**
15
+     * 业务ID
16
+     */
16
     @NotNull(message = "业务ID不能为空")
17
     @NotNull(message = "业务ID不能为空")
17
     private Long id;
18
     private Long id;
18
-    
19
-    /** 物品类型 */
19
+
20
+    /**
21
+     * 物品类型
22
+     */
20
     @NotBlank(message = "物品类型不能为空")
23
     @NotBlank(message = "物品类型不能为空")
21
     private String itemType;
24
     private String itemType;
22
-    
23
-    /** 数量 */
25
+
26
+    /**
27
+     * 数量
28
+     */
24
     private Integer quantity;
29
     private Integer quantity;
25
-    
26
-    /** 位置 */
30
+
31
+    /**
32
+     * 位置
33
+     */
27
     private String location;
34
     private String location;
28
-    
29
-    /** 查获时间 */
35
+
36
+    /**
37
+     * 查获时间
38
+     */
30
     private Date seizureTime;
39
     private Date seizureTime;
31
-    
32
-    /** 旅客信息 */
40
+
41
+    /**
42
+     * 旅客信息
43
+     */
33
     private String passengerInfo;
44
     private String passengerInfo;
34
 
45
 
35
     public Long getId() {
46
     public Long getId() {

+ 17 - 18
airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalCcMapper.java

@@ -10,16 +10,15 @@ import org.apache.ibatis.annotations.Param;
10
 
10
 
11
 /**
11
 /**
12
  * 审批抄送Mapper接口
12
  * 审批抄送Mapper接口
13
- * 
13
+ *
14
  * @author simon lin
14
  * @author simon lin
15
  * @date 2025-09-06
15
  * @date 2025-09-06
16
  */
16
  */
17
 @Mapper
17
 @Mapper
18
-public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
19
-{
18
+public interface ApprovalCcMapper extends BaseMapper<ApprovalCc> {
20
     /**
19
     /**
21
      * 查询审批抄送
20
      * 查询审批抄送
22
-     * 
21
+     *
23
      * @param id 审批抄送主键
22
      * @param id 审批抄送主键
24
      * @return 审批抄送
23
      * @return 审批抄送
25
      */
24
      */
@@ -27,7 +26,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
27
 
26
 
28
     /**
27
     /**
29
      * 根据实例ID查询审批抄送列表
28
      * 根据实例ID查询审批抄送列表
30
-     * 
29
+     *
31
      * @param instanceId 实例ID
30
      * @param instanceId 实例ID
32
      * @return 审批抄送列表
31
      * @return 审批抄送列表
33
      */
32
      */
@@ -35,16 +34,16 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
35
 
34
 
36
     /**
35
     /**
37
      * 根据抄送用户ID查询审批抄送列表
36
      * 根据抄送用户ID查询审批抄送列表
38
-     * 
37
+     *
39
      * @param ccUserId 抄送用户ID
38
      * @param ccUserId 抄送用户ID
40
-     * @param isRead 是否已读
39
+     * @param isRead   是否已读
41
      * @return 审批抄送列表
40
      * @return 审批抄送列表
42
      */
41
      */
43
     List<ApprovalCc> selectApprovalCcByCcUser(@Param("ccUserId") Long ccUserId, @Param("isRead") String isRead);
42
     List<ApprovalCc> selectApprovalCcByCcUser(@Param("ccUserId") Long ccUserId, @Param("isRead") String isRead);
44
 
43
 
45
     /**
44
     /**
46
      * 查询审批抄送列表
45
      * 查询审批抄送列表
47
-     * 
46
+     *
48
      * @param approvalCc 审批抄送
47
      * @param approvalCc 审批抄送
49
      * @return 审批抄送集合
48
      * @return 审批抄送集合
50
      */
49
      */
@@ -52,7 +51,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
52
 
51
 
53
     /**
52
     /**
54
      * 新增审批抄送
53
      * 新增审批抄送
55
-     * 
54
+     *
56
      * @param approvalCc 审批抄送
55
      * @param approvalCc 审批抄送
57
      * @return 结果
56
      * @return 结果
58
      */
57
      */
@@ -60,7 +59,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
60
 
59
 
61
     /**
60
     /**
62
      * 修改审批抄送
61
      * 修改审批抄送
63
-     * 
62
+     *
64
      * @param approvalCc 审批抄送
63
      * @param approvalCc 审批抄送
65
      * @return 结果
64
      * @return 结果
66
      */
65
      */
@@ -68,7 +67,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
68
 
67
 
69
     /**
68
     /**
70
      * 删除审批抄送
69
      * 删除审批抄送
71
-     * 
70
+     *
72
      * @param id 审批抄送主键
71
      * @param id 审批抄送主键
73
      * @return 结果
72
      * @return 结果
74
      */
73
      */
@@ -76,7 +75,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
76
 
75
 
77
     /**
76
     /**
78
      * 批量删除审批抄送
77
      * 批量删除审批抄送
79
-     * 
78
+     *
80
      * @param ids 需要删除的数据主键集合
79
      * @param ids 需要删除的数据主键集合
81
      * @return 结果
80
      * @return 结果
82
      */
81
      */
@@ -84,7 +83,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
84
 
83
 
85
     /**
84
     /**
86
      * 根据实例ID删除审批抄送
85
      * 根据实例ID删除审批抄送
87
-     * 
86
+     *
88
      * @param instanceId 实例ID
87
      * @param instanceId 实例ID
89
      * @return 结果
88
      * @return 结果
90
      */
89
      */
@@ -92,16 +91,16 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
92
 
91
 
93
     /**
92
     /**
94
      * 统计用户抄送消息数量
93
      * 统计用户抄送消息数量
95
-     * 
94
+     *
96
      * @param ccUserId 抄送用户ID
95
      * @param ccUserId 抄送用户ID
97
-     * @param isRead 是否已读
96
+     * @param isRead   是否已读
98
      * @return 抄送消息数量
97
      * @return 抄送消息数量
99
      */
98
      */
100
     int countCcMessagesByCcUser(@Param("ccUserId") Long ccUserId, @Param("isRead") String isRead);
99
     int countCcMessagesByCcUser(@Param("ccUserId") Long ccUserId, @Param("isRead") String isRead);
101
 
100
 
102
     /**
101
     /**
103
      * 获取用户抄送详情列表(关联实例和历史)
102
      * 获取用户抄送详情列表(关联实例和历史)
104
-     * 
103
+     *
105
      * @param ccUserId 抄送用户ID
104
      * @param ccUserId 抄送用户ID
106
      * @return 抄送详情列表
105
      * @return 抄送详情列表
107
      */
106
      */
@@ -109,7 +108,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
109
 
108
 
110
     /**
109
     /**
111
      * 直接获取用户抄送详情DTO列表(支持分页)
110
      * 直接获取用户抄送详情DTO列表(支持分页)
112
-     * 
111
+     *
113
      * @param ccUserId 抄送用户ID
112
      * @param ccUserId 抄送用户ID
114
      * @return 抄送详情DTO列表
113
      * @return 抄送详情DTO列表
115
      */
114
      */
@@ -117,7 +116,7 @@ public interface ApprovalCcMapper extends BaseMapper<ApprovalCc>
117
 
116
 
118
     /**
117
     /**
119
      * 批量更新审批抄送已读状态
118
      * 批量更新审批抄送已读状态
120
-     * 
119
+     *
121
      * @param ids 需要更新的ID列表
120
      * @param ids 需要更新的ID列表
122
      * @return 结果
121
      * @return 结果
123
      */
122
      */

+ 13 - 14
airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalHistoryMapper.java

@@ -9,16 +9,15 @@ import org.apache.ibatis.annotations.Param;
9
 
9
 
10
 /**
10
 /**
11
  * 审批历史Mapper接口
11
  * 审批历史Mapper接口
12
- * 
12
+ *
13
  * @author simon lin
13
  * @author simon lin
14
  * @date 2025-09-06
14
  * @date 2025-09-06
15
  */
15
  */
16
 @Mapper
16
 @Mapper
17
-public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
18
-{
17
+public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory> {
19
     /**
18
     /**
20
      * 查询审批历史
19
      * 查询审批历史
21
-     * 
20
+     *
22
      * @param id 审批历史主键
21
      * @param id 审批历史主键
23
      * @return 审批历史
22
      * @return 审批历史
24
      */
23
      */
@@ -26,7 +25,7 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
26
 
25
 
27
     /**
26
     /**
28
      * 根据实例ID查询审批历史列表
27
      * 根据实例ID查询审批历史列表
29
-     * 
28
+     *
30
      * @param instanceId 实例ID
29
      * @param instanceId 实例ID
31
      * @return 审批历史列表
30
      * @return 审批历史列表
32
      */
31
      */
@@ -34,7 +33,7 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
34
 
33
 
35
     /**
34
     /**
36
      * 根据任务ID查询审批历史列表
35
      * 根据任务ID查询审批历史列表
37
-     * 
36
+     *
38
      * @param taskId 任务ID
37
      * @param taskId 任务ID
39
      * @return 审批历史列表
38
      * @return 审批历史列表
40
      */
39
      */
@@ -42,16 +41,16 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
42
 
41
 
43
     /**
42
     /**
44
      * 根据操作人ID查询审批历史列表
43
      * 根据操作人ID查询审批历史列表
45
-     * 
44
+     *
46
      * @param operatorId 操作人ID
45
      * @param operatorId 操作人ID
47
-     * @param action 操作类型
46
+     * @param action     操作类型
48
      * @return 审批历史列表
47
      * @return 审批历史列表
49
      */
48
      */
50
     List<ApprovalHistory> selectApprovalHistoryByOperator(@Param("operatorId") Long operatorId, @Param("action") String action);
49
     List<ApprovalHistory> selectApprovalHistoryByOperator(@Param("operatorId") Long operatorId, @Param("action") String action);
51
 
50
 
52
     /**
51
     /**
53
      * 查询审批历史列表
52
      * 查询审批历史列表
54
-     * 
53
+     *
55
      * @param approvalHistory 审批历史
54
      * @param approvalHistory 审批历史
56
      * @return 审批历史集合
55
      * @return 审批历史集合
57
      */
56
      */
@@ -59,7 +58,7 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
59
 
58
 
60
     /**
59
     /**
61
      * 新增审批历史
60
      * 新增审批历史
62
-     * 
61
+     *
63
      * @param approvalHistory 审批历史
62
      * @param approvalHistory 审批历史
64
      * @return 结果
63
      * @return 结果
65
      */
64
      */
@@ -67,7 +66,7 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
67
 
66
 
68
     /**
67
     /**
69
      * 修改审批历史
68
      * 修改审批历史
70
-     * 
69
+     *
71
      * @param approvalHistory 审批历史
70
      * @param approvalHistory 审批历史
72
      * @return 结果
71
      * @return 结果
73
      */
72
      */
@@ -75,7 +74,7 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
75
 
74
 
76
     /**
75
     /**
77
      * 删除审批历史
76
      * 删除审批历史
78
-     * 
77
+     *
79
      * @param id 审批历史主键
78
      * @param id 审批历史主键
80
      * @return 结果
79
      * @return 结果
81
      */
80
      */
@@ -83,7 +82,7 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
83
 
82
 
84
     /**
83
     /**
85
      * 批量删除审批历史
84
      * 批量删除审批历史
86
-     * 
85
+     *
87
      * @param ids 需要删除的数据主键集合
86
      * @param ids 需要删除的数据主键集合
88
      * @return 结果
87
      * @return 结果
89
      */
88
      */
@@ -91,7 +90,7 @@ public interface ApprovalHistoryMapper extends BaseMapper<ApprovalHistory>
91
 
90
 
92
     /**
91
     /**
93
      * 根据实例ID删除审批历史
92
      * 根据实例ID删除审批历史
94
-     * 
93
+     *
95
      * @param instanceId 实例ID
94
      * @param instanceId 实例ID
96
      * @return 结果
95
      * @return 结果
97
      */
96
      */

+ 18 - 19
airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalInstanceMapper.java

@@ -11,16 +11,15 @@ import org.apache.ibatis.annotations.Param;
11
 
11
 
12
 /**
12
 /**
13
  * 审批实例Mapper接口
13
  * 审批实例Mapper接口
14
- * 
14
+ *
15
  * @author simon lin
15
  * @author simon lin
16
  * @date 2025-09-06
16
  * @date 2025-09-06
17
  */
17
  */
18
 @Mapper
18
 @Mapper
19
-public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
20
-{
19
+public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance> {
21
     /**
20
     /**
22
      * 查询审批实例
21
      * 查询审批实例
23
-     * 
22
+     *
24
      * @param id 审批实例主键
23
      * @param id 审批实例主键
25
      * @return 审批实例
24
      * @return 审批实例
26
      */
25
      */
@@ -28,7 +27,7 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
28
 
27
 
29
     /**
28
     /**
30
      * 根据实例编号查询审批实例
29
      * 根据实例编号查询审批实例
31
-     * 
30
+     *
32
      * @param instanceNo 实例编号
31
      * @param instanceNo 实例编号
33
      * @return 审批实例
32
      * @return 审批实例
34
      */
33
      */
@@ -36,25 +35,25 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
36
 
35
 
37
     /**
36
     /**
38
      * 根据业务类型和业务ID查询审批实例
37
      * 根据业务类型和业务ID查询审批实例
39
-     * 
38
+     *
40
      * @param businessType 业务类型
39
      * @param businessType 业务类型
41
-     * @param businessId 业务ID
40
+     * @param businessId   业务ID
42
      * @return 审批实例列表
41
      * @return 审批实例列表
43
      */
42
      */
44
     List<ApprovalInstance> selectApprovalInstanceByBusiness(@Param("businessType") String businessType, @Param("businessId") Long businessId);
43
     List<ApprovalInstance> selectApprovalInstanceByBusiness(@Param("businessType") String businessType, @Param("businessId") Long businessId);
45
 
44
 
46
     /**
45
     /**
47
      * 根据提交人ID查询审批实例列表
46
      * 根据提交人ID查询审批实例列表
48
-     * 
47
+     *
49
      * @param submitterId 提交人ID
48
      * @param submitterId 提交人ID
50
-     * @param status 实例状态
49
+     * @param status      实例状态
51
      * @return 审批实例列表
50
      * @return 审批实例列表
52
      */
51
      */
53
     List<ApprovalInstance> selectApprovalInstanceBySubmitter(@Param("submitterId") Long submitterId, @Param("status") String status);
52
     List<ApprovalInstance> selectApprovalInstanceBySubmitter(@Param("submitterId") Long submitterId, @Param("status") String status);
54
 
53
 
55
     /**
54
     /**
56
      * 查询审批实例列表
55
      * 查询审批实例列表
57
-     * 
56
+     *
58
      * @param approvalInstance 审批实例
57
      * @param approvalInstance 审批实例
59
      * @return 审批实例集合
58
      * @return 审批实例集合
60
      */
59
      */
@@ -64,9 +63,9 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
64
      * 根据工作流ID列表、时间范围和用户ID列表查询审批实例列表
63
      * 根据工作流ID列表、时间范围和用户ID列表查询审批实例列表
65
      *
64
      *
66
      * @param workflowIds 工作流ID列表
65
      * @param workflowIds 工作流ID列表
67
-     * @param beginTime 开始时间
68
-     * @param endTime 结束时间
69
-     * @param userIds 用户ID列表
66
+     * @param beginTime   开始时间
67
+     * @param endTime     结束时间
68
+     * @param userIds     用户ID列表
70
      * @return 审批实例集合
69
      * @return 审批实例集合
71
      */
70
      */
72
     List<ApprovalInstance> selectApprovalInstancesByWorkflowIdsAndTimeRangeAndUsers(
71
     List<ApprovalInstance> selectApprovalInstancesByWorkflowIdsAndTimeRangeAndUsers(
@@ -77,7 +76,7 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
77
 
76
 
78
     /**
77
     /**
79
      * 查询审批实例详情(包含关联数据)
78
      * 查询审批实例详情(包含关联数据)
80
-     * 
79
+     *
81
      * @param id 审批实例主键
80
      * @param id 审批实例主键
82
      * @return 审批实例
81
      * @return 审批实例
83
      */
82
      */
@@ -85,7 +84,7 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
85
 
84
 
86
     /**
85
     /**
87
      * 新增审批实例
86
      * 新增审批实例
88
-     * 
87
+     *
89
      * @param approvalInstance 审批实例
88
      * @param approvalInstance 审批实例
90
      * @return 结果
89
      * @return 结果
91
      */
90
      */
@@ -93,7 +92,7 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
93
 
92
 
94
     /**
93
     /**
95
      * 修改审批实例
94
      * 修改审批实例
96
-     * 
95
+     *
97
      * @param approvalInstance 审批实例
96
      * @param approvalInstance 审批实例
98
      * @return 结果
97
      * @return 结果
99
      */
98
      */
@@ -101,7 +100,7 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
101
 
100
 
102
     /**
101
     /**
103
      * 删除审批实例
102
      * 删除审批实例
104
-     * 
103
+     *
105
      * @param id 审批实例主键
104
      * @param id 审批实例主键
106
      * @return 结果
105
      * @return 结果
107
      */
106
      */
@@ -109,7 +108,7 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
109
 
108
 
110
     /**
109
     /**
111
      * 批量删除审批实例
110
      * 批量删除审批实例
112
-     * 
111
+     *
113
      * @param ids 需要删除的数据主键集合
112
      * @param ids 需要删除的数据主键集合
114
      * @return 结果
113
      * @return 结果
115
      */
114
      */
@@ -117,7 +116,7 @@ public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance>
117
 
116
 
118
     /**
117
     /**
119
      * 生成实例编号
118
      * 生成实例编号
120
-     * 
119
+     *
121
      * @return 实例编号
120
      * @return 实例编号
122
      */
121
      */
123
     String generateInstanceNo();
122
     String generateInstanceNo();

+ 17 - 18
airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalNodeDefinitionMapper.java

@@ -9,16 +9,15 @@ import org.apache.ibatis.annotations.Param;
9
 
9
 
10
 /**
10
 /**
11
  * 审批节点定义Mapper接口
11
  * 审批节点定义Mapper接口
12
- * 
12
+ *
13
  * @author simon lin
13
  * @author simon lin
14
  * @date 2025-09-06
14
  * @date 2025-09-06
15
  */
15
  */
16
 @Mapper
16
 @Mapper
17
-public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDefinition>
18
-{
17
+public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDefinition> {
19
     /**
18
     /**
20
      * 查询审批节点定义
19
      * 查询审批节点定义
21
-     * 
20
+     *
22
      * @param id 审批节点定义主键
21
      * @param id 审批节点定义主键
23
      * @return 审批节点定义
22
      * @return 审批节点定义
24
      */
23
      */
@@ -26,7 +25,7 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
26
 
25
 
27
     /**
26
     /**
28
      * 根据流程ID查询审批节点定义列表
27
      * 根据流程ID查询审批节点定义列表
29
-     * 
28
+     *
30
      * @param workflowId 流程定义ID
29
      * @param workflowId 流程定义ID
31
      * @return 审批节点定义列表
30
      * @return 审批节点定义列表
32
      */
31
      */
@@ -34,16 +33,16 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
34
 
33
 
35
     /**
34
     /**
36
      * 根据流程ID和节点代码查询审批节点定义
35
      * 根据流程ID和节点代码查询审批节点定义
37
-     * 
36
+     *
38
      * @param workflowId 流程定义ID
37
      * @param workflowId 流程定义ID
39
-     * @param nodeCode 节点代码
38
+     * @param nodeCode   节点代码
40
      * @return 审批节点定义
39
      * @return 审批节点定义
41
      */
40
      */
42
     ApprovalNodeDefinition selectApprovalNodeDefinitionByWorkflowAndCode(@Param("workflowId") Long workflowId, @Param("nodeCode") String nodeCode);
41
     ApprovalNodeDefinition selectApprovalNodeDefinitionByWorkflowAndCode(@Param("workflowId") Long workflowId, @Param("nodeCode") String nodeCode);
43
 
42
 
44
     /**
43
     /**
45
      * 根据流程ID查询第一个节点
44
      * 根据流程ID查询第一个节点
46
-     * 
45
+     *
47
      * @param workflowId 流程定义ID
46
      * @param workflowId 流程定义ID
48
      * @return 审批节点定义
47
      * @return 审批节点定义
49
      */
48
      */
@@ -51,8 +50,8 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
51
 
50
 
52
     /**
51
     /**
53
      * 根据流程ID和当前节点顺序查询下一个节点
52
      * 根据流程ID和当前节点顺序查询下一个节点
54
-     * 
55
-     * @param workflowId 流程定义ID
53
+     *
54
+     * @param workflowId   流程定义ID
56
      * @param currentOrder 当前节点顺序
55
      * @param currentOrder 当前节点顺序
57
      * @return 审批节点定义
56
      * @return 审批节点定义
58
      */
57
      */
@@ -60,8 +59,8 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
60
 
59
 
61
     /**
60
     /**
62
      * 根据流程ID和当前节点顺序查询上一个节点
61
      * 根据流程ID和当前节点顺序查询上一个节点
63
-     * 
64
-     * @param workflowId 流程定义ID
62
+     *
63
+     * @param workflowId   流程定义ID
65
      * @param currentOrder 当前节点顺序
64
      * @param currentOrder 当前节点顺序
66
      * @return 审批节点定义
65
      * @return 审批节点定义
67
      */
66
      */
@@ -69,7 +68,7 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
69
 
68
 
70
     /**
69
     /**
71
      * 查询审批节点定义列表
70
      * 查询审批节点定义列表
72
-     * 
71
+     *
73
      * @param approvalNodeDefinition 审批节点定义
72
      * @param approvalNodeDefinition 审批节点定义
74
      * @return 审批节点定义集合
73
      * @return 审批节点定义集合
75
      */
74
      */
@@ -77,7 +76,7 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
77
 
76
 
78
     /**
77
     /**
79
      * 新增审批节点定义
78
      * 新增审批节点定义
80
-     * 
79
+     *
81
      * @param approvalNodeDefinition 审批节点定义
80
      * @param approvalNodeDefinition 审批节点定义
82
      * @return 结果
81
      * @return 结果
83
      */
82
      */
@@ -85,7 +84,7 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
85
 
84
 
86
     /**
85
     /**
87
      * 修改审批节点定义
86
      * 修改审批节点定义
88
-     * 
87
+     *
89
      * @param approvalNodeDefinition 审批节点定义
88
      * @param approvalNodeDefinition 审批节点定义
90
      * @return 结果
89
      * @return 结果
91
      */
90
      */
@@ -93,7 +92,7 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
93
 
92
 
94
     /**
93
     /**
95
      * 删除审批节点定义
94
      * 删除审批节点定义
96
-     * 
95
+     *
97
      * @param id 审批节点定义主键
96
      * @param id 审批节点定义主键
98
      * @return 结果
97
      * @return 结果
99
      */
98
      */
@@ -101,7 +100,7 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
101
 
100
 
102
     /**
101
     /**
103
      * 批量删除审批节点定义
102
      * 批量删除审批节点定义
104
-     * 
103
+     *
105
      * @param ids 需要删除的数据主键集合
104
      * @param ids 需要删除的数据主键集合
106
      * @return 结果
105
      * @return 结果
107
      */
106
      */
@@ -109,7 +108,7 @@ public interface ApprovalNodeDefinitionMapper extends BaseMapper<ApprovalNodeDef
109
 
108
 
110
     /**
109
     /**
111
      * 根据流程ID删除审批节点定义
110
      * 根据流程ID删除审批节点定义
112
-     * 
111
+     *
113
      * @param workflowId 流程定义ID
112
      * @param workflowId 流程定义ID
114
      * @return 结果
113
      * @return 结果
115
      */
114
      */

+ 18 - 19
airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalTaskMapper.java

@@ -9,16 +9,15 @@ import org.apache.ibatis.annotations.Param;
9
 
9
 
10
 /**
10
 /**
11
  * 审批任务Mapper接口
11
  * 审批任务Mapper接口
12
- * 
12
+ *
13
  * @author simon lin
13
  * @author simon lin
14
  * @date 2025-09-06
14
  * @date 2025-09-06
15
  */
15
  */
16
 @Mapper
16
 @Mapper
17
-public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
18
-{
17
+public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask> {
19
     /**
18
     /**
20
      * 查询审批任务
19
      * 查询审批任务
21
-     * 
20
+     *
22
      * @param id 审批任务主键
21
      * @param id 审批任务主键
23
      * @return 审批任务
22
      * @return 审批任务
24
      */
23
      */
@@ -26,7 +25,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
26
 
25
 
27
     /**
26
     /**
28
      * 根据任务编号查询审批任务
27
      * 根据任务编号查询审批任务
29
-     * 
28
+     *
30
      * @param taskNo 任务编号
29
      * @param taskNo 任务编号
31
      * @return 审批任务
30
      * @return 审批任务
32
      */
31
      */
@@ -34,7 +33,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
34
 
33
 
35
     /**
34
     /**
36
      * 根据实例ID查询审批任务列表
35
      * 根据实例ID查询审批任务列表
37
-     * 
36
+     *
38
      * @param instanceId 实例ID
37
      * @param instanceId 实例ID
39
      * @return 审批任务列表
38
      * @return 审批任务列表
40
      */
39
      */
@@ -42,25 +41,25 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
42
 
41
 
43
     /**
42
     /**
44
      * 根据处理人ID查询待办任务列表
43
      * 根据处理人ID查询待办任务列表
45
-     * 
44
+     *
46
      * @param assigneeId 处理人ID
45
      * @param assigneeId 处理人ID
47
-     * @param status 任务状态
46
+     * @param status     任务状态
48
      * @return 审批任务列表
47
      * @return 审批任务列表
49
      */
48
      */
50
     List<ApprovalTask> selectApprovalTaskByAssignee(@Param("assigneeId") Long assigneeId, @Param("status") String status);
49
     List<ApprovalTask> selectApprovalTaskByAssignee(@Param("assigneeId") Long assigneeId, @Param("status") String status);
51
 
50
 
52
     /**
51
     /**
53
      * 根据实例ID和节点ID查询审批任务
52
      * 根据实例ID和节点ID查询审批任务
54
-     * 
53
+     *
55
      * @param instanceId 实例ID
54
      * @param instanceId 实例ID
56
-     * @param nodeId 节点ID
55
+     * @param nodeId     节点ID
57
      * @return 审批任务
56
      * @return 审批任务
58
      */
57
      */
59
     ApprovalTask selectApprovalTaskByInstanceAndNode(@Param("instanceId") Long instanceId, @Param("nodeId") Long nodeId);
58
     ApprovalTask selectApprovalTaskByInstanceAndNode(@Param("instanceId") Long instanceId, @Param("nodeId") Long nodeId);
60
 
59
 
61
     /**
60
     /**
62
      * 查询审批任务列表
61
      * 查询审批任务列表
63
-     * 
62
+     *
64
      * @param approvalTask 审批任务
63
      * @param approvalTask 审批任务
65
      * @return 审批任务集合
64
      * @return 审批任务集合
66
      */
65
      */
@@ -68,7 +67,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
68
 
67
 
69
     /**
68
     /**
70
      * 查询审批任务详情(包含关联数据)
69
      * 查询审批任务详情(包含关联数据)
71
-     * 
70
+     *
72
      * @param id 审批任务主键
71
      * @param id 审批任务主键
73
      * @return 审批任务
72
      * @return 审批任务
74
      */
73
      */
@@ -76,7 +75,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
76
 
75
 
77
     /**
76
     /**
78
      * 新增审批任务
77
      * 新增审批任务
79
-     * 
78
+     *
80
      * @param approvalTask 审批任务
79
      * @param approvalTask 审批任务
81
      * @return 结果
80
      * @return 结果
82
      */
81
      */
@@ -84,7 +83,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
84
 
83
 
85
     /**
84
     /**
86
      * 修改审批任务
85
      * 修改审批任务
87
-     * 
86
+     *
88
      * @param approvalTask 审批任务
87
      * @param approvalTask 审批任务
89
      * @return 结果
88
      * @return 结果
90
      */
89
      */
@@ -92,7 +91,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
92
 
91
 
93
     /**
92
     /**
94
      * 删除审批任务
93
      * 删除审批任务
95
-     * 
94
+     *
96
      * @param id 审批任务主键
95
      * @param id 审批任务主键
97
      * @return 结果
96
      * @return 结果
98
      */
97
      */
@@ -100,7 +99,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
100
 
99
 
101
     /**
100
     /**
102
      * 批量删除审批任务
101
      * 批量删除审批任务
103
-     * 
102
+     *
104
      * @param ids 需要删除的数据主键集合
103
      * @param ids 需要删除的数据主键集合
105
      * @return 结果
104
      * @return 结果
106
      */
105
      */
@@ -108,7 +107,7 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
108
 
107
 
109
     /**
108
     /**
110
      * 根据实例ID删除审批任务
109
      * 根据实例ID删除审批任务
111
-     * 
110
+     *
112
      * @param instanceId 实例ID
111
      * @param instanceId 实例ID
113
      * @return 结果
112
      * @return 结果
114
      */
113
      */
@@ -116,14 +115,14 @@ public interface ApprovalTaskMapper extends BaseMapper<ApprovalTask>
116
 
115
 
117
     /**
116
     /**
118
      * 生成任务编号
117
      * 生成任务编号
119
-     * 
118
+     *
120
      * @return 任务编号
119
      * @return 任务编号
121
      */
120
      */
122
     String generateTaskNo();
121
     String generateTaskNo();
123
 
122
 
124
     /**
123
     /**
125
      * 统计用户待办任务数量
124
      * 统计用户待办任务数量
126
-     * 
125
+     *
127
      * @param assigneeId 处理人ID
126
      * @param assigneeId 处理人ID
128
      * @return 待办任务数量
127
      * @return 待办任务数量
129
      */
128
      */

+ 10 - 11
airport-system/src/main/java/com/sundot/airport/system/mapper/approval/ApprovalWorkflowDefinitionMapper.java

@@ -9,16 +9,15 @@ import org.apache.ibatis.annotations.Param;
9
 
9
 
10
 /**
10
 /**
11
  * 审批流程定义Mapper接口
11
  * 审批流程定义Mapper接口
12
- * 
12
+ *
13
  * @author simon lin
13
  * @author simon lin
14
  * @date 2025-09-06
14
  * @date 2025-09-06
15
  */
15
  */
16
 @Mapper
16
 @Mapper
17
-public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWorkflowDefinition>
18
-{
17
+public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWorkflowDefinition> {
19
     /**
18
     /**
20
      * 查询审批流程定义
19
      * 查询审批流程定义
21
-     * 
20
+     *
22
      * @param id 审批流程定义主键
21
      * @param id 审批流程定义主键
23
      * @return 审批流程定义
22
      * @return 审批流程定义
24
      */
23
      */
@@ -26,7 +25,7 @@ public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWor
26
 
25
 
27
     /**
26
     /**
28
      * 根据流程代码查询审批流程定义
27
      * 根据流程代码查询审批流程定义
29
-     * 
28
+     *
30
      * @param workflowCode 流程代码
29
      * @param workflowCode 流程代码
31
      * @return 审批流程定义
30
      * @return 审批流程定义
32
      */
31
      */
@@ -34,7 +33,7 @@ public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWor
34
 
33
 
35
     /**
34
     /**
36
      * 根据流程类型查询审批流程定义列表
35
      * 根据流程类型查询审批流程定义列表
37
-     * 
36
+     *
38
      * @param workflowType 流程类型
37
      * @param workflowType 流程类型
39
      * @return 审批流程定义列表
38
      * @return 审批流程定义列表
40
      */
39
      */
@@ -42,7 +41,7 @@ public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWor
42
 
41
 
43
     /**
42
     /**
44
      * 查询审批流程定义列表
43
      * 查询审批流程定义列表
45
-     * 
44
+     *
46
      * @param approvalWorkflowDefinition 审批流程定义
45
      * @param approvalWorkflowDefinition 审批流程定义
47
      * @return 审批流程定义集合
46
      * @return 审批流程定义集合
48
      */
47
      */
@@ -50,7 +49,7 @@ public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWor
50
 
49
 
51
     /**
50
     /**
52
      * 新增审批流程定义
51
      * 新增审批流程定义
53
-     * 
52
+     *
54
      * @param approvalWorkflowDefinition 审批流程定义
53
      * @param approvalWorkflowDefinition 审批流程定义
55
      * @return 结果
54
      * @return 结果
56
      */
55
      */
@@ -58,7 +57,7 @@ public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWor
58
 
57
 
59
     /**
58
     /**
60
      * 修改审批流程定义
59
      * 修改审批流程定义
61
-     * 
60
+     *
62
      * @param approvalWorkflowDefinition 审批流程定义
61
      * @param approvalWorkflowDefinition 审批流程定义
63
      * @return 结果
62
      * @return 结果
64
      */
63
      */
@@ -66,7 +65,7 @@ public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWor
66
 
65
 
67
     /**
66
     /**
68
      * 删除审批流程定义
67
      * 删除审批流程定义
69
-     * 
68
+     *
70
      * @param id 审批流程定义主键
69
      * @param id 审批流程定义主键
71
      * @return 结果
70
      * @return 结果
72
      */
71
      */
@@ -74,7 +73,7 @@ public interface ApprovalWorkflowDefinitionMapper extends BaseMapper<ApprovalWor
74
 
73
 
75
     /**
74
     /**
76
      * 批量删除审批流程定义
75
      * 批量删除审批流程定义
77
-     * 
76
+     *
78
      * @param ids 需要删除的数据主键集合
77
      * @param ids 需要删除的数据主键集合
79
      * @return 结果
78
      * @return 结果
80
      */
79
      */

+ 5 - 1
airport-system/src/main/java/com/sundot/airport/system/service/approval/BusinessApprovalHandler.java

@@ -9,6 +9,7 @@ import com.sundot.airport.system.domain.approval.ApprovalInstance;
9
 public interface BusinessApprovalHandler {
9
 public interface BusinessApprovalHandler {
10
     /**
10
     /**
11
      * 判断是否支持处理指定的业务类型
11
      * 判断是否支持处理指定的业务类型
12
+     *
12
      * @param businessType 业务类型
13
      * @param businessType 业务类型
13
      * @return true-支持,false-不支持
14
      * @return true-支持,false-不支持
14
      */
15
      */
@@ -16,18 +17,21 @@ public interface BusinessApprovalHandler {
16
 
17
 
17
     /**
18
     /**
18
      * 处理审批通过的业务逻辑
19
      * 处理审批通过的业务逻辑
20
+     *
19
      * @param instance 审批实例
21
      * @param instance 审批实例
20
      */
22
      */
21
     void handleApproved(ApprovalInstance instance);
23
     void handleApproved(ApprovalInstance instance);
22
 
24
 
23
     /**
25
     /**
24
      * 处理审批驳回的业务逻辑
26
      * 处理审批驳回的业务逻辑
27
+     *
25
      * @param instance 审批实例
28
      * @param instance 审批实例
26
      */
29
      */
27
     void handleRejected(ApprovalInstance instance);
30
     void handleRejected(ApprovalInstance instance);
28
 
31
 
29
     /**
32
     /**
30
-     *  处理审批流程取消
33
+     * 处理审批流程取消
34
+     *
31
      * @param instance
35
      * @param instance
32
      */
36
      */
33
     void handleCancelled(ApprovalInstance instance);
37
     void handleCancelled(ApprovalInstance instance);

+ 72 - 71
airport-system/src/main/java/com/sundot/airport/system/service/approval/IApprovalEngineService.java

@@ -8,66 +8,65 @@ import com.sundot.airport.system.domain.approval.ApprovalTask;
8
 
8
 
9
 /**
9
 /**
10
  * 审批流程引擎Service接口
10
  * 审批流程引擎Service接口
11
- * 
11
+ *
12
  * @author simon lin
12
  * @author simon lin
13
  * @date 2025-09-06
13
  * @date 2025-09-06
14
  */
14
  */
15
-public interface IApprovalEngineService
16
-{
15
+public interface IApprovalEngineService {
17
     /**
16
     /**
18
      * 启动审批流程
17
      * 启动审批流程
19
-     * 
20
-     * @param workflowCode 流程代码
21
-     * @param businessType 业务类型
22
-     * @param businessId 业务ID
23
-     * @param title 审批标题
24
-     * @param submitterId 提交人ID
18
+     *
19
+     * @param workflowCode  流程代码
20
+     * @param businessType  业务类型
21
+     * @param businessId    业务ID
22
+     * @param title         审批标题
23
+     * @param submitterId   提交人ID
25
      * @param submitterName 提交人姓名
24
      * @param submitterName 提交人姓名
26
-     * @param formData 表单数据
27
-     * @param businessData 业务数据
25
+     * @param formData      表单数据
26
+     * @param businessData  业务数据
28
      * @return 审批实例
27
      * @return 审批实例
29
      */
28
      */
30
-    ApprovalInstance startProcess(String workflowCode, String businessType, Long businessId, 
31
-                                String title, Long submitterId, String submitterName, 
32
-                                Map<String, Object> formData, Map<String, Object> businessData);
29
+    ApprovalInstance startProcess(String workflowCode, String businessType, Long businessId,
30
+                                  String title, Long submitterId, String submitterName,
31
+                                  Map<String, Object> formData, Map<String, Object> businessData);
33
 
32
 
34
     /**
33
     /**
35
      * 审批任务(同意)
34
      * 审批任务(同意)
36
-     * 
37
-     * @param taskId 任务ID
38
-     * @param operatorId 操作人ID
35
+     *
36
+     * @param taskId       任务ID
37
+     * @param operatorId   操作人ID
39
      * @param operatorName 操作人姓名
38
      * @param operatorName 操作人姓名
40
-     * @param comment 审批意见
41
-     * @param formData 表单数据
39
+     * @param comment      审批意见
40
+     * @param formData     表单数据
42
      * @return 结果
41
      * @return 结果
43
      */
42
      */
44
     boolean approveTask(Long taskId, Long operatorId, String operatorName, String comment, Map<String, Object> formData);
43
     boolean approveTask(Long taskId, Long operatorId, String operatorName, String comment, Map<String, Object> formData);
45
 
44
 
46
     /**
45
     /**
47
      * 驳回任务
46
      * 驳回任务
48
-     * 
49
-     * @param taskId 任务ID
50
-     * @param operatorId 操作人ID
47
+     *
48
+     * @param taskId       任务ID
49
+     * @param operatorId   操作人ID
51
      * @param operatorName 操作人姓名
50
      * @param operatorName 操作人姓名
52
-     * @param comment 驳回理由
51
+     * @param comment      驳回理由
53
      * @return 结果
52
      * @return 结果
54
      */
53
      */
55
     boolean rejectTask(Long taskId, Long operatorId, String operatorName, String comment);
54
     boolean rejectTask(Long taskId, Long operatorId, String operatorName, String comment);
56
 
55
 
57
     /**
56
     /**
58
      * 取消审批流程
57
      * 取消审批流程
59
-     * 
60
-     * @param instanceId 实例ID
61
-     * @param operatorId 操作人ID
58
+     *
59
+     * @param instanceId   实例ID
60
+     * @param operatorId   操作人ID
62
      * @param operatorName 操作人姓名
61
      * @param operatorName 操作人姓名
63
-     * @param comment 取消理由
62
+     * @param comment      取消理由
64
      * @return 结果
63
      * @return 结果
65
      */
64
      */
66
     boolean cancelProcess(Long instanceId, Long operatorId, String operatorName, String comment);
65
     boolean cancelProcess(Long instanceId, Long operatorId, String operatorName, String comment);
67
 
66
 
68
     /**
67
     /**
69
      * 获取用户待办任务列表
68
      * 获取用户待办任务列表
70
-     * 
69
+     *
71
      * @param userId 用户ID
70
      * @param userId 用户ID
72
      * @return 待办任务列表
71
      * @return 待办任务列表
73
      */
72
      */
@@ -75,7 +74,7 @@ public interface IApprovalEngineService
75
 
74
 
76
     /**
75
     /**
77
      * 获取用户已办任务列表
76
      * 获取用户已办任务列表
78
-     * 
77
+     *
79
      * @param userId 用户ID
78
      * @param userId 用户ID
80
      * @return 已办任务列表
79
      * @return 已办任务列表
81
      */
80
      */
@@ -83,7 +82,7 @@ public interface IApprovalEngineService
83
 
82
 
84
     /**
83
     /**
85
      * 获取用户发起的审批实例列表
84
      * 获取用户发起的审批实例列表
86
-     * 
85
+     *
87
      * @param userId 用户ID
86
      * @param userId 用户ID
88
      * @param status 状态
87
      * @param status 状态
89
      * @return 审批实例列表
88
      * @return 审批实例列表
@@ -92,9 +91,9 @@ public interface IApprovalEngineService
92
 
91
 
93
     /**
92
     /**
94
      * 根据业务类型和级别获取对应的流程代码
93
      * 根据业务类型和级别获取对应的流程代码
95
-     * 
96
-     * @param businessType 业务类型
97
-     * @param level 级别
94
+     *
95
+     * @param businessType  业务类型
96
+     * @param level         级别
98
      * @param submitterRole 提交人角色
97
      * @param submitterRole 提交人角色
99
      * @return 流程代码
98
      * @return 流程代码
100
      */
99
      */
@@ -102,70 +101,71 @@ public interface IApprovalEngineService
102
 
101
 
103
     /**
102
     /**
104
      * 个人级别审批流程(发送通知确认)
103
      * 个人级别审批流程(发送通知确认)
105
-     * 
106
-     * @param businessType 业务类型
107
-     * @param businessId 业务ID
108
-     * @param title 标题
109
-     * @param submitterId 提交人ID
104
+     *
105
+     * @param businessType  业务类型
106
+     * @param businessId    业务ID
107
+     * @param title         标题
108
+     * @param submitterId   提交人ID
110
      * @param submitterName 提交人姓名
109
      * @param submitterName 提交人姓名
111
      * @param targetUserIds 目标用户ID列表
110
      * @param targetUserIds 目标用户ID列表
112
-     * @param formData 表单数据
113
-     * @param businessData 业务数据
111
+     * @param formData      表单数据
112
+     * @param businessData  业务数据
114
      * @return 审批实例
113
      * @return 审批实例
115
      */
114
      */
116
     ApprovalInstance startPersonalLevelProcess(String businessType, Long businessId, String title,
115
     ApprovalInstance startPersonalLevelProcess(String businessType, Long businessId, String title,
117
-                                             Long submitterId, String submitterName, Long sectionLeaderId,
118
-                                             Map<String, Object> formData, Map<String, Object> businessData);
116
+                                               Long submitterId, String submitterName, Long sectionLeaderId,
117
+                                               Map<String, Object> formData, Map<String, Object> businessData);
119
 
118
 
120
     /**
119
     /**
121
      * 科级审批流程
120
      * 科级审批流程
122
-     * 
123
-     * @param businessType 业务类型
124
-     * @param businessId 业务ID
125
-     * @param title 标题
126
-     * @param submitterId 提交人ID
127
-     * @param submitterName 提交人姓名
121
+     *
122
+     * @param businessType    业务类型
123
+     * @param businessId      业务ID
124
+     * @param title           标题
125
+     * @param submitterId     提交人ID
126
+     * @param submitterName   提交人姓名
128
      * @param sectionLeaderId 科长ID
127
      * @param sectionLeaderId 科长ID
129
-     * @param formData 表单数据
130
-     * @param businessData 业务数据
128
+     * @param formData        表单数据
129
+     * @param businessData    业务数据
131
      * @return 审批实例
130
      * @return 审批实例
132
      */
131
      */
133
     ApprovalInstance startSectionLevelProcess(String businessType, Long businessId, String title,
132
     ApprovalInstance startSectionLevelProcess(String businessType, Long businessId, String title,
134
-                                            Long submitterId, String submitterName, Long sectionLeaderId,
135
-                                            Map<String, Object> formData, Map<String, Object> businessData);
133
+                                              Long submitterId, String submitterName, Long sectionLeaderId,
134
+                                              Map<String, Object> formData, Map<String, Object> businessData);
136
 
135
 
137
     /**
136
     /**
138
      * 班组级审批流程
137
      * 班组级审批流程
139
-     * 
140
-     * @param businessType 业务类型
141
-     * @param businessId 业务ID
142
-     * @param title 标题
143
-     * @param submitterId 提交人ID
138
+     *
139
+     * @param businessType  业务类型
140
+     * @param businessId    业务ID
141
+     * @param title         标题
142
+     * @param submitterId   提交人ID
144
      * @param submitterName 提交人姓名
143
      * @param submitterName 提交人姓名
145
-     * @param formData 表单数据
146
-     * @param businessData 业务数据
144
+     * @param formData      表单数据
145
+     * @param businessData  业务数据
147
      * @return 审批实例
146
      * @return 审批实例
148
      */
147
      */
149
     ApprovalInstance startGroupLevelProcess(String businessType, Long businessId, String title,
148
     ApprovalInstance startGroupLevelProcess(String businessType, Long businessId, String title,
150
-                                          Long submitterId, String submitterName,
151
-                                          Map<String, Object> formData, Map<String, Object> businessData);
149
+                                            Long submitterId, String submitterName,
150
+                                            Map<String, Object> formData, Map<String, Object> businessData);
152
 
151
 
153
     /**
152
     /**
154
      * 查获上报审批流程
153
      * 查获上报审批流程
155
-     * 
156
-     * @param businessType 业务类型
157
-     * @param businessId 业务ID
158
-     * @param title 标题
159
-     * @param submitterId 提交人ID
154
+     *
155
+     * @param businessType  业务类型
156
+     * @param businessId    业务ID
157
+     * @param title         标题
158
+     * @param submitterId   提交人ID
160
      * @param submitterName 提交人姓名
159
      * @param submitterName 提交人姓名
161
      * @param submitterRole 提交人角色
160
      * @param submitterRole 提交人角色
162
-     * @param formData 表单数据
163
-     * @param businessData 业务数据
161
+     * @param formData      表单数据
162
+     * @param businessData  业务数据
164
      * @return 审批实例
163
      * @return 审批实例
165
      */
164
      */
166
     ApprovalInstance startSeizureReportProcess(String businessType, Long businessId, String title,
165
     ApprovalInstance startSeizureReportProcess(String businessType, Long businessId, String title,
167
-                                             Long submitterId, String submitterName, String submitterRole,
168
-                                             Map<String, Object> formData, Map<String, Object> businessData);
166
+                                               Long submitterId, String submitterName, String submitterRole,
167
+                                               Map<String, Object> formData, Map<String, Object> businessData);
168
+
169
     /**
169
     /**
170
      * 批量审批任务(同意)
170
      * 批量审批任务(同意)
171
      *
171
      *
@@ -175,7 +175,8 @@ public interface IApprovalEngineService
175
     boolean approveTaskList(List<Long> ids);
175
     boolean approveTaskList(List<Long> ids);
176
 
176
 
177
     /**
177
     /**
178
-     *  批量审批任务(驳回)
178
+     * 批量审批任务(驳回)
179
+     *
179
      * @param ids 任务ID列表
180
      * @param ids 任务ID列表
180
      * @return 批量结果
181
      * @return 批量结果
181
      */
182
      */

+ 19 - 20
airport-system/src/main/java/com/sundot/airport/system/service/approval/IApprovalUserService.java

@@ -4,25 +4,24 @@ import java.util.List;
4
 
4
 
5
 /**
5
 /**
6
  * 审批流程用户服务接口
6
  * 审批流程用户服务接口
7
- * 
7
+ *
8
  * @author simon lin
8
  * @author simon lin
9
  * @date 2025-09-06
9
  * @date 2025-09-06
10
  */
10
  */
11
-public interface IApprovalUserService
12
-{
11
+public interface IApprovalUserService {
13
     /**
12
     /**
14
      * 根据审批人类型获取审批人ID列表
13
      * 根据审批人类型获取审批人ID列表
15
-     * 
16
-     * @param approverType 审批人类型
14
+     *
15
+     * @param approverType  审批人类型
17
      * @param approverValue 审批人值
16
      * @param approverValue 审批人值
18
-     * @param businessData 业务数据(可用于动态获取审批人)
17
+     * @param businessData  业务数据(可用于动态获取审批人)
19
      * @return 审批人ID列表
18
      * @return 审批人ID列表
20
      */
19
      */
21
     List<Long> getApproverIds(String approverType, String approverValue, Object businessData);
20
     List<Long> getApproverIds(String approverType, String approverValue, Object businessData);
22
 
21
 
23
     /**
22
     /**
24
      * 根据部门ID获取部门负责人(科长)
23
      * 根据部门ID获取部门负责人(科长)
25
-     * 
24
+     *
26
      * @param deptId 部门ID
25
      * @param deptId 部门ID
27
      * @return 部门负责人用户ID列表
26
      * @return 部门负责人用户ID列表
28
      */
27
      */
@@ -30,7 +29,7 @@ public interface IApprovalUserService
30
 
29
 
31
     /**
30
     /**
32
      * 根据用户ID获取所属部门的科长
31
      * 根据用户ID获取所属部门的科长
33
-     * 
32
+     *
34
      * @param userId 用户ID
33
      * @param userId 用户ID
35
      * @return 科长用户ID列表
34
      * @return 科长用户ID列表
36
      */
35
      */
@@ -38,7 +37,7 @@ public interface IApprovalUserService
38
 
37
 
39
     /**
38
     /**
40
      * 根据用户ID获取所属班组的班组长
39
      * 根据用户ID获取所属班组的班组长
41
-     * 
40
+     *
42
      * @param userId 用户ID
41
      * @param userId 用户ID
43
      * @return 班组长用户ID列表
42
      * @return 班组长用户ID列表
44
      */
43
      */
@@ -46,7 +45,7 @@ public interface IApprovalUserService
46
 
45
 
47
     /**
46
     /**
48
      * 根据角色标识获取用户ID列表
47
      * 根据角色标识获取用户ID列表
49
-     * 
48
+     *
50
      * @param roleKey 角色标识
49
      * @param roleKey 角色标识
51
      * @return 用户ID列表
50
      * @return 用户ID列表
52
      */
51
      */
@@ -54,7 +53,7 @@ public interface IApprovalUserService
54
 
53
 
55
     /**
54
     /**
56
      * 根据部门ID获取部门下所有用户ID列表
55
      * 根据部门ID获取部门下所有用户ID列表
57
-     * 
56
+     *
58
      * @param deptId 部门ID
57
      * @param deptId 部门ID
59
      * @return 用户ID列表
58
      * @return 用户ID列表
60
      */
59
      */
@@ -62,7 +61,7 @@ public interface IApprovalUserService
62
 
61
 
63
     /**
62
     /**
64
      * 判断用户是否为班组长角色
63
      * 判断用户是否为班组长角色
65
-     * 
64
+     *
66
      * @param userId 用户ID
65
      * @param userId 用户ID
67
      * @return 是否为班组长
66
      * @return 是否为班组长
68
      */
67
      */
@@ -70,7 +69,7 @@ public interface IApprovalUserService
70
 
69
 
71
     /**
70
     /**
72
      * 判断用户是否为科长角色
71
      * 判断用户是否为科长角色
73
-     * 
72
+     *
74
      * @param userId 用户ID
73
      * @param userId 用户ID
75
      * @return 是否为科长
74
      * @return 是否为科长
76
      */
75
      */
@@ -78,32 +77,32 @@ public interface IApprovalUserService
78
 
77
 
79
     /**
78
     /**
80
      * 根据业务数据动态获取整改班组
79
      * 根据业务数据动态获取整改班组
81
-     * 
80
+     *
82
      * @param businessData 业务数据
81
      * @param businessData 业务数据
83
      * @return 班组ID
82
      * @return 班组ID
84
      */
83
      */
85
     Long getTargetGroupIdFromBusinessData(Object businessData);
84
     Long getTargetGroupIdFromBusinessData(Object businessData);
86
-    
85
+
87
     /**
86
     /**
88
      * 根据任务ID获取原始操作者(创建者或更新者)的用户ID
87
      * 根据任务ID获取原始操作者(创建者或更新者)的用户ID
89
-     * 
88
+     *
90
      * @param taskId 任务ID
89
      * @param taskId 任务ID
91
      * @return 原始操作者的用户ID,如果找不到返回null
90
      * @return 原始操作者的用户ID,如果找不到返回null
92
      */
91
      */
93
     Long getOriginalOperatorByTaskId(Long taskId);
92
     Long getOriginalOperatorByTaskId(Long taskId);
94
-    
93
+
95
     /**
94
     /**
96
      * 根据任务ID获取任务的创建者或更新者用户ID(用于驳回回流)
95
      * 根据任务ID获取任务的创建者或更新者用户ID(用于驳回回流)
97
-     * 
96
+     *
98
      * @param taskId 任务ID
97
      * @param taskId 任务ID
99
      * @return 任务创建者或更新者的用户ID,如果找不到返回null
98
      * @return 任务创建者或更新者的用户ID,如果找不到返回null
100
      */
99
      */
101
     Long getTaskCreatorOrUpdaterByTaskId(Long taskId);
100
     Long getTaskCreatorOrUpdaterByTaskId(Long taskId);
102
-    
101
+
103
     /**
102
     /**
104
      * 根据用户ID查找其直接上级(违禁品审批用)
103
      * 根据用户ID查找其直接上级(违禁品审批用)
105
      * 如果用户是安检员,找其班组长;如果是班组长,找其科长
104
      * 如果用户是安检员,找其班组长;如果是班组长,找其科长
106
-     * 
105
+     *
107
      * @param userId 用户ID
106
      * @param userId 用户ID
108
      * @return 直接上级的用户ID列表
107
      * @return 直接上级的用户ID列表
109
      */
108
      */

+ 11 - 11
airport-system/src/main/java/com/sundot/airport/system/service/approval/IApprovalWorkflowService.java

@@ -1,19 +1,19 @@
1
 package com.sundot.airport.system.service.approval;
1
 package com.sundot.airport.system.service.approval;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+
4
 import com.sundot.airport.system.domain.approval.ApprovalWorkflowDefinition;
5
 import com.sundot.airport.system.domain.approval.ApprovalWorkflowDefinition;
5
 
6
 
6
 /**
7
 /**
7
  * 审批流程定义Service接口
8
  * 审批流程定义Service接口
8
- * 
9
+ *
9
  * @author simon lin
10
  * @author simon lin
10
  * @date 2025-09-06
11
  * @date 2025-09-06
11
  */
12
  */
12
-public interface IApprovalWorkflowService
13
-{
13
+public interface IApprovalWorkflowService {
14
     /**
14
     /**
15
      * 查询审批流程定义
15
      * 查询审批流程定义
16
-     * 
16
+     *
17
      * @param id 审批流程定义主键
17
      * @param id 审批流程定义主键
18
      * @return 审批流程定义
18
      * @return 审批流程定义
19
      */
19
      */
@@ -21,7 +21,7 @@ public interface IApprovalWorkflowService
21
 
21
 
22
     /**
22
     /**
23
      * 根据流程代码查询审批流程定义
23
      * 根据流程代码查询审批流程定义
24
-     * 
24
+     *
25
      * @param workflowCode 流程代码
25
      * @param workflowCode 流程代码
26
      * @return 审批流程定义
26
      * @return 审批流程定义
27
      */
27
      */
@@ -29,7 +29,7 @@ public interface IApprovalWorkflowService
29
 
29
 
30
     /**
30
     /**
31
      * 根据流程类型查询审批流程定义列表
31
      * 根据流程类型查询审批流程定义列表
32
-     * 
32
+     *
33
      * @param workflowType 流程类型
33
      * @param workflowType 流程类型
34
      * @return 审批流程定义列表
34
      * @return 审批流程定义列表
35
      */
35
      */
@@ -37,7 +37,7 @@ public interface IApprovalWorkflowService
37
 
37
 
38
     /**
38
     /**
39
      * 查询审批流程定义列表
39
      * 查询审批流程定义列表
40
-     * 
40
+     *
41
      * @param approvalWorkflowDefinition 审批流程定义
41
      * @param approvalWorkflowDefinition 审批流程定义
42
      * @return 审批流程定义集合
42
      * @return 审批流程定义集合
43
      */
43
      */
@@ -45,7 +45,7 @@ public interface IApprovalWorkflowService
45
 
45
 
46
     /**
46
     /**
47
      * 新增审批流程定义
47
      * 新增审批流程定义
48
-     * 
48
+     *
49
      * @param approvalWorkflowDefinition 审批流程定义
49
      * @param approvalWorkflowDefinition 审批流程定义
50
      * @return 结果
50
      * @return 结果
51
      */
51
      */
@@ -53,7 +53,7 @@ public interface IApprovalWorkflowService
53
 
53
 
54
     /**
54
     /**
55
      * 修改审批流程定义
55
      * 修改审批流程定义
56
-     * 
56
+     *
57
      * @param approvalWorkflowDefinition 审批流程定义
57
      * @param approvalWorkflowDefinition 审批流程定义
58
      * @return 结果
58
      * @return 结果
59
      */
59
      */
@@ -61,7 +61,7 @@ public interface IApprovalWorkflowService
61
 
61
 
62
     /**
62
     /**
63
      * 批量删除审批流程定义
63
      * 批量删除审批流程定义
64
-     * 
64
+     *
65
      * @param ids 需要删除的审批流程定义主键集合
65
      * @param ids 需要删除的审批流程定义主键集合
66
      * @return 结果
66
      * @return 结果
67
      */
67
      */
@@ -69,7 +69,7 @@ public interface IApprovalWorkflowService
69
 
69
 
70
     /**
70
     /**
71
      * 删除审批流程定义信息
71
      * 删除审批流程定义信息
72
-     * 
72
+     *
73
      * @param id 审批流程定义主键
73
      * @param id 审批流程定义主键
74
      * @return 结果
74
      * @return 结果
75
      */
75
      */

+ 49 - 49
airport-system/src/main/java/com/sundot/airport/system/service/approval/ICheckApprovalService.java

@@ -8,161 +8,161 @@ import java.util.Map;
8
 
8
 
9
 /**
9
 /**
10
  * 审批检查服务接口
10
  * 审批检查服务接口
11
- * 
11
+ *
12
  * @author airport-system
12
  * @author airport-system
13
  */
13
  */
14
 public interface ICheckApprovalService {
14
 public interface ICheckApprovalService {
15
-    
15
+
16
     /**
16
     /**
17
      * 启动个人级别检查审批流程
17
      * 启动个人级别检查审批流程
18
-     * 
18
+     *
19
      * @param requestData 请求数据,包含checkType、location、targetUserIds、formData等
19
      * @param requestData 请求数据,包含checkType、location、targetUserIds、formData等
20
-     * @param userId 当前用户ID
21
-     * @param username 当前用户名
22
-     * @param remark 备注
20
+     * @param userId      当前用户ID
21
+     * @param username    当前用户名
22
+     * @param remark      备注
23
      * @return ApprovalInstance 审批实例
23
      * @return ApprovalInstance 审批实例
24
      * @throws Exception 启动流程失败时抛出异常
24
      * @throws Exception 启动流程失败时抛出异常
25
      */
25
      */
26
     ApprovalInstance submitPersonalCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
26
     ApprovalInstance submitPersonalCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
27
-    
27
+
28
     /**
28
     /**
29
      * 启动科级检查审批流程
29
      * 启动科级检查审批流程
30
-     * 
30
+     *
31
      * @param requestData 请求数据,包含checkType、severity、targetDeptId、sectionLeaderId、formData等
31
      * @param requestData 请求数据,包含checkType、severity、targetDeptId、sectionLeaderId、formData等
32
-     * @param userId 当前用户ID
33
-     * @param username 当前用户名
34
-     * @param remark 备注
32
+     * @param userId      当前用户ID
33
+     * @param username    当前用户名
34
+     * @param remark      备注
35
      * @return ApprovalInstance 审批实例
35
      * @return ApprovalInstance 审批实例
36
      * @throws Exception 启动流程失败时抛出异常
36
      * @throws Exception 启动流程失败时抛出异常
37
      */
37
      */
38
     ApprovalInstance submitSectionCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
38
     ApprovalInstance submitSectionCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
39
-    
39
+
40
     /**
40
     /**
41
      * 启动班组级检查审批流程
41
      * 启动班组级检查审批流程
42
-     * 
42
+     *
43
      * @param requestData 请求数据,包含checkType、severity、groupLeaderId、formData等
43
      * @param requestData 请求数据,包含checkType、severity、groupLeaderId、formData等
44
-     * @param userId 当前用户ID
45
-     * @param username 当前用户名
46
-     * @param remark 备注
44
+     * @param userId      当前用户ID
45
+     * @param username    当前用户名
46
+     * @param remark      备注
47
      * @return ApprovalInstance 审批实例
47
      * @return ApprovalInstance 审批实例
48
      * @throws Exception 启动流程失败时抛出异常
48
      * @throws Exception 启动流程失败时抛出异常
49
      */
49
      */
50
     ApprovalInstance submitGroupCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
50
     ApprovalInstance submitGroupCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
51
-    
51
+
52
     /**
52
     /**
53
      * 启动查获上报审批流程
53
      * 启动查获上报审批流程
54
-     * 
54
+     *
55
      * @param requestData 请求数据,包含seizureTime、passengerInfo、formData等
55
      * @param requestData 请求数据,包含seizureTime、passengerInfo、formData等
56
-     * @param userId 当前用户ID
57
-     * @param username 当前用户名
58
-     * @param remark 备注
56
+     * @param userId      当前用户ID
57
+     * @param username    当前用户名
58
+     * @param remark      备注
59
      * @return ApprovalInstance 审批实例
59
      * @return ApprovalInstance 审批实例
60
      * @throws Exception 启动流程失败时抛出异常
60
      * @throws Exception 启动流程失败时抛出异常
61
      */
61
      */
62
     ApprovalInstance submitSeizureReport(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
62
     ApprovalInstance submitSeizureReport(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception;
63
-    
63
+
64
     /**
64
     /**
65
      * 审批任务(同意)
65
      * 审批任务(同意)
66
-     * 
67
-     * @param taskId 任务ID
68
-     * @param comment 审批意见
66
+     *
67
+     * @param taskId   任务ID
68
+     * @param comment  审批意见
69
      * @param formData 表单数据(科长节点需要选择班组等)
69
      * @param formData 表单数据(科长节点需要选择班组等)
70
-     * @param userId 当前用户ID
70
+     * @param userId   当前用户ID
71
      * @param username 当前用户名
71
      * @param username 当前用户名
72
      * @return ApprovalTask 处理后的任务
72
      * @return ApprovalTask 处理后的任务
73
      * @throws Exception 审批失败时抛出异常
73
      * @throws Exception 审批失败时抛出异常
74
      */
74
      */
75
     ApprovalTask approveTask(Long taskId, String comment, Map<String, Object> formData, Long userId, String username) throws Exception;
75
     ApprovalTask approveTask(Long taskId, String comment, Map<String, Object> formData, Long userId, String username) throws Exception;
76
-    
76
+
77
     /**
77
     /**
78
      * 审批任务(驳回)
78
      * 审批任务(驳回)
79
-     * 
80
-     * @param taskId 任务ID
81
-     * @param comment 驳回原因
82
-     * @param userId 当前用户ID
79
+     *
80
+     * @param taskId   任务ID
81
+     * @param comment  驳回原因
82
+     * @param userId   当前用户ID
83
      * @param username 当前用户名
83
      * @param username 当前用户名
84
      * @return ApprovalTask 处理后的任务
84
      * @return ApprovalTask 处理后的任务
85
      * @throws Exception 驳回失败时抛出异常
85
      * @throws Exception 驳回失败时抛出异常
86
      */
86
      */
87
     ApprovalTask rejectTask(Long taskId, String comment, Long userId, String username) throws Exception;
87
     ApprovalTask rejectTask(Long taskId, String comment, Long userId, String username) throws Exception;
88
-    
88
+
89
     /**
89
     /**
90
      * 获取用户待办任务列表
90
      * 获取用户待办任务列表
91
-     * 
91
+     *
92
      * @param userId 用户ID
92
      * @param userId 用户ID
93
      * @return List<ApprovalTask> 待办任务列表
93
      * @return List<ApprovalTask> 待办任务列表
94
      * @throws Exception 查询失败时抛出异常
94
      * @throws Exception 查询失败时抛出异常
95
      */
95
      */
96
     List<ApprovalTask> getPendingTasks(Long userId) throws Exception;
96
     List<ApprovalTask> getPendingTasks(Long userId) throws Exception;
97
-    
97
+
98
     /**
98
     /**
99
      * 获取用户已办任务列表
99
      * 获取用户已办任务列表
100
-     * 
100
+     *
101
      * @param userId 用户ID
101
      * @param userId 用户ID
102
      * @return List<ApprovalTask> 已办任务列表
102
      * @return List<ApprovalTask> 已办任务列表
103
      * @throws Exception 查询失败时抛出异常
103
      * @throws Exception 查询失败时抛出异常
104
      */
104
      */
105
     List<ApprovalTask> getCompletedTasks(Long userId) throws Exception;
105
     List<ApprovalTask> getCompletedTasks(Long userId) throws Exception;
106
-    
106
+
107
     /**
107
     /**
108
      * 获取用户发起的审批实例列表
108
      * 获取用户发起的审批实例列表
109
-     * 
109
+     *
110
      * @param userId 用户ID
110
      * @param userId 用户ID
111
      * @param status 状态筛选(可为空)
111
      * @param status 状态筛选(可为空)
112
      * @return List<ApprovalInstance> 审批实例列表
112
      * @return List<ApprovalInstance> 审批实例列表
113
      * @throws Exception 查询失败时抛出异常
113
      * @throws Exception 查询失败时抛出异常
114
      */
114
      */
115
     List<ApprovalInstance> getSubmittedInstances(Long userId, String status) throws Exception;
115
     List<ApprovalInstance> getSubmittedInstances(Long userId, String status) throws Exception;
116
-    
116
+
117
     /**
117
     /**
118
      * 获取用户待办任务数量
118
      * 获取用户待办任务数量
119
-     * 
119
+     *
120
      * @param userId 用户ID
120
      * @param userId 用户ID
121
      * @return Long 待办任务数量
121
      * @return Long 待办任务数量
122
      * @throws Exception 查询失败时抛出异常
122
      * @throws Exception 查询失败时抛出异常
123
      */
123
      */
124
     Long getPendingTaskCount(Long userId) throws Exception;
124
     Long getPendingTaskCount(Long userId) throws Exception;
125
-    
125
+
126
     /**
126
     /**
127
      * 获取用户抄送列表详情
127
      * 获取用户抄送列表详情
128
-     * 
128
+     *
129
      * @param userId 用户ID
129
      * @param userId 用户ID
130
      * @return List 抄送详情列表
130
      * @return List 抄送详情列表
131
      * @throws Exception 查询失败时抛出异常
131
      * @throws Exception 查询失败时抛出异常
132
      */
132
      */
133
     List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> getCcDetailsByUserId(Long userId) throws Exception;
133
     List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> getCcDetailsByUserId(Long userId) throws Exception;
134
-    
134
+
135
     /**
135
     /**
136
      * 根据实例ID获取审批历史
136
      * 根据实例ID获取审批历史
137
-     * 
137
+     *
138
      * @param instanceId 审批实例ID
138
      * @param instanceId 审批实例ID
139
      * @return List<ApprovalHistory> 审批历史列表
139
      * @return List<ApprovalHistory> 审批历史列表
140
      * @throws Exception 查询失败时抛出异常
140
      * @throws Exception 查询失败时抛出异常
141
      */
141
      */
142
     List<com.sundot.airport.system.domain.approval.ApprovalHistory> getApprovalHistoryByInstanceId(Long instanceId) throws Exception;
142
     List<com.sundot.airport.system.domain.approval.ApprovalHistory> getApprovalHistoryByInstanceId(Long instanceId) throws Exception;
143
-    
143
+
144
     /**
144
     /**
145
      * 根据任务ID获取审批历史
145
      * 根据任务ID获取审批历史
146
-     * 
146
+     *
147
      * @param taskId 任务ID
147
      * @param taskId 任务ID
148
      * @return List<ApprovalHistory> 审批历史列表
148
      * @return List<ApprovalHistory> 审批历史列表
149
      * @throws Exception 查询失败时抛出异常
149
      * @throws Exception 查询失败时抛出异常
150
      */
150
      */
151
     List<com.sundot.airport.system.domain.approval.ApprovalHistory> getApprovalHistoryByTaskId(Long taskId) throws Exception;
151
     List<com.sundot.airport.system.domain.approval.ApprovalHistory> getApprovalHistoryByTaskId(Long taskId) throws Exception;
152
-    
152
+
153
     /**
153
     /**
154
      * 获取用户的审批历史记录
154
      * 获取用户的审批历史记录
155
-     * 
155
+     *
156
      * @param userId 用户ID
156
      * @param userId 用户ID
157
      * @param action 操作类型(可为空,如:SUBMIT, APPROVE, REJECT, CANCEL)
157
      * @param action 操作类型(可为空,如:SUBMIT, APPROVE, REJECT, CANCEL)
158
      * @return List<ApprovalHistory> 审批历史列表
158
      * @return List<ApprovalHistory> 审批历史列表
159
      * @throws Exception 查询失败时抛出异常
159
      * @throws Exception 查询失败时抛出异常
160
      */
160
      */
161
     List<com.sundot.airport.system.domain.approval.ApprovalHistory> getUserApprovalHistory(Long userId, String action) throws Exception;
161
     List<com.sundot.airport.system.domain.approval.ApprovalHistory> getUserApprovalHistory(Long userId, String action) throws Exception;
162
-    
162
+
163
     /**
163
     /**
164
      * 批量更新审批抄送已读状态
164
      * 批量更新审批抄送已读状态
165
-     * 
165
+     *
166
      * @param ids 需要更新的ID列表
166
      * @param ids 需要更新的ID列表
167
      * @return 影响行数
167
      * @return 影响行数
168
      * @throws Exception 更新失败时抛出异常
168
      * @throws Exception 更新失败时抛出异常

+ 164 - 191
airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/ApprovalEngineServiceImpl.java

@@ -29,42 +29,41 @@ import com.sundot.airport.system.mapper.SysUserMapper;
29
 
29
 
30
 /**
30
 /**
31
  * 审批流程引擎Service业务层处理
31
  * 审批流程引擎Service业务层处理
32
- * 
32
+ *
33
  * @author simon lin
33
  * @author simon lin
34
  * @date 2025-09-06
34
  * @date 2025-09-06
35
  */
35
  */
36
 @Service
36
 @Service
37
-public class ApprovalEngineServiceImpl implements IApprovalEngineService
38
-{
37
+public class ApprovalEngineServiceImpl implements IApprovalEngineService {
39
     private static final Logger logger = LoggerFactory.getLogger(ApprovalEngineServiceImpl.class);
38
     private static final Logger logger = LoggerFactory.getLogger(ApprovalEngineServiceImpl.class);
40
-    
39
+
41
     @Autowired
40
     @Autowired
42
     private ApprovalWorkflowDefinitionMapper workflowDefinitionMapper;
41
     private ApprovalWorkflowDefinitionMapper workflowDefinitionMapper;
43
-    
42
+
44
     @Autowired
43
     @Autowired
45
     private ApprovalNodeDefinitionMapper nodeDefinitionMapper;
44
     private ApprovalNodeDefinitionMapper nodeDefinitionMapper;
46
-    
45
+
47
     @Autowired
46
     @Autowired
48
     private ApprovalInstanceMapper instanceMapper;
47
     private ApprovalInstanceMapper instanceMapper;
49
-    
48
+
50
     @Autowired
49
     @Autowired
51
     private ApprovalTaskMapper taskMapper;
50
     private ApprovalTaskMapper taskMapper;
52
-    
51
+
53
     @Autowired
52
     @Autowired
54
     private ApprovalHistoryMapper historyMapper;
53
     private ApprovalHistoryMapper historyMapper;
55
-    
54
+
56
     @Autowired
55
     @Autowired
57
     private ApprovalCcMapper ccMapper;
56
     private ApprovalCcMapper ccMapper;
58
-    
57
+
59
     @Autowired
58
     @Autowired
60
     private SysUserMapper sysUserMapper;
59
     private SysUserMapper sysUserMapper;
61
-    
60
+
62
     @Autowired
61
     @Autowired
63
     private IApprovalUserService approvalUserService;
62
     private IApprovalUserService approvalUserService;
64
 
63
 
65
     @Autowired(required = false)
64
     @Autowired(required = false)
66
     private List<BusinessApprovalHandler> businessHandlers;
65
     private List<BusinessApprovalHandler> businessHandlers;
67
-    
66
+
68
     private ObjectMapper objectMapper = new ObjectMapper();
67
     private ObjectMapper objectMapper = new ObjectMapper();
69
 
68
 
70
     /**
69
     /**
@@ -72,10 +71,9 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
72
      */
71
      */
73
     @Override
72
     @Override
74
     @Transactional
73
     @Transactional
75
-    public ApprovalInstance startProcess(String workflowCode, String businessType, Long businessId, 
76
-                                       String title, Long submitterId, String submitterName, 
77
-                                       Map<String, Object> formData, Map<String, Object> businessData)
78
-    {
74
+    public ApprovalInstance startProcess(String workflowCode, String businessType, Long businessId,
75
+                                         String title, Long submitterId, String submitterName,
76
+                                         Map<String, Object> formData, Map<String, Object> businessData) {
79
         // 1. 查询流程定义
77
         // 1. 查询流程定义
80
         ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode(workflowCode);
78
         ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode(workflowCode);
81
         if (workflow == null) {
79
         if (workflow == null) {
@@ -94,17 +92,17 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
94
         instance.setSubmitTime(DateUtils.getNowDate());
92
         instance.setSubmitTime(DateUtils.getNowDate());
95
         instance.setStatus("RUNNING");
93
         instance.setStatus("RUNNING");
96
         instance.setUrgentLevel("NORMAL");
94
         instance.setUrgentLevel("NORMAL");
97
-        
95
+
98
         try {
96
         try {
99
             instance.setFormData(formData != null ? objectMapper.writeValueAsString(formData) : null);
97
             instance.setFormData(formData != null ? objectMapper.writeValueAsString(formData) : null);
100
             instance.setBusinessData(businessData != null ? objectMapper.writeValueAsString(businessData) : null);
98
             instance.setBusinessData(businessData != null ? objectMapper.writeValueAsString(businessData) : null);
101
         } catch (Exception e) {
99
         } catch (Exception e) {
102
             throw new RuntimeException("表单数据序列化失败", e);
100
             throw new RuntimeException("表单数据序列化失败", e);
103
         }
101
         }
104
-        
102
+
105
         instance.setCreateBy(SecurityUtils.getUsername());
103
         instance.setCreateBy(SecurityUtils.getUsername());
106
         instance.setCreateTime(DateUtils.getNowDate());
104
         instance.setCreateTime(DateUtils.getNowDate());
107
-        
105
+
108
         instanceMapper.insertApprovalInstance(instance);
106
         instanceMapper.insertApprovalInstance(instance);
109
 
107
 
110
         // 3. 获取第一个节点
108
         // 3. 获取第一个节点
@@ -112,7 +110,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
112
         if (firstNode != null) {
110
         if (firstNode != null) {
113
             instance.setCurrentNodeId(firstNode.getId());
111
             instance.setCurrentNodeId(firstNode.getId());
114
             instanceMapper.updateApprovalInstance(instance);
112
             instanceMapper.updateApprovalInstance(instance);
115
-            
113
+
116
             // 4. 创建第一个任务(如果不是开始节点)
114
             // 4. 创建第一个任务(如果不是开始节点)
117
             if (!"START".equals(firstNode.getNodeType())) {
115
             if (!"START".equals(firstNode.getNodeType())) {
118
                 createTasksForNode(instance, firstNode, formData, null);
116
                 createTasksForNode(instance, firstNode, formData, null);
@@ -135,8 +133,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
135
      */
133
      */
136
     @Override
134
     @Override
137
     @Transactional
135
     @Transactional
138
-    public boolean approveTask(Long taskId, Long operatorId, String operatorName, String comment, Map<String, Object> formData)
139
-    {
136
+    public boolean approveTask(Long taskId, Long operatorId, String operatorName, String comment, Map<String, Object> formData) {
140
         // 1. 查询任务
137
         // 1. 查询任务
141
         ApprovalTask task = taskMapper.selectApprovalTaskById(taskId);
138
         ApprovalTask task = taskMapper.selectApprovalTaskById(taskId);
142
         if (task == null || !"PENDING".equals(task.getStatus())) {
139
         if (task == null || !"PENDING".equals(task.getStatus())) {
@@ -167,7 +164,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
167
 
164
 
168
         // 5. 记录历史
165
         // 5. 记录历史
169
         recordHistory(instance.getId(), task.getId(), currentNode.getId(), currentNode.getNodeName(),
166
         recordHistory(instance.getId(), task.getId(), currentNode.getId(), currentNode.getNodeName(),
170
-                     "APPROVE", operatorId, operatorName, comment, formData);
167
+                "APPROVE", operatorId, operatorName, comment, formData);
171
 
168
 
172
         // 6. 流转到下一节点(传递当前任务引用)
169
         // 6. 流转到下一节点(传递当前任务引用)
173
         moveToNextNode(instance, currentNode, operatorId, operatorName, comment, formData, task);
170
         moveToNextNode(instance, currentNode, operatorId, operatorName, comment, formData, task);
@@ -180,8 +177,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
180
      */
177
      */
181
     @Override
178
     @Override
182
     @Transactional
179
     @Transactional
183
-    public boolean rejectTask(Long taskId, Long operatorId, String operatorName, String comment)
184
-    {
180
+    public boolean rejectTask(Long taskId, Long operatorId, String operatorName, String comment) {
185
         // 1. 查询任务
181
         // 1. 查询任务
186
         ApprovalTask task = taskMapper.selectApprovalTaskById(taskId);
182
         ApprovalTask task = taskMapper.selectApprovalTaskById(taskId);
187
         if (task == null || !"PENDING".equals(task.getStatus())) {
183
         if (task == null || !"PENDING".equals(task.getStatus())) {
@@ -226,7 +222,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
226
 
222
 
227
         // 6. 记录历史
223
         // 6. 记录历史
228
         recordHistory(instance.getId(), task.getId(), currentNode.getId(), currentNode.getNodeName(),
224
         recordHistory(instance.getId(), task.getId(), currentNode.getId(), currentNode.getNodeName(),
229
-                     "REJECT", operatorId, operatorName, comment, null);
225
+                "REJECT", operatorId, operatorName, comment, null);
230
 
226
 
231
         // 执行业务处理逻辑
227
         // 执行业务处理逻辑
232
         executeBusinessLogic(instance, "REJECTED");
228
         executeBusinessLogic(instance, "REJECTED");
@@ -241,7 +237,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
241
     public boolean approveTaskList(List<Long> ids) {
237
     public boolean approveTaskList(List<Long> ids) {
242
         //获取当前登陆人
238
         //获取当前登陆人
243
         SysUser user = sysUserMapper.selectUserById(SecurityUtils.getUserId());
239
         SysUser user = sysUserMapper.selectUserById(SecurityUtils.getUserId());
244
-        
240
+
245
         boolean allSuccess = true;
241
         boolean allSuccess = true;
246
         for (Long taskId : ids) {
242
         for (Long taskId : ids) {
247
             try {
243
             try {
@@ -277,8 +273,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
277
      */
273
      */
278
     @Override
274
     @Override
279
     @Transactional
275
     @Transactional
280
-    public boolean cancelProcess(Long instanceId, Long operatorId, String operatorName, String comment)
281
-    {
276
+    public boolean cancelProcess(Long instanceId, Long operatorId, String operatorName, String comment) {
282
         // 1. 查询实例
277
         // 1. 查询实例
283
         ApprovalInstance instance = instanceMapper.selectApprovalInstanceById(instanceId);
278
         ApprovalInstance instance = instanceMapper.selectApprovalInstanceById(instanceId);
284
         if (instance == null || !"RUNNING".equals(instance.getStatus())) {
279
         if (instance == null || !"RUNNING".equals(instance.getStatus())) {
@@ -295,7 +290,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
295
         // 3. 取消所有待办任务
290
         // 3. 取消所有待办任务
296
         List<ApprovalTask> pendingTasks = taskMapper.selectApprovalTaskByInstanceId(instanceId)
291
         List<ApprovalTask> pendingTasks = taskMapper.selectApprovalTaskByInstanceId(instanceId)
297
                 .stream().filter(task -> "PENDING".equals(task.getStatus())).collect(Collectors.toList());
292
                 .stream().filter(task -> "PENDING".equals(task.getStatus())).collect(Collectors.toList());
298
-        
293
+
299
         for (ApprovalTask task : pendingTasks) {
294
         for (ApprovalTask task : pendingTasks) {
300
             task.setStatus("CANCELLED");
295
             task.setStatus("CANCELLED");
301
             task.setCompleteTime(DateUtils.getNowDate());
296
             task.setCompleteTime(DateUtils.getNowDate());
@@ -315,8 +310,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
315
      * 获取用户待办任务列表
310
      * 获取用户待办任务列表
316
      */
311
      */
317
     @Override
312
     @Override
318
-    public List<ApprovalTask> getUserPendingTasks(Long userId)
319
-    {
313
+    public List<ApprovalTask> getUserPendingTasks(Long userId) {
320
         return taskMapper.selectApprovalTaskByAssignee(userId, "PENDING");
314
         return taskMapper.selectApprovalTaskByAssignee(userId, "PENDING");
321
     }
315
     }
322
 
316
 
@@ -324,8 +318,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
324
      * 获取用户已办任务列表
318
      * 获取用户已办任务列表
325
      */
319
      */
326
     @Override
320
     @Override
327
-    public List<ApprovalTask> getUserCompletedTasks(Long userId)
328
-    {
321
+    public List<ApprovalTask> getUserCompletedTasks(Long userId) {
329
         return taskMapper.selectApprovalTaskByAssignee(userId, null)
322
         return taskMapper.selectApprovalTaskByAssignee(userId, null)
330
                 .stream().filter(task -> !"PENDING".equals(task.getStatus())).collect(Collectors.toList());
323
                 .stream().filter(task -> !"PENDING".equals(task.getStatus())).collect(Collectors.toList());
331
     }
324
     }
@@ -334,8 +327,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
334
      * 获取用户发起的审批实例列表
327
      * 获取用户发起的审批实例列表
335
      */
328
      */
336
     @Override
329
     @Override
337
-    public List<ApprovalInstance> getUserSubmittedInstances(Long userId, String status)
338
-    {
330
+    public List<ApprovalInstance> getUserSubmittedInstances(Long userId, String status) {
339
         return instanceMapper.selectApprovalInstanceBySubmitter(userId, status);
331
         return instanceMapper.selectApprovalInstanceBySubmitter(userId, status);
340
     }
332
     }
341
 
333
 
@@ -343,8 +335,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
343
      * 根据业务类型和级别获取对应的流程代码
335
      * 根据业务类型和级别获取对应的流程代码
344
      */
336
      */
345
     @Override
337
     @Override
346
-    public String getWorkflowCodeByBusinessAndLevel(String businessType, String level, String submitterRole)
347
-    {
338
+    public String getWorkflowCodeByBusinessAndLevel(String businessType, String level, String submitterRole) {
348
         if ("SEIZURE_REPORT".equals(businessType)) {
339
         if ("SEIZURE_REPORT".equals(businessType)) {
349
             if ("SEIZURE_REPORT_LEADER".equals(submitterRole)) {
340
             if ("SEIZURE_REPORT_LEADER".equals(submitterRole)) {
350
                 return "SEIZURE_REPORT_LEADER";
341
                 return "SEIZURE_REPORT_LEADER";
@@ -352,7 +343,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
352
                 return "SEIZURE_REPORT_STAFF";
343
                 return "SEIZURE_REPORT_STAFF";
353
             }
344
             }
354
         }
345
         }
355
-        
346
+
356
         switch (level) {
347
         switch (level) {
357
             case "PERSONAL":
348
             case "PERSONAL":
358
                 return "PERSONAL_LEVEL";
349
                 return "PERSONAL_LEVEL";
@@ -371,22 +362,21 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
371
     @Override
362
     @Override
372
     @Transactional
363
     @Transactional
373
     public ApprovalInstance startPersonalLevelProcess(String businessType, Long businessId, String title,
364
     public ApprovalInstance startPersonalLevelProcess(String businessType, Long businessId, String title,
374
-                                                    Long submitterId, String submitterName, Long sectionLeaderId,
375
-                                                    Map<String, Object> formData, Map<String, Object> businessData)
376
-    {
365
+                                                      Long submitterId, String submitterName, Long sectionLeaderId,
366
+                                                      Map<String, Object> formData, Map<String, Object> businessData) {
377
         // 新的个人级别流程:组长发起 → 科长审批 → 问题人整改 → 发起人审批 → 完成
367
         // 新的个人级别流程:组长发起 → 科长审批 → 问题人整改 → 发起人审批 → 完成
378
-        ApprovalInstance instance = startProcess("PERSONAL_LEVEL", businessType, businessId, title, 
379
-                                                submitterId, submitterName, formData, businessData);
380
-        
368
+        ApprovalInstance instance = startProcess("PERSONAL_LEVEL", businessType, businessId, title,
369
+                submitterId, submitterName, formData, businessData);
370
+
381
         // 获取第一个审批节点(科长审批节点)
371
         // 获取第一个审批节点(科长审批节点)
382
         ApprovalNodeDefinition firstApprovalNode = nodeDefinitionMapper.selectNextNodeByOrder(
372
         ApprovalNodeDefinition firstApprovalNode = nodeDefinitionMapper.selectNextNodeByOrder(
383
                 instance.getWorkflowId(), 1); // 获取排序为2的节点(科长审批)
373
                 instance.getWorkflowId(), 1); // 获取排序为2的节点(科长审批)
384
-        
374
+
385
         if (firstApprovalNode != null) {
375
         if (firstApprovalNode != null) {
386
             // 更新实例当前节点为科长审批节点
376
             // 更新实例当前节点为科长审批节点
387
             instance.setCurrentNodeId(firstApprovalNode.getId());
377
             instance.setCurrentNodeId(firstApprovalNode.getId());
388
             instanceMapper.updateApprovalInstance(instance);
378
             instanceMapper.updateApprovalInstance(instance);
389
-            
379
+
390
             // 创建科长审批任务
380
             // 创建科长审批任务
391
             SysUser sectionLeader = sysUserMapper.selectUserById(sectionLeaderId);
381
             SysUser sectionLeader = sysUserMapper.selectUserById(sectionLeaderId);
392
             if (sectionLeader != null) {
382
             if (sectionLeader != null) {
@@ -397,7 +387,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
397
         } else {
387
         } else {
398
             throw new RuntimeException("无法找到科长审批节点");
388
             throw new RuntimeException("无法找到科长审批节点");
399
         }
389
         }
400
-        
390
+
401
         return instance;
391
         return instance;
402
     }
392
     }
403
 
393
 
@@ -407,9 +397,8 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
407
     @Override
397
     @Override
408
     @Transactional
398
     @Transactional
409
     public ApprovalInstance startSectionLevelProcess(String businessType, Long businessId, String title,
399
     public ApprovalInstance startSectionLevelProcess(String businessType, Long businessId, String title,
410
-                                                   Long submitterId, String submitterName, Long sectionLeaderId,
411
-                                                   Map<String, Object> formData, Map<String, Object> businessData)
412
-    {
400
+                                                     Long submitterId, String submitterName, Long sectionLeaderId,
401
+                                                     Map<String, Object> formData, Map<String, Object> businessData) {
413
         ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode("SECTION_LEVEL");
402
         ApprovalWorkflowDefinition workflow = workflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode("SECTION_LEVEL");
414
         if (workflow == null) {
403
         if (workflow == null) {
415
             throw new RuntimeException("流程定义不存在: SECTION_LEVEL");
404
             throw new RuntimeException("流程定义不存在: SECTION_LEVEL");
@@ -425,29 +414,29 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
425
         instance.setSubmitterName(submitterName);
414
         instance.setSubmitterName(submitterName);
426
         instance.setSubmitTime(DateUtils.getNowDate());
415
         instance.setSubmitTime(DateUtils.getNowDate());
427
         instance.setStatus("RUNNING");
416
         instance.setStatus("RUNNING");
428
-        
417
+
429
         try {
418
         try {
430
             instance.setFormData(formData != null ? objectMapper.writeValueAsString(formData) : null);
419
             instance.setFormData(formData != null ? objectMapper.writeValueAsString(formData) : null);
431
         } catch (Exception e) {
420
         } catch (Exception e) {
432
             throw new RuntimeException("表单数据序列化失败", e);
421
             throw new RuntimeException("表单数据序列化失败", e);
433
         }
422
         }
434
-        
423
+
435
         // 扩展业务数据,添加科长ID和发起人ID用于后续流程
424
         // 扩展业务数据,添加科长ID和发起人ID用于后续流程
436
         if (businessData == null) {
425
         if (businessData == null) {
437
             businessData = new HashMap<>();
426
             businessData = new HashMap<>();
438
         }
427
         }
439
         businessData.put("sectionLeaderId", sectionLeaderId);
428
         businessData.put("sectionLeaderId", sectionLeaderId);
440
         businessData.put("initiatorId", submitterId);
429
         businessData.put("initiatorId", submitterId);
441
-        
430
+
442
         try {
431
         try {
443
             instance.setBusinessData(objectMapper.writeValueAsString(businessData));
432
             instance.setBusinessData(objectMapper.writeValueAsString(businessData));
444
         } catch (Exception e) {
433
         } catch (Exception e) {
445
             throw new RuntimeException("业务数据序列化失败", e);
434
             throw new RuntimeException("业务数据序列化失败", e);
446
         }
435
         }
447
-        
436
+
448
         instance.setCreateBy(SecurityUtils.getUsername());
437
         instance.setCreateBy(SecurityUtils.getUsername());
449
         instance.setCreateTime(DateUtils.getNowDate());
438
         instance.setCreateTime(DateUtils.getNowDate());
450
-        
439
+
451
         instanceMapper.insertApprovalInstance(instance);
440
         instanceMapper.insertApprovalInstance(instance);
452
 
441
 
453
         // 获取第一个节点
442
         // 获取第一个节点
@@ -455,7 +444,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
455
         if (firstNode != null) {
444
         if (firstNode != null) {
456
             instance.setCurrentNodeId(firstNode.getId());
445
             instance.setCurrentNodeId(firstNode.getId());
457
             instanceMapper.updateApprovalInstance(instance);
446
             instanceMapper.updateApprovalInstance(instance);
458
-            
447
+
459
             // 如果是开始节点,直接流转到下一个节点(科长审批)
448
             // 如果是开始节点,直接流转到下一个节点(科长审批)
460
             if ("START".equals(firstNode.getNodeType())) {
449
             if ("START".equals(firstNode.getNodeType())) {
461
                 moveToNextNode(instance, firstNode, submitterId, submitterName, "提交", formData, null);
450
                 moveToNextNode(instance, firstNode, submitterId, submitterName, "提交", formData, null);
@@ -474,11 +463,10 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
474
     @Override
463
     @Override
475
     @Transactional
464
     @Transactional
476
     public ApprovalInstance startGroupLevelProcess(String businessType, Long businessId, String title,
465
     public ApprovalInstance startGroupLevelProcess(String businessType, Long businessId, String title,
477
-                                                 Long submitterId, String submitterName,
478
-                                                 Map<String, Object> formData, Map<String, Object> businessData)
479
-    {
480
-        return startProcess("GROUP_LEVEL", businessType, businessId, title, 
481
-                          submitterId, submitterName, formData, businessData);
466
+                                                   Long submitterId, String submitterName,
467
+                                                   Map<String, Object> formData, Map<String, Object> businessData) {
468
+        return startProcess("GROUP_LEVEL", businessType, businessId, title,
469
+                submitterId, submitterName, formData, businessData);
482
     }
470
     }
483
 
471
 
484
     /**
472
     /**
@@ -487,19 +475,17 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
487
     @Override
475
     @Override
488
     @Transactional
476
     @Transactional
489
     public ApprovalInstance startSeizureReportProcess(String businessType, Long businessId, String title,
477
     public ApprovalInstance startSeizureReportProcess(String businessType, Long businessId, String title,
490
-                                                     Long submitterId, String submitterName, String submitterRole,
491
-                                                     Map<String, Object> formData, Map<String, Object> businessData)
492
-    {
478
+                                                      Long submitterId, String submitterName, String submitterRole,
479
+                                                      Map<String, Object> formData, Map<String, Object> businessData) {
493
         String workflowCode = getWorkflowCodeByBusinessAndLevel(businessType, null, submitterRole);
480
         String workflowCode = getWorkflowCodeByBusinessAndLevel(businessType, null, submitterRole);
494
-        return startProcess(workflowCode, businessType, businessId, title, 
495
-                          submitterId, submitterName, formData, businessData);
481
+        return startProcess(workflowCode, businessType, businessId, title,
482
+                submitterId, submitterName, formData, businessData);
496
     }
483
     }
497
 
484
 
498
     /**
485
     /**
499
      * 为节点创建任务
486
      * 为节点创建任务
500
      */
487
      */
501
-    private void createTasksForNode(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark)
502
-    {
488
+    private void createTasksForNode(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark) {
503
         // 根据审批人类型获取审批人列表
489
         // 根据审批人类型获取审批人列表
504
         List<Long> assigneeIds = getAssigneeIds(node, instance);
490
         List<Long> assigneeIds = getAssigneeIds(node, instance);
505
 
491
 
@@ -543,12 +529,11 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
543
             }
529
             }
544
         }
530
         }
545
     }
531
     }
546
-    
532
+
547
     /**
533
     /**
548
      * 为节点创建任务(支持动态分配)
534
      * 为节点创建任务(支持动态分配)
549
      */
535
      */
550
-    private void createTasksForNodeWithDynamicAssignment(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark)
551
-    {
536
+    private void createTasksForNodeWithDynamicAssignment(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark) {
552
         // 使用带表单数据的获取审批人方法
537
         // 使用带表单数据的获取审批人方法
553
         List<Long> assigneeIds = getAssigneeIds(node, instance, formData);
538
         List<Long> assigneeIds = getAssigneeIds(node, instance, formData);
554
 
539
 
@@ -596,8 +581,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
596
     /**
581
     /**
597
      * 创建通知任务
582
      * 创建通知任务
598
      */
583
      */
599
-    private void createNotificationTask(ApprovalInstance instance, Long userId, String userName, String taskName)
600
-    {
584
+    private void createNotificationTask(ApprovalInstance instance, Long userId, String userName, String taskName) {
601
         ApprovalTask task = new ApprovalTask();
585
         ApprovalTask task = new ApprovalTask();
602
         task.setTaskNo(taskMapper.generateTaskNo());
586
         task.setTaskNo(taskMapper.generateTaskNo());
603
         task.setInstanceId(instance.getId());
587
         task.setInstanceId(instance.getId());
@@ -607,17 +591,17 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
607
         task.setAssigneeName(userName);
591
         task.setAssigneeName(userName);
608
         task.setAssignTime(DateUtils.getNowDate());
592
         task.setAssignTime(DateUtils.getNowDate());
609
         task.setStatus("PENDING");
593
         task.setStatus("PENDING");
610
-        
594
+
611
         // 设置备注(通知任务的默认备注)
595
         // 设置备注(通知任务的默认备注)
612
         task.setRemark("系统自动分配的通知任务");
596
         task.setRemark("系统自动分配的通知任务");
613
-        
597
+
614
         // 通知任务可以不设置formData,或者使用实例的formData
598
         // 通知任务可以不设置formData,或者使用实例的formData
615
         task.setFormData(instance.getFormData());
599
         task.setFormData(instance.getFormData());
616
-        
600
+
617
         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 24)); // 24小时超时
601
         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 24)); // 24小时超时
618
         task.setCreateBy(SecurityUtils.getUsername());
602
         task.setCreateBy(SecurityUtils.getUsername());
619
         task.setCreateTime(DateUtils.getNowDate());
603
         task.setCreateTime(DateUtils.getNowDate());
620
-        
604
+
621
         taskMapper.insertApprovalTask(task);
605
         taskMapper.insertApprovalTask(task);
622
     }
606
     }
623
 
607
 
@@ -639,7 +623,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
639
         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 48)); // 48小时超时
623
         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 48)); // 48小时超时
640
         task.setCreateBy(SecurityUtils.getUsername());
624
         task.setCreateBy(SecurityUtils.getUsername());
641
         task.setCreateTime(DateUtils.getNowDate());
625
         task.setCreateTime(DateUtils.getNowDate());
642
-        
626
+
643
         taskMapper.insertApprovalTask(task);
627
         taskMapper.insertApprovalTask(task);
644
     }
628
     }
645
 
629
 
@@ -661,27 +645,26 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
661
         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 48)); // 48小时超时
645
         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 48)); // 48小时超时
662
         task.setCreateBy(SecurityUtils.getUsername());
646
         task.setCreateBy(SecurityUtils.getUsername());
663
         task.setCreateTime(DateUtils.getNowDate());
647
         task.setCreateTime(DateUtils.getNowDate());
664
-        
648
+
665
         taskMapper.insertApprovalTask(task);
649
         taskMapper.insertApprovalTask(task);
666
     }
650
     }
667
 
651
 
668
     /**
652
     /**
669
      * 流转到下一节点
653
      * 流转到下一节点
670
      */
654
      */
671
-    private void moveToNextNode(ApprovalInstance instance, ApprovalNodeDefinition currentNode, 
672
-                               Long operatorId, String operatorName, String comment, Map<String, Object> formData, ApprovalTask currentTask)
673
-    {
655
+    private void moveToNextNode(ApprovalInstance instance, ApprovalNodeDefinition currentNode,
656
+                                Long operatorId, String operatorName, String comment, Map<String, Object> formData, ApprovalTask currentTask) {
674
         // 查找下一个节点
657
         // 查找下一个节点
675
         ApprovalNodeDefinition nextNode = nodeDefinitionMapper.selectNextNodeByOrder(
658
         ApprovalNodeDefinition nextNode = nodeDefinitionMapper.selectNextNodeByOrder(
676
                 instance.getWorkflowId(), currentNode.getSortOrder());
659
                 instance.getWorkflowId(), currentNode.getSortOrder());
677
-        
660
+
678
         if (nextNode != null) {
661
         if (nextNode != null) {
679
             // 更新实例当前节点
662
             // 更新实例当前节点
680
             instance.setCurrentNodeId(nextNode.getId());
663
             instance.setCurrentNodeId(nextNode.getId());
681
             instance.setUpdateBy(SecurityUtils.getUsername());
664
             instance.setUpdateBy(SecurityUtils.getUsername());
682
             instance.setUpdateTime(DateUtils.getNowDate());
665
             instance.setUpdateTime(DateUtils.getNowDate());
683
             instanceMapper.updateApprovalInstance(instance);
666
             instanceMapper.updateApprovalInstance(instance);
684
-            
667
+
685
             if ("END".equals(nextNode.getNodeType())) {
668
             if ("END".equals(nextNode.getNodeType())) {
686
                 // 结束节点,完成流程
669
                 // 结束节点,完成流程
687
                 completeProcess(instance, operatorId, operatorName);
670
                 completeProcess(instance, operatorId, operatorName);
@@ -696,14 +679,13 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
696
                 }
679
                 }
697
                 // 检查下一节点是否需要动态分配
680
                 // 检查下一节点是否需要动态分配
698
                 else if (isSeizureReportWorkflow(instance) && ("GROUP_LEADER".equals(nextNode.getApproverType()) || "SECTION_LEADER".equals(nextNode.getApproverType()))) {
681
                 else if (isSeizureReportWorkflow(instance) && ("GROUP_LEADER".equals(nextNode.getApproverType()) || "SECTION_LEADER".equals(nextNode.getApproverType()))) {
699
-                    Long submitterId=instance.getSubmitterId();
700
-                    if("SECTION_LEADER".equals(nextNode.getApproverType()) && ObjectUtil.isNotEmpty(currentTask) && ObjectUtil.isNotEmpty(currentTask.getAssigneeId())){
701
-                        submitterId=currentTask.getAssigneeId();
682
+                    Long submitterId = instance.getSubmitterId();
683
+                    if ("SECTION_LEADER".equals(nextNode.getApproverType()) && ObjectUtil.isNotEmpty(currentTask) && ObjectUtil.isNotEmpty(currentTask.getAssigneeId())) {
684
+                        submitterId = currentTask.getAssigneeId();
702
                     }
685
                     }
703
                     // 违禁品审批流程:根据提交人角色分配给其直接上级
686
                     // 违禁品审批流程:根据提交人角色分配给其直接上级
704
-                    createTasksForNodeWithDirectSuperior(instance, nextNode, formData, null,submitterId);
705
-                }
706
-                else if ("GROUP_LEADER".equals(nextNode.getApproverType()) && formData != null && formData.containsKey("targetGroupId")) {
687
+                    createTasksForNodeWithDirectSuperior(instance, nextNode, formData, null, submitterId);
688
+                } else if ("GROUP_LEADER".equals(nextNode.getApproverType()) && formData != null && formData.containsKey("targetGroupId")) {
707
                     // 科长审批后,分配给指定班组的班组长
689
                     // 科长审批后,分配给指定班组的班组长
708
                     createTasksForNodeWithDynamicAssignment(instance, nextNode, formData, null);
690
                     createTasksForNodeWithDynamicAssignment(instance, nextNode, formData, null);
709
                 } else if ("GROUP_LEADER".equals(nextNode.getApproverType()) && instance.getBusinessData() != null) {
691
                 } else if ("GROUP_LEADER".equals(nextNode.getApproverType()) && instance.getBusinessData() != null) {
@@ -716,8 +698,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
716
                 } else if ("DEPT_SECTION_LEADER".equals(nextNode.getApproverType())) {
698
                 } else if ("DEPT_SECTION_LEADER".equals(nextNode.getApproverType())) {
717
                     // 科长复查完成后,分配给指定部门(如质检科)的科长
699
                     // 科长复查完成后,分配给指定部门(如质检科)的科长
718
                     createTasksForNodeWithDeptSectionLeader(instance, nextNode, formData, null);
700
                     createTasksForNodeWithDeptSectionLeader(instance, nextNode, formData, null);
719
-                }
720
-                 else {
701
+                } else {
721
                     // 使用默认分配逻辑
702
                     // 使用默认分配逻辑
722
                     createTasksForNode(instance, nextNode, formData, null);
703
                     createTasksForNode(instance, nextNode, formData, null);
723
                 }
704
                 }
@@ -731,20 +712,22 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
731
     /**
712
     /**
732
      * 完成流程
713
      * 完成流程
733
      */
714
      */
734
-    private void completeProcess(ApprovalInstance instance, Long operatorId, String operatorName)
735
-    {
715
+    private void completeProcess(ApprovalInstance instance, Long operatorId, String operatorName) {
736
         instance.setStatus("COMPLETED");
716
         instance.setStatus("COMPLETED");
737
         instance.setCompletionTime(DateUtils.getNowDate());
717
         instance.setCompletionTime(DateUtils.getNowDate());
738
         instance.setCurrentNodeId(null);
718
         instance.setCurrentNodeId(null);
739
         instance.setUpdateBy(SecurityUtils.getUsername());
719
         instance.setUpdateBy(SecurityUtils.getUsername());
740
         instance.setUpdateTime(DateUtils.getNowDate());
720
         instance.setUpdateTime(DateUtils.getNowDate());
741
         instanceMapper.updateApprovalInstance(instance);
721
         instanceMapper.updateApprovalInstance(instance);
742
-        
722
+
743
         // 记录完成历史
723
         // 记录完成历史
744
         recordHistory(instance.getId(), null, null, null, "COMPLETE", operatorId, operatorName, "流程完成", null);
724
         recordHistory(instance.getId(), null, null, null, "COMPLETE", operatorId, operatorName, "流程完成", null);
745
 
725
 
746
         // 创建抄送记录
726
         // 创建抄送记录
747
-         if(!"SEIZURE_REPORT".equals(instance.getBusinessType())){ createCcRecords(instance);} ;
727
+        if (!"SEIZURE_REPORT".equals(instance.getBusinessType())) {
728
+            createCcRecords(instance);
729
+        }
730
+        ;
748
 
731
 
749
         // 执行业务处理逻辑
732
         // 执行业务处理逻辑
750
         executeBusinessLogic(instance, "APPROVED");
733
         executeBusinessLogic(instance, "APPROVED");
@@ -752,7 +735,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
752
 
735
 
753
     /**
736
     /**
754
      * 添加业务处理方法
737
      * 添加业务处理方法
755
-      */
738
+     */
756
     private void executeBusinessLogic(ApprovalInstance instance, String action) {
739
     private void executeBusinessLogic(ApprovalInstance instance, String action) {
757
         if (businessHandlers == null || businessHandlers.isEmpty()) {
740
         if (businessHandlers == null || businessHandlers.isEmpty()) {
758
             return;
741
             return;
@@ -782,8 +765,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
782
      * 记录历史
765
      * 记录历史
783
      */
766
      */
784
     private void recordHistory(Long instanceId, Long taskId, Long nodeId, String nodeName, String action,
767
     private void recordHistory(Long instanceId, Long taskId, Long nodeId, String nodeName, String action,
785
-                             Long operatorId, String operatorName, String comment, Map<String, Object> formData)
786
-    {
768
+                               Long operatorId, String operatorName, String comment, Map<String, Object> formData) {
787
         // 通过operatorId查询用户真实姓名
769
         // 通过operatorId查询用户真实姓名
788
         String realOperatorName = operatorName;
770
         String realOperatorName = operatorName;
789
         if (operatorId != null) {
771
         if (operatorId != null) {
@@ -792,7 +774,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
792
                 realOperatorName = operator.getNickName();
774
                 realOperatorName = operator.getNickName();
793
             }
775
             }
794
         }
776
         }
795
-        
777
+
796
         ApprovalHistory history = new ApprovalHistory();
778
         ApprovalHistory history = new ApprovalHistory();
797
         history.setInstanceId(instanceId);
779
         history.setInstanceId(instanceId);
798
         history.setTaskId(taskId);
780
         history.setTaskId(taskId);
@@ -803,33 +785,31 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
803
         history.setOperatorName(realOperatorName);
785
         history.setOperatorName(realOperatorName);
804
         history.setOperationTime(DateUtils.getNowDate());
786
         history.setOperationTime(DateUtils.getNowDate());
805
         history.setComment(comment);
787
         history.setComment(comment);
806
-        
788
+
807
         try {
789
         try {
808
             history.setFormData(formData != null ? objectMapper.writeValueAsString(formData) : null);
790
             history.setFormData(formData != null ? objectMapper.writeValueAsString(formData) : null);
809
         } catch (Exception e) {
791
         } catch (Exception e) {
810
             // 忽略序列化错误
792
             // 忽略序列化错误
811
         }
793
         }
812
-        
794
+
813
         history.setCreateBy(SecurityUtils.getUsername());
795
         history.setCreateBy(SecurityUtils.getUsername());
814
         history.setCreateTime(DateUtils.getNowDate());
796
         history.setCreateTime(DateUtils.getNowDate());
815
-        
797
+
816
         historyMapper.insertApprovalHistory(history);
798
         historyMapper.insertApprovalHistory(history);
817
     }
799
     }
818
 
800
 
819
     /**
801
     /**
820
      * 根据节点配置获取审批人ID列表
802
      * 根据节点配置获取审批人ID列表
821
      */
803
      */
822
-    private List<Long> getAssigneeIds(ApprovalNodeDefinition node, ApprovalInstance instance)
823
-    {
804
+    private List<Long> getAssigneeIds(ApprovalNodeDefinition node, ApprovalInstance instance) {
824
         String businessData = instance.getBusinessData();
805
         String businessData = instance.getBusinessData();
825
         return approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessData);
806
         return approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessData);
826
     }
807
     }
827
-    
808
+
828
     /**
809
     /**
829
      * 根据节点配置和表单数据获取审批人ID列表(用于流转时的动态分配)
810
      * 根据节点配置和表单数据获取审批人ID列表(用于流转时的动态分配)
830
      */
811
      */
831
-    private List<Long> getAssigneeIds(ApprovalNodeDefinition node, ApprovalInstance instance, Map<String, Object> formData)
832
-    {
812
+    private List<Long> getAssigneeIds(ApprovalNodeDefinition node, ApprovalInstance instance, Map<String, Object> formData) {
833
         // 优先使用表单数据(包含targetGroupId等动态信息)
813
         // 优先使用表单数据(包含targetGroupId等动态信息)
834
         String dynamicData = null;
814
         String dynamicData = null;
835
         if (formData != null) {
815
         if (formData != null) {
@@ -839,29 +819,28 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
839
                 // 忽略序列化错误,使用业务数据
819
                 // 忽略序列化错误,使用业务数据
840
             }
820
             }
841
         }
821
         }
842
-        
822
+
843
         // 如果没有表单数据或序列化失败,使用原始业务数据
823
         // 如果没有表单数据或序列化失败,使用原始业务数据
844
         String businessData = dynamicData != null ? dynamicData : instance.getBusinessData();
824
         String businessData = dynamicData != null ? dynamicData : instance.getBusinessData();
845
         return approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessData);
825
         return approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessData);
846
     }
826
     }
847
-    
827
+
848
     /**
828
     /**
849
      * 为节点创建任务(回流给原始操作者)
829
      * 为节点创建任务(回流给原始操作者)
850
      */
830
      */
851
-    private void createTasksForNodeWithOriginalOperator(ApprovalInstance instance, ApprovalNodeDefinition node, 
852
-                                                       Map<String, Object> formData, ApprovalTask currentTask, String remark)
853
-    {
831
+    private void createTasksForNodeWithOriginalOperator(ApprovalInstance instance, ApprovalNodeDefinition node,
832
+                                                        Map<String, Object> formData, ApprovalTask currentTask, String remark) {
854
         // 创建包含当前taskId的业务数据
833
         // 创建包含当前taskId的业务数据
855
         Map<String, Object> businessDataWithTaskId = new HashMap<>();
834
         Map<String, Object> businessDataWithTaskId = new HashMap<>();
856
         if (currentTask != null) {
835
         if (currentTask != null) {
857
             businessDataWithTaskId.put("taskId", currentTask.getId());
836
             businessDataWithTaskId.put("taskId", currentTask.getId());
858
         }
837
         }
859
-        
838
+
860
         // 使用包含taskId的业务数据获取原始操作者
839
         // 使用包含taskId的业务数据获取原始操作者
861
         try {
840
         try {
862
             String businessDataStr = objectMapper.writeValueAsString(businessDataWithTaskId);
841
             String businessDataStr = objectMapper.writeValueAsString(businessDataWithTaskId);
863
             List<Long> assigneeIds = approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessDataStr);
842
             List<Long> assigneeIds = approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessDataStr);
864
-            
843
+
865
             for (Long assigneeId : assigneeIds) {
844
             for (Long assigneeId : assigneeIds) {
866
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
845
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
867
                 if (user != null) {
846
                 if (user != null) {
@@ -905,35 +884,33 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
905
             throw new RuntimeException("创建原始操作者任务失败", e);
884
             throw new RuntimeException("创建原始操作者任务失败", e);
906
         }
885
         }
907
     }
886
     }
908
-    
887
+
909
     /**
888
     /**
910
      * 获取当前实例的活跃任务
889
      * 获取当前实例的活跃任务
911
      */
890
      */
912
-    private ApprovalTask getCurrentTask(ApprovalInstance instance)
913
-    {
891
+    private ApprovalTask getCurrentTask(ApprovalInstance instance) {
914
         if (instance.getCurrentNodeId() != null) {
892
         if (instance.getCurrentNodeId() != null) {
915
             List<ApprovalTask> tasks = taskMapper.selectApprovalTaskByInstanceId(instance.getId());
893
             List<ApprovalTask> tasks = taskMapper.selectApprovalTaskByInstanceId(instance.getId());
916
             return tasks.stream()
894
             return tasks.stream()
917
-                   .filter(task -> task.getNodeId().equals(instance.getCurrentNodeId()) && "PENDING".equals(task.getStatus()))
918
-                   .findFirst()
919
-                   .orElse(null);
895
+                    .filter(task -> task.getNodeId().equals(instance.getCurrentNodeId()) && "PENDING".equals(task.getStatus()))
896
+                    .findFirst()
897
+                    .orElse(null);
920
         }
898
         }
921
         return null;
899
         return null;
922
     }
900
     }
923
-    
901
+
924
     /**
902
     /**
925
      * 为指定部门科长节点创建任务(质检科长审批)
903
      * 为指定部门科长节点创建任务(质检科长审批)
926
      */
904
      */
927
-    private void createTasksForNodeWithDeptSectionLeader(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark)
928
-    {
905
+    private void createTasksForNodeWithDeptSectionLeader(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark) {
929
         // 创建包含质检科ID的业务数据
906
         // 创建包含质检科ID的业务数据
930
         Map<String, Object> businessDataWithDeptId = new HashMap<>();
907
         Map<String, Object> businessDataWithDeptId = new HashMap<>();
931
         businessDataWithDeptId.put("deptId", 289); // 质检科ID
908
         businessDataWithDeptId.put("deptId", 289); // 质检科ID
932
-        
909
+
933
         try {
910
         try {
934
             String businessDataStr = objectMapper.writeValueAsString(businessDataWithDeptId);
911
             String businessDataStr = objectMapper.writeValueAsString(businessDataWithDeptId);
935
             List<Long> assigneeIds = approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessDataStr);
912
             List<Long> assigneeIds = approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), businessDataStr);
936
-            
913
+
937
             for (Long assigneeId : assigneeIds) {
914
             for (Long assigneeId : assigneeIds) {
938
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
915
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
939
                 if (user != null) {
916
                 if (user != null) {
@@ -977,22 +954,21 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
977
             throw new RuntimeException("创建质检科长任务失败", e);
954
             throw new RuntimeException("创建质检科长任务失败", e);
978
         }
955
         }
979
     }
956
     }
980
-    
957
+
981
     /**
958
     /**
982
      * 创建驳回回流任务
959
      * 创建驳回回流任务
983
      */
960
      */
984
-    private void createBackflowTask(ApprovalInstance instance, ApprovalNodeDefinition currentNode, 
985
-                                   Long originalUserId, String rejectComment, String rejectOperatorName)
986
-    {
961
+    private void createBackflowTask(ApprovalInstance instance, ApprovalNodeDefinition currentNode,
962
+                                    Long originalUserId, String rejectComment, String rejectOperatorName) {
987
         SysUser originalUser = sysUserMapper.selectUserById(originalUserId);
963
         SysUser originalUser = sysUserMapper.selectUserById(originalUserId);
988
         if (originalUser != null) {
964
         if (originalUser != null) {
989
             // 查找上一个节点
965
             // 查找上一个节点
990
             ApprovalNodeDefinition previousNode = nodeDefinitionMapper.selectPreviousNodeByOrder(
966
             ApprovalNodeDefinition previousNode = nodeDefinitionMapper.selectPreviousNodeByOrder(
991
-                instance.getWorkflowId(), currentNode.getSortOrder());
992
-            
967
+                    instance.getWorkflowId(), currentNode.getSortOrder());
968
+
993
             // 如果没有上一个节点,则使用当前节点(兼容处理)
969
             // 如果没有上一个节点,则使用当前节点(兼容处理)
994
             ApprovalNodeDefinition targetNode = previousNode != null ? previousNode : currentNode;
970
             ApprovalNodeDefinition targetNode = previousNode != null ? previousNode : currentNode;
995
-            
971
+
996
             ApprovalTask backflowTask = new ApprovalTask();
972
             ApprovalTask backflowTask = new ApprovalTask();
997
             backflowTask.setTaskNo(taskMapper.generateTaskNo());
973
             backflowTask.setTaskNo(taskMapper.generateTaskNo());
998
             backflowTask.setInstanceId(instance.getId());
974
             backflowTask.setInstanceId(instance.getId());
@@ -1002,37 +978,36 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1002
             backflowTask.setAssigneeName(originalUser.getNickName());
978
             backflowTask.setAssigneeName(originalUser.getNickName());
1003
             backflowTask.setAssignTime(DateUtils.getNowDate());
979
             backflowTask.setAssignTime(DateUtils.getNowDate());
1004
             backflowTask.setStatus("PENDING");
980
             backflowTask.setStatus("PENDING");
1005
-            
981
+
1006
             // 在任务备注中记录驳回信息
982
             // 在任务备注中记录驳回信息
1007
             backflowTask.setRemark("任务被" + rejectOperatorName + "驳回,驳回原因:" + rejectComment);
983
             backflowTask.setRemark("任务被" + rejectOperatorName + "驳回,驳回原因:" + rejectComment);
1008
-            
984
+
1009
             // 驳回回流任务使用实例的formData
985
             // 驳回回流任务使用实例的formData
1010
             backflowTask.setFormData(instance.getFormData());
986
             backflowTask.setFormData(instance.getFormData());
1011
-            
987
+
1012
             // 设置超时时间(默认48小时)
988
             // 设置超时时间(默认48小时)
1013
             backflowTask.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 48));
989
             backflowTask.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), 48));
1014
-            
990
+
1015
             backflowTask.setCreateBy(SecurityUtils.getUsername());
991
             backflowTask.setCreateBy(SecurityUtils.getUsername());
1016
             backflowTask.setCreateTime(DateUtils.getNowDate());
992
             backflowTask.setCreateTime(DateUtils.getNowDate());
1017
-            
993
+
1018
             taskMapper.insertApprovalTask(backflowTask);
994
             taskMapper.insertApprovalTask(backflowTask);
1019
-            
995
+
1020
             // 记录回流历史
996
             // 记录回流历史
1021
 //            recordHistory(instance.getId(), backflowTask.getId(), targetNode.getId(), targetNode.getNodeName(),
997
 //            recordHistory(instance.getId(), backflowTask.getId(), targetNode.getId(), targetNode.getNodeName(),
1022
 //                         "BACKFLOW", originalUserId, originalUser.getNickName(),
998
 //                         "BACKFLOW", originalUserId, originalUser.getNickName(),
1023
 //                         "驳回回流,需要重新处理。驳回原因:" + rejectComment, null);
999
 //                         "驳回回流,需要重新处理。驳回原因:" + rejectComment, null);
1024
         }
1000
         }
1025
     }
1001
     }
1026
-    
1002
+
1027
     /**
1003
     /**
1028
      * 根据业务数据为班组长节点创建任务(班组级流程)
1004
      * 根据业务数据为班组长节点创建任务(班组级流程)
1029
      */
1005
      */
1030
-    private void createTasksForNodeWithBusinessData(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark)
1031
-    {
1006
+    private void createTasksForNodeWithBusinessData(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark) {
1032
         try {
1007
         try {
1033
             // 使用实例的业务数据来获取班组长
1008
             // 使用实例的业务数据来获取班组长
1034
             List<Long> assigneeIds = approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), instance.getBusinessData());
1009
             List<Long> assigneeIds = approvalUserService.getApproverIds(node.getApproverType(), node.getApproverValue(), instance.getBusinessData());
1035
-            
1010
+
1036
             for (Long assigneeId : assigneeIds) {
1011
             for (Long assigneeId : assigneeIds) {
1037
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
1012
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
1038
                 if (user != null) {
1013
                 if (user != null) {
@@ -1076,12 +1051,11 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1076
             throw new RuntimeException("创建班组长任务失败", e);
1051
             throw new RuntimeException("创建班组长任务失败", e);
1077
         }
1052
         }
1078
     }
1053
     }
1079
-    
1054
+
1080
     /**
1055
     /**
1081
      * 判断是否为违禁品审批流程
1056
      * 判断是否为违禁品审批流程
1082
      */
1057
      */
1083
-    private boolean isSeizureReportWorkflow(ApprovalInstance instance)
1084
-    {
1058
+    private boolean isSeizureReportWorkflow(ApprovalInstance instance) {
1085
         return "SEIZURE_REPORT".equals(instance.getBusinessType());
1059
         return "SEIZURE_REPORT".equals(instance.getBusinessType());
1086
     }
1060
     }
1087
 
1061
 
@@ -1104,7 +1078,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1104
      */
1078
      */
1105
     private void handlePersonalCheckNodeAssignment(ApprovalInstance instance, ApprovalNodeDefinition nextNode, Map<String, Object> formData) {
1079
     private void handlePersonalCheckNodeAssignment(ApprovalInstance instance, ApprovalNodeDefinition nextNode, Map<String, Object> formData) {
1106
         String nodeCode = nextNode.getNodeCode();
1080
         String nodeCode = nextNode.getNodeCode();
1107
-        
1081
+
1108
         switch (nodeCode) {
1082
         switch (nodeCode) {
1109
             case "PROBLEM_USER_RECTIFY":
1083
             case "PROBLEM_USER_RECTIFY":
1110
                 // 科长审批后 → 问题人整改
1084
                 // 科长审批后 → 问题人整改
@@ -1126,7 +1100,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1126
      */
1100
      */
1127
     private void handleSectionCheckNodeAssignment(ApprovalInstance instance, ApprovalNodeDefinition nextNode, Map<String, Object> formData) {
1101
     private void handleSectionCheckNodeAssignment(ApprovalInstance instance, ApprovalNodeDefinition nextNode, Map<String, Object> formData) {
1128
         String nodeCode = nextNode.getNodeCode();
1102
         String nodeCode = nextNode.getNodeCode();
1129
-        
1103
+
1130
         switch (nodeCode) {
1104
         switch (nodeCode) {
1131
             case "GROUP_LEADER_RECTIFY":
1105
             case "GROUP_LEADER_RECTIFY":
1132
                 // 检查是否需要流转至班组长(基于科长审批时的选择)
1106
                 // 检查是否需要流转至班组长(基于科长审批时的选择)
@@ -1235,15 +1209,15 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1235
         }
1209
         }
1236
         return null;
1210
         return null;
1237
     }
1211
     }
1238
-    
1212
+
1239
     /**
1213
     /**
1240
      * 自动取消同一节点的其他待办任务
1214
      * 自动取消同一节点的其他待办任务
1241
      *
1215
      *
1242
-     * @param instanceId 流程实例ID
1243
-     * @param nodeId 审批节点ID
1216
+     * @param instanceId    流程实例ID
1217
+     * @param nodeId        审批节点ID
1244
      * @param currentTaskId 当前已处理的任务ID(不取消此任务)
1218
      * @param currentTaskId 当前已处理的任务ID(不取消此任务)
1245
-     * @param operatorId 操作人ID
1246
-     * @param operatorName 操作人姓名
1219
+     * @param operatorId    操作人ID
1220
+     * @param operatorName  操作人姓名
1247
      */
1221
      */
1248
     private void cancelOtherPendingTasksInSameNode(Long instanceId, Long nodeId, Long currentTaskId, Long operatorId, String operatorName) {
1222
     private void cancelOtherPendingTasksInSameNode(Long instanceId, Long nodeId, Long currentTaskId, Long operatorId, String operatorName) {
1249
         try {
1223
         try {
@@ -1251,10 +1225,10 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1251
             List<ApprovalTask> allTasks = taskMapper.selectApprovalTaskByInstanceId(instanceId);
1225
             List<ApprovalTask> allTasks = taskMapper.selectApprovalTaskByInstanceId(instanceId);
1252
 
1226
 
1253
             List<ApprovalTask> pendingTasks = allTasks.stream()
1227
             List<ApprovalTask> pendingTasks = allTasks.stream()
1254
-                .filter(t -> t.getNodeId().equals(nodeId))
1255
-                .filter(t -> "PENDING".equals(t.getStatus()))
1256
-                .filter(t -> !t.getId().equals(currentTaskId))  // 排除当前任务
1257
-                .collect(Collectors.toList());
1228
+                    .filter(t -> t.getNodeId().equals(nodeId))
1229
+                    .filter(t -> "PENDING".equals(t.getStatus()))
1230
+                    .filter(t -> !t.getId().equals(currentTaskId))  // 排除当前任务
1231
+                    .collect(Collectors.toList());
1258
 
1232
 
1259
             if (pendingTasks.isEmpty()) {
1233
             if (pendingTasks.isEmpty()) {
1260
                 return;
1234
                 return;
@@ -1272,15 +1246,15 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1272
 
1246
 
1273
                 // 3. 记录取消历史
1247
                 // 3. 记录取消历史
1274
                 recordHistory(
1248
                 recordHistory(
1275
-                    instanceId,
1276
-                    taskToCancel.getId(),
1277
-                    nodeId,
1278
-                    taskToCancel.getTaskName(),
1279
-                    "AUTO_CANCEL",
1280
-                    operatorId,
1281
-                    operatorName,
1282
-                    "同节点任务已由其他审批人处理,自动取消",
1283
-                    null
1249
+                        instanceId,
1250
+                        taskToCancel.getId(),
1251
+                        nodeId,
1252
+                        taskToCancel.getTaskName(),
1253
+                        "AUTO_CANCEL",
1254
+                        operatorId,
1255
+                        operatorName,
1256
+                        "同节点任务已由其他审批人处理,自动取消",
1257
+                        null
1284
                 );
1258
                 );
1285
             }
1259
             }
1286
 
1260
 
@@ -1296,17 +1270,16 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1296
     /**
1270
     /**
1297
      * 为违禁品审批节点创建任务(根据提交人角色分配给其直接上级)
1271
      * 为违禁品审批节点创建任务(根据提交人角色分配给其直接上级)
1298
      */
1272
      */
1299
-    private void createTasksForNodeWithDirectSuperior(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark,Long submitterId)
1300
-    {
1273
+    private void createTasksForNodeWithDirectSuperior(ApprovalInstance instance, ApprovalNodeDefinition node, Map<String, Object> formData, String remark, Long submitterId) {
1301
         try {
1274
         try {
1302
-            
1275
+
1303
             // 根据提交人查找其直接上级
1276
             // 根据提交人查找其直接上级
1304
             List<Long> assigneeIds = approvalUserService.getDirectSuperiorIds(submitterId);
1277
             List<Long> assigneeIds = approvalUserService.getDirectSuperiorIds(submitterId);
1305
-            
1278
+
1306
             if (assigneeIds.isEmpty()) {
1279
             if (assigneeIds.isEmpty()) {
1307
                 throw new RuntimeException("未找到提交人的直接上级,无法分配审批任务");
1280
                 throw new RuntimeException("未找到提交人的直接上级,无法分配审批任务");
1308
             }
1281
             }
1309
-            
1282
+
1310
             for (Long assigneeId : assigneeIds) {
1283
             for (Long assigneeId : assigneeIds) {
1311
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
1284
                 SysUser user = sysUserMapper.selectUserById(assigneeId);
1312
                 if (user != null) {
1285
                 if (user != null) {
@@ -1319,7 +1292,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1319
                     task.setAssigneeName(user.getNickName());
1292
                     task.setAssigneeName(user.getNickName());
1320
                     task.setAssignTime(DateUtils.getNowDate());
1293
                     task.setAssignTime(DateUtils.getNowDate());
1321
                     task.setStatus("PENDING");
1294
                     task.setStatus("PENDING");
1322
-                    
1295
+
1323
                     // 设置表单数据 - 如果formData为空,使用当前实例的formData
1296
                     // 设置表单数据 - 如果formData为空,使用当前实例的formData
1324
                     try {
1297
                     try {
1325
                         if (formData != null) {
1298
                         if (formData != null) {
@@ -1331,15 +1304,15 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1331
                         // 序列化失败时使用实例的formData
1304
                         // 序列化失败时使用实例的formData
1332
                         task.setFormData(instance.getFormData());
1305
                         task.setFormData(instance.getFormData());
1333
                     }
1306
                     }
1334
-                    
1307
+
1335
                     // 设置超时时间
1308
                     // 设置超时时间
1336
                     if (node.getTimeoutHours() != null && node.getTimeoutHours() > 0) {
1309
                     if (node.getTimeoutHours() != null && node.getTimeoutHours() > 0) {
1337
                         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), node.getTimeoutHours()));
1310
                         task.setTimeoutTime(DateUtils.addHours(DateUtils.getNowDate(), node.getTimeoutHours()));
1338
                     }
1311
                     }
1339
-                    
1312
+
1340
                     task.setCreateBy(SecurityUtils.getUsername());
1313
                     task.setCreateBy(SecurityUtils.getUsername());
1341
                     task.setCreateTime(DateUtils.getNowDate());
1314
                     task.setCreateTime(DateUtils.getNowDate());
1342
-                    
1315
+
1343
                     taskMapper.insertApprovalTask(task);
1316
                     taskMapper.insertApprovalTask(task);
1344
                 }
1317
                 }
1345
             }
1318
             }
@@ -1347,7 +1320,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1347
             throw new RuntimeException("创建违禁品审批任务失败:" + e.getMessage(), e);
1320
             throw new RuntimeException("创建违禁品审批任务失败:" + e.getMessage(), e);
1348
         }
1321
         }
1349
     }
1322
     }
1350
-    
1323
+
1351
     /**
1324
     /**
1352
      * 创建抄送记录
1325
      * 创建抄送记录
1353
      * 抄送对象包括:发起人、groupLeaderId(如果存在)、质检科所有人员
1326
      * 抄送对象包括:发起人、groupLeaderId(如果存在)、质检科所有人员
@@ -1356,7 +1329,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1356
         try {
1329
         try {
1357
             // 收集抄送用户ID,使用Set避免重复
1330
             // 收集抄送用户ID,使用Set避免重复
1358
             java.util.Set<Long> ccUserIds = new java.util.HashSet<>();
1331
             java.util.Set<Long> ccUserIds = new java.util.HashSet<>();
1359
-            
1332
+
1360
             // 根据业务类型决定抄送对象
1333
             // 根据业务类型决定抄送对象
1361
             if ("PERSONAL_CHECK".equals(instance.getBusinessType())) {
1334
             if ("PERSONAL_CHECK".equals(instance.getBusinessType())) {
1362
                 // 个人级别检查:抄送质检科、组长发起人、审批科长
1335
                 // 个人级别检查:抄送质检科、组长发起人、审批科长
@@ -1365,7 +1338,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1365
                 // 其他流程:原有逻辑
1338
                 // 其他流程:原有逻辑
1366
                 createDefaultCcRecords(instance, ccUserIds);
1339
                 createDefaultCcRecords(instance, ccUserIds);
1367
             }
1340
             }
1368
-            
1341
+
1369
             // 创建抄送记录
1342
             // 创建抄送记录
1370
             Date ccTime = DateUtils.getNowDate();
1343
             Date ccTime = DateUtils.getNowDate();
1371
             for (Long ccUserId : ccUserIds) {
1344
             for (Long ccUserId : ccUserIds) {
@@ -1379,11 +1352,11 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1379
                     cc.setIsRead("0"); // 未读
1352
                     cc.setIsRead("0"); // 未读
1380
                     cc.setCreateBy(SecurityUtils.getUsername());
1353
                     cc.setCreateBy(SecurityUtils.getUsername());
1381
                     cc.setCreateTime(ccTime);
1354
                     cc.setCreateTime(ccTime);
1382
-                    
1355
+
1383
                     ccMapper.insertApprovalCc(cc);
1356
                     ccMapper.insertApprovalCc(cc);
1384
                 }
1357
                 }
1385
             }
1358
             }
1386
-            
1359
+
1387
         } catch (Exception e) {
1360
         } catch (Exception e) {
1388
             // 记录错误但不中断流程
1361
             // 记录错误但不中断流程
1389
             e.printStackTrace();
1362
             e.printStackTrace();
@@ -1396,13 +1369,13 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1396
     private void createPersonalCheckCcRecords(ApprovalInstance instance, java.util.Set<Long> ccUserIds) {
1369
     private void createPersonalCheckCcRecords(ApprovalInstance instance, java.util.Set<Long> ccUserIds) {
1397
         // 1. 添加发起人(组长)
1370
         // 1. 添加发起人(组长)
1398
         ccUserIds.add(instance.getSubmitterId());
1371
         ccUserIds.add(instance.getSubmitterId());
1399
-        
1372
+
1400
         // 2. 添加质检科所有人员
1373
         // 2. 添加质检科所有人员
1401
         List<SysUser> qualityUsers = sysUserMapper.selectUsersByRoleName("质检科");
1374
         List<SysUser> qualityUsers = sysUserMapper.selectUsersByRoleName("质检科");
1402
         for (SysUser user : qualityUsers) {
1375
         for (SysUser user : qualityUsers) {
1403
             ccUserIds.add(user.getUserId());
1376
             ccUserIds.add(user.getUserId());
1404
         }
1377
         }
1405
-        
1378
+
1406
         // 3. 从business_data中提取sectionLeaderId(审批科长)
1379
         // 3. 从business_data中提取sectionLeaderId(审批科长)
1407
         if (StringUtils.isNotEmpty(instance.getBusinessData())) {
1380
         if (StringUtils.isNotEmpty(instance.getBusinessData())) {
1408
             Long sectionLeaderId = extractSectionLeaderIdFromBusinessData(instance.getBusinessData());
1381
             Long sectionLeaderId = extractSectionLeaderIdFromBusinessData(instance.getBusinessData());
@@ -1418,7 +1391,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1418
     private void createDefaultCcRecords(ApprovalInstance instance, java.util.Set<Long> ccUserIds) {
1391
     private void createDefaultCcRecords(ApprovalInstance instance, java.util.Set<Long> ccUserIds) {
1419
         // 1. 添加发起人
1392
         // 1. 添加发起人
1420
         ccUserIds.add(instance.getSubmitterId());
1393
         ccUserIds.add(instance.getSubmitterId());
1421
-        
1394
+
1422
         // 2. 从business_data中提取groupLeaderId
1395
         // 2. 从business_data中提取groupLeaderId
1423
         if (StringUtils.isNotEmpty(instance.getBusinessData())) {
1396
         if (StringUtils.isNotEmpty(instance.getBusinessData())) {
1424
             Long groupLeaderId = extractGroupLeaderIdFromBusinessData(instance.getBusinessData());
1397
             Long groupLeaderId = extractGroupLeaderIdFromBusinessData(instance.getBusinessData());
@@ -1426,7 +1399,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1426
                 ccUserIds.add(groupLeaderId);
1399
                 ccUserIds.add(groupLeaderId);
1427
             }
1400
             }
1428
         }
1401
         }
1429
-        
1402
+
1430
         // 3. 添加质检科所有人员
1403
         // 3. 添加质检科所有人员
1431
         List<SysUser> qualityUsers = sysUserMapper.selectUsersByRoleName("质检科");
1404
         List<SysUser> qualityUsers = sysUserMapper.selectUsersByRoleName("质检科");
1432
         for (SysUser user : qualityUsers) {
1405
         for (SysUser user : qualityUsers) {
@@ -1451,7 +1424,7 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1451
         }
1424
         }
1452
         return null;
1425
         return null;
1453
     }
1426
     }
1454
-    
1427
+
1455
     /**
1428
     /**
1456
      * 从业务数据JSON中提取groupLeaderId
1429
      * 从业务数据JSON中提取groupLeaderId
1457
      */
1430
      */
@@ -1510,13 +1483,13 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1510
         try {
1483
         try {
1511
             Object groupLeaderIdObj = formData.get("groupLeaderId");
1484
             Object groupLeaderIdObj = formData.get("groupLeaderId");
1512
             Long groupLeaderId = null;
1485
             Long groupLeaderId = null;
1513
-            
1486
+
1514
             if (groupLeaderIdObj instanceof Number) {
1487
             if (groupLeaderIdObj instanceof Number) {
1515
                 groupLeaderId = ((Number) groupLeaderIdObj).longValue();
1488
                 groupLeaderId = ((Number) groupLeaderIdObj).longValue();
1516
             } else if (groupLeaderIdObj instanceof String) {
1489
             } else if (groupLeaderIdObj instanceof String) {
1517
                 groupLeaderId = Long.parseLong((String) groupLeaderIdObj);
1490
                 groupLeaderId = Long.parseLong((String) groupLeaderIdObj);
1518
             }
1491
             }
1519
-            
1492
+
1520
             if (groupLeaderId != null) {
1493
             if (groupLeaderId != null) {
1521
                 SysUser groupLeader = sysUserMapper.selectUserById(groupLeaderId);
1494
                 SysUser groupLeader = sysUserMapper.selectUserById(groupLeaderId);
1522
                 if (groupLeader != null) {
1495
                 if (groupLeader != null) {
@@ -1582,19 +1555,19 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService
1582
             // 查找发起人审批节点
1555
             // 查找发起人审批节点
1583
             List<ApprovalNodeDefinition> nodes = nodeDefinitionMapper.selectApprovalNodeDefinitionByWorkflowId(instance.getWorkflowId());
1556
             List<ApprovalNodeDefinition> nodes = nodeDefinitionMapper.selectApprovalNodeDefinitionByWorkflowId(instance.getWorkflowId());
1584
             ApprovalNodeDefinition initiatorNode = null;
1557
             ApprovalNodeDefinition initiatorNode = null;
1585
-            
1558
+
1586
             for (ApprovalNodeDefinition node : nodes) {
1559
             for (ApprovalNodeDefinition node : nodes) {
1587
                 if ("INITIATOR_FINAL_REVIEW".equals(node.getNodeCode())) {
1560
                 if ("INITIATOR_FINAL_REVIEW".equals(node.getNodeCode())) {
1588
                     initiatorNode = node;
1561
                     initiatorNode = node;
1589
                     break;
1562
                     break;
1590
                 }
1563
                 }
1591
             }
1564
             }
1592
-            
1565
+
1593
             if (initiatorNode != null) {
1566
             if (initiatorNode != null) {
1594
                 // 更新实例当前节点
1567
                 // 更新实例当前节点
1595
                 instance.setCurrentNodeId(initiatorNode.getId());
1568
                 instance.setCurrentNodeId(initiatorNode.getId());
1596
                 instanceMapper.updateApprovalInstance(instance);
1569
                 instanceMapper.updateApprovalInstance(instance);
1597
-                
1570
+
1598
                 // 创建发起人审批任务
1571
                 // 创建发起人审批任务
1599
                 createTaskForInitiatorFinalReview(instance, initiatorNode, formData);
1572
                 createTaskForInitiatorFinalReview(instance, initiatorNode, formData);
1600
             } else {
1573
             } else {

+ 89 - 109
airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/ApprovalUserServiceImpl.java

@@ -20,25 +20,24 @@ import com.sundot.airport.system.service.approval.IApprovalUserService;
20
 
20
 
21
 /**
21
 /**
22
  * 审批流程用户服务实现
22
  * 审批流程用户服务实现
23
- * 
23
+ *
24
  * @author simon lin
24
  * @author simon lin
25
  * @date 2025-09-06
25
  * @date 2025-09-06
26
  */
26
  */
27
 @Service
27
 @Service
28
-public class ApprovalUserServiceImpl implements IApprovalUserService
29
-{
28
+public class ApprovalUserServiceImpl implements IApprovalUserService {
30
     @Autowired
29
     @Autowired
31
     private SysUserMapper userMapper;
30
     private SysUserMapper userMapper;
32
-    
31
+
33
     @Autowired
32
     @Autowired
34
     private SysDeptMapper deptMapper;
33
     private SysDeptMapper deptMapper;
35
-    
34
+
36
     @Autowired
35
     @Autowired
37
     private SysRoleMapper roleMapper;
36
     private SysRoleMapper roleMapper;
38
-    
37
+
39
     @Autowired
38
     @Autowired
40
     private ApprovalTaskMapper taskMapper;
39
     private ApprovalTaskMapper taskMapper;
41
-    
40
+
42
     @Autowired
41
     @Autowired
43
     private ApprovalInstanceMapper instanceMapper;
42
     private ApprovalInstanceMapper instanceMapper;
44
 
43
 
@@ -46,8 +45,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
46
      * 根据审批人类型获取审批人ID列表
45
      * 根据审批人类型获取审批人ID列表
47
      */
46
      */
48
     @Override
47
     @Override
49
-    public List<Long> getApproverIds(String approverType, String approverValue, Object businessData)
50
-    {
48
+    public List<Long> getApproverIds(String approverType, String approverValue, Object businessData) {
51
         switch (approverType) {
49
         switch (approverType) {
52
             case "USER":
50
             case "USER":
53
                 // 指定用户,approverValue为用户ID,多个用逗号分隔
51
                 // 指定用户,approverValue为用户ID,多个用逗号分隔
@@ -64,11 +62,11 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
64
                     return userIds;
62
                     return userIds;
65
                 }
63
                 }
66
                 break;
64
                 break;
67
-                
65
+
68
             case "ROLE":
66
             case "ROLE":
69
                 // 角色,approverValue为角色标识
67
                 // 角色,approverValue为角色标识
70
                 return getUserIdsByRoleKey(approverValue);
68
                 return getUserIdsByRoleKey(approverValue);
71
-                
69
+
72
             case "DEPT":
70
             case "DEPT":
73
                 // 部门,approverValue为部门ID
71
                 // 部门,approverValue为部门ID
74
                 if (approverValue != null) {
72
                 if (approverValue != null) {
@@ -80,27 +78,27 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
80
                     }
78
                     }
81
                 }
79
                 }
82
                 break;
80
                 break;
83
-                
81
+
84
             case "GROUP_LEADER":
82
             case "GROUP_LEADER":
85
                 // 班组长,根据业务数据动态获取
83
                 // 班组长,根据业务数据动态获取
86
                 return getGroupLeaderIdsByBusinessData(businessData);
84
                 return getGroupLeaderIdsByBusinessData(businessData);
87
-                
85
+
88
             case "SECTION_LEADER":
86
             case "SECTION_LEADER":
89
                 // 科长,根据业务数据动态获取
87
                 // 科长,根据业务数据动态获取
90
                 return getSectionLeaderIdsByBusinessData(businessData);
88
                 return getSectionLeaderIdsByBusinessData(businessData);
91
-                
89
+
92
             case "ORIGINAL_OPERATOR":
90
             case "ORIGINAL_OPERATOR":
93
                 // 原始操作者,根据业务数据中的taskId获取
91
                 // 原始操作者,根据业务数据中的taskId获取
94
                 return getOriginalOperatorIdsByBusinessData(businessData);
92
                 return getOriginalOperatorIdsByBusinessData(businessData);
95
-                
93
+
96
             case "DEPT_SECTION_LEADER":
94
             case "DEPT_SECTION_LEADER":
97
                 // 指定部门的科长,根据业务数据中的deptId获取
95
                 // 指定部门的科长,根据业务数据中的deptId获取
98
                 return getDeptSectionLeaderIdsByBusinessData(businessData);
96
                 return getDeptSectionLeaderIdsByBusinessData(businessData);
99
-                
97
+
100
             default:
98
             default:
101
                 break;
99
                 break;
102
         }
100
         }
103
-        
101
+
104
         return new ArrayList<>();
102
         return new ArrayList<>();
105
     }
103
     }
106
 
104
 
@@ -109,30 +107,29 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
109
      * 如果传入的是班组ID,会自动查找其父部门的科长
107
      * 如果传入的是班组ID,会自动查找其父部门的科长
110
      */
108
      */
111
     @Override
109
     @Override
112
-    public List<Long> getDeptLeaderIds(Long deptId)
113
-    {
110
+    public List<Long> getDeptLeaderIds(Long deptId) {
114
         List<Long> leaderIds = new ArrayList<>();
111
         List<Long> leaderIds = new ArrayList<>();
115
-        
112
+
116
         if (deptId == null) {
113
         if (deptId == null) {
117
             return leaderIds;
114
             return leaderIds;
118
         }
115
         }
119
-        
116
+
120
         // 获取传入的部门信息
117
         // 获取传入的部门信息
121
         SysDept dept = deptMapper.selectDeptById(deptId);
118
         SysDept dept = deptMapper.selectDeptById(deptId);
122
         if (dept == null) {
119
         if (dept == null) {
123
             return leaderIds;
120
             return leaderIds;
124
         }
121
         }
125
-        
122
+
126
         // 确定要查找科长的科室ID
123
         // 确定要查找科长的科室ID
127
         Long sectionDeptId = deptId;
124
         Long sectionDeptId = deptId;
128
-        
125
+
129
         // 如果当前部门有父部门,说明这是班组,需要找父部门(科室)的科长
126
         // 如果当前部门有父部门,说明这是班组,需要找父部门(科室)的科长
130
         if (dept.getParentId() != null && dept.getParentId() != 100) {
127
         if (dept.getParentId() != null && dept.getParentId() != 100) {
131
             sectionDeptId = dept.getParentId();
128
             sectionDeptId = dept.getParentId();
132
             // 重新获取科室部门信息
129
             // 重新获取科室部门信息
133
             dept = deptMapper.selectDeptById(sectionDeptId);
130
             dept = deptMapper.selectDeptById(sectionDeptId);
134
         }
131
         }
135
-        
132
+
136
         if (dept != null) {
133
         if (dept != null) {
137
             // 方法1: 根据部门负责人姓名查找用户
134
             // 方法1: 根据部门负责人姓名查找用户
138
             if (dept.getLeader() != null && !dept.getLeader().isEmpty()) {
135
             if (dept.getLeader() != null && !dept.getLeader().isEmpty()) {
@@ -141,11 +138,11 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
141
                     leaderIds.add(leader.getUserId());
138
                     leaderIds.add(leader.getUserId());
142
                 }
139
                 }
143
             }
140
             }
144
-            
141
+
145
             // 方法2: 根据角色查找科长(在该科室下的科长)
142
             // 方法2: 根据角色查找科长(在该科室下的科长)
146
             List<Long> sectionLeaderIds = getUserIdsByRoleKey("kezhang");
143
             List<Long> sectionLeaderIds = getUserIdsByRoleKey("kezhang");
147
             List<SysUser> sectionUsers = userMapper.selectUsersByDeptId(sectionDeptId);
144
             List<SysUser> sectionUsers = userMapper.selectUsersByDeptId(sectionDeptId);
148
-            
145
+
149
             for (SysUser user : sectionUsers) {
146
             for (SysUser user : sectionUsers) {
150
                 if (sectionLeaderIds.contains(user.getUserId())) {
147
                 if (sectionLeaderIds.contains(user.getUserId())) {
151
                     if (!leaderIds.contains(user.getUserId())) {
148
                     if (!leaderIds.contains(user.getUserId())) {
@@ -154,7 +151,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
154
                 }
151
                 }
155
             }
152
             }
156
         }
153
         }
157
-        
154
+
158
         return leaderIds;
155
         return leaderIds;
159
     }
156
     }
160
 
157
 
@@ -162,8 +159,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
162
      * 根据用户ID获取所属部门的科长
159
      * 根据用户ID获取所属部门的科长
163
      */
160
      */
164
     @Override
161
     @Override
165
-    public List<Long> getSectionLeaderIdsByUserId(Long userId)
166
-    {
162
+    public List<Long> getSectionLeaderIdsByUserId(Long userId) {
167
         SysUser user = userMapper.selectUserById(userId);
163
         SysUser user = userMapper.selectUserById(userId);
168
         if (user != null && user.getDeptId() != null) {
164
         if (user != null && user.getDeptId() != null) {
169
             return getDeptLeaderIds(user.getDeptId());
165
             return getDeptLeaderIds(user.getDeptId());
@@ -175,15 +171,14 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
175
      * 根据用户ID获取所属班组的班组长
171
      * 根据用户ID获取所属班组的班组长
176
      */
172
      */
177
     @Override
173
     @Override
178
-    public List<Long> getGroupLeaderIdsByUserId(Long userId)
179
-    {
174
+    public List<Long> getGroupLeaderIdsByUserId(Long userId) {
180
         List<Long> groupLeaderIds = new ArrayList<>();
175
         List<Long> groupLeaderIds = new ArrayList<>();
181
-        
176
+
182
         SysUser user = userMapper.selectUserById(userId);
177
         SysUser user = userMapper.selectUserById(userId);
183
         if (user != null && user.getDeptId() != null) {
178
         if (user != null && user.getDeptId() != null) {
184
             // 获取班组长角色的用户
179
             // 获取班组长角色的用户
185
             List<Long> groupLeaderRoleIds = getUserIdsByRoleKey("banzuzhang");
180
             List<Long> groupLeaderRoleIds = getUserIdsByRoleKey("banzuzhang");
186
-            
181
+
187
             // 获取同部门的班组长
182
             // 获取同部门的班组长
188
             List<SysUser> deptUsers = userMapper.selectUsersByDeptId(user.getDeptId());
183
             List<SysUser> deptUsers = userMapper.selectUsersByDeptId(user.getDeptId());
189
             for (SysUser deptUser : deptUsers) {
184
             for (SysUser deptUser : deptUsers) {
@@ -192,7 +187,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
192
                 }
187
                 }
193
             }
188
             }
194
         }
189
         }
195
-        
190
+
196
         return groupLeaderIds;
191
         return groupLeaderIds;
197
     }
192
     }
198
 
193
 
@@ -200,45 +195,42 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
200
      * 根据角色标识获取用户ID列表
195
      * 根据角色标识获取用户ID列表
201
      */
196
      */
202
     @Override
197
     @Override
203
-    public List<Long> getUserIdsByRoleKey(String roleKey)
204
-    {
198
+    public List<Long> getUserIdsByRoleKey(String roleKey) {
205
         if (roleKey == null) {
199
         if (roleKey == null) {
206
             return new ArrayList<>();
200
             return new ArrayList<>();
207
         }
201
         }
208
-        
202
+
209
         List<SysUser> users = userMapper.selectUsersByRoleKey(roleKey);
203
         List<SysUser> users = userMapper.selectUsersByRoleKey(roleKey);
210
         return users.stream()
204
         return users.stream()
211
-                   .map(SysUser::getUserId)
212
-                   .collect(Collectors.toList());
205
+                .map(SysUser::getUserId)
206
+                .collect(Collectors.toList());
213
     }
207
     }
214
 
208
 
215
     /**
209
     /**
216
      * 根据部门ID获取部门下所有用户ID列表
210
      * 根据部门ID获取部门下所有用户ID列表
217
      */
211
      */
218
     @Override
212
     @Override
219
-    public List<Long> getUserIdsByDeptId(Long deptId)
220
-    {
213
+    public List<Long> getUserIdsByDeptId(Long deptId) {
221
         if (deptId == null) {
214
         if (deptId == null) {
222
             return new ArrayList<>();
215
             return new ArrayList<>();
223
         }
216
         }
224
-        
217
+
225
         List<SysUser> users = userMapper.selectUsersByDeptId(deptId);
218
         List<SysUser> users = userMapper.selectUsersByDeptId(deptId);
226
         return users.stream()
219
         return users.stream()
227
-                   .filter(user -> "0".equals(user.getStatus()) && "0".equals(user.getDelFlag()))
228
-                   .map(SysUser::getUserId)
229
-                   .collect(Collectors.toList());
220
+                .filter(user -> "0".equals(user.getStatus()) && "0".equals(user.getDelFlag()))
221
+                .map(SysUser::getUserId)
222
+                .collect(Collectors.toList());
230
     }
223
     }
231
 
224
 
232
     /**
225
     /**
233
      * 判断用户是否为班组长角色
226
      * 判断用户是否为班组长角色
234
      */
227
      */
235
     @Override
228
     @Override
236
-    public boolean isGroupLeader(Long userId)
237
-    {
229
+    public boolean isGroupLeader(Long userId) {
238
         if (userId == null) {
230
         if (userId == null) {
239
             return false;
231
             return false;
240
         }
232
         }
241
-        
233
+
242
         List<Long> groupLeaderIds = getUserIdsByRoleKey("banzuzhang");
234
         List<Long> groupLeaderIds = getUserIdsByRoleKey("banzuzhang");
243
         return groupLeaderIds.contains(userId);
235
         return groupLeaderIds.contains(userId);
244
     }
236
     }
@@ -247,12 +239,11 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
247
      * 判断用户是否为科长角色
239
      * 判断用户是否为科长角色
248
      */
240
      */
249
     @Override
241
     @Override
250
-    public boolean isSectionLeader(Long userId)
251
-    {
242
+    public boolean isSectionLeader(Long userId) {
252
         if (userId == null) {
243
         if (userId == null) {
253
             return false;
244
             return false;
254
         }
245
         }
255
-        
246
+
256
         List<Long> sectionLeaderIds = getUserIdsByRoleKey("kezhang");
247
         List<Long> sectionLeaderIds = getUserIdsByRoleKey("kezhang");
257
         return sectionLeaderIds.contains(userId);
248
         return sectionLeaderIds.contains(userId);
258
     }
249
     }
@@ -261,8 +252,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
261
      * 根据业务数据动态获取整改班组
252
      * 根据业务数据动态获取整改班组
262
      */
253
      */
263
     @Override
254
     @Override
264
-    public Long getTargetGroupIdFromBusinessData(Object businessData)
265
-    {
255
+    public Long getTargetGroupIdFromBusinessData(Object businessData) {
266
         if (businessData instanceof String) {
256
         if (businessData instanceof String) {
267
             try {
257
             try {
268
                 String businessDataStr = (String) businessData;
258
                 String businessDataStr = (String) businessData;
@@ -280,15 +270,14 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
280
                 return null;
270
                 return null;
281
             }
271
             }
282
         }
272
         }
283
-        
273
+
284
         return null;
274
         return null;
285
     }
275
     }
286
 
276
 
287
     /**
277
     /**
288
      * 根据业务数据获取班组长ID列表
278
      * 根据业务数据获取班组长ID列表
289
      */
279
      */
290
-    private List<Long> getGroupLeaderIdsByBusinessData(Object businessData)
291
-    {
280
+    private List<Long> getGroupLeaderIdsByBusinessData(Object businessData) {
292
         // 优先检查是否有直接指定的groupLeaderId
281
         // 优先检查是否有直接指定的groupLeaderId
293
         Long groupLeaderId = getGroupLeaderIdFromBusinessData(businessData);
282
         Long groupLeaderId = getGroupLeaderIdFromBusinessData(businessData);
294
         if (groupLeaderId != null) {
283
         if (groupLeaderId != null) {
@@ -296,22 +285,22 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
296
             result.add(groupLeaderId);
285
             result.add(groupLeaderId);
297
             return result;
286
             return result;
298
         }
287
         }
299
-        
288
+
300
         Long targetId = null;
289
         Long targetId = null;
301
-        
290
+
302
         // 尝试从业务数据中获取targetGroupId或targetDeptId
291
         // 尝试从业务数据中获取targetGroupId或targetDeptId
303
         targetId = getTargetGroupIdFromBusinessData(businessData);
292
         targetId = getTargetGroupIdFromBusinessData(businessData);
304
         if (targetId == null) {
293
         if (targetId == null) {
305
             targetId = getTargetDeptIdFromBusinessData(businessData);
294
             targetId = getTargetDeptIdFromBusinessData(businessData);
306
         }
295
         }
307
-        
296
+
308
         if (targetId != null) {
297
         if (targetId != null) {
309
             // 获取班组长角色的用户
298
             // 获取班组长角色的用户
310
             List<Long> groupLeaderRoleIds = getUserIdsByRoleKey("banzuzhang");
299
             List<Long> groupLeaderRoleIds = getUserIdsByRoleKey("banzuzhang");
311
-            
300
+
312
             // 获取目标部门/班组的所有用户
301
             // 获取目标部门/班组的所有用户
313
             List<SysUser> groupUsers = userMapper.selectUsersByDeptId(targetId);
302
             List<SysUser> groupUsers = userMapper.selectUsersByDeptId(targetId);
314
-            
303
+
315
             // 找到交集:既在目标部门/班组,又是班组长角色的用户
304
             // 找到交集:既在目标部门/班组,又是班组长角色的用户
316
             List<Long> groupLeaderIds = new ArrayList<>();
305
             List<Long> groupLeaderIds = new ArrayList<>();
317
             for (SysUser user : groupUsers) {
306
             for (SysUser user : groupUsers) {
@@ -319,10 +308,10 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
319
                     groupLeaderIds.add(user.getUserId());
308
                     groupLeaderIds.add(user.getUserId());
320
                 }
309
                 }
321
             }
310
             }
322
-            
311
+
323
             return groupLeaderIds;
312
             return groupLeaderIds;
324
         }
313
         }
325
-        
314
+
326
         // 如果无法从业务数据中获取,返回空列表
315
         // 如果无法从业务数据中获取,返回空列表
327
         return new ArrayList<>();
316
         return new ArrayList<>();
328
     }
317
     }
@@ -330,8 +319,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
330
     /**
319
     /**
331
      * 根据业务数据获取科长ID列表
320
      * 根据业务数据获取科长ID列表
332
      */
321
      */
333
-    private List<Long> getSectionLeaderIdsByBusinessData(Object businessData)
334
-    {
322
+    private List<Long> getSectionLeaderIdsByBusinessData(Object businessData) {
335
         // 优先检查是否有直接指定的sectionLeaderId
323
         // 优先检查是否有直接指定的sectionLeaderId
336
         Long sectionLeaderId = getSectionLeaderIdFromBusinessData(businessData);
324
         Long sectionLeaderId = getSectionLeaderIdFromBusinessData(businessData);
337
         if (sectionLeaderId != null) {
325
         if (sectionLeaderId != null) {
@@ -339,14 +327,14 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
339
             result.add(sectionLeaderId);
327
             result.add(sectionLeaderId);
340
             return result;
328
             return result;
341
         }
329
         }
342
-        
330
+
343
         // 如果没有直接指定的sectionLeaderId,则根据业务数据获取目标部门ID
331
         // 如果没有直接指定的sectionLeaderId,则根据业务数据获取目标部门ID
344
         Long targetDeptId = getTargetDeptIdFromBusinessData(businessData);
332
         Long targetDeptId = getTargetDeptIdFromBusinessData(businessData);
345
-        
333
+
346
         if (targetDeptId != null) {
334
         if (targetDeptId != null) {
347
             return getDeptLeaderIds(targetDeptId);
335
             return getDeptLeaderIds(targetDeptId);
348
         }
336
         }
349
-        
337
+
350
         // 如果无法从业务数据中获取,返回空列表
338
         // 如果无法从业务数据中获取,返回空列表
351
         return new ArrayList<>();
339
         return new ArrayList<>();
352
     }
340
     }
@@ -354,8 +342,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
354
     /**
342
     /**
355
      * 根据业务数据获取直接指定的班组长ID
343
      * 根据业务数据获取直接指定的班组长ID
356
      */
344
      */
357
-    private Long getGroupLeaderIdFromBusinessData(Object businessData)
358
-    {
345
+    private Long getGroupLeaderIdFromBusinessData(Object businessData) {
359
         if (businessData instanceof String) {
346
         if (businessData instanceof String) {
360
             try {
347
             try {
361
                 String businessDataStr = (String) businessData;
348
                 String businessDataStr = (String) businessData;
@@ -374,12 +361,11 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
374
         }
361
         }
375
         return null;
362
         return null;
376
     }
363
     }
377
-    
364
+
378
     /**
365
     /**
379
      * 根据业务数据获取直接指定的科长ID
366
      * 根据业务数据获取直接指定的科长ID
380
      */
367
      */
381
-    private Long getSectionLeaderIdFromBusinessData(Object businessData)
382
-    {
368
+    private Long getSectionLeaderIdFromBusinessData(Object businessData) {
383
         if (businessData instanceof String) {
369
         if (businessData instanceof String) {
384
             try {
370
             try {
385
                 String businessDataStr = (String) businessData;
371
                 String businessDataStr = (String) businessData;
@@ -398,12 +384,11 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
398
         }
384
         }
399
         return null;
385
         return null;
400
     }
386
     }
401
-    
387
+
402
     /**
388
     /**
403
      * 根据业务数据获取目标部门ID
389
      * 根据业务数据获取目标部门ID
404
      */
390
      */
405
-    private Long getTargetDeptIdFromBusinessData(Object businessData)
406
-    {
391
+    private Long getTargetDeptIdFromBusinessData(Object businessData) {
407
         if (businessData instanceof String) {
392
         if (businessData instanceof String) {
408
             try {
393
             try {
409
                 String businessDataStr = (String) businessData;
394
                 String businessDataStr = (String) businessData;
@@ -421,17 +406,16 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
421
                 return null;
406
                 return null;
422
             }
407
             }
423
         }
408
         }
424
-        
409
+
425
         return null;
410
         return null;
426
     }
411
     }
427
-    
412
+
428
     /**
413
     /**
429
      * 根据业务数据获取原始操作者ID列表(用于班组长整改完成后回流)
414
      * 根据业务数据获取原始操作者ID列表(用于班组长整改完成后回流)
430
      */
415
      */
431
-    private List<Long> getOriginalOperatorIdsByBusinessData(Object businessData)
432
-    {
416
+    private List<Long> getOriginalOperatorIdsByBusinessData(Object businessData) {
433
         List<Long> operatorIds = new ArrayList<>();
417
         List<Long> operatorIds = new ArrayList<>();
434
-        
418
+
435
         if (businessData instanceof String) {
419
         if (businessData instanceof String) {
436
             try {
420
             try {
437
                 String businessDataStr = (String) businessData;
421
                 String businessDataStr = (String) businessData;
@@ -452,17 +436,16 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
452
                 // 解析失败,返回空列表
436
                 // 解析失败,返回空列表
453
             }
437
             }
454
         }
438
         }
455
-        
439
+
456
         return operatorIds;
440
         return operatorIds;
457
     }
441
     }
458
-    
442
+
459
     /**
443
     /**
460
      * 根据业务数据获取指定部门的科长ID列表
444
      * 根据业务数据获取指定部门的科长ID列表
461
      */
445
      */
462
-    private List<Long> getDeptSectionLeaderIdsByBusinessData(Object businessData)
463
-    {
446
+    private List<Long> getDeptSectionLeaderIdsByBusinessData(Object businessData) {
464
         List<Long> sectionLeaderIds = new ArrayList<>();
447
         List<Long> sectionLeaderIds = new ArrayList<>();
465
-        
448
+
466
         if (businessData instanceof String) {
449
         if (businessData instanceof String) {
467
             try {
450
             try {
468
                 String businessDataStr = (String) businessData;
451
                 String businessDataStr = (String) businessData;
@@ -473,11 +456,11 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
473
                     java.util.regex.Matcher matcher = pattern.matcher(businessDataStr);
456
                     java.util.regex.Matcher matcher = pattern.matcher(businessDataStr);
474
                     if (matcher.find()) {
457
                     if (matcher.find()) {
475
                         Long deptId = Long.valueOf(matcher.group(1));
458
                         Long deptId = Long.valueOf(matcher.group(1));
476
-                        
459
+
477
                         // 获取指定部门下具有科长角色的用户
460
                         // 获取指定部门下具有科长角色的用户
478
                         List<Long> kezhangRoleIds = getUserIdsByRoleKey("kezhang");
461
                         List<Long> kezhangRoleIds = getUserIdsByRoleKey("kezhang");
479
                         List<SysUser> deptUsers = userMapper.selectUsersByDeptId(deptId);
462
                         List<SysUser> deptUsers = userMapper.selectUsersByDeptId(deptId);
480
-                        
463
+
481
                         // 找到交集:既在指定部门,又是科长角色的用户
464
                         // 找到交集:既在指定部门,又是科长角色的用户
482
                         for (SysUser user : deptUsers) {
465
                         for (SysUser user : deptUsers) {
483
                             if (kezhangRoleIds.contains(user.getUserId())) {
466
                             if (kezhangRoleIds.contains(user.getUserId())) {
@@ -490,29 +473,28 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
490
                 // 解析失败,返回空列表
473
                 // 解析失败,返回空列表
491
             }
474
             }
492
         }
475
         }
493
-        
476
+
494
         return sectionLeaderIds;
477
         return sectionLeaderIds;
495
     }
478
     }
496
-    
479
+
497
     /**
480
     /**
498
      * 根据任务ID获取原始操作者(创建者或更新者)的用户ID
481
      * 根据任务ID获取原始操作者(创建者或更新者)的用户ID
499
      */
482
      */
500
     @Override
483
     @Override
501
-    public Long getOriginalOperatorByTaskId(Long taskId)
502
-    {
484
+    public Long getOriginalOperatorByTaskId(Long taskId) {
503
         if (taskId == null) {
485
         if (taskId == null) {
504
             return null;
486
             return null;
505
         }
487
         }
506
-        
488
+
507
         // 查找当前任务
489
         // 查找当前任务
508
         ApprovalTask currentTask = taskMapper.selectApprovalTaskById(taskId);
490
         ApprovalTask currentTask = taskMapper.selectApprovalTaskById(taskId);
509
         if (currentTask == null) {
491
         if (currentTask == null) {
510
             return null;
492
             return null;
511
         }
493
         }
512
-        
494
+
513
         // 获取同一实例的所有历史任务,按创建时间排序
495
         // 获取同一实例的所有历史任务,按创建时间排序
514
         List<ApprovalTask> instanceTasks = taskMapper.selectApprovalTaskByInstanceId(currentTask.getInstanceId());
496
         List<ApprovalTask> instanceTasks = taskMapper.selectApprovalTaskByInstanceId(currentTask.getInstanceId());
515
-        
497
+
516
         // 查找最早的科长审批任务(SECTION_LEADER节点)
498
         // 查找最早的科长审批任务(SECTION_LEADER节点)
517
         for (ApprovalTask task : instanceTasks) {
499
         for (ApprovalTask task : instanceTasks) {
518
             if (task.getCreateBy() != null) {
500
             if (task.getCreateBy() != null) {
@@ -523,7 +505,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
523
                 }
505
                 }
524
             }
506
             }
525
         }
507
         }
526
-        
508
+
527
         // 如果找不到科长任务,查找实例的提交者(通常提交后会有科长审批)
509
         // 如果找不到科长任务,查找实例的提交者(通常提交后会有科长审批)
528
         if (currentTask.getInstanceId() != null) {
510
         if (currentTask.getInstanceId() != null) {
529
             ApprovalInstance instance = instanceMapper.selectApprovalInstanceById(currentTask.getInstanceId());
511
             ApprovalInstance instance = instanceMapper.selectApprovalInstanceById(currentTask.getInstanceId());
@@ -532,26 +514,25 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
532
                 return getSectionLeaderIdsByUserId(instance.getSubmitterId()).stream().findFirst().orElse(null);
514
                 return getSectionLeaderIdsByUserId(instance.getSubmitterId()).stream().findFirst().orElse(null);
533
             }
515
             }
534
         }
516
         }
535
-        
517
+
536
         return null;
518
         return null;
537
     }
519
     }
538
-    
520
+
539
     /**
521
     /**
540
      * 根据任务ID获取任务的创建者或更新者用户ID(用于驳回回流)
522
      * 根据任务ID获取任务的创建者或更新者用户ID(用于驳回回流)
541
      */
523
      */
542
     @Override
524
     @Override
543
-    public Long getTaskCreatorOrUpdaterByTaskId(Long taskId)
544
-    {
525
+    public Long getTaskCreatorOrUpdaterByTaskId(Long taskId) {
545
         if (taskId == null) {
526
         if (taskId == null) {
546
             return null;
527
             return null;
547
         }
528
         }
548
-        
529
+
549
         // 查找当前任务
530
         // 查找当前任务
550
         ApprovalTask currentTask = taskMapper.selectApprovalTaskById(taskId);
531
         ApprovalTask currentTask = taskMapper.selectApprovalTaskById(taskId);
551
         if (currentTask == null) {
532
         if (currentTask == null) {
552
             return null;
533
             return null;
553
         }
534
         }
554
-        
535
+
555
         // 如果没有更新者,查找create_by(创建者)
536
         // 如果没有更新者,查找create_by(创建者)
556
         if (currentTask.getCreateBy() != null && !currentTask.getCreateBy().isEmpty()) {
537
         if (currentTask.getCreateBy() != null && !currentTask.getCreateBy().isEmpty()) {
557
             SysUser user = userMapper.selectUserByUserName(currentTask.getCreateBy());
538
             SysUser user = userMapper.selectUserByUserName(currentTask.getCreateBy());
@@ -559,23 +540,22 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
559
                 return user.getUserId();
540
                 return user.getUserId();
560
             }
541
             }
561
         }
542
         }
562
-        
543
+
563
         return null;
544
         return null;
564
     }
545
     }
565
-    
546
+
566
     /**
547
     /**
567
      * 根据用户ID查找其直接上级(违禁品审批用)
548
      * 根据用户ID查找其直接上级(违禁品审批用)
568
      * 如果用户是安检员,找其班组长;如果是班组长,找其科长
549
      * 如果用户是安检员,找其班组长;如果是班组长,找其科长
569
      */
550
      */
570
     @Override
551
     @Override
571
-    public List<Long> getDirectSuperiorIds(Long userId)
572
-    {
552
+    public List<Long> getDirectSuperiorIds(Long userId) {
573
         List<Long> superiorIds = new ArrayList<>();
553
         List<Long> superiorIds = new ArrayList<>();
574
-        
554
+
575
         if (userId == null) {
555
         if (userId == null) {
576
             return superiorIds;
556
             return superiorIds;
577
         }
557
         }
578
-        
558
+
579
         // 判断用户角色
559
         // 判断用户角色
580
         if (isGroupLeader(userId)) {
560
         if (isGroupLeader(userId)) {
581
             // 如果是班组长,找其科长
561
             // 如果是班组长,找其科长
@@ -586,7 +566,7 @@ public class ApprovalUserServiceImpl implements IApprovalUserService
586
             List<Long> groupLeaderIds = getGroupLeaderIdsByUserId(userId);
566
             List<Long> groupLeaderIds = getGroupLeaderIdsByUserId(userId);
587
             superiorIds.addAll(groupLeaderIds);
567
             superiorIds.addAll(groupLeaderIds);
588
         }
568
         }
589
-        
569
+
590
         return superiorIds;
570
         return superiorIds;
591
     }
571
     }
592
 }
572
 }

+ 19 - 27
airport-system/src/main/java/com/sundot/airport/system/service/approval/impl/ApprovalWorkflowServiceImpl.java

@@ -1,6 +1,7 @@
1
 package com.sundot.airport.system.service.approval.impl;
1
 package com.sundot.airport.system.service.approval.impl;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+
4
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.stereotype.Service;
6
 import org.springframework.stereotype.Service;
6
 import com.sundot.airport.system.mapper.approval.ApprovalWorkflowDefinitionMapper;
7
 import com.sundot.airport.system.mapper.approval.ApprovalWorkflowDefinitionMapper;
@@ -9,109 +10,100 @@ import com.sundot.airport.system.service.approval.IApprovalWorkflowService;
9
 
10
 
10
 /**
11
 /**
11
  * 审批流程定义Service业务层处理
12
  * 审批流程定义Service业务层处理
12
- * 
13
+ *
13
  * @author simon lin
14
  * @author simon lin
14
  * @date 2025-09-06
15
  * @date 2025-09-06
15
  */
16
  */
16
 @Service
17
 @Service
17
-public class ApprovalWorkflowServiceImpl implements IApprovalWorkflowService
18
-{
18
+public class ApprovalWorkflowServiceImpl implements IApprovalWorkflowService {
19
     @Autowired
19
     @Autowired
20
     private ApprovalWorkflowDefinitionMapper approvalWorkflowDefinitionMapper;
20
     private ApprovalWorkflowDefinitionMapper approvalWorkflowDefinitionMapper;
21
 
21
 
22
     /**
22
     /**
23
      * 查询审批流程定义
23
      * 查询审批流程定义
24
-     * 
24
+     *
25
      * @param id 审批流程定义主键
25
      * @param id 审批流程定义主键
26
      * @return 审批流程定义
26
      * @return 审批流程定义
27
      */
27
      */
28
     @Override
28
     @Override
29
-    public ApprovalWorkflowDefinition selectApprovalWorkflowDefinitionById(Long id)
30
-    {
29
+    public ApprovalWorkflowDefinition selectApprovalWorkflowDefinitionById(Long id) {
31
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionById(id);
30
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionById(id);
32
     }
31
     }
33
 
32
 
34
     /**
33
     /**
35
      * 根据流程代码查询审批流程定义
34
      * 根据流程代码查询审批流程定义
36
-     * 
35
+     *
37
      * @param workflowCode 流程代码
36
      * @param workflowCode 流程代码
38
      * @return 审批流程定义
37
      * @return 审批流程定义
39
      */
38
      */
40
     @Override
39
     @Override
41
-    public ApprovalWorkflowDefinition selectApprovalWorkflowDefinitionByCode(String workflowCode)
42
-    {
40
+    public ApprovalWorkflowDefinition selectApprovalWorkflowDefinitionByCode(String workflowCode) {
43
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode(workflowCode);
41
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionByCode(workflowCode);
44
     }
42
     }
45
 
43
 
46
     /**
44
     /**
47
      * 根据流程类型查询审批流程定义列表
45
      * 根据流程类型查询审批流程定义列表
48
-     * 
46
+     *
49
      * @param workflowType 流程类型
47
      * @param workflowType 流程类型
50
      * @return 审批流程定义列表
48
      * @return 审批流程定义列表
51
      */
49
      */
52
     @Override
50
     @Override
53
-    public List<ApprovalWorkflowDefinition> selectApprovalWorkflowDefinitionByType(String workflowType)
54
-    {
51
+    public List<ApprovalWorkflowDefinition> selectApprovalWorkflowDefinitionByType(String workflowType) {
55
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionByType(workflowType);
52
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionByType(workflowType);
56
     }
53
     }
57
 
54
 
58
     /**
55
     /**
59
      * 查询审批流程定义列表
56
      * 查询审批流程定义列表
60
-     * 
57
+     *
61
      * @param approvalWorkflowDefinition 审批流程定义
58
      * @param approvalWorkflowDefinition 审批流程定义
62
      * @return 审批流程定义
59
      * @return 审批流程定义
63
      */
60
      */
64
     @Override
61
     @Override
65
-    public List<ApprovalWorkflowDefinition> selectApprovalWorkflowDefinitionList(ApprovalWorkflowDefinition approvalWorkflowDefinition)
66
-    {
62
+    public List<ApprovalWorkflowDefinition> selectApprovalWorkflowDefinitionList(ApprovalWorkflowDefinition approvalWorkflowDefinition) {
67
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionList(approvalWorkflowDefinition);
63
         return approvalWorkflowDefinitionMapper.selectApprovalWorkflowDefinitionList(approvalWorkflowDefinition);
68
     }
64
     }
69
 
65
 
70
     /**
66
     /**
71
      * 新增审批流程定义
67
      * 新增审批流程定义
72
-     * 
68
+     *
73
      * @param approvalWorkflowDefinition 审批流程定义
69
      * @param approvalWorkflowDefinition 审批流程定义
74
      * @return 结果
70
      * @return 结果
75
      */
71
      */
76
     @Override
72
     @Override
77
-    public int insertApprovalWorkflowDefinition(ApprovalWorkflowDefinition approvalWorkflowDefinition)
78
-    {
73
+    public int insertApprovalWorkflowDefinition(ApprovalWorkflowDefinition approvalWorkflowDefinition) {
79
         return approvalWorkflowDefinitionMapper.insertApprovalWorkflowDefinition(approvalWorkflowDefinition);
74
         return approvalWorkflowDefinitionMapper.insertApprovalWorkflowDefinition(approvalWorkflowDefinition);
80
     }
75
     }
81
 
76
 
82
     /**
77
     /**
83
      * 修改审批流程定义
78
      * 修改审批流程定义
84
-     * 
79
+     *
85
      * @param approvalWorkflowDefinition 审批流程定义
80
      * @param approvalWorkflowDefinition 审批流程定义
86
      * @return 结果
81
      * @return 结果
87
      */
82
      */
88
     @Override
83
     @Override
89
-    public int updateApprovalWorkflowDefinition(ApprovalWorkflowDefinition approvalWorkflowDefinition)
90
-    {
84
+    public int updateApprovalWorkflowDefinition(ApprovalWorkflowDefinition approvalWorkflowDefinition) {
91
         return approvalWorkflowDefinitionMapper.updateApprovalWorkflowDefinition(approvalWorkflowDefinition);
85
         return approvalWorkflowDefinitionMapper.updateApprovalWorkflowDefinition(approvalWorkflowDefinition);
92
     }
86
     }
93
 
87
 
94
     /**
88
     /**
95
      * 批量删除审批流程定义
89
      * 批量删除审批流程定义
96
-     * 
90
+     *
97
      * @param ids 需要删除的审批流程定义主键
91
      * @param ids 需要删除的审批流程定义主键
98
      * @return 结果
92
      * @return 结果
99
      */
93
      */
100
     @Override
94
     @Override
101
-    public int deleteApprovalWorkflowDefinitionByIds(Long[] ids)
102
-    {
95
+    public int deleteApprovalWorkflowDefinitionByIds(Long[] ids) {
103
         return approvalWorkflowDefinitionMapper.deleteApprovalWorkflowDefinitionByIds(ids);
96
         return approvalWorkflowDefinitionMapper.deleteApprovalWorkflowDefinitionByIds(ids);
104
     }
97
     }
105
 
98
 
106
     /**
99
     /**
107
      * 删除审批流程定义信息
100
      * 删除审批流程定义信息
108
-     * 
101
+     *
109
      * @param id 审批流程定义主键
102
      * @param id 审批流程定义主键
110
      * @return 结果
103
      * @return 结果
111
      */
104
      */
112
     @Override
105
     @Override
113
-    public int deleteApprovalWorkflowDefinitionById(Long id)
114
-    {
106
+    public int deleteApprovalWorkflowDefinitionById(Long id) {
115
         return approvalWorkflowDefinitionMapper.deleteApprovalWorkflowDefinitionById(id);
107
         return approvalWorkflowDefinitionMapper.deleteApprovalWorkflowDefinitionById(id);
116
     }
108
     }
117
 }
109
 }

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

@@ -25,40 +25,40 @@ import java.util.Map;
25
 
25
 
26
 /**
26
 /**
27
  * 审批检查服务实现类
27
  * 审批检查服务实现类
28
- * 
28
+ *
29
  * @author Simon Lin
29
  * @author Simon Lin
30
  */
30
  */
31
 @Service
31
 @Service
32
 public class CheckApprovalServiceImpl implements ICheckApprovalService {
32
 public class CheckApprovalServiceImpl implements ICheckApprovalService {
33
-    
33
+
34
     private static final Logger logger = LoggerFactory.getLogger(CheckApprovalServiceImpl.class);
34
     private static final Logger logger = LoggerFactory.getLogger(CheckApprovalServiceImpl.class);
35
-    
35
+
36
     @Autowired
36
     @Autowired
37
     private IApprovalEngineService approvalEngineService;
37
     private IApprovalEngineService approvalEngineService;
38
-    
38
+
39
     @Autowired
39
     @Autowired
40
     private ApprovalTaskMapper approvalTaskMapper;
40
     private ApprovalTaskMapper approvalTaskMapper;
41
-    
41
+
42
     @Autowired
42
     @Autowired
43
     private ApprovalCcMapper approvalCcMapper;
43
     private ApprovalCcMapper approvalCcMapper;
44
-    
44
+
45
     @Autowired
45
     @Autowired
46
     private ApprovalHistoryMapper approvalHistoryMapper;
46
     private ApprovalHistoryMapper approvalHistoryMapper;
47
-    
47
+
48
     @Autowired
48
     @Autowired
49
     private ApprovalInstanceMapper approvalInstanceMapper;
49
     private ApprovalInstanceMapper approvalInstanceMapper;
50
-    
50
+
51
     @Override
51
     @Override
52
     public ApprovalInstance submitPersonalCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
52
     public ApprovalInstance submitPersonalCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
53
         // 提取系统控制参数
53
         // 提取系统控制参数
54
         String checkType = (String) requestData.get("checkType");
54
         String checkType = (String) requestData.get("checkType");
55
         String location = (String) requestData.get("location");
55
         String location = (String) requestData.get("location");
56
-        
56
+
57
         // 新的参数:问题人ID和审批科长ID
57
         // 新的参数:问题人ID和审批科长ID
58
         Object problemUserIdObj = requestData.get("problemUserId");
58
         Object problemUserIdObj = requestData.get("problemUserId");
59
         Object sectionLeaderIdObj = requestData.get("sectionLeaderId");
59
         Object sectionLeaderIdObj = requestData.get("sectionLeaderId");
60
         Object businessIdObj = requestData.get("businessId");
60
         Object businessIdObj = requestData.get("businessId");
61
-        
61
+
62
         if (businessIdObj == null) {
62
         if (businessIdObj == null) {
63
             throw new Exception("businessId参数不能为空");
63
             throw new Exception("businessId参数不能为空");
64
         }
64
         }
@@ -76,27 +76,27 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
76
         } else if (businessIdObj instanceof String) {
76
         } else if (businessIdObj instanceof String) {
77
             businessId = Long.parseLong((String) businessIdObj);
77
             businessId = Long.parseLong((String) businessIdObj);
78
         }
78
         }
79
-        
79
+
80
         Long problemUserId = null;
80
         Long problemUserId = null;
81
         if (problemUserIdObj instanceof Number) {
81
         if (problemUserIdObj instanceof Number) {
82
             problemUserId = ((Number) problemUserIdObj).longValue();
82
             problemUserId = ((Number) problemUserIdObj).longValue();
83
         } else if (problemUserIdObj instanceof String) {
83
         } else if (problemUserIdObj instanceof String) {
84
             problemUserId = Long.parseLong((String) problemUserIdObj);
84
             problemUserId = Long.parseLong((String) problemUserIdObj);
85
         }
85
         }
86
-        
86
+
87
         Long sectionLeaderId = null;
87
         Long sectionLeaderId = null;
88
         if (sectionLeaderIdObj instanceof Number) {
88
         if (sectionLeaderIdObj instanceof Number) {
89
             sectionLeaderId = ((Number) sectionLeaderIdObj).longValue();
89
             sectionLeaderId = ((Number) sectionLeaderIdObj).longValue();
90
         } else if (sectionLeaderIdObj instanceof String) {
90
         } else if (sectionLeaderIdObj instanceof String) {
91
             sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
91
             sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
92
         }
92
         }
93
-        
93
+
94
         // 提取用户表单数据
94
         // 提取用户表单数据
95
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
95
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
96
         if (userFormData == null) {
96
         if (userFormData == null) {
97
             userFormData = new HashMap<>();
97
             userFormData = new HashMap<>();
98
         }
98
         }
99
-        
99
+
100
         Map<String, Object> params = new HashMap<>();
100
         Map<String, Object> params = new HashMap<>();
101
         params.put("businessType", "PERSONAL_CHECK");
101
         params.put("businessType", "PERSONAL_CHECK");
102
         params.put("businessId", businessId);
102
         params.put("businessId", businessId);
@@ -105,11 +105,11 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
105
         params.put("location", location);
105
         params.put("location", location);
106
         params.put("problemUserId", problemUserId);
106
         params.put("problemUserId", problemUserId);
107
         params.put("sectionLeaderId", sectionLeaderId);
107
         params.put("sectionLeaderId", sectionLeaderId);
108
-        
108
+
109
         // 组装最终的表单数据(保留用户填写的所有字段)
109
         // 组装最终的表单数据(保留用户填写的所有字段)
110
         Map<String, Object> formData = new HashMap<>(userFormData);
110
         Map<String, Object> formData = new HashMap<>(userFormData);
111
         params.put("formData", formData);
111
         params.put("formData", formData);
112
-        
112
+
113
         // 业务数据(用于系统控制)
113
         // 业务数据(用于系统控制)
114
         Map<String, Object> businessData = new HashMap<>();
114
         Map<String, Object> businessData = new HashMap<>();
115
         businessData.put("checkType", checkType);
115
         businessData.put("checkType", checkType);
@@ -118,19 +118,19 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
118
         businessData.put("sectionLeaderId", sectionLeaderId);
118
         businessData.put("sectionLeaderId", sectionLeaderId);
119
         businessData.put("initiatorId", userId); // 发起人ID,用于最后的审批环节
119
         businessData.put("initiatorId", userId); // 发起人ID,用于最后的审批环节
120
         params.put("businessData", businessData);
120
         params.put("businessData", businessData);
121
-        
121
+
122
         return approvalEngineService.startPersonalLevelProcess(
122
         return approvalEngineService.startPersonalLevelProcess(
123
-            (String) params.get("businessType"),
124
-            (Long) params.get("businessId"),
125
-            (String) params.get("title"),
126
-            userId,
127
-            username,
128
-            sectionLeaderId, // 第一个审批节点分配给科长
129
-            formData,
130
-            businessData
123
+                (String) params.get("businessType"),
124
+                (Long) params.get("businessId"),
125
+                (String) params.get("title"),
126
+                userId,
127
+                username,
128
+                sectionLeaderId, // 第一个审批节点分配给科长
129
+                formData,
130
+                businessData
131
         );
131
         );
132
     }
132
     }
133
-    
133
+
134
     @Override
134
     @Override
135
     public ApprovalInstance submitSectionCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
135
     public ApprovalInstance submitSectionCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
136
         // 提取系统控制参数
136
         // 提取系统控制参数
@@ -139,24 +139,24 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
139
         Object targetDeptIdObj = requestData.get("targetDeptId");
139
         Object targetDeptIdObj = requestData.get("targetDeptId");
140
         Object sectionLeaderIdObj = requestData.get("sectionLeaderId");
140
         Object sectionLeaderIdObj = requestData.get("sectionLeaderId");
141
         Object businessIdObj = requestData.get("businessId");
141
         Object businessIdObj = requestData.get("businessId");
142
-        
142
+
143
         if (businessIdObj == null) {
143
         if (businessIdObj == null) {
144
             throw new Exception("businessId参数不能为空");
144
             throw new Exception("businessId参数不能为空");
145
         }
145
         }
146
-        
146
+
147
         Long businessId = null;
147
         Long businessId = null;
148
         if (businessIdObj instanceof Number) {
148
         if (businessIdObj instanceof Number) {
149
             businessId = ((Number) businessIdObj).longValue();
149
             businessId = ((Number) businessIdObj).longValue();
150
         } else if (businessIdObj instanceof String) {
150
         } else if (businessIdObj instanceof String) {
151
             businessId = Long.parseLong((String) businessIdObj);
151
             businessId = Long.parseLong((String) businessIdObj);
152
         }
152
         }
153
-        
153
+
154
         // 提取用户表单数据
154
         // 提取用户表单数据
155
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
155
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
156
         if (userFormData == null) {
156
         if (userFormData == null) {
157
             userFormData = new HashMap<>();
157
             userFormData = new HashMap<>();
158
         }
158
         }
159
-        
159
+
160
         Long targetDeptId = null;
160
         Long targetDeptId = null;
161
         if (targetDeptIdObj != null) {
161
         if (targetDeptIdObj != null) {
162
             if (targetDeptIdObj instanceof Number) {
162
             if (targetDeptIdObj instanceof Number) {
@@ -165,7 +165,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
165
                 targetDeptId = Long.parseLong((String) targetDeptIdObj);
165
                 targetDeptId = Long.parseLong((String) targetDeptIdObj);
166
             }
166
             }
167
         }
167
         }
168
-        
168
+
169
         Long sectionLeaderId = null;
169
         Long sectionLeaderId = null;
170
         if (sectionLeaderIdObj != null) {
170
         if (sectionLeaderIdObj != null) {
171
             if (sectionLeaderIdObj instanceof Number) {
171
             if (sectionLeaderIdObj instanceof Number) {
@@ -174,14 +174,14 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
174
                 sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
174
                 sectionLeaderId = Long.parseLong((String) sectionLeaderIdObj);
175
             }
175
             }
176
         }
176
         }
177
-        
177
+
178
         if (sectionLeaderId == null) {
178
         if (sectionLeaderId == null) {
179
             throw new Exception("sectionLeaderId参数不能为空");
179
             throw new Exception("sectionLeaderId参数不能为空");
180
         }
180
         }
181
-        
181
+
182
         // 生成业务ID
182
         // 生成业务ID
183
         //Long businessId = System.currentTimeMillis();
183
         //Long businessId = System.currentTimeMillis();
184
-        
184
+
185
         Map<String, Object> params = new HashMap<>();
185
         Map<String, Object> params = new HashMap<>();
186
         params.put("businessType", "SECTION_CHECK");
186
         params.put("businessType", "SECTION_CHECK");
187
         params.put("businessId", businessId);
187
         params.put("businessId", businessId);
@@ -189,11 +189,11 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
189
         params.put("checkType", checkType);
189
         params.put("checkType", checkType);
190
         params.put("severity", severity);
190
         params.put("severity", severity);
191
         params.put("targetDeptId", targetDeptId);
191
         params.put("targetDeptId", targetDeptId);
192
-        
192
+
193
         // 组装最终的表单数据
193
         // 组装最终的表单数据
194
         Map<String, Object> formData = new HashMap<>(userFormData);
194
         Map<String, Object> formData = new HashMap<>(userFormData);
195
         params.put("formData", formData);
195
         params.put("formData", formData);
196
-        
196
+
197
         // 业务数据
197
         // 业务数据
198
         Map<String, Object> businessData = new HashMap<>();
198
         Map<String, Object> businessData = new HashMap<>();
199
         businessData.put("checkType", checkType);
199
         businessData.put("checkType", checkType);
@@ -203,19 +203,19 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
203
         }
203
         }
204
         businessData.put("sectionLeaderId", sectionLeaderId);
204
         businessData.put("sectionLeaderId", sectionLeaderId);
205
         params.put("businessData", businessData);
205
         params.put("businessData", businessData);
206
-        
206
+
207
         return approvalEngineService.startSectionLevelProcess(
207
         return approvalEngineService.startSectionLevelProcess(
208
-            (String) params.get("businessType"),
209
-            (Long) params.get("businessId"),
210
-            (String) params.get("title"),
211
-            userId,
212
-            username,
213
-            sectionLeaderId,
214
-            formData,
215
-            businessData
208
+                (String) params.get("businessType"),
209
+                (Long) params.get("businessId"),
210
+                (String) params.get("title"),
211
+                userId,
212
+                username,
213
+                sectionLeaderId,
214
+                formData,
215
+                businessData
216
         );
216
         );
217
     }
217
     }
218
-    
218
+
219
     @Override
219
     @Override
220
     public ApprovalInstance submitGroupCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
220
     public ApprovalInstance submitGroupCheck(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
221
         // 提取系统控制参数
221
         // 提取系统控制参数
@@ -223,24 +223,24 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
223
         String severity = (String) requestData.get("severity");
223
         String severity = (String) requestData.get("severity");
224
         Object groupLeaderIdObj = requestData.get("groupLeaderId");
224
         Object groupLeaderIdObj = requestData.get("groupLeaderId");
225
         Object businessIdObj = requestData.get("businessId");
225
         Object businessIdObj = requestData.get("businessId");
226
-        
226
+
227
         if (businessIdObj == null) {
227
         if (businessIdObj == null) {
228
             throw new Exception("businessId参数不能为空");
228
             throw new Exception("businessId参数不能为空");
229
         }
229
         }
230
-        
230
+
231
         Long businessId = null;
231
         Long businessId = null;
232
         if (businessIdObj instanceof Number) {
232
         if (businessIdObj instanceof Number) {
233
             businessId = ((Number) businessIdObj).longValue();
233
             businessId = ((Number) businessIdObj).longValue();
234
         } else if (businessIdObj instanceof String) {
234
         } else if (businessIdObj instanceof String) {
235
             businessId = Long.parseLong((String) businessIdObj);
235
             businessId = Long.parseLong((String) businessIdObj);
236
         }
236
         }
237
-        
237
+
238
         // 提取用户表单数据
238
         // 提取用户表单数据
239
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
239
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
240
         if (userFormData == null) {
240
         if (userFormData == null) {
241
             userFormData = new HashMap<>();
241
             userFormData = new HashMap<>();
242
         }
242
         }
243
-        
243
+
244
         Long groupLeaderId = null;
244
         Long groupLeaderId = null;
245
         if (groupLeaderIdObj != null) {
245
         if (groupLeaderIdObj != null) {
246
             if (groupLeaderIdObj instanceof Number) {
246
             if (groupLeaderIdObj instanceof Number) {
@@ -249,14 +249,14 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
249
                 groupLeaderId = Long.parseLong((String) groupLeaderIdObj);
249
                 groupLeaderId = Long.parseLong((String) groupLeaderIdObj);
250
             }
250
             }
251
         }
251
         }
252
-        
252
+
253
         if (groupLeaderId == null) {
253
         if (groupLeaderId == null) {
254
             throw new Exception("groupLeaderId参数不能为空");
254
             throw new Exception("groupLeaderId参数不能为空");
255
         }
255
         }
256
-        
256
+
257
         // 生成业务ID
257
         // 生成业务ID
258
         //Long businessId = System.currentTimeMillis();
258
         //Long businessId = System.currentTimeMillis();
259
-        
259
+
260
         Map<String, Object> params = new HashMap<>();
260
         Map<String, Object> params = new HashMap<>();
261
         params.put("businessType", "GROUP_CHECK");
261
         params.put("businessType", "GROUP_CHECK");
262
         params.put("businessId", businessId);
262
         params.put("businessId", businessId);
@@ -264,29 +264,29 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
264
         params.put("checkType", checkType);
264
         params.put("checkType", checkType);
265
         params.put("severity", severity);
265
         params.put("severity", severity);
266
         params.put("groupLeaderId", groupLeaderId);
266
         params.put("groupLeaderId", groupLeaderId);
267
-        
267
+
268
         // 组装表单数据
268
         // 组装表单数据
269
         Map<String, Object> formData = new HashMap<>(userFormData);
269
         Map<String, Object> formData = new HashMap<>(userFormData);
270
         params.put("formData", formData);
270
         params.put("formData", formData);
271
-        
271
+
272
         // 业务数据
272
         // 业务数据
273
         Map<String, Object> businessData = new HashMap<>();
273
         Map<String, Object> businessData = new HashMap<>();
274
         businessData.put("checkType", checkType);
274
         businessData.put("checkType", checkType);
275
         businessData.put("severity", severity);
275
         businessData.put("severity", severity);
276
         businessData.put("groupLeaderId", groupLeaderId);
276
         businessData.put("groupLeaderId", groupLeaderId);
277
         params.put("businessData", businessData);
277
         params.put("businessData", businessData);
278
-        
278
+
279
         return approvalEngineService.startGroupLevelProcess(
279
         return approvalEngineService.startGroupLevelProcess(
280
-            (String) params.get("businessType"),
281
-            (Long) params.get("businessId"),
282
-            (String) params.get("title"),
283
-            userId,
284
-            username,
285
-            formData,
286
-            businessData
280
+                (String) params.get("businessType"),
281
+                (Long) params.get("businessId"),
282
+                (String) params.get("title"),
283
+                userId,
284
+                username,
285
+                formData,
286
+                businessData
287
         );
287
         );
288
     }
288
     }
289
-    
289
+
290
     @Override
290
     @Override
291
     public ApprovalInstance submitSeizureReport(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
291
     public ApprovalInstance submitSeizureReport(Map<String, Object> requestData, Long userId, String username, String remark) throws Exception {
292
         // 提取系统控制参数
292
         // 提取系统控制参数
@@ -294,24 +294,24 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
294
         String passengerInfo = (String) requestData.get("passengerInfo");
294
         String passengerInfo = (String) requestData.get("passengerInfo");
295
         String submitterRole = (String) requestData.get("submitterRole");
295
         String submitterRole = (String) requestData.get("submitterRole");
296
         Object businessIdObj = requestData.get("businessId");
296
         Object businessIdObj = requestData.get("businessId");
297
-        
297
+
298
         if (businessIdObj == null) {
298
         if (businessIdObj == null) {
299
             throw new Exception("businessId参数不能为空");
299
             throw new Exception("businessId参数不能为空");
300
         }
300
         }
301
-        
301
+
302
         Long businessId = null;
302
         Long businessId = null;
303
         if (businessIdObj instanceof Number) {
303
         if (businessIdObj instanceof Number) {
304
             businessId = ((Number) businessIdObj).longValue();
304
             businessId = ((Number) businessIdObj).longValue();
305
         } else if (businessIdObj instanceof String) {
305
         } else if (businessIdObj instanceof String) {
306
             businessId = Long.parseLong((String) businessIdObj);
306
             businessId = Long.parseLong((String) businessIdObj);
307
         }
307
         }
308
-        
308
+
309
         // 提取用户表单数据
309
         // 提取用户表单数据
310
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
310
         Map<String, Object> userFormData = (Map<String, Object>) requestData.get("formData");
311
         if (userFormData == null) {
311
         if (userFormData == null) {
312
             userFormData = new HashMap<>();
312
             userFormData = new HashMap<>();
313
         }
313
         }
314
-        
314
+
315
         // 处理查获时间
315
         // 处理查获时间
316
         Date seizureTime = null;
316
         Date seizureTime = null;
317
         if (seizureTimeObj != null) {
317
         if (seizureTimeObj != null) {
@@ -326,20 +326,20 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
326
                 }
326
                 }
327
             }
327
             }
328
         }
328
         }
329
-        
329
+
330
         // 生成业务ID
330
         // 生成业务ID
331
         //Long businessId = System.currentTimeMillis();
331
         //Long businessId = System.currentTimeMillis();
332
-        
332
+
333
         Map<String, Object> params = new HashMap<>();
333
         Map<String, Object> params = new HashMap<>();
334
         params.put("businessType", "SEIZURE_REPORT");
334
         params.put("businessType", "SEIZURE_REPORT");
335
         params.put("businessId", businessId);
335
         params.put("businessId", businessId);
336
         params.put("title", "查获物品上报");
336
         params.put("title", "查获物品上报");
337
         params.put("submitterRole", submitterRole);
337
         params.put("submitterRole", submitterRole);
338
-        
338
+
339
         // 组装表单数据
339
         // 组装表单数据
340
         Map<String, Object> formData = new HashMap<>(userFormData);
340
         Map<String, Object> formData = new HashMap<>(userFormData);
341
         params.put("formData", formData);
341
         params.put("formData", formData);
342
-        
342
+
343
         // 业务数据
343
         // 业务数据
344
         Map<String, Object> businessData = new HashMap<>();
344
         Map<String, Object> businessData = new HashMap<>();
345
         if (seizureTime != null) {
345
         if (seizureTime != null) {
@@ -349,28 +349,28 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
349
             businessData.put("passengerInfo", passengerInfo);
349
             businessData.put("passengerInfo", passengerInfo);
350
         }
350
         }
351
         params.put("businessData", businessData);
351
         params.put("businessData", businessData);
352
-        
352
+
353
         return approvalEngineService.startSeizureReportProcess(
353
         return approvalEngineService.startSeizureReportProcess(
354
-            (String) params.get("businessType"),
355
-            (Long) params.get("businessId"),
356
-            (String) params.get("title"),
357
-            userId,
358
-            username,
359
-            submitterRole,
360
-            formData,
361
-            businessData
354
+                (String) params.get("businessType"),
355
+                (Long) params.get("businessId"),
356
+                (String) params.get("title"),
357
+                userId,
358
+                username,
359
+                submitterRole,
360
+                formData,
361
+                businessData
362
         );
362
         );
363
     }
363
     }
364
-    
364
+
365
     @Override
365
     @Override
366
     public ApprovalTask approveTask(Long taskId, String comment, Map<String, Object> formData, Long userId, String username) throws Exception {
366
     public ApprovalTask approveTask(Long taskId, String comment, Map<String, Object> formData, Long userId, String username) throws Exception {
367
         if (formData == null) {
367
         if (formData == null) {
368
             formData = new HashMap<>();
368
             formData = new HashMap<>();
369
         }
369
         }
370
-        
370
+
371
         Map<String, Object> params = new HashMap<>();
371
         Map<String, Object> params = new HashMap<>();
372
         params.put("comment", comment);
372
         params.put("comment", comment);
373
-        
373
+
374
         boolean success = approvalEngineService.approveTask(taskId, userId, username, comment, formData);
374
         boolean success = approvalEngineService.approveTask(taskId, userId, username, comment, formData);
375
         if (success) {
375
         if (success) {
376
             // 获取更新后的任务信息
376
             // 获取更新后的任务信息
@@ -379,7 +379,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
379
             throw new Exception("审批任务失败");
379
             throw new Exception("审批任务失败");
380
         }
380
         }
381
     }
381
     }
382
-    
382
+
383
     @Override
383
     @Override
384
     public ApprovalTask rejectTask(Long taskId, String comment, Long userId, String username) throws Exception {
384
     public ApprovalTask rejectTask(Long taskId, String comment, Long userId, String username) throws Exception {
385
         boolean success = approvalEngineService.rejectTask(taskId, userId, username, comment);
385
         boolean success = approvalEngineService.rejectTask(taskId, userId, username, comment);
@@ -390,47 +390,47 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
390
             throw new Exception("驳回任务失败");
390
             throw new Exception("驳回任务失败");
391
         }
391
         }
392
     }
392
     }
393
-    
393
+
394
     @Override
394
     @Override
395
     public List<ApprovalTask> getPendingTasks(Long userId) throws Exception {
395
     public List<ApprovalTask> getPendingTasks(Long userId) throws Exception {
396
         return approvalEngineService.getUserPendingTasks(userId);
396
         return approvalEngineService.getUserPendingTasks(userId);
397
     }
397
     }
398
-    
398
+
399
     @Override
399
     @Override
400
     public List<ApprovalTask> getCompletedTasks(Long userId) throws Exception {
400
     public List<ApprovalTask> getCompletedTasks(Long userId) throws Exception {
401
         return approvalEngineService.getUserCompletedTasks(userId);
401
         return approvalEngineService.getUserCompletedTasks(userId);
402
     }
402
     }
403
-    
403
+
404
     @Override
404
     @Override
405
     public List<ApprovalInstance> getSubmittedInstances(Long userId, String status) throws Exception {
405
     public List<ApprovalInstance> getSubmittedInstances(Long userId, String status) throws Exception {
406
         return approvalEngineService.getUserSubmittedInstances(userId, status);
406
         return approvalEngineService.getUserSubmittedInstances(userId, status);
407
     }
407
     }
408
-    
408
+
409
     @Override
409
     @Override
410
     public Long getPendingTaskCount(Long userId) throws Exception {
410
     public Long getPendingTaskCount(Long userId) throws Exception {
411
         List<ApprovalTask> tasks = approvalEngineService.getUserPendingTasks(userId);
411
         List<ApprovalTask> tasks = approvalEngineService.getUserPendingTasks(userId);
412
         return (long) tasks.size();
412
         return (long) tasks.size();
413
     }
413
     }
414
-    
414
+
415
     @Override
415
     @Override
416
     public List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> getCcDetailsByUserId(Long userId) throws Exception {
416
     public List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> getCcDetailsByUserId(Long userId) throws Exception {
417
         // 1. 获取用户抄送记录(关联实例信息) - 这个查询会被PageHelper拦截进行分页
417
         // 1. 获取用户抄送记录(关联实例信息) - 这个查询会被PageHelper拦截进行分页
418
         List<ApprovalCc> ccList = approvalCcMapper.selectCcDetailsByUserId(userId);
418
         List<ApprovalCc> ccList = approvalCcMapper.selectCcDetailsByUserId(userId);
419
-        
419
+
420
         // 2. 转换为DTO并获取历史记录
420
         // 2. 转换为DTO并获取历史记录
421
         List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> resultList = new ArrayList<>();
421
         List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> resultList = new ArrayList<>();
422
-        
422
+
423
         for (ApprovalCc cc : ccList) {
423
         for (ApprovalCc cc : ccList) {
424
-            com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO dto = 
425
-                new com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO();
426
-            
424
+            com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO dto =
425
+                    new com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO();
426
+
427
             // 设置抄送信息
427
             // 设置抄送信息
428
             dto.setCcId(cc.getId());
428
             dto.setCcId(cc.getId());
429
             dto.setInstanceId(cc.getInstanceId());
429
             dto.setInstanceId(cc.getInstanceId());
430
             dto.setCcTime(cc.getCcTime());
430
             dto.setCcTime(cc.getCcTime());
431
             dto.setIsRead(cc.getIsRead());
431
             dto.setIsRead(cc.getIsRead());
432
             dto.setReadTime(cc.getReadTime());
432
             dto.setReadTime(cc.getReadTime());
433
-            
433
+
434
             // 设置实例信息
434
             // 设置实例信息
435
             if (cc.getInstance() != null) {
435
             if (cc.getInstance() != null) {
436
                 dto.setTitle(cc.getInstance().getTitle());
436
                 dto.setTitle(cc.getInstance().getTitle());
@@ -439,47 +439,47 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
439
                 dto.setBusinessType(cc.getInstance().getBusinessType());
439
                 dto.setBusinessType(cc.getInstance().getBusinessType());
440
                 dto.setFormData(cc.getInstance().getFormData());
440
                 dto.setFormData(cc.getInstance().getFormData());
441
             }
441
             }
442
-            
442
+
443
             // 获取历史记录
443
             // 获取历史记录
444
             List<ApprovalHistory> historyList = approvalHistoryMapper.selectApprovalHistoryByInstanceId(cc.getInstanceId());
444
             List<ApprovalHistory> historyList = approvalHistoryMapper.selectApprovalHistoryByInstanceId(cc.getInstanceId());
445
-            List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO.ApprovalHistoryDetailDTO> historyDetailList = 
446
-                new ArrayList<>();
447
-            
445
+            List<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO.ApprovalHistoryDetailDTO> historyDetailList =
446
+                    new ArrayList<>();
447
+
448
             for (ApprovalHistory history : historyList) {
448
             for (ApprovalHistory history : historyList) {
449
-                com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO.ApprovalHistoryDetailDTO historyDto = 
450
-                    new com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO.ApprovalHistoryDetailDTO();
451
-                
449
+                com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO.ApprovalHistoryDetailDTO historyDto =
450
+                        new com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO.ApprovalHistoryDetailDTO();
451
+
452
                 historyDto.setNodeName(history.getNodeName());
452
                 historyDto.setNodeName(history.getNodeName());
453
                 historyDto.setOperatorName(history.getOperatorName());
453
                 historyDto.setOperatorName(history.getOperatorName());
454
                 historyDto.setOperationTime(history.getOperationTime());
454
                 historyDto.setOperationTime(history.getOperationTime());
455
                 historyDto.setComment(history.getComment());
455
                 historyDto.setComment(history.getComment());
456
-                
456
+
457
                 historyDetailList.add(historyDto);
457
                 historyDetailList.add(historyDto);
458
             }
458
             }
459
-            
459
+
460
             dto.setHistoryList(historyDetailList);
460
             dto.setHistoryList(historyDetailList);
461
             resultList.add(dto);
461
             resultList.add(dto);
462
         }
462
         }
463
-        
463
+
464
         // 3. 创建一个新的具有分页信息的列表,用于让PageInfo获取正确的分页信息
464
         // 3. 创建一个新的具有分页信息的列表,用于让PageInfo获取正确的分页信息
465
         // 我们需要将ccList的分页信息传递给resultList
465
         // 我们需要将ccList的分页信息传递给resultList
466
         if (ccList instanceof com.github.pagehelper.Page) {
466
         if (ccList instanceof com.github.pagehelper.Page) {
467
             com.github.pagehelper.Page<ApprovalCc> pagedCcList = (com.github.pagehelper.Page<ApprovalCc>) ccList;
467
             com.github.pagehelper.Page<ApprovalCc> pagedCcList = (com.github.pagehelper.Page<ApprovalCc>) ccList;
468
-            com.github.pagehelper.Page<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> pagedResultList = 
469
-                new com.github.pagehelper.Page<>(pagedCcList.getPageNum(), pagedCcList.getPageSize());
468
+            com.github.pagehelper.Page<com.sundot.airport.system.domain.approval.dto.ApprovalCcDetailDTO> pagedResultList =
469
+                    new com.github.pagehelper.Page<>(pagedCcList.getPageNum(), pagedCcList.getPageSize());
470
             pagedResultList.setTotal(pagedCcList.getTotal());
470
             pagedResultList.setTotal(pagedCcList.getTotal());
471
             pagedResultList.addAll(resultList);
471
             pagedResultList.addAll(resultList);
472
             return pagedResultList;
472
             return pagedResultList;
473
         }
473
         }
474
-        
474
+
475
         return resultList;
475
         return resultList;
476
     }
476
     }
477
-    
477
+
478
     @Override
478
     @Override
479
     public List<ApprovalHistory> getApprovalHistoryByInstanceId(Long instanceId) throws Exception {
479
     public List<ApprovalHistory> getApprovalHistoryByInstanceId(Long instanceId) throws Exception {
480
         try {
480
         try {
481
             List<ApprovalHistory> historyList = approvalHistoryMapper.selectApprovalHistoryByInstanceId(instanceId);
481
             List<ApprovalHistory> historyList = approvalHistoryMapper.selectApprovalHistoryByInstanceId(instanceId);
482
-            
482
+
483
             // 检查审批实例是否完成
483
             // 检查审批实例是否完成
484
             ApprovalInstance instance = approvalInstanceMapper.selectApprovalInstanceById(instanceId);
484
             ApprovalInstance instance = approvalInstanceMapper.selectApprovalInstanceById(instanceId);
485
             if (instance != null && !"COMPLETED".equals(instance.getStatus()) && !"REJECTED".equals(instance.getStatus()) && !"CANCELLED".equals(instance.getStatus())) {
485
             if (instance != null && !"COMPLETED".equals(instance.getStatus()) && !"REJECTED".equals(instance.getStatus()) && !"CANCELLED".equals(instance.getStatus())) {
@@ -488,7 +488,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
488
                 pendingTask.setInstanceId(instanceId);
488
                 pendingTask.setInstanceId(instanceId);
489
                 pendingTask.setStatus("PENDING");
489
                 pendingTask.setStatus("PENDING");
490
                 List<ApprovalTask> pendingTasks = approvalTaskMapper.selectApprovalTaskList(pendingTask);
490
                 List<ApprovalTask> pendingTasks = approvalTaskMapper.selectApprovalTaskList(pendingTask);
491
-                
491
+
492
                 if (!pendingTasks.isEmpty()) {
492
                 if (!pendingTasks.isEmpty()) {
493
                     // 将待办任务转换为审批历史记录格式并添加到列表末尾
493
                     // 将待办任务转换为审批历史记录格式并添加到列表末尾
494
                     ApprovalTask task = pendingTasks.get(0); // 通常只有一个当前待办任务
494
                     ApprovalTask task = pendingTasks.get(0); // 通常只有一个当前待办任务
@@ -503,17 +503,17 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
503
                     pendingHistory.setOperationTime(task.getAssignTime());
503
                     pendingHistory.setOperationTime(task.getAssignTime());
504
                     pendingHistory.setComment("待处理");
504
                     pendingHistory.setComment("待处理");
505
                     pendingHistory.setFormData(task.getFormData());
505
                     pendingHistory.setFormData(task.getFormData());
506
-                    
506
+
507
                     historyList.add(pendingHistory);
507
                     historyList.add(pendingHistory);
508
                 }
508
                 }
509
             }
509
             }
510
-            
510
+
511
             return historyList;
511
             return historyList;
512
         } catch (Exception e) {
512
         } catch (Exception e) {
513
             throw new Exception("根据实例ID查询审批历史失败:" + e.getMessage(), e);
513
             throw new Exception("根据实例ID查询审批历史失败:" + e.getMessage(), e);
514
         }
514
         }
515
     }
515
     }
516
-    
516
+
517
     @Override
517
     @Override
518
     public List<ApprovalHistory> getApprovalHistoryByTaskId(Long taskId) throws Exception {
518
     public List<ApprovalHistory> getApprovalHistoryByTaskId(Long taskId) throws Exception {
519
         try {
519
         try {
@@ -522,7 +522,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
522
             throw new Exception("根据任务ID查询审批历史失败:" + e.getMessage(), e);
522
             throw new Exception("根据任务ID查询审批历史失败:" + e.getMessage(), e);
523
         }
523
         }
524
     }
524
     }
525
-    
525
+
526
     @Override
526
     @Override
527
     public List<ApprovalHistory> getUserApprovalHistory(Long userId, String action) throws Exception {
527
     public List<ApprovalHistory> getUserApprovalHistory(Long userId, String action) throws Exception {
528
         try {
528
         try {
@@ -531,7 +531,7 @@ public class CheckApprovalServiceImpl implements ICheckApprovalService {
531
             throw new Exception("查询用户审批历史失败:" + e.getMessage(), e);
531
             throw new Exception("查询用户审批历史失败:" + e.getMessage(), e);
532
         }
532
         }
533
     }
533
     }
534
-    
534
+
535
     @Override
535
     @Override
536
     public int batchUpdateCcReadStatus(List<Long> ids) throws Exception {
536
     public int batchUpdateCcReadStatus(List<Long> ids) throws Exception {
537
         try {
537
         try {

+ 102 - 73
airport-system/src/main/resources/mapper/approval/ApprovalCcMapper.xml

@@ -1,95 +1,108 @@
1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper
2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalCcMapper">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalCcMapper">
6
-    
6
+
7
     <resultMap type="ApprovalCc" id="ApprovalCcResult">
7
     <resultMap type="ApprovalCc" id="ApprovalCcResult">
8
-        <id     property="id"           column="id"             />
9
-        <result property="instanceId"   column="instance_id"    />
10
-        <result property="ccUserId"     column="cc_user_id"     />
11
-        <result property="ccUserName"   column="cc_user_name"   />
12
-        <result property="ccTime"       column="cc_time"        />
13
-        <result property="isRead"       column="is_read"        />
14
-        <result property="readTime"     column="read_time"      />
15
-        <result property="createBy"     column="create_by"      />
16
-        <result property="createTime"   column="create_time"    />
17
-        <result property="remark"       column="remark"         />
8
+        <id property="id" column="id"/>
9
+        <result property="instanceId" column="instance_id"/>
10
+        <result property="ccUserId" column="cc_user_id"/>
11
+        <result property="ccUserName" column="cc_user_name"/>
12
+        <result property="ccTime" column="cc_time"/>
13
+        <result property="isRead" column="is_read"/>
14
+        <result property="readTime" column="read_time"/>
15
+        <result property="createBy" column="create_by"/>
16
+        <result property="createTime" column="create_time"/>
17
+        <result property="remark" column="remark"/>
18
     </resultMap>
18
     </resultMap>
19
-    
19
+
20
     <resultMap id="InstanceResult" type="ApprovalInstance">
20
     <resultMap id="InstanceResult" type="ApprovalInstance">
21
-        <id     property="id"               column="instance_id"        />
22
-        <result property="instanceNo"       column="instance_no"        />
23
-        <result property="title"            column="title"              />
24
-        <result property="businessType"     column="business_type"      />
25
-        <result property="status"           column="status"             />
26
-        <result property="submitTime"       column="submit_time"        />
27
-        <result property="completionTime"   column="completion_time"    />
21
+        <id property="id" column="instance_id"/>
22
+        <result property="instanceNo" column="instance_no"/>
23
+        <result property="title" column="title"/>
24
+        <result property="businessType" column="business_type"/>
25
+        <result property="status" column="status"/>
26
+        <result property="submitTime" column="submit_time"/>
27
+        <result property="completionTime" column="completion_time"/>
28
     </resultMap>
28
     </resultMap>
29
 
29
 
30
     <resultMap id="ApprovalCcWithInstanceResult" type="ApprovalCc">
30
     <resultMap id="ApprovalCcWithInstanceResult" type="ApprovalCc">
31
-        <id     property="id"           column="id"             />
32
-        <result property="instanceId"   column="instance_id"    />
33
-        <result property="ccUserId"     column="cc_user_id"     />
34
-        <result property="ccUserName"   column="cc_user_name"   />
35
-        <result property="ccTime"       column="cc_time"        />
36
-        <result property="isRead"       column="is_read"        />
37
-        <result property="readTime"     column="read_time"      />
38
-        <result property="createBy"     column="create_by"      />
39
-        <result property="createTime"   column="create_time"    />
40
-        <result property="remark"       column="remark"         />
31
+        <id property="id" column="id"/>
32
+        <result property="instanceId" column="instance_id"/>
33
+        <result property="ccUserId" column="cc_user_id"/>
34
+        <result property="ccUserName" column="cc_user_name"/>
35
+        <result property="ccTime" column="cc_time"/>
36
+        <result property="isRead" column="is_read"/>
37
+        <result property="readTime" column="read_time"/>
38
+        <result property="createBy" column="create_by"/>
39
+        <result property="createTime" column="create_time"/>
40
+        <result property="remark" column="remark"/>
41
         <association property="instance" javaType="ApprovalInstance">
41
         <association property="instance" javaType="ApprovalInstance">
42
-            <id     property="id"               column="ai_id"              />
43
-            <result property="instanceNo"       column="ai_instance_no"     />
44
-            <result property="title"            column="ai_title"           />
45
-            <result property="businessId"       column="ai_business_id"     />
46
-            <result property="businessType"     column="ai_business_type"   />
47
-            <result property="status"           column="ai_status"          />
48
-            <result property="submitTime"       column="ai_submit_time"     />
49
-            <result property="completionTime"   column="ai_completion_time" />
50
-            <result property="formData"         column="ai_form_data"       />
42
+            <id property="id" column="ai_id"/>
43
+            <result property="instanceNo" column="ai_instance_no"/>
44
+            <result property="title" column="ai_title"/>
45
+            <result property="businessId" column="ai_business_id"/>
46
+            <result property="businessType" column="ai_business_type"/>
47
+            <result property="status" column="ai_status"/>
48
+            <result property="submitTime" column="ai_submit_time"/>
49
+            <result property="completionTime" column="ai_completion_time"/>
50
+            <result property="formData" column="ai_form_data"/>
51
         </association>
51
         </association>
52
     </resultMap>
52
     </resultMap>
53
 
53
 
54
     <sql id="selectApprovalCcVo">
54
     <sql id="selectApprovalCcVo">
55
-        select id, instance_id, cc_user_id, cc_user_name, cc_time, is_read, read_time, create_by, create_time, remark from approval_cc
55
+        select id,
56
+               instance_id,
57
+               cc_user_id,
58
+               cc_user_name,
59
+               cc_time,
60
+               is_read,
61
+               read_time,
62
+               create_by,
63
+               create_time,
64
+               remark
65
+        from approval_cc
56
     </sql>
66
     </sql>
57
 
67
 
58
     <select id="selectApprovalCcList" parameterType="ApprovalCc" resultMap="ApprovalCcResult">
68
     <select id="selectApprovalCcList" parameterType="ApprovalCc" resultMap="ApprovalCcResult">
59
         <include refid="selectApprovalCcVo"/>
69
         <include refid="selectApprovalCcVo"/>
60
-        <where>  
61
-            <if test="instanceId != null "> and instance_id = #{instanceId}</if>
62
-            <if test="ccUserId != null "> and cc_user_id = #{ccUserId}</if>
63
-            <if test="ccUserName != null  and ccUserName != ''"> and cc_user_name like concat('%', #{ccUserName}, '%')</if>
64
-            <if test="isRead != null  and isRead != ''"> and is_read = #{isRead}</if>
65
-            <if test="params.beginCcTime != null and params.beginCcTime != '' and params.endCcTime != null and params.endCcTime != ''"> and cc_time between #{params.beginCcTime} and #{params.endCcTime}</if>
70
+        <where>
71
+            <if test="instanceId != null ">and instance_id = #{instanceId}</if>
72
+            <if test="ccUserId != null ">and cc_user_id = #{ccUserId}</if>
73
+            <if test="ccUserName != null  and ccUserName != ''">and cc_user_name like concat('%', #{ccUserName}, '%')
74
+            </if>
75
+            <if test="isRead != null  and isRead != ''">and is_read = #{isRead}</if>
76
+            <if test="params.beginCcTime != null and params.beginCcTime != '' and params.endCcTime != null and params.endCcTime != ''">
77
+                and cc_time between #{params.beginCcTime} and #{params.endCcTime}
78
+            </if>
66
         </where>
79
         </where>
67
     </select>
80
     </select>
68
-    
81
+
69
     <select id="selectApprovalCcById" parameterType="Long" resultMap="ApprovalCcResult">
82
     <select id="selectApprovalCcById" parameterType="Long" resultMap="ApprovalCcResult">
70
         <include refid="selectApprovalCcVo"/>
83
         <include refid="selectApprovalCcVo"/>
71
         where id = #{id}
84
         where id = #{id}
72
     </select>
85
     </select>
73
-    
86
+
74
     <select id="selectApprovalCcByInstanceId" parameterType="Long" resultMap="ApprovalCcResult">
87
     <select id="selectApprovalCcByInstanceId" parameterType="Long" resultMap="ApprovalCcResult">
75
         <include refid="selectApprovalCcVo"/>
88
         <include refid="selectApprovalCcVo"/>
76
         where instance_id = #{instanceId}
89
         where instance_id = #{instanceId}
77
         order by cc_time desc
90
         order by cc_time desc
78
     </select>
91
     </select>
79
-    
92
+
80
     <select id="selectApprovalCcByCcUser" resultMap="ApprovalCcResult">
93
     <select id="selectApprovalCcByCcUser" resultMap="ApprovalCcResult">
81
         <include refid="selectApprovalCcVo"/>
94
         <include refid="selectApprovalCcVo"/>
82
         where cc_user_id = #{ccUserId}
95
         where cc_user_id = #{ccUserId}
83
-        <if test="isRead != null and isRead != ''"> and is_read = #{isRead}</if>
96
+        <if test="isRead != null and isRead != ''">and is_read = #{isRead}</if>
84
         order by cc_time desc
97
         order by cc_time desc
85
     </select>
98
     </select>
86
-    
99
+
87
     <select id="countCcMessagesByCcUser" resultType="int">
100
     <select id="countCcMessagesByCcUser" resultType="int">
88
         select count(*) from approval_cc
101
         select count(*) from approval_cc
89
         where cc_user_id = #{ccUserId}
102
         where cc_user_id = #{ccUserId}
90
-        <if test="isRead != null and isRead != ''"> and is_read = #{isRead}</if>
103
+        <if test="isRead != null and isRead != ''">and is_read = #{isRead}</if>
91
     </select>
104
     </select>
92
-        
105
+
93
     <insert id="insertApprovalCc" parameterType="ApprovalCc" useGeneratedKeys="true" keyProperty="id">
106
     <insert id="insertApprovalCc" parameterType="ApprovalCc" useGeneratedKeys="true" keyProperty="id">
94
         insert into approval_cc
107
         insert into approval_cc
95
         <trim prefix="(" suffix=")" suffixOverrides=",">
108
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -102,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
102
             <if test="createBy != null">create_by,</if>
115
             <if test="createBy != null">create_by,</if>
103
             <if test="createTime != null">create_time,</if>
116
             <if test="createTime != null">create_time,</if>
104
             <if test="remark != null">remark,</if>
117
             <if test="remark != null">remark,</if>
105
-         </trim>
118
+        </trim>
106
         <trim prefix="values (" suffix=")" suffixOverrides=",">
119
         <trim prefix="values (" suffix=")" suffixOverrides=",">
107
             <if test="instanceId != null">#{instanceId},</if>
120
             <if test="instanceId != null">#{instanceId},</if>
108
             <if test="ccUserId != null">#{ccUserId},</if>
121
             <if test="ccUserId != null">#{ccUserId},</if>
@@ -113,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
113
             <if test="createBy != null">#{createBy},</if>
126
             <if test="createBy != null">#{createBy},</if>
114
             <if test="createTime != null">#{createTime},</if>
127
             <if test="createTime != null">#{createTime},</if>
115
             <if test="remark != null">#{remark},</if>
128
             <if test="remark != null">#{remark},</if>
116
-         </trim>
129
+        </trim>
117
     </insert>
130
     </insert>
118
 
131
 
119
     <update id="updateApprovalCc" parameterType="ApprovalCc">
132
     <update id="updateApprovalCc" parameterType="ApprovalCc">
@@ -133,38 +146,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
133
     </update>
146
     </update>
134
 
147
 
135
     <delete id="deleteApprovalCcById" parameterType="Long">
148
     <delete id="deleteApprovalCcById" parameterType="Long">
136
-        delete from approval_cc where id = #{id}
149
+        delete
150
+        from approval_cc
151
+        where id = #{id}
137
     </delete>
152
     </delete>
138
 
153
 
139
     <delete id="deleteApprovalCcByIds" parameterType="String">
154
     <delete id="deleteApprovalCcByIds" parameterType="String">
140
-        delete from approval_cc where id in 
155
+        delete from approval_cc where id in
141
         <foreach item="id" collection="array" open="(" separator="," close=")">
156
         <foreach item="id" collection="array" open="(" separator="," close=")">
142
             #{id}
157
             #{id}
143
         </foreach>
158
         </foreach>
144
     </delete>
159
     </delete>
145
-    
160
+
146
     <delete id="deleteApprovalCcByInstanceId" parameterType="Long">
161
     <delete id="deleteApprovalCcByInstanceId" parameterType="Long">
147
-        delete from approval_cc where instance_id = #{instanceId}
162
+        delete
163
+        from approval_cc
164
+        where instance_id = #{instanceId}
148
     </delete>
165
     </delete>
149
-    
166
+
150
     <select id="selectCcDetailsByUserId" parameterType="Long" resultMap="ApprovalCcWithInstanceResult">
167
     <select id="selectCcDetailsByUserId" parameterType="Long" resultMap="ApprovalCcWithInstanceResult">
151
-        select 
152
-            ac.id, ac.instance_id, ac.cc_user_id, ac.cc_user_name, ac.cc_time, 
153
-            ac.is_read, ac.read_time, ac.create_by, ac.create_time, ac.remark,
154
-            ai.id as ai_id, ai.instance_no as ai_instance_no, ai.title as ai_title,
155
-            ai.business_id as ai_business_id, ai.business_type as ai_business_type, 
156
-            ai.status as ai_status, ai.submit_time as ai_submit_time, ai.completion_time as ai_completion_time,
157
-            ai.form_data as ai_form_data
168
+        select ac.id,
169
+               ac.instance_id,
170
+               ac.cc_user_id,
171
+               ac.cc_user_name,
172
+               ac.cc_time,
173
+               ac.is_read,
174
+               ac.read_time,
175
+               ac.create_by,
176
+               ac.create_time,
177
+               ac.remark,
178
+               ai.id              as ai_id,
179
+               ai.instance_no     as ai_instance_no,
180
+               ai.title           as ai_title,
181
+               ai.business_id     as ai_business_id,
182
+               ai.business_type   as ai_business_type,
183
+               ai.status          as ai_status,
184
+               ai.submit_time     as ai_submit_time,
185
+               ai.completion_time as ai_completion_time,
186
+               ai.form_data       as ai_form_data
158
         from approval_cc ac
187
         from approval_cc ac
159
-        left join approval_instance ai on ac.instance_id = ai.id
188
+                 left join approval_instance ai on ac.instance_id = ai.id
160
         where ac.cc_user_id = #{ccUserId}
189
         where ac.cc_user_id = #{ccUserId}
161
         order by ac.cc_time desc
190
         order by ac.cc_time desc
162
     </select>
191
     </select>
163
-    
192
+
164
     <update id="batchUpdateReadStatus" parameterType="list">
193
     <update id="batchUpdateReadStatus" parameterType="list">
165
-        update approval_cc 
166
-        set is_read = '1', read_time = sysdate() 
167
-        where id in 
194
+        update approval_cc
195
+        set is_read = '1', read_time = sysdate()
196
+        where id in
168
         <foreach collection="list" item="id" open="(" separator="," close=")">
197
         <foreach collection="list" item="id" open="(" separator="," close=")">
169
             #{id}
198
             #{id}
170
         </foreach>
199
         </foreach>

+ 49 - 36
airport-system/src/main/resources/mapper/approval/ApprovalHistoryMapper.xml

@@ -1,47 +1,56 @@
1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper
2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalHistoryMapper">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalHistoryMapper">
6
-    
6
+
7
     <resultMap type="ApprovalHistory" id="ApprovalHistoryResult">
7
     <resultMap type="ApprovalHistory" id="ApprovalHistoryResult">
8
-        <result property="id"    column="id"    />
9
-        <result property="instanceId"    column="instance_id"    />
10
-        <result property="taskId"    column="task_id"    />
11
-        <result property="nodeId"    column="node_id"    />
12
-        <result property="nodeName"    column="node_name"    />
13
-        <result property="operatorId"    column="operator_id"    />
14
-        <result property="operatorName"    column="operator_name"    />
15
-        <result property="action"    column="action"    />
16
-        <result property="comment"    column="comment"    />
17
-        <result property="formData"    column="form_data"    />
18
-        <result property="operationTime"    column="operation_time"    />
19
-        <result property="createBy"    column="create_by"    />
20
-        <result property="createTime"    column="create_time"    />
21
-        <result property="remark"    column="remark"    />
8
+        <result property="id" column="id"/>
9
+        <result property="instanceId" column="instance_id"/>
10
+        <result property="taskId" column="task_id"/>
11
+        <result property="nodeId" column="node_id"/>
12
+        <result property="nodeName" column="node_name"/>
13
+        <result property="operatorId" column="operator_id"/>
14
+        <result property="operatorName" column="operator_name"/>
15
+        <result property="action" column="action"/>
16
+        <result property="comment" column="comment"/>
17
+        <result property="formData" column="form_data"/>
18
+        <result property="operationTime" column="operation_time"/>
19
+        <result property="createBy" column="create_by"/>
20
+        <result property="createTime" column="create_time"/>
21
+        <result property="remark" column="remark"/>
22
     </resultMap>
22
     </resultMap>
23
 
23
 
24
     <sql id="selectApprovalHistoryVo">
24
     <sql id="selectApprovalHistoryVo">
25
-        select id, instance_id, task_id, node_id, node_name, operator_id, operator_name, action, comment, form_data, operation_time, create_by, create_time, remark from approval_history
25
+        select id,
26
+               instance_id,
27
+               task_id,
28
+               node_id,
29
+               node_name,
30
+               operator_id,
31
+               operator_name, action, comment, form_data, operation_time, create_by, create_time, remark
32
+        from approval_history
26
     </sql>
33
     </sql>
27
 
34
 
28
     <select id="selectApprovalHistoryList" parameterType="ApprovalHistory" resultMap="ApprovalHistoryResult">
35
     <select id="selectApprovalHistoryList" parameterType="ApprovalHistory" resultMap="ApprovalHistoryResult">
29
         <include refid="selectApprovalHistoryVo"/>
36
         <include refid="selectApprovalHistoryVo"/>
30
-        <where>  
31
-            <if test="instanceId != null "> and instance_id = #{instanceId}</if>
32
-            <if test="taskId != null "> and task_id = #{taskId}</if>
33
-            <if test="nodeId != null "> and node_id = #{nodeId}</if>
34
-            <if test="nodeName != null  and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
35
-            <if test="operatorId != null "> and operator_id = #{operatorId}</if>
36
-            <if test="operatorName != null  and operatorName != ''"> and operator_name like concat('%', #{operatorName}, '%')</if>
37
-            <if test="action != null  and action != ''"> and action = #{action}</if>
38
-            <if test="comment != null  and comment != ''"> and comment like concat('%', #{comment}, '%')</if>
39
-            <if test="formData != null  and formData != ''"> and form_data = #{formData}</if>
40
-            <if test="operationTime != null "> and operation_time = #{operationTime}</if>
37
+        <where>
38
+            <if test="instanceId != null ">and instance_id = #{instanceId}</if>
39
+            <if test="taskId != null ">and task_id = #{taskId}</if>
40
+            <if test="nodeId != null ">and node_id = #{nodeId}</if>
41
+            <if test="nodeName != null  and nodeName != ''">and node_name like concat('%', #{nodeName}, '%')</if>
42
+            <if test="operatorId != null ">and operator_id = #{operatorId}</if>
43
+            <if test="operatorName != null  and operatorName != ''">and operator_name like concat('%', #{operatorName},
44
+                '%')
45
+            </if>
46
+            <if test="action != null  and action != ''">and action = #{action}</if>
47
+            <if test="comment != null  and comment != ''">and comment like concat('%', #{comment}, '%')</if>
48
+            <if test="formData != null  and formData != ''">and form_data = #{formData}</if>
49
+            <if test="operationTime != null ">and operation_time = #{operationTime}</if>
41
         </where>
50
         </where>
42
         order by id asc
51
         order by id asc
43
     </select>
52
     </select>
44
-    
53
+
45
     <select id="selectApprovalHistoryById" parameterType="Long" resultMap="ApprovalHistoryResult">
54
     <select id="selectApprovalHistoryById" parameterType="Long" resultMap="ApprovalHistoryResult">
46
         <include refid="selectApprovalHistoryVo"/>
55
         <include refid="selectApprovalHistoryVo"/>
47
         where id = #{id}
56
         where id = #{id}
@@ -67,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
67
         </if>
76
         </if>
68
         order by id asc
77
         order by id asc
69
     </select>
78
     </select>
70
-        
79
+
71
     <insert id="insertApprovalHistory" parameterType="ApprovalHistory" useGeneratedKeys="true" keyProperty="id">
80
     <insert id="insertApprovalHistory" parameterType="ApprovalHistory" useGeneratedKeys="true" keyProperty="id">
72
         insert into approval_history
81
         insert into approval_history
73
         <trim prefix="(" suffix=")" suffixOverrides=",">
82
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -84,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
84
             <if test="createBy != null">create_by,</if>
93
             <if test="createBy != null">create_by,</if>
85
             <if test="createTime != null">create_time,</if>
94
             <if test="createTime != null">create_time,</if>
86
             <if test="remark != null">remark,</if>
95
             <if test="remark != null">remark,</if>
87
-         </trim>
96
+        </trim>
88
         <trim prefix="values (" suffix=")" suffixOverrides=",">
97
         <trim prefix="values (" suffix=")" suffixOverrides=",">
89
             <if test="instanceId != null">#{instanceId},</if>
98
             <if test="instanceId != null">#{instanceId},</if>
90
             <if test="taskId != null">#{taskId},</if>
99
             <if test="taskId != null">#{taskId},</if>
@@ -99,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
99
             <if test="createBy != null">#{createBy},</if>
108
             <if test="createBy != null">#{createBy},</if>
100
             <if test="createTime != null">#{createTime},</if>
109
             <if test="createTime != null">#{createTime},</if>
101
             <if test="remark != null">#{remark},</if>
110
             <if test="remark != null">#{remark},</if>
102
-         </trim>
111
+        </trim>
103
     </insert>
112
     </insert>
104
 
113
 
105
     <update id="updateApprovalHistory" parameterType="ApprovalHistory">
114
     <update id="updateApprovalHistory" parameterType="ApprovalHistory">
@@ -123,18 +132,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
123
     </update>
132
     </update>
124
 
133
 
125
     <delete id="deleteApprovalHistoryById" parameterType="Long">
134
     <delete id="deleteApprovalHistoryById" parameterType="Long">
126
-        delete from approval_history where id = #{id}
135
+        delete
136
+        from approval_history
137
+        where id = #{id}
127
     </delete>
138
     </delete>
128
 
139
 
129
     <delete id="deleteApprovalHistoryByIds" parameterType="String">
140
     <delete id="deleteApprovalHistoryByIds" parameterType="String">
130
-        delete from approval_history where id in 
141
+        delete from approval_history where id in
131
         <foreach item="id" collection="array" open="(" separator="," close=")">
142
         <foreach item="id" collection="array" open="(" separator="," close=")">
132
             #{id}
143
             #{id}
133
         </foreach>
144
         </foreach>
134
     </delete>
145
     </delete>
135
 
146
 
136
     <delete id="deleteApprovalHistoryByInstanceId" parameterType="Long">
147
     <delete id="deleteApprovalHistoryByInstanceId" parameterType="Long">
137
-        delete from approval_history where instance_id = #{instanceId}
148
+        delete
149
+        from approval_history
150
+        where instance_id = #{instanceId}
138
     </delete>
151
     </delete>
139
 
152
 
140
 </mapper>
153
 </mapper>

+ 114 - 92
airport-system/src/main/resources/mapper/approval/ApprovalInstanceMapper.xml

@@ -1,88 +1,108 @@
1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper
2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalInstanceMapper">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalInstanceMapper">
6
-    
6
+
7
     <resultMap type="ApprovalInstance" id="ApprovalInstanceResult">
7
     <resultMap type="ApprovalInstance" id="ApprovalInstanceResult">
8
-        <id     property="id"               column="id"                 />
9
-        <result property="instanceNo"       column="instance_no"        />
10
-        <result property="workflowId"       column="workflow_id"        />
11
-        <result property="title"            column="title"              />
12
-        <result property="businessType"     column="business_type"      />
13
-        <result property="businessId"       column="business_id"        />
14
-        <result property="businessData"     column="business_data"      />
15
-        <result property="submitterId"      column="submitter_id"       />
16
-        <result property="submitterName"    column="submitter_name"     />
17
-        <result property="submitTime"       column="submit_time"        />
18
-        <result property="currentNodeId"    column="current_node_id"    />
19
-        <result property="status"           column="status"             />
20
-        <result property="completionTime"   column="completion_time"    />
21
-        <result property="urgentLevel"      column="urgent_level"       />
22
-        <result property="formData"         column="form_data"          />
23
-        <result property="createBy"         column="create_by"          />
24
-        <result property="createTime"       column="create_time"        />
25
-        <result property="updateBy"         column="update_by"          />
26
-        <result property="updateTime"       column="update_time"        />
27
-        <result property="remark"           column="remark"             />
28
-        <association property="workflowDefinition" javaType="ApprovalWorkflowDefinition" resultMap="WorkflowResult" />
29
-        <association property="currentNode" javaType="ApprovalNodeDefinition" resultMap="NodeResult" />
30
-        <collection property="tasks"        javaType="java.util.List"   resultMap="TaskResult" />
31
-        <collection property="histories"    javaType="java.util.List"   resultMap="HistoryResult" />
8
+        <id property="id" column="id"/>
9
+        <result property="instanceNo" column="instance_no"/>
10
+        <result property="workflowId" column="workflow_id"/>
11
+        <result property="title" column="title"/>
12
+        <result property="businessType" column="business_type"/>
13
+        <result property="businessId" column="business_id"/>
14
+        <result property="businessData" column="business_data"/>
15
+        <result property="submitterId" column="submitter_id"/>
16
+        <result property="submitterName" column="submitter_name"/>
17
+        <result property="submitTime" column="submit_time"/>
18
+        <result property="currentNodeId" column="current_node_id"/>
19
+        <result property="status" column="status"/>
20
+        <result property="completionTime" column="completion_time"/>
21
+        <result property="urgentLevel" column="urgent_level"/>
22
+        <result property="formData" column="form_data"/>
23
+        <result property="createBy" column="create_by"/>
24
+        <result property="createTime" column="create_time"/>
25
+        <result property="updateBy" column="update_by"/>
26
+        <result property="updateTime" column="update_time"/>
27
+        <result property="remark" column="remark"/>
28
+        <association property="workflowDefinition" javaType="ApprovalWorkflowDefinition" resultMap="WorkflowResult"/>
29
+        <association property="currentNode" javaType="ApprovalNodeDefinition" resultMap="NodeResult"/>
30
+        <collection property="tasks" javaType="java.util.List" resultMap="TaskResult"/>
31
+        <collection property="histories" javaType="java.util.List" resultMap="HistoryResult"/>
32
     </resultMap>
32
     </resultMap>
33
-    
33
+
34
     <resultMap id="WorkflowResult" type="ApprovalWorkflowDefinition">
34
     <resultMap id="WorkflowResult" type="ApprovalWorkflowDefinition">
35
-        <id     property="id"               column="workflow_id"        />
36
-        <result property="workflowCode"     column="workflow_code"      />
37
-        <result property="workflowName"     column="workflow_name"      />
38
-        <result property="workflowType"     column="workflow_type"      />
39
-        <result property="description"      column="workflow_description" />
35
+        <id property="id" column="workflow_id"/>
36
+        <result property="workflowCode" column="workflow_code"/>
37
+        <result property="workflowName" column="workflow_name"/>
38
+        <result property="workflowType" column="workflow_type"/>
39
+        <result property="description" column="workflow_description"/>
40
     </resultMap>
40
     </resultMap>
41
-    
41
+
42
     <resultMap id="NodeResult" type="ApprovalNodeDefinition">
42
     <resultMap id="NodeResult" type="ApprovalNodeDefinition">
43
-        <id     property="id"               column="current_node_id"    />
44
-        <result property="nodeCode"         column="current_node_code"  />
45
-        <result property="nodeName"         column="current_node_name"  />
46
-        <result property="nodeType"         column="current_node_type"  />
43
+        <id property="id" column="current_node_id"/>
44
+        <result property="nodeCode" column="current_node_code"/>
45
+        <result property="nodeName" column="current_node_name"/>
46
+        <result property="nodeType" column="current_node_type"/>
47
     </resultMap>
47
     </resultMap>
48
-    
48
+
49
     <resultMap id="TaskResult" type="ApprovalTask">
49
     <resultMap id="TaskResult" type="ApprovalTask">
50
-        <id     property="id"               column="task_id"            />
51
-        <result property="taskNo"           column="task_no"            />
52
-        <result property="taskName"         column="task_name"          />
53
-        <result property="assigneeId"       column="assignee_id"        />
54
-        <result property="assigneeName"     column="assignee_name"      />
55
-        <result property="status"           column="task_status"        />
50
+        <id property="id" column="task_id"/>
51
+        <result property="taskNo" column="task_no"/>
52
+        <result property="taskName" column="task_name"/>
53
+        <result property="assigneeId" column="assignee_id"/>
54
+        <result property="assigneeName" column="assignee_name"/>
55
+        <result property="status" column="task_status"/>
56
     </resultMap>
56
     </resultMap>
57
-    
57
+
58
     <resultMap id="HistoryResult" type="ApprovalHistory">
58
     <resultMap id="HistoryResult" type="ApprovalHistory">
59
-        <id     property="id"               column="history_id"         />
60
-        <result property="action"           column="action"             />
61
-        <result property="operatorId"       column="operator_id"        />
62
-        <result property="operatorName"     column="operator_name"      />
63
-        <result property="operationTime"    column="operation_time"     />
64
-        <result property="comment"          column="history_comment"    />
59
+        <id property="id" column="history_id"/>
60
+        <result property="action" column="action"/>
61
+        <result property="operatorId" column="operator_id"/>
62
+        <result property="operatorName" column="operator_name"/>
63
+        <result property="operationTime" column="operation_time"/>
64
+        <result property="comment" column="history_comment"/>
65
     </resultMap>
65
     </resultMap>
66
 
66
 
67
     <sql id="selectApprovalInstanceVo">
67
     <sql id="selectApprovalInstanceVo">
68
-        select id, instance_no, workflow_id, title, business_type, business_id, business_data, 
69
-               submitter_id, submitter_name, submit_time, current_node_id, status, completion_time, 
70
-               urgent_level, form_data, create_by, create_time, update_by, update_time, remark 
68
+        select id,
69
+               instance_no,
70
+               workflow_id,
71
+               title,
72
+               business_type,
73
+               business_id,
74
+               business_data,
75
+               submitter_id,
76
+               submitter_name,
77
+               submit_time,
78
+               current_node_id,
79
+               status,
80
+               completion_time,
81
+               urgent_level,
82
+               form_data,
83
+               create_by,
84
+               create_time,
85
+               update_by,
86
+               update_time,
87
+               remark
71
         from approval_instance
88
         from approval_instance
72
     </sql>
89
     </sql>
73
 
90
 
74
     <select id="selectApprovalInstanceList" parameterType="ApprovalInstance" resultMap="ApprovalInstanceResult">
91
     <select id="selectApprovalInstanceList" parameterType="ApprovalInstance" resultMap="ApprovalInstanceResult">
75
         <include refid="selectApprovalInstanceVo"/>
92
         <include refid="selectApprovalInstanceVo"/>
76
-        <where>  
77
-            <if test="instanceNo != null  and instanceNo != ''"> and instance_no like concat('%', #{instanceNo}, '%')</if>
78
-            <if test="workflowId != null "> and workflow_id = #{workflowId}</if>
79
-            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
80
-            <if test="businessType != null  and businessType != ''"> and business_type = #{businessType}</if>
81
-            <if test="businessId != null "> and business_id = #{businessId}</if>
82
-            <if test="submitterId != null "> and submitter_id = #{submitterId}</if>
83
-            <if test="submitterName != null  and submitterName != ''"> and submitter_name like concat('%', #{submitterName}, '%')</if>
84
-            <if test="status != null  and status != ''"> and status = #{status}</if>
85
-            <if test="urgentLevel != null  and urgentLevel != ''"> and urgent_level = #{urgentLevel}</if>
93
+        <where>
94
+            <if test="instanceNo != null  and instanceNo != ''">and instance_no like concat('%', #{instanceNo}, '%')
95
+            </if>
96
+            <if test="workflowId != null ">and workflow_id = #{workflowId}</if>
97
+            <if test="title != null  and title != ''">and title like concat('%', #{title}, '%')</if>
98
+            <if test="businessType != null  and businessType != ''">and business_type = #{businessType}</if>
99
+            <if test="businessId != null ">and business_id = #{businessId}</if>
100
+            <if test="submitterId != null ">and submitter_id = #{submitterId}</if>
101
+            <if test="submitterName != null  and submitterName != ''">and submitter_name like concat('%',
102
+                #{submitterName}, '%')
103
+            </if>
104
+            <if test="status != null  and status != ''">and status = #{status}</if>
105
+            <if test="urgentLevel != null  and urgentLevel != ''">and urgent_level = #{urgentLevel}</if>
86
             <if test="params != null and params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
106
             <if test="params != null and params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
87
                 and date_format(submit_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
107
                 and date_format(submit_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
88
             </if>
108
             </if>
@@ -92,9 +112,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
92
         </where>
112
         </where>
93
         order by submit_time desc
113
         order by submit_time desc
94
     </select>
114
     </select>
95
-    
115
+
96
     <!-- 根据工作流ID列表、时间范围和用户ID列表查询审批实例 -->
116
     <!-- 根据工作流ID列表、时间范围和用户ID列表查询审批实例 -->
97
-    <select id="selectApprovalInstancesByWorkflowIdsAndTimeRangeAndUsers" parameterType="map" resultMap="ApprovalInstanceResult">
117
+    <select id="selectApprovalInstancesByWorkflowIdsAndTimeRangeAndUsers" parameterType="map"
118
+            resultMap="ApprovalInstanceResult">
98
         <include refid="selectApprovalInstanceVo"/>
119
         <include refid="selectApprovalInstanceVo"/>
99
         <where>
120
         <where>
100
             <if test="workflowIds != null and workflowIds.size() > 0">
121
             <if test="workflowIds != null and workflowIds.size() > 0">
@@ -118,55 +139,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
118
         </where>
139
         </where>
119
         order by submit_time desc
140
         order by submit_time desc
120
     </select>
141
     </select>
121
-    
142
+
122
     <!-- 查询部门及其子部门下的所有用户ID -->
143
     <!-- 查询部门及其子部门下的所有用户ID -->
123
     <select id="selectUserIdsByDeptAndSubDepts" parameterType="long" resultType="long">
144
     <select id="selectUserIdsByDeptAndSubDepts" parameterType="long" resultType="long">
124
-        select user_id 
125
-        from sys_user 
126
-        where dept_id in (
127
-            select dept_id
128
-            from sys_dept
129
-            where dept_id = #{deptId} 
130
-               or parent_id = #{deptId} 
131
-               or ancestors like concat('%,', #{deptId}, ',%') 
132
-               or ancestors like concat(#{deptId}, ',%')
133
-               or ancestors like concat('%,', #{deptId})
134
-               or ancestors = #{deptId}
135
-        ) and del_flag = '0'
145
+        select user_id
146
+        from sys_user
147
+        where dept_id in (select dept_id
148
+                          from sys_dept
149
+                          where dept_id = #{deptId}
150
+                             or parent_id = #{deptId}
151
+                             or ancestors like concat('%,', #{deptId}, ',%')
152
+                             or ancestors like concat(#{deptId}, ',%')
153
+                             or ancestors like concat('%,', #{deptId})
154
+                             or ancestors = #{deptId})
155
+          and del_flag = '0'
136
     </select>
156
     </select>
137
-    
157
+
138
     <select id="selectApprovalInstanceById" parameterType="Long" resultMap="ApprovalInstanceResult">
158
     <select id="selectApprovalInstanceById" parameterType="Long" resultMap="ApprovalInstanceResult">
139
         <include refid="selectApprovalInstanceVo"/>
159
         <include refid="selectApprovalInstanceVo"/>
140
         where id = #{id}
160
         where id = #{id}
141
     </select>
161
     </select>
142
-    
162
+
143
     <select id="selectApprovalInstanceByNo" parameterType="String" resultMap="ApprovalInstanceResult">
163
     <select id="selectApprovalInstanceByNo" parameterType="String" resultMap="ApprovalInstanceResult">
144
         <include refid="selectApprovalInstanceVo"/>
164
         <include refid="selectApprovalInstanceVo"/>
145
         where instance_no = #{instanceNo}
165
         where instance_no = #{instanceNo}
146
     </select>
166
     </select>
147
-    
167
+
148
     <select id="selectApprovalInstanceByBusiness" resultMap="ApprovalInstanceResult">
168
     <select id="selectApprovalInstanceByBusiness" resultMap="ApprovalInstanceResult">
149
         <include refid="selectApprovalInstanceVo"/>
169
         <include refid="selectApprovalInstanceVo"/>
150
         where business_type = #{businessType} and business_id = #{businessId}
170
         where business_type = #{businessType} and business_id = #{businessId}
151
         order by submit_time desc
171
         order by submit_time desc
152
     </select>
172
     </select>
153
-    
173
+
154
     <select id="selectApprovalInstanceBySubmitter" resultMap="ApprovalInstanceResult">
174
     <select id="selectApprovalInstanceBySubmitter" resultMap="ApprovalInstanceResult">
155
         <include refid="selectApprovalInstanceVo"/>
175
         <include refid="selectApprovalInstanceVo"/>
156
         where submitter_id = #{submitterId}
176
         where submitter_id = #{submitterId}
157
-        <if test="status != null and status != ''"> and status = #{status}</if>
177
+        <if test="status != null and status != ''">and status = #{status}</if>
158
         order by submit_time desc
178
         order by submit_time desc
159
     </select>
179
     </select>
160
-    
180
+
161
     <select id="selectApprovalInstanceDetail" parameterType="Long" resultMap="ApprovalInstanceResult">
181
     <select id="selectApprovalInstanceDetail" parameterType="Long" resultMap="ApprovalInstanceResult">
162
         <include refid="selectApprovalInstanceVo"/>
182
         <include refid="selectApprovalInstanceVo"/>
163
         where id = #{id}
183
         where id = #{id}
164
     </select>
184
     </select>
165
-    
185
+
166
     <select id="generateInstanceNo" resultType="String">
186
     <select id="generateInstanceNo" resultType="String">
167
         SELECT CONCAT('INST', DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'), LPAD(FLOOR(RAND() * 1000), 3, '0')) AS new_instance_no
187
         SELECT CONCAT('INST', DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'), LPAD(FLOOR(RAND() * 1000), 3, '0')) AS new_instance_no
168
     </select>
188
     </select>
169
-        
189
+
170
     <insert id="insertApprovalInstance" parameterType="ApprovalInstance" useGeneratedKeys="true" keyProperty="id">
190
     <insert id="insertApprovalInstance" parameterType="ApprovalInstance" useGeneratedKeys="true" keyProperty="id">
171
         insert into approval_instance
191
         insert into approval_instance
172
         <trim prefix="(" suffix=")" suffixOverrides=",">
192
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -189,7 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
189
             <if test="updateBy != null">update_by,</if>
209
             <if test="updateBy != null">update_by,</if>
190
             <if test="updateTime != null">update_time,</if>
210
             <if test="updateTime != null">update_time,</if>
191
             <if test="remark != null">remark,</if>
211
             <if test="remark != null">remark,</if>
192
-         </trim>
212
+        </trim>
193
         <trim prefix="values (" suffix=")" suffixOverrides=",">
213
         <trim prefix="values (" suffix=")" suffixOverrides=",">
194
             <if test="instanceNo != null and instanceNo != ''">#{instanceNo},</if>
214
             <if test="instanceNo != null and instanceNo != ''">#{instanceNo},</if>
195
             <if test="workflowId != null">#{workflowId},</if>
215
             <if test="workflowId != null">#{workflowId},</if>
@@ -210,7 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
210
             <if test="updateBy != null">#{updateBy},</if>
230
             <if test="updateBy != null">#{updateBy},</if>
211
             <if test="updateTime != null">#{updateTime},</if>
231
             <if test="updateTime != null">#{updateTime},</if>
212
             <if test="remark != null">#{remark},</if>
232
             <if test="remark != null">#{remark},</if>
213
-         </trim>
233
+        </trim>
214
     </insert>
234
     </insert>
215
 
235
 
216
     <update id="updateApprovalInstance" parameterType="ApprovalInstance">
236
     <update id="updateApprovalInstance" parameterType="ApprovalInstance">
@@ -240,11 +260,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
240
     </update>
260
     </update>
241
 
261
 
242
     <delete id="deleteApprovalInstanceById" parameterType="Long">
262
     <delete id="deleteApprovalInstanceById" parameterType="Long">
243
-        delete from approval_instance where id = #{id}
263
+        delete
264
+        from approval_instance
265
+        where id = #{id}
244
     </delete>
266
     </delete>
245
 
267
 
246
     <delete id="deleteApprovalInstanceByIds" parameterType="String">
268
     <delete id="deleteApprovalInstanceByIds" parameterType="String">
247
-        delete from approval_instance where id in 
269
+        delete from approval_instance where id in
248
         <foreach item="id" collection="array" open="(" separator="," close=")">
270
         <foreach item="id" collection="array" open="(" separator="," close=")">
249
             #{id}
271
             #{id}
250
         </foreach>
272
         </foreach>

+ 65 - 44
airport-system/src/main/resources/mapper/approval/ApprovalNodeDefinitionMapper.xml

@@ -1,83 +1,100 @@
1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper
2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalNodeDefinitionMapper">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalNodeDefinitionMapper">
6
-    
6
+
7
     <resultMap type="ApprovalNodeDefinition" id="ApprovalNodeDefinitionResult">
7
     <resultMap type="ApprovalNodeDefinition" id="ApprovalNodeDefinitionResult">
8
-        <id     property="id"               column="id"                 />
9
-        <result property="workflowId"       column="workflow_id"        />
10
-        <result property="nodeCode"         column="node_code"          />
11
-        <result property="nodeName"         column="node_name"          />
12
-        <result property="nodeType"         column="node_type"          />
13
-        <result property="sortOrder"        column="sort_order"         />
14
-        <result property="approverType"     column="approver_type"      />
15
-        <result property="approverValue"    column="approver_value"     />
16
-        <result property="canReject"        column="can_reject"         />
17
-        <result property="isRequired"       column="is_required"        />
18
-        <result property="timeoutHours"     column="timeout_hours"      />
19
-        <result property="status"           column="status"             />
20
-        <result property="createBy"         column="create_by"          />
21
-        <result property="createTime"       column="create_time"        />
22
-        <result property="updateBy"         column="update_by"          />
23
-        <result property="updateTime"       column="update_time"        />
24
-        <result property="remark"           column="remark"             />
8
+        <id property="id" column="id"/>
9
+        <result property="workflowId" column="workflow_id"/>
10
+        <result property="nodeCode" column="node_code"/>
11
+        <result property="nodeName" column="node_name"/>
12
+        <result property="nodeType" column="node_type"/>
13
+        <result property="sortOrder" column="sort_order"/>
14
+        <result property="approverType" column="approver_type"/>
15
+        <result property="approverValue" column="approver_value"/>
16
+        <result property="canReject" column="can_reject"/>
17
+        <result property="isRequired" column="is_required"/>
18
+        <result property="timeoutHours" column="timeout_hours"/>
19
+        <result property="status" column="status"/>
20
+        <result property="createBy" column="create_by"/>
21
+        <result property="createTime" column="create_time"/>
22
+        <result property="updateBy" column="update_by"/>
23
+        <result property="updateTime" column="update_time"/>
24
+        <result property="remark" column="remark"/>
25
     </resultMap>
25
     </resultMap>
26
 
26
 
27
     <sql id="selectApprovalNodeDefinitionVo">
27
     <sql id="selectApprovalNodeDefinitionVo">
28
-        select id, workflow_id, node_code, node_name, node_type, sort_order, approver_type, approver_value, 
29
-               can_reject, is_required, timeout_hours, status, create_by, create_time, update_by, update_time, remark 
28
+        select id,
29
+               workflow_id,
30
+               node_code,
31
+               node_name,
32
+               node_type,
33
+               sort_order,
34
+               approver_type,
35
+               approver_value,
36
+               can_reject,
37
+               is_required,
38
+               timeout_hours,
39
+               status,
40
+               create_by,
41
+               create_time,
42
+               update_by,
43
+               update_time,
44
+               remark
30
         from approval_node_definition
45
         from approval_node_definition
31
     </sql>
46
     </sql>
32
 
47
 
33
-    <select id="selectApprovalNodeDefinitionList" parameterType="ApprovalNodeDefinition" resultMap="ApprovalNodeDefinitionResult">
48
+    <select id="selectApprovalNodeDefinitionList" parameterType="ApprovalNodeDefinition"
49
+            resultMap="ApprovalNodeDefinitionResult">
34
         <include refid="selectApprovalNodeDefinitionVo"/>
50
         <include refid="selectApprovalNodeDefinitionVo"/>
35
-        <where>  
36
-            <if test="workflowId != null "> and workflow_id = #{workflowId}</if>
37
-            <if test="nodeCode != null  and nodeCode != ''"> and node_code like concat('%', #{nodeCode}, '%')</if>
38
-            <if test="nodeName != null  and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
39
-            <if test="nodeType != null  and nodeType != ''"> and node_type = #{nodeType}</if>
40
-            <if test="approverType != null  and approverType != ''"> and approver_type = #{approverType}</if>
41
-            <if test="status != null  and status != ''"> and status = #{status}</if>
51
+        <where>
52
+            <if test="workflowId != null ">and workflow_id = #{workflowId}</if>
53
+            <if test="nodeCode != null  and nodeCode != ''">and node_code like concat('%', #{nodeCode}, '%')</if>
54
+            <if test="nodeName != null  and nodeName != ''">and node_name like concat('%', #{nodeName}, '%')</if>
55
+            <if test="nodeType != null  and nodeType != ''">and node_type = #{nodeType}</if>
56
+            <if test="approverType != null  and approverType != ''">and approver_type = #{approverType}</if>
57
+            <if test="status != null  and status != ''">and status = #{status}</if>
42
         </where>
58
         </where>
43
         order by workflow_id, sort_order
59
         order by workflow_id, sort_order
44
     </select>
60
     </select>
45
-    
61
+
46
     <select id="selectApprovalNodeDefinitionById" parameterType="Long" resultMap="ApprovalNodeDefinitionResult">
62
     <select id="selectApprovalNodeDefinitionById" parameterType="Long" resultMap="ApprovalNodeDefinitionResult">
47
         <include refid="selectApprovalNodeDefinitionVo"/>
63
         <include refid="selectApprovalNodeDefinitionVo"/>
48
         where id = #{id}
64
         where id = #{id}
49
     </select>
65
     </select>
50
-    
66
+
51
     <select id="selectApprovalNodeDefinitionByWorkflowId" parameterType="Long" resultMap="ApprovalNodeDefinitionResult">
67
     <select id="selectApprovalNodeDefinitionByWorkflowId" parameterType="Long" resultMap="ApprovalNodeDefinitionResult">
52
         <include refid="selectApprovalNodeDefinitionVo"/>
68
         <include refid="selectApprovalNodeDefinitionVo"/>
53
         where workflow_id = #{workflowId} and status = '0'
69
         where workflow_id = #{workflowId} and status = '0'
54
         order by sort_order
70
         order by sort_order
55
     </select>
71
     </select>
56
-    
72
+
57
     <select id="selectApprovalNodeDefinitionByWorkflowAndCode" resultMap="ApprovalNodeDefinitionResult">
73
     <select id="selectApprovalNodeDefinitionByWorkflowAndCode" resultMap="ApprovalNodeDefinitionResult">
58
         <include refid="selectApprovalNodeDefinitionVo"/>
74
         <include refid="selectApprovalNodeDefinitionVo"/>
59
         where workflow_id = #{workflowId} and node_code = #{nodeCode} and status = '0'
75
         where workflow_id = #{workflowId} and node_code = #{nodeCode} and status = '0'
60
     </select>
76
     </select>
61
-    
77
+
62
     <select id="selectFirstNodeByWorkflowId" parameterType="Long" resultMap="ApprovalNodeDefinitionResult">
78
     <select id="selectFirstNodeByWorkflowId" parameterType="Long" resultMap="ApprovalNodeDefinitionResult">
63
         <include refid="selectApprovalNodeDefinitionVo"/>
79
         <include refid="selectApprovalNodeDefinitionVo"/>
64
         where workflow_id = #{workflowId} and status = '0'
80
         where workflow_id = #{workflowId} and status = '0'
65
         order by sort_order limit 1
81
         order by sort_order limit 1
66
     </select>
82
     </select>
67
-    
83
+
68
     <select id="selectNextNodeByOrder" resultMap="ApprovalNodeDefinitionResult">
84
     <select id="selectNextNodeByOrder" resultMap="ApprovalNodeDefinitionResult">
69
         <include refid="selectApprovalNodeDefinitionVo"/>
85
         <include refid="selectApprovalNodeDefinitionVo"/>
70
         where workflow_id = #{workflowId} and sort_order > #{currentOrder} and status = '0'
86
         where workflow_id = #{workflowId} and sort_order > #{currentOrder} and status = '0'
71
         order by sort_order limit 1
87
         order by sort_order limit 1
72
     </select>
88
     </select>
73
-    
89
+
74
     <select id="selectPreviousNodeByOrder" resultMap="ApprovalNodeDefinitionResult">
90
     <select id="selectPreviousNodeByOrder" resultMap="ApprovalNodeDefinitionResult">
75
         <include refid="selectApprovalNodeDefinitionVo"/>
91
         <include refid="selectApprovalNodeDefinitionVo"/>
76
         where workflow_id = #{workflowId} and sort_order &lt; #{currentOrder} and status = '0'
92
         where workflow_id = #{workflowId} and sort_order &lt; #{currentOrder} and status = '0'
77
         order by sort_order desc limit 1
93
         order by sort_order desc limit 1
78
     </select>
94
     </select>
79
-        
80
-    <insert id="insertApprovalNodeDefinition" parameterType="ApprovalNodeDefinition" useGeneratedKeys="true" keyProperty="id">
95
+
96
+    <insert id="insertApprovalNodeDefinition" parameterType="ApprovalNodeDefinition" useGeneratedKeys="true"
97
+            keyProperty="id">
81
         insert into approval_node_definition
98
         insert into approval_node_definition
82
         <trim prefix="(" suffix=")" suffixOverrides=",">
99
         <trim prefix="(" suffix=")" suffixOverrides=",">
83
             <if test="workflowId != null">workflow_id,</if>
100
             <if test="workflowId != null">workflow_id,</if>
@@ -96,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
96
             <if test="updateBy != null">update_by,</if>
113
             <if test="updateBy != null">update_by,</if>
97
             <if test="updateTime != null">update_time,</if>
114
             <if test="updateTime != null">update_time,</if>
98
             <if test="remark != null">remark,</if>
115
             <if test="remark != null">remark,</if>
99
-         </trim>
116
+        </trim>
100
         <trim prefix="values (" suffix=")" suffixOverrides=",">
117
         <trim prefix="values (" suffix=")" suffixOverrides=",">
101
             <if test="workflowId != null">#{workflowId},</if>
118
             <if test="workflowId != null">#{workflowId},</if>
102
             <if test="nodeCode != null and nodeCode != ''">#{nodeCode},</if>
119
             <if test="nodeCode != null and nodeCode != ''">#{nodeCode},</if>
@@ -114,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
114
             <if test="updateBy != null">#{updateBy},</if>
131
             <if test="updateBy != null">#{updateBy},</if>
115
             <if test="updateTime != null">#{updateTime},</if>
132
             <if test="updateTime != null">#{updateTime},</if>
116
             <if test="remark != null">#{remark},</if>
133
             <if test="remark != null">#{remark},</if>
117
-         </trim>
134
+        </trim>
118
     </insert>
135
     </insert>
119
 
136
 
120
     <update id="updateApprovalNodeDefinition" parameterType="ApprovalNodeDefinition">
137
     <update id="updateApprovalNodeDefinition" parameterType="ApprovalNodeDefinition">
@@ -141,17 +158,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
141
     </update>
158
     </update>
142
 
159
 
143
     <delete id="deleteApprovalNodeDefinitionById" parameterType="Long">
160
     <delete id="deleteApprovalNodeDefinitionById" parameterType="Long">
144
-        delete from approval_node_definition where id = #{id}
161
+        delete
162
+        from approval_node_definition
163
+        where id = #{id}
145
     </delete>
164
     </delete>
146
 
165
 
147
     <delete id="deleteApprovalNodeDefinitionByIds" parameterType="String">
166
     <delete id="deleteApprovalNodeDefinitionByIds" parameterType="String">
148
-        delete from approval_node_definition where id in 
167
+        delete from approval_node_definition where id in
149
         <foreach item="id" collection="array" open="(" separator="," close=")">
168
         <foreach item="id" collection="array" open="(" separator="," close=")">
150
             #{id}
169
             #{id}
151
         </foreach>
170
         </foreach>
152
     </delete>
171
     </delete>
153
-    
172
+
154
     <delete id="deleteApprovalNodeDefinitionByWorkflowId" parameterType="Long">
173
     <delete id="deleteApprovalNodeDefinitionByWorkflowId" parameterType="Long">
155
-        delete from approval_node_definition where workflow_id = #{workflowId}
174
+        delete
175
+        from approval_node_definition
176
+        where workflow_id = #{workflowId}
156
     </delete>
177
     </delete>
157
 </mapper>
178
 </mapper>

+ 135 - 85
airport-system/src/main/resources/mapper/approval/ApprovalTaskMapper.xml

@@ -1,71 +1,89 @@
1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper
2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalTaskMapper">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalTaskMapper">
6
-    
6
+
7
     <resultMap type="ApprovalTask" id="ApprovalTaskResult">
7
     <resultMap type="ApprovalTask" id="ApprovalTaskResult">
8
-        <id     property="id"               column="id"                 />
9
-        <result property="taskNo"           column="task_no"            />
10
-        <result property="instanceId"       column="instance_id"        />
11
-        <result property="nodeId"           column="node_id"            />
12
-        <result property="taskName"         column="task_name"          />
13
-        <result property="assigneeId"       column="assignee_id"        />
14
-        <result property="assigneeName"     column="assignee_name"      />
15
-        <result property="assignTime"       column="assign_time"        />
16
-        <result property="status"           column="status"             />
17
-        <result property="completeTime"     column="complete_time"      />
18
-        <result property="comment"          column="comment"            />
19
-        <result property="formData"         column="form_data"          />
20
-        <result property="timeoutTime"      column="timeout_time"       />
21
-        <result property="isTimeout"        column="is_timeout"         />
22
-        <result property="createBy"         column="create_by"          />
23
-        <result property="createTime"       column="create_time"        />
24
-        <result property="updateBy"         column="update_by"          />
25
-        <result property="updateTime"       column="update_time"        />
26
-        <result property="remark"           column="remark"             />
27
-        <association property="instance"    javaType="ApprovalInstance" resultMap="InstanceResult" />
28
-        <association property="nodeDefinition" javaType="ApprovalNodeDefinition" resultMap="NodeResult" />
8
+        <id property="id" column="id"/>
9
+        <result property="taskNo" column="task_no"/>
10
+        <result property="instanceId" column="instance_id"/>
11
+        <result property="nodeId" column="node_id"/>
12
+        <result property="taskName" column="task_name"/>
13
+        <result property="assigneeId" column="assignee_id"/>
14
+        <result property="assigneeName" column="assignee_name"/>
15
+        <result property="assignTime" column="assign_time"/>
16
+        <result property="status" column="status"/>
17
+        <result property="completeTime" column="complete_time"/>
18
+        <result property="comment" column="comment"/>
19
+        <result property="formData" column="form_data"/>
20
+        <result property="timeoutTime" column="timeout_time"/>
21
+        <result property="isTimeout" column="is_timeout"/>
22
+        <result property="createBy" column="create_by"/>
23
+        <result property="createTime" column="create_time"/>
24
+        <result property="updateBy" column="update_by"/>
25
+        <result property="updateTime" column="update_time"/>
26
+        <result property="remark" column="remark"/>
27
+        <association property="instance" javaType="ApprovalInstance" resultMap="InstanceResult"/>
28
+        <association property="nodeDefinition" javaType="ApprovalNodeDefinition" resultMap="NodeResult"/>
29
     </resultMap>
29
     </resultMap>
30
-    
30
+
31
     <resultMap id="InstanceResult" type="ApprovalInstance">
31
     <resultMap id="InstanceResult" type="ApprovalInstance">
32
-        <id     property="id"               column="instance_id"        />
33
-        <result property="instanceNo"       column="instance_no"        />
34
-        <result property="title"            column="instance_title"     />
35
-        <result property="businessType"     column="business_type"      />
36
-        <result property="businessId"       column="business_id"        />
37
-        <result property="submitterId"      column="submitter_id"       />
38
-        <result property="submitterName"    column="submitter_name"     />
39
-        <result property="submitTime"       column="submit_time"        />
40
-        <result property="urgentLevel"      column="urgent_level"       />
32
+        <id property="id" column="instance_id"/>
33
+        <result property="instanceNo" column="instance_no"/>
34
+        <result property="title" column="instance_title"/>
35
+        <result property="businessType" column="business_type"/>
36
+        <result property="businessId" column="business_id"/>
37
+        <result property="submitterId" column="submitter_id"/>
38
+        <result property="submitterName" column="submitter_name"/>
39
+        <result property="submitTime" column="submit_time"/>
40
+        <result property="urgentLevel" column="urgent_level"/>
41
     </resultMap>
41
     </resultMap>
42
-    
42
+
43
     <resultMap id="NodeResult" type="ApprovalNodeDefinition">
43
     <resultMap id="NodeResult" type="ApprovalNodeDefinition">
44
-        <id     property="id"               column="node_id"            />
45
-        <result property="nodeCode"         column="node_code"          />
46
-        <result property="nodeName"         column="node_name"          />
47
-        <result property="nodeType"         column="node_type"          />
48
-        <result property="canReject"        column="can_reject"         />
44
+        <id property="id" column="node_id"/>
45
+        <result property="nodeCode" column="node_code"/>
46
+        <result property="nodeName" column="node_name"/>
47
+        <result property="nodeType" column="node_type"/>
48
+        <result property="canReject" column="can_reject"/>
49
     </resultMap>
49
     </resultMap>
50
 
50
 
51
     <sql id="selectApprovalTaskVo">
51
     <sql id="selectApprovalTaskVo">
52
-        select id, task_no, instance_id, node_id, task_name, assignee_id, assignee_name, assign_time, 
53
-               status, complete_time, comment, form_data, timeout_time, is_timeout, create_by, create_time, 
54
-               update_by, update_time, remark 
52
+        select id,
53
+               task_no,
54
+               instance_id,
55
+               node_id,
56
+               task_name,
57
+               assignee_id,
58
+               assignee_name,
59
+               assign_time,
60
+               status,
61
+               complete_time,
62
+               comment,
63
+               form_data,
64
+               timeout_time,
65
+               is_timeout,
66
+               create_by,
67
+               create_time,
68
+               update_by,
69
+               update_time,
70
+               remark
55
         from approval_task
71
         from approval_task
56
     </sql>
72
     </sql>
57
 
73
 
58
     <select id="selectApprovalTaskList" parameterType="ApprovalTask" resultMap="ApprovalTaskResult">
74
     <select id="selectApprovalTaskList" parameterType="ApprovalTask" resultMap="ApprovalTaskResult">
59
         <include refid="selectApprovalTaskVo"/>
75
         <include refid="selectApprovalTaskVo"/>
60
-        <where>  
61
-            <if test="taskNo != null  and taskNo != ''"> and task_no like concat('%', #{taskNo}, '%')</if>
62
-            <if test="instanceId != null "> and instance_id = #{instanceId}</if>
63
-            <if test="nodeId != null "> and node_id = #{nodeId}</if>
64
-            <if test="taskName != null  and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
65
-            <if test="assigneeId != null "> and assignee_id = #{assigneeId}</if>
66
-            <if test="assigneeName != null  and assigneeName != ''"> and assignee_name like concat('%', #{assigneeName}, '%')</if>
67
-            <if test="status != null  and status != ''"> and status = #{status}</if>
68
-            <if test="isTimeout != null  and isTimeout != ''"> and is_timeout = #{isTimeout}</if>
76
+        <where>
77
+            <if test="taskNo != null  and taskNo != ''">and task_no like concat('%', #{taskNo}, '%')</if>
78
+            <if test="instanceId != null ">and instance_id = #{instanceId}</if>
79
+            <if test="nodeId != null ">and node_id = #{nodeId}</if>
80
+            <if test="taskName != null  and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
81
+            <if test="assigneeId != null ">and assignee_id = #{assigneeId}</if>
82
+            <if test="assigneeName != null  and assigneeName != ''">and assignee_name like concat('%', #{assigneeName},
83
+                '%')
84
+            </if>
85
+            <if test="status != null  and status != ''">and status = #{status}</if>
86
+            <if test="isTimeout != null  and isTimeout != ''">and is_timeout = #{isTimeout}</if>
69
             <if test="params != null and params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
87
             <if test="params != null and params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
70
                 and date_format(assign_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
88
                 and date_format(assign_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
71
             </if>
89
             </if>
@@ -75,67 +93,95 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
75
         </where>
93
         </where>
76
         order by assign_time desc
94
         order by assign_time desc
77
     </select>
95
     </select>
78
-    
96
+
79
     <select id="selectApprovalTaskById" parameterType="Long" resultMap="ApprovalTaskResult">
97
     <select id="selectApprovalTaskById" parameterType="Long" resultMap="ApprovalTaskResult">
80
         <include refid="selectApprovalTaskVo"/>
98
         <include refid="selectApprovalTaskVo"/>
81
         where id = #{id}
99
         where id = #{id}
82
     </select>
100
     </select>
83
-    
101
+
84
     <select id="selectApprovalTaskByNo" parameterType="String" resultMap="ApprovalTaskResult">
102
     <select id="selectApprovalTaskByNo" parameterType="String" resultMap="ApprovalTaskResult">
85
         <include refid="selectApprovalTaskVo"/>
103
         <include refid="selectApprovalTaskVo"/>
86
         where task_no = #{taskNo}
104
         where task_no = #{taskNo}
87
     </select>
105
     </select>
88
-    
106
+
89
     <select id="selectApprovalTaskByInstanceId" parameterType="Long" resultMap="ApprovalTaskResult">
107
     <select id="selectApprovalTaskByInstanceId" parameterType="Long" resultMap="ApprovalTaskResult">
90
         <include refid="selectApprovalTaskVo"/>
108
         <include refid="selectApprovalTaskVo"/>
91
         where instance_id = #{instanceId}
109
         where instance_id = #{instanceId}
92
         order by assign_time
110
         order by assign_time
93
     </select>
111
     </select>
94
-    
112
+
95
     <select id="selectApprovalTaskByAssignee" resultMap="ApprovalTaskResult">
113
     <select id="selectApprovalTaskByAssignee" resultMap="ApprovalTaskResult">
96
-        select 
97
-            at.id, at.task_no, at.instance_id, at.node_id, at.task_name, at.assignee_id, at.assignee_name, 
98
-            at.assign_time, at.status, at.complete_time, at.comment, at.form_data, at.timeout_time, at.is_timeout, 
99
-            at.create_by, at.create_time, at.update_by, at.update_time, at.remark,
100
-            ai.instance_no, ai.title as instance_title, ai.business_type, ai.business_id, ai.submitter_id, 
101
-            ai.submitter_name, ai.submit_time, ai.urgent_level,
102
-            and1.node_code, and1.node_name, and1.node_type, and1.can_reject
114
+        select
115
+        at.id, at.task_no, at.instance_id, at.node_id, at.task_name, at.assignee_id, at.assignee_name,
116
+        at.assign_time, at.status, at.complete_time, at.comment, at.form_data, at.timeout_time, at.is_timeout,
117
+        at.create_by, at.create_time, at.update_by, at.update_time, at.remark,
118
+        ai.instance_no, ai.title as instance_title, ai.business_type, ai.business_id, ai.submitter_id,
119
+        ai.submitter_name, ai.submit_time, ai.urgent_level,
120
+        and1.node_code, and1.node_name, and1.node_type, and1.can_reject
103
         from approval_task at
121
         from approval_task at
104
         left join approval_instance ai on at.instance_id = ai.id
122
         left join approval_instance ai on at.instance_id = ai.id
105
         left join approval_node_definition and1 on at.node_id = and1.id
123
         left join approval_node_definition and1 on at.node_id = and1.id
106
         where at.assignee_id = #{assigneeId}
124
         where at.assignee_id = #{assigneeId}
107
-        <if test="status != null and status != ''"> and at.status = #{status}</if>
125
+        <if test="status != null and status != ''">and at.status = #{status}</if>
108
         order by at.assign_time desc
126
         order by at.assign_time desc
109
     </select>
127
     </select>
110
-    
128
+
111
     <select id="selectApprovalTaskByInstanceAndNode" resultMap="ApprovalTaskResult">
129
     <select id="selectApprovalTaskByInstanceAndNode" resultMap="ApprovalTaskResult">
112
         <include refid="selectApprovalTaskVo"/>
130
         <include refid="selectApprovalTaskVo"/>
113
         where instance_id = #{instanceId} and node_id = #{nodeId}
131
         where instance_id = #{instanceId} and node_id = #{nodeId}
114
         limit 1
132
         limit 1
115
     </select>
133
     </select>
116
-    
134
+
117
     <select id="selectApprovalTaskDetail" parameterType="Long" resultMap="ApprovalTaskResult">
135
     <select id="selectApprovalTaskDetail" parameterType="Long" resultMap="ApprovalTaskResult">
118
-        select 
119
-            at.id, at.task_no, at.instance_id, at.node_id, at.task_name, at.assignee_id, at.assignee_name, 
120
-            at.assign_time, at.status, at.complete_time, at.comment, at.form_data, at.timeout_time, at.is_timeout, 
121
-            at.create_by, at.create_time, at.update_by, at.update_time, at.remark,
122
-            ai.instance_no, ai.title as instance_title, ai.business_type, ai.business_id, ai.submitter_id, 
123
-            ai.submitter_name, ai.submit_time, ai.urgent_level,
124
-            and1.node_code, and1.node_name, and1.node_type, and1.can_reject
136
+        select at.id,
137
+               at.task_no,
138
+               at.instance_id,
139
+               at.node_id,
140
+               at.task_name,
141
+               at.assignee_id,
142
+               at.assignee_name,
143
+               at.assign_time,
144
+               at.status,
145
+               at.complete_time,
146
+               at.comment,
147
+               at.form_data,
148
+               at.timeout_time,
149
+               at.is_timeout,
150
+               at.create_by,
151
+               at.create_time,
152
+               at.update_by,
153
+               at.update_time,
154
+               at.remark,
155
+               ai.instance_no,
156
+               ai.title as instance_title,
157
+               ai.business_type,
158
+               ai.business_id,
159
+               ai.submitter_id,
160
+               ai.submitter_name,
161
+               ai.submit_time,
162
+               ai.urgent_level,
163
+               and1.node_code,
164
+               and1.node_name,
165
+               and1.node_type,
166
+               and1.can_reject
125
         from approval_task at
167
         from approval_task at
126
-        left join approval_instance ai on at.instance_id = ai.id
127
-        left join approval_node_definition and1 on at.node_id = and1.id
168
+        left join approval_instance ai
169
+        on at.instance_id = ai.id
170
+            left join approval_node_definition and1 on at.node_id = and1.id
128
         where at.id = #{id}
171
         where at.id = #{id}
129
     </select>
172
     </select>
130
-    
173
+
131
     <select id="generateTaskNo" resultType="String">
174
     <select id="generateTaskNo" resultType="String">
132
         SELECT CONCAT('TASK', DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'), LPAD(FLOOR(RAND() * 1000), 3, '0')) AS new_task_no
175
         SELECT CONCAT('TASK', DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'), LPAD(FLOOR(RAND() * 1000), 3, '0')) AS new_task_no
133
     </select>
176
     </select>
134
-    
177
+
135
     <select id="countPendingTasksByAssignee" parameterType="Long" resultType="int">
178
     <select id="countPendingTasksByAssignee" parameterType="Long" resultType="int">
136
-        select count(1) from approval_task where assignee_id = #{assigneeId} and status = 'PENDING'
179
+        select count(1)
180
+        from approval_task
181
+        where assignee_id = #{assigneeId}
182
+          and status = 'PENDING'
137
     </select>
183
     </select>
138
-        
184
+
139
     <insert id="insertApprovalTask" parameterType="ApprovalTask" useGeneratedKeys="true" keyProperty="id">
185
     <insert id="insertApprovalTask" parameterType="ApprovalTask" useGeneratedKeys="true" keyProperty="id">
140
         insert into approval_task
186
         insert into approval_task
141
         <trim prefix="(" suffix=")" suffixOverrides=",">
187
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -157,7 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
157
             <if test="updateBy != null">update_by,</if>
203
             <if test="updateBy != null">update_by,</if>
158
             <if test="updateTime != null">update_time,</if>
204
             <if test="updateTime != null">update_time,</if>
159
             <if test="remark != null">remark,</if>
205
             <if test="remark != null">remark,</if>
160
-         </trim>
206
+        </trim>
161
         <trim prefix="values (" suffix=")" suffixOverrides=",">
207
         <trim prefix="values (" suffix=")" suffixOverrides=",">
162
             <if test="taskNo != null and taskNo != ''">#{taskNo},</if>
208
             <if test="taskNo != null and taskNo != ''">#{taskNo},</if>
163
             <if test="instanceId != null">#{instanceId},</if>
209
             <if test="instanceId != null">#{instanceId},</if>
@@ -177,7 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
177
             <if test="updateBy != null">#{updateBy},</if>
223
             <if test="updateBy != null">#{updateBy},</if>
178
             <if test="updateTime != null">#{updateTime},</if>
224
             <if test="updateTime != null">#{updateTime},</if>
179
             <if test="remark != null">#{remark},</if>
225
             <if test="remark != null">#{remark},</if>
180
-         </trim>
226
+        </trim>
181
     </insert>
227
     </insert>
182
 
228
 
183
     <update id="updateApprovalTask" parameterType="ApprovalTask">
229
     <update id="updateApprovalTask" parameterType="ApprovalTask">
@@ -206,17 +252,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
206
     </update>
252
     </update>
207
 
253
 
208
     <delete id="deleteApprovalTaskById" parameterType="Long">
254
     <delete id="deleteApprovalTaskById" parameterType="Long">
209
-        delete from approval_task where id = #{id}
255
+        delete
256
+        from approval_task
257
+        where id = #{id}
210
     </delete>
258
     </delete>
211
 
259
 
212
     <delete id="deleteApprovalTaskByIds" parameterType="String">
260
     <delete id="deleteApprovalTaskByIds" parameterType="String">
213
-        delete from approval_task where id in 
261
+        delete from approval_task where id in
214
         <foreach item="id" collection="array" open="(" separator="," close=")">
262
         <foreach item="id" collection="array" open="(" separator="," close=")">
215
             #{id}
263
             #{id}
216
         </foreach>
264
         </foreach>
217
     </delete>
265
     </delete>
218
-    
266
+
219
     <delete id="deleteApprovalTaskByInstanceId" parameterType="Long">
267
     <delete id="deleteApprovalTaskByInstanceId" parameterType="Long">
220
-        delete from approval_task where instance_id = #{instanceId}
268
+        delete
269
+        from approval_task
270
+        where instance_id = #{instanceId}
221
     </delete>
271
     </delete>
222
 </mapper>
272
 </mapper>

+ 65 - 45
airport-system/src/main/resources/mapper/approval/ApprovalWorkflowDefinitionMapper.xml

@@ -1,71 +1,89 @@
1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper
2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalWorkflowDefinitionMapper">
5
 <mapper namespace="com.sundot.airport.system.mapper.approval.ApprovalWorkflowDefinitionMapper">
6
-    
6
+
7
     <resultMap type="ApprovalWorkflowDefinition" id="ApprovalWorkflowDefinitionResult">
7
     <resultMap type="ApprovalWorkflowDefinition" id="ApprovalWorkflowDefinitionResult">
8
-        <id     property="id"               column="id"                 />
9
-        <result property="workflowCode"     column="workflow_code"      />
10
-        <result property="workflowName"     column="workflow_name"      />
11
-        <result property="workflowType"     column="workflow_type"      />
12
-        <result property="description"      column="description"        />
13
-        <result property="status"           column="status"             />
14
-        <result property="createBy"         column="create_by"          />
15
-        <result property="createTime"       column="create_time"        />
16
-        <result property="updateBy"         column="update_by"          />
17
-        <result property="updateTime"       column="update_time"        />
18
-        <result property="remark"           column="remark"             />
19
-        <collection property="nodes"        javaType="java.util.List"   resultMap="NodeResult" />
8
+        <id property="id" column="id"/>
9
+        <result property="workflowCode" column="workflow_code"/>
10
+        <result property="workflowName" column="workflow_name"/>
11
+        <result property="workflowType" column="workflow_type"/>
12
+        <result property="description" column="description"/>
13
+        <result property="status" column="status"/>
14
+        <result property="createBy" column="create_by"/>
15
+        <result property="createTime" column="create_time"/>
16
+        <result property="updateBy" column="update_by"/>
17
+        <result property="updateTime" column="update_time"/>
18
+        <result property="remark" column="remark"/>
19
+        <collection property="nodes" javaType="java.util.List" resultMap="NodeResult"/>
20
     </resultMap>
20
     </resultMap>
21
-    
21
+
22
     <resultMap id="NodeResult" type="ApprovalNodeDefinition">
22
     <resultMap id="NodeResult" type="ApprovalNodeDefinition">
23
-        <id     property="id"               column="node_id"            />
24
-        <result property="workflowId"       column="workflow_id"        />
25
-        <result property="nodeCode"         column="node_code"          />
26
-        <result property="nodeName"         column="node_name"          />
27
-        <result property="nodeType"         column="node_type"          />
28
-        <result property="sortOrder"        column="sort_order"         />
29
-        <result property="approverType"     column="approver_type"      />
30
-        <result property="approverValue"    column="approver_value"     />
31
-        <result property="canReject"        column="can_reject"         />
32
-        <result property="isRequired"       column="is_required"        />
33
-        <result property="timeoutHours"     column="timeout_hours"      />
34
-        <result property="status"           column="node_status"        />
23
+        <id property="id" column="node_id"/>
24
+        <result property="workflowId" column="workflow_id"/>
25
+        <result property="nodeCode" column="node_code"/>
26
+        <result property="nodeName" column="node_name"/>
27
+        <result property="nodeType" column="node_type"/>
28
+        <result property="sortOrder" column="sort_order"/>
29
+        <result property="approverType" column="approver_type"/>
30
+        <result property="approverValue" column="approver_value"/>
31
+        <result property="canReject" column="can_reject"/>
32
+        <result property="isRequired" column="is_required"/>
33
+        <result property="timeoutHours" column="timeout_hours"/>
34
+        <result property="status" column="node_status"/>
35
     </resultMap>
35
     </resultMap>
36
 
36
 
37
     <sql id="selectApprovalWorkflowDefinitionVo">
37
     <sql id="selectApprovalWorkflowDefinitionVo">
38
-        select id, workflow_code, workflow_name, workflow_type, description, status, create_by, create_time, update_by, update_time, remark from approval_workflow_definition
38
+        select id,
39
+               workflow_code,
40
+               workflow_name,
41
+               workflow_type,
42
+               description,
43
+               status,
44
+               create_by,
45
+               create_time,
46
+               update_by,
47
+               update_time,
48
+               remark
49
+        from approval_workflow_definition
39
     </sql>
50
     </sql>
40
 
51
 
41
-    <select id="selectApprovalWorkflowDefinitionList" parameterType="ApprovalWorkflowDefinition" resultMap="ApprovalWorkflowDefinitionResult">
52
+    <select id="selectApprovalWorkflowDefinitionList" parameterType="ApprovalWorkflowDefinition"
53
+            resultMap="ApprovalWorkflowDefinitionResult">
42
         <include refid="selectApprovalWorkflowDefinitionVo"/>
54
         <include refid="selectApprovalWorkflowDefinitionVo"/>
43
-        <where>  
44
-            <if test="workflowCode != null  and workflowCode != ''"> and workflow_code like concat('%', #{workflowCode}, '%')</if>
45
-            <if test="workflowName != null  and workflowName != ''"> and workflow_name like concat('%', #{workflowName}, '%')</if>
46
-            <if test="workflowType != null  and workflowType != ''"> and workflow_type = #{workflowType}</if>
47
-            <if test="status != null  and status != ''"> and status = #{status}</if>
55
+        <where>
56
+            <if test="workflowCode != null  and workflowCode != ''">and workflow_code like concat('%', #{workflowCode},
57
+                '%')
58
+            </if>
59
+            <if test="workflowName != null  and workflowName != ''">and workflow_name like concat('%', #{workflowName},
60
+                '%')
61
+            </if>
62
+            <if test="workflowType != null  and workflowType != ''">and workflow_type = #{workflowType}</if>
63
+            <if test="status != null  and status != ''">and status = #{status}</if>
48
         </where>
64
         </where>
49
         order by create_time desc
65
         order by create_time desc
50
     </select>
66
     </select>
51
-    
67
+
52
     <select id="selectApprovalWorkflowDefinitionById" parameterType="Long" resultMap="ApprovalWorkflowDefinitionResult">
68
     <select id="selectApprovalWorkflowDefinitionById" parameterType="Long" resultMap="ApprovalWorkflowDefinitionResult">
53
         <include refid="selectApprovalWorkflowDefinitionVo"/>
69
         <include refid="selectApprovalWorkflowDefinitionVo"/>
54
         where id = #{id}
70
         where id = #{id}
55
     </select>
71
     </select>
56
-    
57
-    <select id="selectApprovalWorkflowDefinitionByCode" parameterType="String" resultMap="ApprovalWorkflowDefinitionResult">
72
+
73
+    <select id="selectApprovalWorkflowDefinitionByCode" parameterType="String"
74
+            resultMap="ApprovalWorkflowDefinitionResult">
58
         <include refid="selectApprovalWorkflowDefinitionVo"/>
75
         <include refid="selectApprovalWorkflowDefinitionVo"/>
59
         where workflow_code = #{workflowCode} and status = '0'
76
         where workflow_code = #{workflowCode} and status = '0'
60
     </select>
77
     </select>
61
-    
78
+
62
     <select id="selectApprovalWorkflowDefinitionByType" parameterType="String" resultType="ApprovalWorkflowDefinition">
79
     <select id="selectApprovalWorkflowDefinitionByType" parameterType="String" resultType="ApprovalWorkflowDefinition">
63
         <include refid="selectApprovalWorkflowDefinitionVo"/>
80
         <include refid="selectApprovalWorkflowDefinitionVo"/>
64
         where workflow_type = #{workflowType} and status = '0'
81
         where workflow_type = #{workflowType} and status = '0'
65
         order by create_time desc
82
         order by create_time desc
66
     </select>
83
     </select>
67
-        
68
-    <insert id="insertApprovalWorkflowDefinition" parameterType="ApprovalWorkflowDefinition" useGeneratedKeys="true" keyProperty="id">
84
+
85
+    <insert id="insertApprovalWorkflowDefinition" parameterType="ApprovalWorkflowDefinition" useGeneratedKeys="true"
86
+            keyProperty="id">
69
         insert into approval_workflow_definition
87
         insert into approval_workflow_definition
70
         <trim prefix="(" suffix=")" suffixOverrides=",">
88
         <trim prefix="(" suffix=")" suffixOverrides=",">
71
             <if test="workflowCode != null and workflowCode != ''">workflow_code,</if>
89
             <if test="workflowCode != null and workflowCode != ''">workflow_code,</if>
@@ -78,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
78
             <if test="updateBy != null">update_by,</if>
96
             <if test="updateBy != null">update_by,</if>
79
             <if test="updateTime != null">update_time,</if>
97
             <if test="updateTime != null">update_time,</if>
80
             <if test="remark != null">remark,</if>
98
             <if test="remark != null">remark,</if>
81
-         </trim>
99
+        </trim>
82
         <trim prefix="values (" suffix=")" suffixOverrides=",">
100
         <trim prefix="values (" suffix=")" suffixOverrides=",">
83
             <if test="workflowCode != null and workflowCode != ''">#{workflowCode},</if>
101
             <if test="workflowCode != null and workflowCode != ''">#{workflowCode},</if>
84
             <if test="workflowName != null and workflowName != ''">#{workflowName},</if>
102
             <if test="workflowName != null and workflowName != ''">#{workflowName},</if>
@@ -90,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
90
             <if test="updateBy != null">#{updateBy},</if>
108
             <if test="updateBy != null">#{updateBy},</if>
91
             <if test="updateTime != null">#{updateTime},</if>
109
             <if test="updateTime != null">#{updateTime},</if>
92
             <if test="remark != null">#{remark},</if>
110
             <if test="remark != null">#{remark},</if>
93
-         </trim>
111
+        </trim>
94
     </insert>
112
     </insert>
95
 
113
 
96
     <update id="updateApprovalWorkflowDefinition" parameterType="ApprovalWorkflowDefinition">
114
     <update id="updateApprovalWorkflowDefinition" parameterType="ApprovalWorkflowDefinition">
@@ -111,11 +129,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
111
     </update>
129
     </update>
112
 
130
 
113
     <delete id="deleteApprovalWorkflowDefinitionById" parameterType="Long">
131
     <delete id="deleteApprovalWorkflowDefinitionById" parameterType="Long">
114
-        delete from approval_workflow_definition where id = #{id}
132
+        delete
133
+        from approval_workflow_definition
134
+        where id = #{id}
115
     </delete>
135
     </delete>
116
 
136
 
117
     <delete id="deleteApprovalWorkflowDefinitionByIds" parameterType="String">
137
     <delete id="deleteApprovalWorkflowDefinitionByIds" parameterType="String">
118
-        delete from approval_workflow_definition where id in 
138
+        delete from approval_workflow_definition where id in
119
         <foreach item="id" collection="array" open="(" separator="," close=")">
139
         <foreach item="id" collection="array" open="(" separator="," close=")">
120
             #{id}
140
             #{id}
121
         </foreach>
141
         </foreach>