xf 1 рік тому
батько
коміт
8fa200453b

+ 3 - 8
src/Hotline.Api/Controllers/TestController.cs

@@ -1,13 +1,8 @@
-using System.Security.Cryptography;
-using System.Text;
-using Dapr;
+using Dapr;
 using Hotline.Application.TimeLimits;
 using Hotline.CallCenter.BlackLists;
 using Hotline.CallCenter.Devices;
 using Hotline.CallCenter.Ivrs;
-using Hotline.FlowEngine.Definitions;
-using Hotline.FlowEngine.Workflows;
-using Hotline.Identity.Accounts;
 using Hotline.Identity.Roles;
 using Hotline.Realtimes;
 using Hotline.Repository.SqlSugar;
@@ -28,7 +23,6 @@ using Wex.Sdk.Tel;
 using XC.RSAUtil;
 using XF.Domain.Authentications;
 using XF.Domain.Cache;
-using XF.Domain.Entities;
 using XF.Domain.Exceptions;
 using XF.Domain.Locks;
 
@@ -104,9 +98,10 @@ public class TestController : BaseController
     [HttpGet("time")]
     public async Task<string> GetTime()
     {
-        var rsp = await _wexClient.QueryTelsAsync(new QueryTelRequest { StaffNo = "123" }, HttpContext.RequestAborted);
+        //var rsp = await _wexClient.QueryTelsAsync(new QueryTelRequest { StaffNo = "123" }, HttpContext.RequestAborted);
 
         return DateTime.Now.ToString("F");
+
     }
 
     [HttpGet("pgsql")]

+ 6 - 3
src/Hotline.Application/FlowEngine/WorkflowApplication.cs

@@ -112,7 +112,10 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
         var workflow = await _workflowDomainService.CreateWorkflowAsync(wfModule, dto.Title,
             _sessionContext.RequiredUserId, _sessionContext.RequiredOrgCode, externalId, cancellationToken);
 
-        await _workflowDomainService.StartAsync(workflow, cancellationToken);
+        var nextStepBoxDefine = _workflowDomainService.GetStepBoxDefine(definition, dto.NextStepCode);
+        var flowAssignMode = await GetFlowAssignModeAsync(nextStepBoxDefine, false, dto.NextHandlers, cancellationToken);
+
+        await _workflowDomainService.StartAsync(workflow, flowAssignMode, cancellationToken);
 
         await NextAsync(workflow, dto, workflow.ExpiredTime, false, cancellationToken);
     }
@@ -287,8 +290,8 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
 
         await _workflowDomainService.NextAsync(workflow, dto, nextStepBoxDefine, isStartCountersign, flowAssignMode, expiredTime, cancellationToken);
 
-        //更新接办部门(详情页面展示)
-        await AddOrUpdateAssignAsync(workflow, dto, nextStepBoxDefine, cancellationToken);
+        ////更新接办部门(详情页面展示)
+        //await AddOrUpdateAssignAsync(workflow, dto, nextStepBoxDefine, cancellationToken);
     }
 
     /// <summary>

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

@@ -16,7 +16,7 @@ namespace Hotline.FlowEngine.Workflows
         Task StartAsync(Workflow workflow, BasicWorkflowDto dto, StepDefine nextStepBoxDefine,
             bool isStartCountersign, FlowAssignMode flowAssignMode, CancellationToken cancellationToken);
 
-        Task StartAsync(Workflow workflow, CancellationToken cancellationToken);
+        Task StartAsync(Workflow workflow, FlowAssignMode flowAssignMode, CancellationToken cancellationToken);
 
         /// <summary>
         /// 查询工作流

+ 4 - 1
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -139,10 +139,13 @@ namespace Hotline.FlowEngine.Workflows
             //await _mediator.Publish(new StartWorkflowNotify(workflow, dto, isStartCountersign, flowAssignMode), cancellationToken);
         }
 
-        public async Task StartAsync(Workflow workflow, CancellationToken cancellationToken)
+        public async Task StartAsync(Workflow workflow, FlowAssignMode flowAssignMode, CancellationToken cancellationToken)
         {
             //开始节点
             await CreateStartStepAsync(workflow, cancellationToken);
+
+            workflow.UpdateHandlers(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgCode,
+            flowAssignMode.FlowAssignType, flowAssignMode.HandlerObjects);
         }
 
         public async Task<Workflow> GetWorkflowAsync(string workflowId,