|
@@ -475,6 +475,50 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
475
|
475
|
return AjaxResult.success(userTaskList);
|
476
|
476
|
}
|
477
|
477
|
|
|
478
|
+ /**
|
|
479
|
+ * 获取重新提交的节点
|
|
480
|
+ *
|
|
481
|
+ * @param flowTaskVo
|
|
482
|
+ * @return
|
|
483
|
+ */
|
|
484
|
+ @Override
|
|
485
|
+ public AjaxResult findReCommitTask(FlowTaskVo flowTaskVo) {
|
|
486
|
+ // 当前任务 task
|
|
487
|
+ Task task = taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult();
|
|
488
|
+ // 从流程历史任务中获取可重新提交的节点
|
|
489
|
+ List<HistoricActivityInstance> hisActIns = historyService.createHistoricActivityInstanceQuery()
|
|
490
|
+ .processInstanceId(task.getProcessInstanceId())
|
|
491
|
+ .activityType("userTask")
|
|
492
|
+ .orderByHistoricActivityInstanceStartTime()
|
|
493
|
+ .desc()
|
|
494
|
+ .list();
|
|
495
|
+
|
|
496
|
+ // 跳转的节点列表
|
|
497
|
+ List<HistoricActivityInstance> reCommitList = new ArrayList<>();
|
|
498
|
+ if (hisActIns.size() > 0)
|
|
499
|
+ reCommitList.add(hisActIns.get(1));
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+ List<UserTask> userTaskList = new ArrayList<>();
|
|
503
|
+ // 获取流程定义信息
|
|
504
|
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
|
|
505
|
+ // 获取所有节点信息,暂不考虑子流程情况
|
|
506
|
+ Process process = repositoryService.getBpmnModel(processDefinition.getId()).getProcesses().get(0);
|
|
507
|
+ Collection<FlowElement> flowElements = process.getFlowElements();
|
|
508
|
+ // 获取当前任务节点元素
|
|
509
|
+ UserTask source = null;
|
|
510
|
+ if (flowElements != null) {
|
|
511
|
+ for (FlowElement flowElement : flowElements) {
|
|
512
|
+ // 类型为用户节点
|
|
513
|
+ if (reCommitList.size() > 0 && flowElement.getId().equals(reCommitList.get(0).getActivityId())) {
|
|
514
|
+ source = (UserTask) flowElement;
|
|
515
|
+ }
|
|
516
|
+ }
|
|
517
|
+ }
|
|
518
|
+ userTaskList.add(source);
|
|
519
|
+ return AjaxResult.success(userTaskList);
|
|
520
|
+ }
|
|
521
|
+
|
478
|
522
|
/**
|
479
|
523
|
* 删除任务
|
480
|
524
|
*
|