Selaa lähdekoodia

fixed: 补充判断流转方向方法

xf 6 kuukautta sitten
vanhempi
commit
02a840251c

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

@@ -750,10 +750,11 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
             stepOption.InputRealHandler = false;
 
             //已归档工单,撤回至中心看作otc,撤回至部门看作cto
+            //todo 依据归档节点的busiType判断
             stepOption.FlowDirection = isWorkflowFiled
                 ? stepDefine.BusinessType is EBusinessType.Seat or EBusinessType.Send
                     ? EFlowDirection.FiledToCenter
-                    : stepDefine.BusinessType is EBusinessType.Department
+                    : stepDefine.BusinessType is EBusinessType.Department or EBusinessType.DepartmentLeader
                         ? EFlowDirection.FiledToOrg
                         : null
                 //: CheckFlowDirection(currentStep.BusinessType, stepDefine.BusinessType);

+ 13 - 9
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -1091,7 +1091,7 @@ namespace Hotline.FlowEngine.Workflows
         /// <summary>
         /// 撤回至开始节点
         /// </summary>
-        public async Task RecallToStartStepAsync(string workflowId, string opinion, bool isOrderFiled,DateTime? expiredTime,
+        public async Task RecallToStartStepAsync(string workflowId, string opinion, bool isOrderFiled, DateTime? expiredTime,
             CancellationToken cancellationToken)
         {
             //todo 1.当前待办节点删掉 2.当前待办trace更新(status, opinion) 3.复制startStep为待办 4.更新workflow(status, csStatus, handlers) 5.publish event
@@ -1130,13 +1130,14 @@ namespace Hotline.FlowEngine.Workflows
             var flowAssignInfo = await GetNextStepFlowAssignInfoByDefineAsync(targetStepDefine, dto.HandlerType, dto.IsStartCountersign,
                 dto.NextHandlers.Select(d => new Kv(d.Key, d.Value)).ToList(), cancellationToken);
             //flowAssignInfo.FlowAssignType = EFlowAssignType.Role;
-            await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled, cancellationToken);
+            await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled,
+                cancellationToken);
         }
 
         /// <summary>
         /// 撤回至派单节点
         /// </summary>
-        public async Task RecallToSendStepAsync(string workflowId, string opinion, bool isOrderFiled,DateTime? expiredTime,
+        public async Task RecallToSendStepAsync(string workflowId, string opinion, bool isOrderFiled, DateTime? expiredTime,
             CancellationToken cancellationToken)
         {
             var workflow = await GetWorkflowAsync(workflowId, withDefine: true, withSteps: true, withTraces: true, withCountersigns: true,
@@ -1174,7 +1175,8 @@ namespace Hotline.FlowEngine.Workflows
             var flowAssignInfo = await GetNextStepFlowAssignInfoByDefineAsync(targetStepDefine, dto.HandlerType, dto.IsStartCountersign,
                 dto.NextHandlers.Select(d => new Kv(d.Key, d.Value)).ToList(), cancellationToken);
             //flowAssignInfo.FlowAssignType = EFlowAssignType.Role;
-            await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled, cancellationToken);
+            await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled,
+                cancellationToken);
         }
 
         /// <summary>
@@ -1182,7 +1184,7 @@ namespace Hotline.FlowEngine.Workflows
         /// </summary>
         /// <returns></returns>
         public async Task RecallToCenterFirstToSendAsync(string workflowId, string opinion, bool isOrderFiled,
-            DateTime? expiredTime,  CancellationToken cancellationToken)
+            DateTime? expiredTime, CancellationToken cancellationToken)
         {
             var workflow = await GetWorkflowAsync(workflowId, withDefine: true, withSteps: true, withTraces: true, withCountersigns: true,
                 cancellationToken: cancellationToken);
@@ -1215,7 +1217,8 @@ namespace Hotline.FlowEngine.Workflows
                 };
                 var flowAssignInfo = await GetNextStepFlowAssignInfoByDefineAsync(targetStepDefine, dto.HandlerType, dto.IsStartCountersign,
                     dto.NextHandlers.Select(d => new Kv(d.Key, d.Value)).ToList(), cancellationToken);
-                await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled, cancellationToken);
+                await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled,
+                    cancellationToken);
             }
             else
             {
@@ -1252,7 +1255,8 @@ namespace Hotline.FlowEngine.Workflows
                 var flowAssignInfo = await GetNextStepFlowAssignInfoByDefineAsync(targetStepDefine, dto.HandlerType, dto.IsStartCountersign,
                     dto.NextHandlers.Select(d => new Kv(d.Key, d.Value)).ToList(), cancellationToken);
                 //flowAssignInfo.FlowAssignType = EFlowAssignType.Role;
-                await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled, cancellationToken);
+                await RecallAsync(workflow, dto, targetStepDefine, flowAssignInfo, EWorkflowTraceType.Recall, expiredTime, isOrderFiled,
+                    cancellationToken);
             }
         }
 
@@ -2359,7 +2363,7 @@ namespace Hotline.FlowEngine.Workflows
                 OrgId = targetStep.HandlerOrgId,
                 OrgName = targetStep.HandlerOrgName
             });
-            
+
             //取消维护workflow得冗余字段(FlowedOrgIds, HandlerOrgs)
             //workflow.Assign(flowAssignInfo.FlowAssignType, flowAssignInfo.GetHandlerIds());
             //workflow.ResetHandlers(flowAssignInfo.FlowAssignType, flowAssignInfo.HandlerObjects);
@@ -2425,7 +2429,7 @@ namespace Hotline.FlowEngine.Workflows
 
             var step = CreateStep(workflow, endStepDefine, prevStep, EFlowAssignType.User, handler,
                 null, null, EWorkflowStepStatus.WaitForAccept,
-                ECountersignPosition.None, expiredTime, endStepDefine.Name, true);
+                ECountersignPosition.None, expiredTime, endStepDefine.Name, true, businessType: EBusinessType.File);
 
             //step.Accept(_sessionContext.RequiredUserId, _sessionContext.UserName,
             //    _sessionContext.RequiredOrgId, _sessionContext.OrgName,