Browse Source

完善撤回流程

zhanglei
yxt_djz 3 years ago
parent
commit
a14a4094e4
  1. 10
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java

10
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java

@ -1156,7 +1156,12 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
private String getTaskId(String currentActivityId, String processInstanceId, String processDefinitionId) { private String getTaskId(String currentActivityId, String processInstanceId, String processDefinitionId) {
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(currentActivityId); 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 // 获取上一个节点的activityId
String sourceRef = sequenceFlow.getSourceRef(); String sourceRef = sequenceFlow.getSourceRef();
HistoricActivityInstance historicActivityInstance = historyService.createHistoricActivityInstanceQuery().activityId(sourceRef) 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()); // taskService.addComment(currentTask.getId(), execution.getProcessInstanceId(), body.get("msg").toString());
// FlowNode flowNode2 = (FlowNode)bpmnModel.getFlowElement(sourceRef); // FlowNode flowNode2 = (FlowNode)bpmnModel.getFlowElement(sourceRef);
String taskId = getTaskId(currentActivityId, historicTaskInstance.getProcessInstanceId(), historicTaskInstance.getProcessDefinitionId()); 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(); HistoricTaskInstance historicTaskInstance1 = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
String assignee = historicTaskInstance1.getAssignee(); String assignee = historicTaskInstance1.getAssignee();
String userSid = flowTaskVo.getUserSid(); String userSid = flowTaskVo.getUserSid();

Loading…
Cancel
Save