IFlowManager.java
20.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
package com.hotent.runtime.manager;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.hotent.base.model.CommonResult;
import com.hotent.base.query.PageList;
import com.hotent.base.query.QueryFilter;
import com.hotent.bpm.api.constant.EventType;
import com.hotent.bpm.api.model.form.FormType;
import com.hotent.bpm.api.model.identity.BpmIdentity;
import com.hotent.bpm.api.model.process.def.BpmVariableDef;
import com.hotent.bpm.api.model.process.inst.BpmProcessInstance;
import com.hotent.bpm.api.model.process.nodedef.BpmNodeDef;
import com.hotent.bpm.api.model.process.task.BpmTask;
import com.hotent.bpm.engine.inst.DefaultProcessInstCmd;
import com.hotent.bpm.persistence.model.*;
import com.hotent.runtime.model.BpmTaskTransRecord;
import com.hotent.runtime.params.*;
import com.hotent.runtime.vo.FlowTypeVo;
/**
* 流程的相关接口
*
* @company 广州宏天软件股份有限公司
* @author zhangxianwen
* @email zhangxw@jee-soft.cn
* @date 2018年6月28日
*/
public interface IFlowManager {
/**
* 获取用户领导的待办事宜
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmTask> getLeaderTodoList(String account, QueryFilter queryFilter) throws Exception;
/**
* 获取用户待办事宜
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
CompletableFuture<PageList<DefaultBpmTask>> getTodoList(String account, QueryFilter<DefaultBpmTask> queryFilter) throws Exception;
/**
* 根据组织ID获取组织信息
* @param orgId
* @return
*/
ObjectNode getOrgByIdOrCode(String orgId);
/**
* 获取待办列表查询条件
* @return
* @throws Exception
*/
QueryFilter getTodoQueryFilter(QueryFilter filter) throws Exception;
/**
* 根据ID主键ID删除传阅任务
* @param id
*/
void delBpmTaskNoticeById(String id) throws Exception;
/**
* 获取我传阅的任务(知会任务)
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<BpmTaskNotice> getMyNoticeReadList(String account, QueryFilter queryFilter) throws Exception;
/**
* 获取我传阅的任务(知会任务)在各分类下的数量
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
List<Map<String,Object>> getMyNoticeReadCount(String account, QueryFilter queryFilter) throws Exception;
/**
* 获取待阅任务(知会任务)
* @return
* @throws Exception
*/
BpmTaskNotice getNoticeTodoReadById(String id);
/**
* 获取待阅任务(知会任务)
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<BpmTaskNotice> getNoticeTodoReadList(String account, QueryFilter queryFilter) throws Exception;
/**
*获取待阅在各分类下的数量
* @return
* @throws Exception
*/
List<Map<String,Object>> getNoticeTodoReadCount(String account, QueryFilter filter) throws Exception;
/**
* 获取已阅任务(知会任务)
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<BpmTaskNoticeDone> getNoticeDoneReadList(String account, QueryFilter queryFilter) throws Exception;
/**
* 获取已阅任务(知会任务)在各分类下的数量
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
List<Map<String,Object>> getNoticeDoneReadCount(String account,QueryFilter queryFilter) throws Exception;
/**
* 获取用户的已办事宜
* @param account
* @param queryFilter
* @param status
* @return
* @throws Exception
*/
PageList<Map<String,Object>> getDoneList(String account,String userId, QueryFilter queryFilter,String status) throws Exception;
/**
* 获取办结事宜。
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmProcessInstance> getCompletedList(String account, QueryFilter queryFilter) throws Exception;
/**
* 获取用户的办结事宜。
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmProcessInstance> getMyCompletedList(String account, QueryFilter queryFilter) throws Exception;
/**
* 我的请求
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmProcessInstance> getMyRequestList(String account, QueryFilter queryFilter) throws Exception;
/**
* 获取用户可发起的流程
* @param account
* @param queryFilter
* @param typeId
* @return
* @throws Exception
*/
PageList<DefaultBpmDefinition> getMyFlowList(String account, QueryFilter queryFilter,String typeId) throws Exception;
/**
* 获取用户的草稿列表
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmProcessInstance> getMyDraftList(String account, QueryFilter queryFilter) throws Exception;
/**
* 根据流程定义ID或流程定义KEY获取流程变量
*
* @param json {defId:"流程定义ID",defKey:"流程定义key"}
* @return
*/
List<BpmVariableDef> getWorkflowVar(String json) throws Exception;
/**
* 获取用户的抄送转发事宜
* @param account
* @param queryFilter
* @param type
* @return
* @throws Exception
*/
PageList<CopyTo> getReceiverCopyTo(String account, QueryFilter queryFilter,String type) throws Exception ;
/**
* 由我发出的抄送
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<CopyTo> myCopyTo(String account, QueryFilter queryFilter) throws Exception ;
/**
* 获取用户转办代理事宜
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmTaskTurn> getDelegate(String account, QueryFilter queryFilter) throws Exception;
List<Map<String,Object>> getDelegateCount(String account, QueryFilter queryFilter) throws Exception;
/**
* 我的流转任务
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<BpmTaskTransRecord> getMyTrans(String account, QueryFilter queryFilter) throws Exception;
/**
* 根据id删除草稿
* @param id
* @return
*/
CommonResult<String> removeDraftById(String runId) throws Exception;
/**
* 任务转办
* @param assignParamObject
* @return
* @throws Exception
*/
CommonResult<String> delegate(AssignParamObject assignParamObject) throws Exception;
/**
* 任务沟通
* @param communicateParamObject
* @return
* @throws Exception
*/
CommonResult<String> communicate(CommunicateParamObject communicateParamObject) throws Exception;
/**
* 流程任务加签,增加会签人员
* @param assignParamObject
* @return
* @throws Exception
*/
CommonResult<String> taskSignUsers(AssignParamObject assignParamObject) throws Exception;
/**
* 添加签署人员 (根据加签代码修改)
* @param assignParamObject
* @return
* @throws Exception
*/
CommonResult<String> taskCustomSignUsers(AssignParamObject assignParamObject) throws Exception;
/**
* 根据实例id撤回流程(撤销)
* @param instanceId
* @return
* @throws Exception
*/
CommonResult<String> revokeInstance(RevokeParamObject revokeParamObject) throws Exception;
// /**
// * 根据流程定义key获取流程的所有节点信息
// * @param defKey
// * @return
// * @throws Exception
// */
// List<BpmNodeDefVo> getNodesByDefKey(String defKey) throws Exception ;
/**
* 根据任务id获取下一环节处理人
* @param taskId
* @return
* @throws Exception
*/
Map<String, List<BpmIdentity>> getNextTaskUsers(String taskId) throws Exception;
/**
* 修改任务执行人
* @param modifyExecutorsParamObject
* @return
* @throws Exception
*/
CommonResult<String> setTaskExecutors(ModifyExecutorsParamObject modifyExecutorsParamObject) throws Exception;
/**
* 判断用户是否有添加会签权限
* @param json
* @return
* @throws Exception
*/
Boolean isAllowAddSign(IsAllowAddSignObject isAllowAddSignObject) throws Exception;
/**
* 保存流转信息(增加流转)
* @param taskTransParamObject
* @return
* @throws Exception
*/
CommonResult<String> taskToTrans(TaskTransParamObject taskTransParamObject) throws Exception;
/**
* 普通任务加签
* @param taskTransParamObject
* @return
* @throws Exception
*/
CommonResult<String> userTaskToSign(TaskTransParamObject taskTransParamObject) throws Exception;
/**
* 保存并行审批信息
* @param taskApproveLineParam
* @return
* @throws Exception
*/
CommonResult<String> taskToApproveLine(TaskApproveLineParam taskApproveLineParam) throws Exception;
/**
* 获取处理任务的 在线表单地址
* @param taskId
* @param formType
* @return
* @throws Exception
*/
String getUrlFormByTaskId(String taskId, String formType) throws Exception;
/**
* 获取实例表单
* 如果nodeId 不为空,先获取节点配置的实例表单
* 否则获取全局的实例表单地址
* @param proInstId
* @param nodeId
* @param formType pc/mobile
* @return
* @throws Exception
*/
String getInstUrlForm(String proInstId, String nodeId, String formType) throws Exception;
/**
* 我的请求(包括人工终止和结束状态的实例)
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmProcessInstance> getMyRequestListAll(String account, QueryFilter queryFilter) throws Exception;
/**
* 查询流程定义列表
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmDefinition> getBpmDefList(String account, QueryFilter queryFilter) throws Exception;
/**
* 新建流程列表
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmDefinition> newProcess(String account, QueryFilter queryFilter) throws Exception;
/**
* 流程分类下的数量
* @param queryFilter
* @return
* @throws Exception
*/
List<Map<String,Object>> newProcessCount(QueryFilter queryFilter) throws Exception;
/**
* 我的请求列表
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmProcessInstance> myRequest(String account, QueryFilter queryFilter) throws Exception;
List<Map<String,Object>> myRequestCount(String account) throws Exception;
/**
* 查询流程实例列表
* @param account
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmProcessInstance> getInstanceList(String account, QueryFilter queryFilter) throws Exception;
/**
* 获取流程实例的表单和数据
* @param proInstId
* @param defKey
* @return
* @throws Exception
*/
InstFormAndBoVo getInstFormAndBO(String proInstId,String nodeId,String formId,FormType formType,Boolean includData,Boolean getStartForm,Boolean myApplication) throws Exception;
/**
* 流程启动时获取bo和表单。
* @param startCmdParam
* @return
* @throws Exception
*/
FormAndBoVo getFormAndBO(StartCmdParam startCmdParam,FormType formType) throws Exception;
/**
* 获取发起的cmd格式数据
* @param request
* @param startCmdParam
* @return
* @throws Exception
*/
DefaultProcessInstCmd getStartCmd(StartCmdParam startCmdParam) throws Exception;
/**
* 获取可以选择的路径
* @param defId
* @return
* @throws Exception
*/
SelectDestinationVo selectDestination(String defId) throws Exception;
/**
* 节点图片
* @param proInstId
* @param type
* @param from
* @param nodeId
* @param defId
* @return
* @throws Exception
*/
FlowImageVo flowImage(String proInstId, String type, String from, String nodeId,String defId) throws Exception;
/**
* 流程图相关(移动端)
* @param proInstId
* @param type
* @param from
* @param nodeId
* @param defId
* @return
* @throws Exception
*/
FlowImageMobileVo flowImageMobile(String proInstId, String type, String from, String nodeId, String defId) throws Exception;
/**
* 流程审批历史(页面数据)
* @param instId
* @param taskId
* @return
* @throws Exception
*/
List<ObjectNode> opinionHistory(String instId, String taskId) throws Exception;
/**
* 获取任务处理页面参数
* @param taskId
* @return
* @throws Exception
*/
CompletableFuture<TaskDoNextVo> taskDoNext(String taskId) throws Exception;
/**
* 获取用户审批界面参数
* @param taskId
* @return
* @throws Exception
*/
TaskDoNextVo taskApprove(String taskId) throws Exception;
/**
* 获取任务流程图页面参数
* @param taskId
* @return
* @throws Exception
*/
TaskjImageVo taskImage(String taskId,String defId) throws Exception;
/**
* 获取流程实例中指定节点的审批意见
* @param instId
* @param nodeId
* @return
* @throws Exception
*/
Object nodeOpinion(String defId,String instId,String nodeId ,boolean isDerive) throws Exception;
/**
* 获取任务的详情
* @param taskId
* @return
* @throws Exception
*/
CompletableFuture<TaskDetailVo> taskDetail(String taskId,String reqValue,FormType formType,String leaderId) throws Exception;
CompletableFuture<TaskDetailVo> taskDetailMobile(String taskId,String reqValue,FormType formType) throws Exception;
/**
* 判断当前人是否有该任务处理权限
* @param taskId 任务ID
* @param leaderId 领导用户ID
* @return
* @throws Exception
*/
Boolean isAuth(String taskId, String leaderId) throws Exception;
/**
* 判断当前用户是否为任务的执行人或者候选人
* @param taskId 任务ID
* @return 判断结果
* @throws Exception
*/
Boolean checkTaskByAssignee(String taskId) throws Exception;
/**
* 获取任务上下文流程变量
* @param taskId
* @param vars
* @return
* @throws Exception
*/
Map<String, Object> getTaskVars(String taskId,Map<String,String> vars) throws Exception;
/**
* 处理任务
* @param doNextParamObject
* @param reqValue
* @param usersMap
* @return
* @throws Exception
*/
CompletableFuture<CommonResult<String>> complete(DoNextParamObject doNextParamObject) throws Exception;
/**
* 保存草稿
* @param doNextParamObject
* @return
* @throws Exception
*/
CommonResult<String> saveDraft(DoNextParamObject doNextParamObject) throws Exception;
/**
* 获取任务任务明细
* @param taskId
* @param reqValue
* @return
* @throws Exception
*/
CompletableFuture<TaskGetVo> getTaskById(String taskId,boolean requireLayout) throws Exception;
/**
* 任务办理(同意、反对、弃权)
* @param taskId
* @param actionName
* @return
* @throws Exception
*/
TaskToAgreeVo toAgree(String taskId, String actionName) throws Exception;
/**
* 驳回任务页面参数
* @param taskId
* @param actionName
* @return
* @throws Exception
*/
TaskToRejectVo toReject(String taskId, String backModel) throws Exception;
/**
* 撤销我流转出去的任务
* @param withDrawParam
* @return
* @throws Exception
*/
CommonResult<String> withDraw(WithDrawParam withDrawParam) throws Exception;
List<ObjectNode> opinionHistory(String instId,String taskId,boolean isCommu) throws Exception;
List<ObjectNode> filterByAuth(List<ObjectNode> opinionList,String inst, boolean isRequest) throws Exception;
/**
* 征询设置
* @param taskTransParamObject
* @return
* @throws Exception
*/
CommonResult<String> taskToInqu(TaskTransParamObject taskTransParamObject) throws Exception;
//添加阅读记录
void addReadRecord(Object obj) throws Exception;
//知会任务待办转已办
void noticeTurnDode(String taskId);
ObjectNode getAfterJumpNode(ObjectNode obj ) throws Exception;
BpmNodeDef getCurNodeProperties(String orElse, String orElse2,String instId) throws Exception;
/**
* 获取指定节点属性
* @param defId
* @param instId
* @param nodeId
* @return
* @throws Exception
*/
BpmNodeDef getNodePropertiesByNodeId(String defId, String instId,String nodeId) throws Exception;
/**
* 获取流程字段信息
* @param account
* @param queryFilter
* @param status
* @return
* @throws Exception
*/
PageList<Map<String,Object>> getFlowFieldList(QueryFilter queryFilter) throws Exception;
/**
* 获取已办
* @param current 用户账号
* @param queryFilter 过滤条件
* @param status 已办类型:null-我的已办;1-领导已办
* @return
* @throws Exception
*/
CompletableFuture<PageList<Map<String, Object>>> getDoneInstList(String current, QueryFilter queryFilter, String status) throws Exception;
/**
* 转移任务给(用户)
* @param map
* @return
*/
CommonResult<String> divertDoneTask(Map<String,Object> map) throws Exception;
List<Map<String,Object>> getDoneInstCount(String current,QueryFilter queryFilter,String status) throws Exception;
CommonResult<String> taskToSignSequence(
TaskTransParamObject taskTransParamObject) throws Exception;
/**
* 撤回流转出去的任务
* @param revokeParamObject
* @return
* @throws Exception
*/
CommonResult<String> revokeTrans(RevokeTransParamObject revokeTransParamObject) throws Exception;
void revokeSignSequence(
RevokeTransParamObject revokeTransParamObject) throws Exception;
CommonResult<String> taskToSignLine(
TaskTransParamObject taskTransParamObject) throws Exception;
/**
* 并行签署撤回
* @param revokeParamObject
* @throws Exception
*/
void revokeSignLine(RevokeSignLineParamObject revokeParamObject) throws Exception;
/**
* 根据任务ID获取审批按钮
* @param taskId
* @return
*/
TaskDetailVo getButtonsBytaskId(String taskId) throws Exception;
/**
* 获取顺签下一步执行人
* @param taskId
* @return
*/
CommonResult<BpmIdentity> nextExecutor(String taskId);
/**
* 判断当前用户是否有实例和任务的权限
* @param procDefKey
* @param procInstId
* @return
*/
boolean isInRightMap(String procDefKey,String procInstId);
Map<String, ObjectNode> getInstanceByPks(List<String> pks, String boDefAlias, String flowKey);
/**
* 获取表单列表流程相关按钮的权限
* @param instIds 流程实例ID集合
* @return 表单列表流程按钮权限
* */
List<DataTemplateButtonPermissionVo> getDataTemplateButtonPermission(List<String> instIds, String types) throws Exception;
/**
* 获取待办事宜(根据用户、组织、岗位、角色)
* @param team
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmTask> getTodoListByTeam(String team, QueryFilter<DefaultBpmTask> queryFilter) throws Exception;
Map<String, List<DefaultBpmDefinition>> newProcessCard(String currentUserAccout, QueryFilter queryFilter, Integer size) throws Exception;
Map<String, BpmLeaderTask> getLeaderTodoCard(String currentUserAccout, QueryFilter queryFilter, Integer size);
/**
* 任务是否处于第一个节点
*
* <pre>
* 当前如果是子流程实例中的任务,则直接返回false
* </pre>
*
* @param taskId
* @return
*/
Boolean isTaskFirstNode(String taskId) throws Exception;
/**
* 删除流程实例
* @param id
* @return
*/
Object instRemove(String id) throws Exception;
/**
* 执行对应的全局时间或者节点事件
* @param instanceId
* @param tasks
* @param eventType
* @throws Exception
*/
void doPostAsync(String instanceId, List<BpmTask> tasks, EventType eventType) throws Exception;
/**
* 根据流程实例id恢复实例数据
* @param idArr
*/
CommonResult<String> doRestore(String[] idArr) throws Exception;
/**
* 查询常用流程
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmDefinition> getMyOftenFlow(QueryFilter<DefaultBpmDefinition> queryFilter) throws Exception;
/**
* 获取我有权限的常用流程
* @param queryFilter
* @return
* @throws Exception
*/
PageList<DefaultBpmDefinition> getMyOftenFlowKeyHasAuthority(QueryFilter<DefaultBpmDefinition> queryFilter) throws Exception;
/**
* 根据父流程实例id和节点id。获取该节点上的外部子流程实例
* @param parentInstId
* @param nodeId
* @return
*/
List<BpmProcessInstance> getSubInstanceList(String parentInstId, String nodeId);
/**
* 根据父流程定义id和节点id。获取该节点上的外部子流程定义id
* @param parentDefId
* @param parentInstId
* @param nodeId
* @return
* @throws Exception
*/
String getSubDefId(String parentDefId, String parentInstId, String nodeId) throws Exception;
/**
* 获取当前用户有权限的流程分类信息
* @return
* @throws Exception
*/
List<FlowTypeVo> getCurUserFlowType() throws Exception;
}