xf 1 年之前
父节点
当前提交
58acb772bd
共有 1 个文件被更改,包括 18 次插入7 次删除
  1. 18 7
      src/Hotline.Application/FlowEngine/WorkflowApplication.cs

+ 18 - 7
src/Hotline.Application/FlowEngine/WorkflowApplication.cs

@@ -1132,17 +1132,28 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
 
         if (currentStep.IsInCountersign())
         {
-            if (dto.BackToCountersignEnd)
+            if (currentStep.IsCountersignEndStep)
             {
-                var prevStep = workflow.Steps.FirstOrDefault(d => d.Id == currentStep.PrevStepId);
-                if (prevStep is null)
-                    throw new UserFriendlyException($"未查询到当前节点的上级节点");
-                return FlowAssignInfo.Create(prevStep.FlowAssignType.Value, prevStep.Handlers, isStartCountersign);
+                //汇总节点(非顶级)
+                var csStartStep = workflow.Steps.FirstOrDefault(d => d.Id == currentStep.CountersignStartStepId);
+                if (csStartStep is null)
+                    throw new UserFriendlyException("未查询到会签开始节点");
+                return FlowAssignInfo.Create(csStartStep.FlowAssignType.Value, csStartStep.Handlers, isStartCountersign);
             }
             else
             {
-                //按会签策略判断,目前所有策略为org
-                return FlowAssignInfo.Create(EFlowAssignType.Org, handlers, isStartCountersign);
+                if (dto.BackToCountersignEnd)
+                {
+                    var prevStep = workflow.Steps.FirstOrDefault(d => d.Id == currentStep.PrevStepId);
+                    if (prevStep is null)
+                        throw new UserFriendlyException($"未查询到当前节点的上级节点");
+                    return FlowAssignInfo.Create(prevStep.FlowAssignType.Value, prevStep.Handlers, isStartCountersign);
+                }
+                else
+                {
+                    //按会签策略判断,目前所有策略为org
+                    return FlowAssignInfo.Create(EFlowAssignType.Org, handlers, isStartCountersign);
+                }
             }
         }