|
@@ -666,8 +666,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
666
|
666
|
.list();
|
667
|
667
|
String myTaskId = null;
|
668
|
668
|
String nextUserTaskId = null;
|
669
|
|
- Map<String, Object> currentVariables = taskService.getVariables(taskService.createTaskQuery().processInstanceId(task.getProcessInstanceId()).singleResult().getId());
|
670
|
|
- List<UserTask> nextUserTask = FindNextNodeUtil.getNextUserTasksByHistTask(repositoryService, task, currentVariables);
|
671
|
669
|
|
672
|
670
|
for (HistoricTaskInstance hti : htiList) {
|
673
|
671
|
if (loginUser.getUserId().toString().equals(hti.getAssignee())) {
|
|
@@ -675,21 +673,27 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
675
|
673
|
break;
|
676
|
674
|
}
|
677
|
675
|
}
|
678
|
|
- for (HistoricTaskInstance hti : htiList) {
|
679
|
|
- if (CollectionUtils.isNotEmpty(nextUserTask)) {
|
680
|
|
- for (UserTask userTask : nextUserTask) {
|
681
|
|
- if (userTask.getId().equals(hti.getTaskDefinitionKey()) && hti.getEndTime() != null && hti.getDeleteReason() == null) {
|
682
|
|
- nextUserTaskId = task.getTaskDefinitionKey();
|
683
|
|
- break;
|
684
|
|
- }
|
685
|
|
- }
|
686
|
|
- }
|
687
|
|
- }
|
688
|
676
|
if (null == myTaskId) {
|
689
|
677
|
throw new CustomException("该任务非当前用户提交,无法撤回");
|
690
|
678
|
}
|
691
|
|
- if (nextUserTaskId != null) {
|
692
|
|
- throw new CustomException("下一节点已办理,无法撤回");
|
|
679
|
+ List<Task> taskList = taskService.createTaskQuery().processInstanceId(task.getProcessInstanceId()).list();
|
|
680
|
+ if (taskList.size() == 1) {
|
|
681
|
+ Map<String, Object> currentVariables = taskService.getVariables(taskService.createTaskQuery().processInstanceId(task.getProcessInstanceId()).singleResult().getId());
|
|
682
|
+ List<UserTask> nextUserTask = FindNextNodeUtil.getNextUserTasksByHistTask(repositoryService, task, currentVariables);
|
|
683
|
+
|
|
684
|
+ for (HistoricTaskInstance hti : htiList) {
|
|
685
|
+ if (CollectionUtils.isNotEmpty(nextUserTask)) {
|
|
686
|
+ for (UserTask userTask : nextUserTask) {
|
|
687
|
+ if (userTask.getId().equals(hti.getTaskDefinitionKey()) && hti.getEndTime() != null && hti.getDeleteReason() == null) {
|
|
688
|
+ nextUserTaskId = task.getTaskDefinitionKey();
|
|
689
|
+ break;
|
|
690
|
+ }
|
|
691
|
+ }
|
|
692
|
+ }
|
|
693
|
+ }
|
|
694
|
+ if (nextUserTaskId != null) {
|
|
695
|
+ throw new CustomException("下一节点已办理,无法撤回");
|
|
696
|
+ }
|
693
|
697
|
}
|
694
|
698
|
// 获取流程定义信息
|
695
|
699
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
|