|
@@ -85,7 +85,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
/// <param name="dto"></param>
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task StartAsync(Workflow workflow, BasicWorkflowDto dto, StepDefine nextStepBoxDefine, FlowAssignMode flowAssignMode, CancellationToken cancellationToken)
|
|
|
+ public async Task StartAsync(Workflow workflow, BasicWorkflowDto dto, StepDefine nextStepBoxDefine, bool isStartCountersign, FlowAssignMode flowAssignMode, CancellationToken cancellationToken)
|
|
|
{
|
|
|
//var nextStepBoxDefine = GetStepBoxDefine(workflow.Definition, dto.NextStepCode);
|
|
|
|
|
@@ -96,7 +96,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
//开始节点
|
|
|
var (startStepBox, startStep) = await CreateStartStepAsync(workflow, dto, cancellationToken);
|
|
|
|
|
|
- var isStartCountersign = startStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
+ //var isStartCountersign = startStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
//检查是否支持会签
|
|
|
if (isStartCountersign && startStep.CountersignMode == ECountersignMode.UnSupport)
|
|
|
throw new UserFriendlyException($"当前节点不支持发起会签, stepId: {startStep.Id}", "当前节点不支持发起会签");
|
|
@@ -228,7 +228,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
/// 办理(流转至下一节点)
|
|
|
/// </summary>
|
|
|
public async Task NextAsync(Workflow workflow, BasicWorkflowDto dto, StepDefine nextStepBoxDefine,
|
|
|
- bool isOutOfCallCenter, FlowAssignMode flowAssignMode, CancellationToken cancellationToken)
|
|
|
+ bool isOutOfCallCenter, bool isStartCountersign, FlowAssignMode flowAssignMode, CancellationToken cancellationToken)
|
|
|
{
|
|
|
ValidatePermission(workflow);
|
|
|
CheckWhetherRunnable(workflow.Status);
|
|
@@ -239,7 +239,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
if (currentStep.Status is EWorkflowStepStatus.Completed or EWorkflowStepStatus.Created)
|
|
|
throw UserFriendlyException.SameMessage("当前节点状态无法办理");
|
|
|
|
|
|
- var isStartCountersign = currentStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
+ //var isStartCountersign = currentStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
//检查是否支持发起会签
|
|
|
if (isStartCountersign && currentStep.CountersignMode == ECountersignMode.UnSupport)
|
|
|
throw new UserFriendlyException($"当前节点不支持发起会签, stepId: {currentStep.Id}", "当前节点不支持发起会签");
|
|
@@ -445,14 +445,17 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
if (currentStepBox.StepType is EStepType.Start)
|
|
|
throw UserFriendlyException.SameMessage("当前流程已退回到开始节点");
|
|
|
|
|
|
- var isStartCountersign = currentStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
- //检查是否支持会签
|
|
|
- if (isStartCountersign && currentStep.CountersignMode == ECountersignMode.UnSupport)
|
|
|
- throw new UserFriendlyException($"当前节点不支持发起会签, stepId: {currentStep.Id}", "当前节点不支持发起会签");
|
|
|
+ //var isStartCountersign = currentStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
+ ////检查是否支持会签
|
|
|
+ //if (isStartCountersign && currentStep.CountersignMode == ECountersignMode.UnSupport)
|
|
|
+ // throw new UserFriendlyException($"当前节点不支持发起会签, stepId: {currentStep.Id}", "当前节点不支持发起会签");
|
|
|
|
|
|
var targetStepBox = workflow.StepBoxes.FirstOrDefault(d => d.Code == dto.TargetStepCode);
|
|
|
if (targetStepBox is null)
|
|
|
throw UserFriendlyException.SameMessage("该流程尚未流转至该节点");
|
|
|
+
|
|
|
+ var targetStepDefine = GetStepBoxDefine(workflow.Definition, dto.TargetStepCode);
|
|
|
+ var isStartCountersign = targetStepDefine.CouldPrevStartCountersign(dto.NextHandlers.Count);
|
|
|
|
|
|
await RecallAsync(workflow, dto, targetStepBox, isStartCountersign, cancellationToken);
|
|
|
|
|
@@ -472,10 +475,13 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
if (currentStepBox.StepType is EStepType.End)
|
|
|
throw UserFriendlyException.SameMessage("当前流程已流转到结束节点");
|
|
|
|
|
|
- var isStartCountersign = currentStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
- //检查是否支持会签
|
|
|
- if (isStartCountersign && currentStep.CountersignMode == ECountersignMode.UnSupport)
|
|
|
- throw new UserFriendlyException($"当前节点不支持发起会签, stepId: {currentStep.Id}", "当前节点不支持发起会签");
|
|
|
+ //var isStartCountersign = currentStep.ShouldStartCountersign(dto.NextHandlers.Count);
|
|
|
+ ////检查是否支持会签
|
|
|
+ //if (isStartCountersign && currentStep.CountersignMode == ECountersignMode.UnSupport)
|
|
|
+ // throw new UserFriendlyException($"当前节点不支持发起会签, stepId: {currentStep.Id}", "当前节点不支持发起会签");
|
|
|
+
|
|
|
+ var targetStepDefine = GetStepBoxDefine(workflow.Definition, dto.TargetStepCode);
|
|
|
+ var isStartCountersign = targetStepDefine.CouldPrevStartCountersign(dto.NextHandlers.Count);
|
|
|
|
|
|
var targetStepBox = workflow.StepBoxes.FirstOrDefault(d => d.Code == dto.TargetStepCode);
|
|
|
if (targetStepBox == null)
|