Jelajahi Sumber

fix: 派单不选办理对象时,更新当前节点异常

xf 9 bulan lalu
induk
melakukan
806c745cc5

+ 1 - 1
src/Hotline.Api/Controllers/OrderController.cs

@@ -2571,7 +2571,7 @@ public class OrderController : BaseController
             order.CurrentStepAcceptTime = DateTime.Now;
             await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
 
-            result.Workflow.CurrentStepAcceptTime = order.CurrentStepAcceptTime;
+            result.Workflow.UpdateCurrentStepAcceptTime(order.CurrentStepAcceptTime.Value);
             await _mediator.Publish(new GetOrderDetailNotify(result.Workflow,
                 _sessionContext.RequiredUserId, _sessionContext.UserName,
                 _sessionContext.RequiredOrgId, _sessionContext.OrgName,

+ 14 - 4
src/Hotline/FlowEngine/Workflows/Workflow.cs

@@ -510,10 +510,10 @@ public partial class Workflow
         string? handleOrgAreaName,
         int handlerOrgLevel)
     {
-        // ActualHandleStepCode = step.Code;
-        // ActualHandleStepName = step.Name;
-        // ActualHandleStepId = step.Id;
-        // ActualHandleStepCreateTime = step.CreationTime;
+        ActualHandleStepCode = step.Code;
+        ActualHandleStepName = step.Name;
+        ActualHandleStepId = step.Id;
+        ActualHandleStepCreateTime = step.CreationTime;
         ActualHandleStepAcceptTime = step.AcceptTime;
         ActualHandleTime = step.HandleTime;
         ActualHandlerId = handlerId;
@@ -566,6 +566,16 @@ public partial class Workflow
         CurrentHandleOrgLevel ??= handlerOrgLevel;
         CurrentHandleOrgAreaCode = handleOrgAreaCode;
         CurrentHandleOrgAreaName = handleOrgAreaName;
+
+        //坐席->派单存在不选办理对象的场景,所以要补赋值
+        CurrentStepId = step.Id;
+        CurrentStepCode = step.Code;
+        CurrentStepName = step.Name;
+        CurrentStepCreateTime = step.CreationTime;
+        CurrentHandlerId = step.HandlerId;
+        CurrentHandlerName = step.HandlerName;
+        CurrentHandleOrgId = step.HandlerOrgId;
+        CurrentHandleOrgName = step.HandlerOrgName;
     }
 
     private void ResetActualStep()

+ 15 - 7
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -153,7 +153,7 @@ namespace Hotline.FlowEngine.Workflows
             UpdateActualStep(workflow, dto, firstStepDefine, firstSteps);
 
             //更新实际办理节点
-            UpdateCurrentStep(workflow, dto, firstSteps);
+            UpdateCurrentStep(workflow, dto, firstStepDefine, firstSteps);
 
             //发起会签时记录顶层会签节点(必须在update currentStep之后)
             if (dto.IsStartCountersign && !workflow.IsInCountersign)
@@ -1483,17 +1483,25 @@ namespace Hotline.FlowEngine.Workflows
 
         #region private method
 
-        private static void UpdateCurrentStep(Workflow workflow, BasicWorkflowDto dto, List<WorkflowStep> nextSteps)
+        private static void UpdateCurrentStep(Workflow workflow, BasicWorkflowDto dto,
+            StepDefine nextStepDefine, List<WorkflowStep> nextSteps)
         {
             if (dto.IsStartCountersign) return;
             if (workflow.IsInCountersign) return;
 
-            var nextHandler = dto.NextHandlers.First();
-            workflow.UpdateCurrentStepWhenAssign(nextSteps.First(), nextHandler);
+            if (nextStepDefine.BusinessType is EBusinessType.Center or EBusinessType.Send)
+            {
+
+            }
+            else
+            {
+                var nextHandler = dto.NextHandlers.First();
+                workflow.UpdateCurrentStepWhenAssign(nextSteps.First(), nextHandler);
+            }
         }
 
-        private static void UpdateActualStep(Workflow workflow, BasicWorkflowDto dto, StepDefine nextStepDefine,
-            List<WorkflowStep> nextSteps)
+        private static void UpdateActualStep(Workflow workflow, BasicWorkflowDto dto,
+            StepDefine nextStepDefine, List<WorkflowStep> nextSteps)
         {
             if (dto.IsStartCountersign) return;
             if (workflow.IsInCountersign) return;
@@ -1503,7 +1511,7 @@ namespace Hotline.FlowEngine.Workflows
             {
                 workflow.UpdateActualStepWhenAssign(nextSteps.First(),
                     actualHandleOrgCode: OrgSeedData.CenterId,
-                    actualHandleOrgName: "市民热线服务中心");
+                    actualHandleOrgName: OrgSeedData.CenterName);
             }
             else
             {