Kaynağa Gözat

feature: 中心会签以及部门会签的判断改为以发起人所在部门判断

xf 10 ay önce
ebeveyn
işleme
8ca1f75bd6

+ 1 - 1
src/Hotline.Application/FlowEngine/WorkflowApplication.cs

@@ -166,7 +166,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
 
         //var firstStepHandlers = await GetNextStepHandlersAsync(workflow, firstStepDefine, dto, cancellationToken);
 
-        var counterSignType = _workflowDomainService.GetCounterSignType(startStep.BusinessType);
+        var counterSignType = _workflowDomainService.GetCounterSignType(dto.IsStartCountersign);
 
         //办理开始节点
         await _workflowDomainService.HandleStepAsync(current, startStep, workflow, dto, flowAssignInfo.FlowAssignType,

+ 2 - 1
src/Hotline/FlowEngine/Workflows/IWorkflowDomainService.cs

@@ -204,7 +204,8 @@ namespace Hotline.FlowEngine.Workflows
         /// <summary>
         /// 获取会签类型
         /// </summary>
-        ECounterSignType? GetCounterSignType(EBusinessType businessType);
+        //ECounterSignType? GetCounterSignType(EBusinessType businessType);
+        ECounterSignType? GetCounterSignType(bool isStartCountersign);
 
         /// <summary>
         /// 查询退回节点信息

+ 22 - 16
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -333,7 +333,7 @@ namespace Hotline.FlowEngine.Workflows
                 _ => throw new ArgumentOutOfRangeException()
             };
 
-            var counterSignType = GetCounterSignType(currentStep.BusinessType);
+            var counterSignType = GetCounterSignType(dto.IsStartCountersign);
 
             var updateSteps = new List<WorkflowStep> { currentStep };
 
@@ -1376,21 +1376,27 @@ namespace Hotline.FlowEngine.Workflows
             return endTrace;
         }
 
-        /// <summary>
-        /// 判断会签类型(中心会签或部门会签)
-        /// </summary>
-        /// <param name="businessType"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentOutOfRangeException"></exception>
-        public ECounterSignType? GetCounterSignType(EBusinessType businessType) =>
-            businessType switch
-            {
-                EBusinessType.Center => ECounterSignType.Center,
-                EBusinessType.Send => ECounterSignType.Center,
-                EBusinessType.Department => ECounterSignType.Department,
-                EBusinessType.File => null,
-                _ => throw new ArgumentOutOfRangeException(nameof(businessType), businessType, null)
-            };
+        ///// <summary>
+        ///// 判断会签类型(中心会签或部门会签)
+        ///// </summary>
+        ///// <param name="businessType"></param>
+        ///// <returns></returns>
+        ///// <exception cref="ArgumentOutOfRangeException"></exception>
+        //public ECounterSignType? GetCounterSignType(EBusinessType businessType) =>
+        //    businessType switch
+        //    {
+        //        EBusinessType.Center => ECounterSignType.Center,
+        //        EBusinessType.Send => ECounterSignType.Center,
+        //        EBusinessType.Department => ECounterSignType.Department,
+        //        EBusinessType.File => null,
+        //        _ => throw new ArgumentOutOfRangeException(nameof(businessType), businessType, null)
+        //    };
+
+        public ECounterSignType? GetCounterSignType(bool isStartCountersign)
+        {
+            if (!isStartCountersign) return null;
+            return _sessionContext.OrgIsCenter ? ECounterSignType.Center : ECounterSignType.Department;
+        }
 
         /// <summary>
         /// 办理节点