|
|
@ -1156,7 +1156,12 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask |
|
|
|
private String getTaskId(String currentActivityId, String processInstanceId, String processDefinitionId) { |
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); |
|
|
|
FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(currentActivityId); |
|
|
|
SequenceFlow sequenceFlow = flowNode.getIncomingFlows().get(0); |
|
|
|
List<SequenceFlow> list=flowNode.getIncomingFlows(); |
|
|
|
if(list.size()==0){ |
|
|
|
return ""; |
|
|
|
} |
|
|
|
SequenceFlow sequenceFlow = list.get(0); |
|
|
|
|
|
|
|
// 获取上一个节点的activityId
|
|
|
|
String sourceRef = sequenceFlow.getSourceRef(); |
|
|
|
HistoricActivityInstance historicActivityInstance = historyService.createHistoricActivityInstanceQuery().activityId(sourceRef) |
|
|
@ -1183,6 +1188,9 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask |
|
|
|
// taskService.addComment(currentTask.getId(), execution.getProcessInstanceId(), body.get("msg").toString());
|
|
|
|
// FlowNode flowNode2 = (FlowNode)bpmnModel.getFlowElement(sourceRef);
|
|
|
|
String taskId = getTaskId(currentActivityId, historicTaskInstance.getProcessInstanceId(), historicTaskInstance.getProcessDefinitionId()); |
|
|
|
if(StringUtils.isBlank(taskId)){ |
|
|
|
return new ResultBean<List<LatestTaskVo>>().fail().setMsg("流程找不到上一环节,撤回操作失败!").setData(new ArrayList<>()); |
|
|
|
} |
|
|
|
HistoricTaskInstance historicTaskInstance1 = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult(); |
|
|
|
String assignee = historicTaskInstance1.getAssignee(); |
|
|
|
String userSid = flowTaskVo.getUserSid(); |
|
|
|