|
@@ -807,4 +807,54 @@ public class FlowTaskService {
|
|
return task;
|
|
return task;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取当前节点审核人id信息集合
|
|
|
|
+ * @param taskId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<String> getTaskAuditUsers(String taskId) {
|
|
|
|
+ List<String> assignList = Lists.newArrayList ();
|
|
|
|
+ //获取当前节点审核人id信息集合
|
|
|
|
+ taskService.getIdentityLinksForTask ( taskId ).forEach ( identityLink -> {
|
|
|
|
+ assignList.add ( identityLink.getUserId () );
|
|
|
|
+ } );
|
|
|
|
+ return assignList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取当前节点信息
|
|
|
|
+ * @param processInstanceId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public FlowNode getCurrentTask(String processInstanceId){
|
|
|
|
+ //当前任务信息
|
|
|
|
+ Task task =taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult();
|
|
|
|
+
|
|
|
|
+ if(task!=null) {
|
|
|
|
+ //获取流程发布Id信息
|
|
|
|
+ String definitionId = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult().getProcessDefinitionId();
|
|
|
|
+ //获取bpm对象
|
|
|
|
+ BpmnModel bpmnModel = SpringUtil.getBean (RepositoryService.class).getBpmnModel(definitionId);
|
|
|
|
+ //传节点定义key 获取当前节点
|
|
|
|
+ FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
|
|
|
+ return flowNode;
|
|
|
|
+ }else{
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取当前节点名称
|
|
|
|
+ * @param processInstanceId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public String getCurrentTaskName(String processInstanceId){
|
|
|
|
+ FlowNode currentTask = getCurrentTask(processInstanceId);
|
|
|
|
+ if (Objects.nonNull(currentTask)) {
|
|
|
|
+ return currentTask.getName();
|
|
|
|
+ }
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|