|
@@ -261,12 +261,12 @@ public class WorkflowController : BaseController
|
|
|
/// 查询当前流程下一节点配置
|
|
|
/// </summary>
|
|
|
[HttpGet("{workflowId}/nextsteps")]
|
|
|
- public async Task<DefineWithSelectionStepDto> GetNextStepDefine(string workflowId)
|
|
|
+ public async Task<DefineWithSelectionStepsDto> GetNextStepDefine(string workflowId)
|
|
|
{
|
|
|
var workflow = await _workflowDomainService.GetWorkflowAsync(workflowId, true, true,
|
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
|
var nextStepDefines = _workflowDomainService.GetNextStepDefines(workflow);
|
|
|
- return new DefineWithSelectionStepDto
|
|
|
+ return new DefineWithSelectionStepsDto
|
|
|
{
|
|
|
Id = workflow.DefinitionId,
|
|
|
Steps = nextStepDefines.Select(d => new KeyValuePair<string, string>(d.Code, d.Name)).ToList()
|
|
@@ -314,17 +314,23 @@ public class WorkflowController : BaseController
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 获取撤回参数
|
|
|
+ /// 获取撤回可选节点
|
|
|
/// </summary>
|
|
|
/// <param name="workflowId"></param>
|
|
|
/// <returns></returns>
|
|
|
[Permission(EPermission.FlowJump)]
|
|
|
[HttpGet("{workflowId}/recall")]
|
|
|
- public async Task<IReadOnlyList<StepDefineDto>> GetRecallOptions(string workflowId)
|
|
|
+ public async Task<DefineWithSelectionStepsDto> GetRecallOptions(string workflowId)
|
|
|
{
|
|
|
var workflow = await _workflowDomainService.GetWorkflowAsync(workflowId, true, true, cancellationToken: HttpContext.RequestAborted);
|
|
|
- return _mapper.Map<IReadOnlyList<StepDefineDto>>(
|
|
|
- workflow.StepBoxes.Where(d => d.StepType != EStepType.Start && d.StepType != EStepType.End));
|
|
|
+ var stepCodes = workflow.StepBoxes.Where(d => d.StepType != EStepType.Start && d.StepType != EStepType.End)
|
|
|
+ .Select(d => d.Code).ToList();
|
|
|
+ var nextStepDefines = workflow.Definition.FindSteps(stepCodes);
|
|
|
+ return new DefineWithSelectionStepsDto
|
|
|
+ {
|
|
|
+ Id = workflow.DefinitionId,
|
|
|
+ Steps = nextStepDefines.Select(d => new KeyValuePair<string, string>(d.Code, d.Name)).ToList()
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -344,11 +350,16 @@ public class WorkflowController : BaseController
|
|
|
/// <param name="workflowId"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("{workflowId}/jump")]
|
|
|
- public async Task<IReadOnlyList<StepDefineDto>> GetJumpOptions(string workflowId)
|
|
|
+ public async Task<DefineWithSelectionStepsDto> GetJumpOptions(string workflowId)
|
|
|
{
|
|
|
var workflow = await _workflowDomainService.GetWorkflowAsync(workflowId, true, true, cancellationToken: HttpContext.RequestAborted);
|
|
|
- var steps = workflow.Definition.Steps.Where(d => d.StepType != EStepType.Start && d.StepType != EStepType.End);
|
|
|
- return _mapper.Map<IReadOnlyList<StepDefineDto>>(steps);
|
|
|
+ var steps = workflow.Definition.Steps.Where(d => d.StepType != EStepType.Start && d.StepType != EStepType.End).ToList();
|
|
|
+ var nextStepDefines = workflow.Definition.FindSteps(steps.Select(d => d.Code));
|
|
|
+ return new DefineWithSelectionStepsDto
|
|
|
+ {
|
|
|
+ Id = workflow.DefinitionId,
|
|
|
+ Steps = nextStepDefines.Select(d => new KeyValuePair<string, string>(d.Code, d.Name)).ToList()
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
/// <summary>
|