|
@@ -49,9 +49,10 @@ public class FlowTaskActorProvider implements TaskActorProvider {
|
|
|
|
|
|
@Override
|
|
|
public List<FlwTaskActor> getTaskActors(NodeModel nodeModel, Execution execution) {
|
|
|
+ final FlowCreator flowCreator = execution.getFlowCreator();
|
|
|
if (TaskType.major.eq(nodeModel.getType())) {
|
|
|
// 发起人审批,经过 isAllowed 验证合法,直接返回当前执行人
|
|
|
- return Collections.singletonList(FlwTaskActor.ofFlowCreator(execution.getFlowCreator()));
|
|
|
+ return Collections.singletonList(FlwTaskActor.ofFlowCreator(flowCreator));
|
|
|
}
|
|
|
if (TaskType.approval.eq(nodeModel.getType())) {
|
|
|
/*
|
|
@@ -68,13 +69,13 @@ public class FlowTaskActorProvider implements TaskActorProvider {
|
|
|
*/
|
|
|
if (NodeSetType.supervisor.eq(nodeModel.getSetType())) {
|
|
|
// 2,主管
|
|
|
- return getDepartmentHeadInfo(nodeModel.getExamineLevel(), false, () -> "请设置直接主管信息");
|
|
|
+ return getDepartmentHeadInfo(flowCreator, nodeModel.getExamineLevel(), false, () -> "请设置直接主管信息");
|
|
|
} else if (NodeSetType.initiatorThemselves.eq(nodeModel.getSetType())) {
|
|
|
// 5,发起人自己
|
|
|
return Collections.singletonList(FlowHelper.getFlwTaskActor());
|
|
|
} else if (NodeSetType.multiLevelSupervisors.eq(nodeModel.getSetType())) {
|
|
|
// 6,连续多级主管
|
|
|
- return getDepartmentHeadInfo(nodeModel.getExamineLevel(), true, () -> "未找到任何主管信息");
|
|
|
+ return getDepartmentHeadInfo(flowCreator, nodeModel.getExamineLevel(), true, () -> "未找到任何主管信息");
|
|
|
}
|
|
|
}
|
|
|
List<NodeAssignee> nodeAssigneeList = nodeModel.getNodeAssigneeList();
|
|
@@ -96,10 +97,9 @@ public class FlowTaskActorProvider implements TaskActorProvider {
|
|
|
/**
|
|
|
* 获取部门主管信息
|
|
|
*/
|
|
|
- private List<FlwTaskActor> getDepartmentHeadInfo(Integer examineLevel, boolean multiLevel, Supplier<String> supplier) {
|
|
|
- UserSession userSession = UserSession.getLoginInfo();
|
|
|
+ private List<FlwTaskActor> getDepartmentHeadInfo(FlowCreator flowCreator, Integer examineLevel, boolean multiLevel, Supplier<String> supplier) {
|
|
|
ISysDepartmentService sysDepartmentService = SpringHelper.getBean(ISysDepartmentService.class);
|
|
|
- List<DepartmentHeadVO> voList = sysDepartmentService.getDepartmentHeadInfo(userSession.getId(), examineLevel, multiLevel);
|
|
|
+ List<DepartmentHeadVO> voList = sysDepartmentService.getDepartmentHeadInfo(Long.valueOf(flowCreator.getCreateId()), examineLevel, multiLevel);
|
|
|
if (CollectionUtils.isEmpty(voList)) {
|
|
|
ApiAssert.fail(supplier.get());
|
|
|
}
|