Explorar el Código

重构订单处理控制器和处理器

重构 `OrderController` 类,增加异步处理逻辑,更新当前步骤接受时间。删除 `OrderCarbonCopyController`、`OrderComplementController` 等多个控制器及其相关代码。删除多个处理器类及其相关代码,包括 `AddOrderPushMessageNotifyHandler`、`GetOrderDetailNotifyHandler` 等。新增 `GetHandlerRandomAsync` 方法,更新 `OrderApplication` 类,添加对 `ExtendedNumerics.Exceptions` 的引用。更新 `Startup.cs`,删除不必要的引用和服务注册。
xf hace 1 mes
padre
commit
2930d2a52b
Se han modificado 18 ficheros con 135 adiciones y 78 borrados
  1. 11 6
      src/Hotline.Api/Controllers/OrderController.cs
  2. 3 12
      src/Hotline.Api/Controllers/OrderControllers/OrderCarbonCopyController.cs
  3. 1 1
      src/Hotline.Api/Controllers/OrderControllers/OrderComplementController.cs
  4. 1 1
      src/Hotline.Application/Orders/Handlers/OrderHandler/AddOrderPushMessageNotifyHandler.cs
  5. 2 7
      src/Hotline.Application/Orders/Handlers/OrderHandler/GetOrderDetailNotifyHandler.cs
  6. 1 9
      src/Hotline.Application/Orders/Handlers/OrderHandler/OrderRelateCallHandler.cs
  7. 2 10
      src/Hotline.Application/Orders/Handlers/OrderHandler/OrderVisitSmsHandler.cs
  8. 1 5
      src/Hotline.Application/Orders/Handlers/OrderHandler/TranspondCityNotifyHandler.cs
  9. 1 1
      src/Hotline.Application/Orders/Handlers/OrderHandler/UpdateOrderPushMessageNotifyHandler.cs
  10. 1 1
      src/Hotline.Application/Orders/Handlers/OrderScreenHandler/OrderScreenEndWorkflowHandler.cs
  11. 1 1
      src/Hotline.Application/Orders/Handlers/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs
  12. 1 1
      src/Hotline.Application/Orders/Handlers/OrderScreenHandler/OrderScreenStartWorkflowHandler.cs
  13. 2 16
      src/Hotline.Application/Orders/Handlers/SnapshotHandler/GuiderSystemTimeoutHandler.cs
  14. 5 1
      src/Hotline.Application/Orders/IOrderApplication.cs
  15. 95 0
      src/Hotline.Application/Orders/OrderApplication.cs
  16. 1 0
      src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs
  17. 5 0
      src/Hotline/Settings/SettingConstants.cs
  18. 1 6
      test/Hotline.Tests/Startup.cs

+ 11 - 6
src/Hotline.Api/Controllers/OrderController.cs

@@ -3709,6 +3709,7 @@ public class OrderController : BaseController
                 if (acceptTime != null)
                 {
                     order.ActualHandleStepAcceptTime = acceptTime;
+                    order.CurrentStepAcceptTime = acceptTime;
                     await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
                 }
             }
@@ -4733,11 +4734,14 @@ public class OrderController : BaseController
                         if (unhandleStep.Id != startStep.Id)
                             nextflowDto.Opinion = "跨级派单,自动办理";
 
-                        var operater = new FakeSessionContext
-                        {
-                            OrgId = unhandleStep.HandlerOrgId,
-                            OrgName = unhandleStep.HandlerOrgName,
-                        };
+                        //var operater = new FakeSessionContext
+                        //{
+                        //    OrgId = unhandleStep.HandlerOrgId,
+                        //    OrgName = unhandleStep.HandlerOrgName,
+                        //};
+
+                        var operater = await _orderApplication.GetHandlerRandomAsync(unhandleStep, cancellationToken);
+
                         var (_, _, _, nextSteps) = await _workflowDomainService.NextAsync(operater, nextflowDto, 
                             EHandleMode.CrossLevel, order.ExpiredTime,
                             isAutoFillSummaryOpinion, cancellationToken: cancellationToken);
@@ -4840,7 +4844,8 @@ public class OrderController : BaseController
                     BusinessType = nextStepDefine.BusinessType,
                 };
 
-                await HandleNextInMainAndSecondaryAsync(current, definition, orgs, nextDto, expiredTime, isAutoFillSummaryOpinion, cancellation);
+                var operater = await _orderApplication.GetHandlerRandomAsync(currentStep, cancellation);
+                await HandleNextInMainAndSecondaryAsync(operater, definition, orgs, nextDto, expiredTime, isAutoFillSummaryOpinion, cancellation);
             }
         }
     }

+ 3 - 12
src/Hotline.Api/Controllers/OrderModuleControllers/OrderCarbonCopyController.cs → src/Hotline.Api/Controllers/OrderControllers/OrderCarbonCopyController.cs

@@ -1,23 +1,14 @@
 using Hotline.Application.Orders;
-using Hotline.Caching.Services;
-using Hotline.FlowEngine.WorkflowModules;
-using Hotline.Orders;
+using Hotline.Caching.Interfaces;
 using Hotline.Repository.SqlSugar.Extensions;
-using Hotline.Settings.TimeLimits;
 using Hotline.Settings;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Dtos.Order.CarbonCopy;
-using Hotline.Share.Enums.Order;
-using Hotline.Share.Requests;
+using Mapster;
 using MapsterMapper;
 using Microsoft.AspNetCore.Mvc;
-using XF.Domain.Authentications;
-using XF.Domain.Repository;
-using XF.Utility.EnumExtensions;
-using Hotline.Caching.Interfaces;
-using Mapster;
 
-namespace Hotline.Api.Controllers.OrderModuleControllers
+namespace Hotline.Api.Controllers.OrderControllers
 {
     /// <summary>
     /// 工单抄送

+ 1 - 1
src/Hotline.Api/Controllers/OrderModuleControllers/OrderComplementController.cs → src/Hotline.Api/Controllers/OrderControllers/OrderComplementController.cs

@@ -2,7 +2,7 @@
 using Hotline.Share.Dtos.Order;
 using Microsoft.AspNetCore.Mvc;
 
-namespace Hotline.Api.Controllers.OrderModuleControllers;
+namespace Hotline.Api.Controllers.OrderControllers;
 
 public class OrderComplementController : BaseController
 {

+ 1 - 1
src/Hotline.Application/Orders/Handles/OrderHandler/AddOrderPushMessageNotifyHandler.cs → src/Hotline.Application/Orders/Handlers/OrderHandler/AddOrderPushMessageNotifyHandler.cs

@@ -6,7 +6,7 @@ using Hotline.Share.Enums.Push;
 using MediatR;
 using Microsoft.Extensions.Logging;
 
-namespace Hotline.Application.Orders.Handles.Order
+namespace Hotline.Application.Orders.Handlers.OrderHandler
 {
     /// <summary>
     /// 新增工单发送短信

+ 2 - 7
src/Hotline.Application/Orders/Handles/OrderHandler/GetOrderDetailNotifyHandler.cs → src/Hotline.Application/Orders/Handlers/OrderHandler/GetOrderDetailNotifyHandler.cs

@@ -1,13 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Hotline.FlowEngine.Workflows;
+using Hotline.FlowEngine.Workflows;
 using Hotline.Orders.Notifications;
 using MediatR;
 
-namespace Hotline.Application.Orders.Handles.Order
+namespace Hotline.Application.Orders.Handlers.OrderHandler
 {
     public class GetOrderDetailNotifyHandler : INotificationHandler<GetOrderDetailNotify>
     {

+ 1 - 9
src/Hotline.Application/Orders/Handles/OrderHandler/OrderRelateCallHandler.cs → src/Hotline.Application/Orders/Handlers/OrderHandler/OrderRelateCallHandler.cs

@@ -1,18 +1,10 @@
 using DotNetCore.CAP;
 using Hotline.Application.CallCenter;
-using Hotline.CallCenter.Calls;
-using Hotline.Orders;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Mq;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using XF.Domain.Dependency;
-using XF.Domain.Repository;
 
-namespace Hotline.Application.Orders.Handles.Order
+namespace Hotline.Application.Orders.Handlers.OrderHandler
 {
     public class OrderRelateCallHandler : ICapSubscribe, ITransientDependency
     {

+ 2 - 10
src/Hotline.Application/Orders/Handles/OrderHandler/OrderVisitSmsHandler.cs → src/Hotline.Application/Orders/Handlers/OrderHandler/OrderVisitSmsHandler.cs

@@ -1,23 +1,15 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using DotNetCore.CAP;
-using Hotline.FlowEngine.Workflows;
+using DotNetCore.CAP;
 using Hotline.Orders;
-using Hotline.Orders.Notifications;
 using Hotline.Push.FWMessage;
 using Hotline.Push.Notifies;
 using Hotline.Share.Dtos.Push;
 using Hotline.Share.Enums.Push;
 using Hotline.Share.Mq;
-using Hotline.Share.Tools;
 using MediatR;
 using XF.Domain.Dependency;
 using XF.Domain.Repository;
 
-namespace Hotline.Application.Orders.Handles.Order;
+namespace Hotline.Application.Orders.Handlers.OrderHandler;
 public class OrderVisitSmsHandler : INotificationHandler<ReceiveMessageNotify>
 {
     private readonly IOrderVisitDomainService _orderVisitDomainService;

+ 1 - 5
src/Hotline.Application/Orders/Handles/OrderHandler/TranspondCityNotifyHandler.cs → src/Hotline.Application/Orders/Handlers/OrderHandler/TranspondCityNotifyHandler.cs

@@ -1,5 +1,4 @@
 using DotNetCore.CAP;
-using Hotline.EventBus;
 using Hotline.Orders;
 using Hotline.Orders.Notifications;
 using Hotline.OrderTranspond;
@@ -7,13 +6,10 @@ using Hotline.Share.Dtos.Order;
 using Hotline.Share.Enums.Order;
 using MapsterMapper;
 using MediatR;
-using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
-using System;
-using Hotline.DI;
 using XF.Domain.Repository;
 
-namespace Hotline.Application.Orders.Handles.Order
+namespace Hotline.Application.Orders.Handlers.OrderHandler
 {
     // [Injection(AppScopes = EAppScope.YiBin)]
     public class TranspondCityNotifyHandler : INotificationHandler<OrderStartWorkflowNotify>

+ 1 - 1
src/Hotline.Application/Orders/Handles/OrderHandler/UpdateOrderPushMessageNotifyHandler.cs → src/Hotline.Application/Orders/Handlers/OrderHandler/UpdateOrderPushMessageNotifyHandler.cs

@@ -6,7 +6,7 @@ using Hotline.Share.Enums.Push;
 using MediatR;
 using Microsoft.Extensions.Logging;
 
-namespace Hotline.Application.Orders.Handles.Order
+namespace Hotline.Application.Orders.Handlers.OrderHandler
 {
     public class UpdateOrderPushMessageNotifyHandler : INotificationHandler<UpdateOrderNotify>
     {

+ 1 - 1
src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenEndWorkflowHandler.cs → src/Hotline.Application/Orders/Handlers/OrderScreenHandler/OrderScreenEndWorkflowHandler.cs

@@ -15,7 +15,7 @@ using Microsoft.Extensions.Options;
 using XF.Domain.Authentications;
 using XF.Domain.Repository;
 
-namespace Hotline.Application.Orders.Handles.OrderScreenHandler;
+namespace Hotline.Application.Orders.Handlers.OrderScreenHandler;
 public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
 {
     private readonly IOrderRepository _orderRepository;

+ 1 - 1
src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs → src/Hotline.Application/Orders/Handlers/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs

@@ -13,7 +13,7 @@ using XF.Domain.Authentications;
 using XF.Domain.Extensions;
 using XF.Domain.Repository;
 
-namespace Hotline.Application.Orders.Handles.OrderScreen;
+namespace Hotline.Application.Orders.Handlers.OrderScreenHandler;
 public class OrderScreenNextWorkflowHandler : INotificationHandler<NextStepNotify>
 {
     private readonly ICapPublisher _capPublisher;

+ 1 - 1
src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenStartWorkflowHandler.cs → src/Hotline.Application/Orders/Handlers/OrderScreenHandler/OrderScreenStartWorkflowHandler.cs

@@ -3,7 +3,7 @@ using Hotline.FlowEngine.WorkflowModules;
 using Hotline.Orders;
 using MediatR;
 
-namespace Hotline.Application.Orders.Handles.OrderScreen;
+namespace Hotline.Application.Orders.Handlers.OrderScreenHandler;
 
 public class OrderScreenStartWorkflowHandler : INotificationHandler<StartWorkflowNotify>
 {

+ 2 - 16
src/Hotline.Application/Orders/Handles/SnapshotHandler/GuiderSystemTimeoutHandler.cs → src/Hotline.Application/Orders/Handlers/SnapshotHandler/GuiderSystemTimeoutHandler.cs

@@ -1,24 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Hotline.Application.Orders;
-using Hotline.Authentications;
-using Hotline.Caching.Interfaces;
-using Hotline.EventBus;
-using Hotline.FlowEngine.Notifications;
-using Hotline.FlowEngine.Workflows;
-using Hotline.Orders;
+using Hotline.Caching.Interfaces;
 using Hotline.Settings;
-using Hotline.Share.Dtos.FlowEngine;
-using Hotline.Share.Enums.FlowEngine;
 using Hotline.Share.Tools;
 using Hotline.Snapshot.Notifications;
 using MediatR;
-using XF.Domain.Exceptions;
 
-namespace Hotline.Application.Orders.Handles.Snapshot
+namespace Hotline.Application.Orders.Handlers.SnapshotHandler
 {
     /// <summary>
     /// 需求:坐席派给网格员的安全隐患工单若未推送成功超过4小时或者网格员超过4小时没回复,则自动流转到标注节点待标注列表

+ 5 - 1
src/Hotline.Application/Orders/IOrderApplication.cs

@@ -457,5 +457,9 @@ namespace Hotline.Application.Orders
 
         Task OrderPrevious(OrderSendBackAudit sendBack, Order order, CancellationToken cancellationToken);
 
-	}
+        /// <summary>
+        /// 依据当前待办节点随意获取一个合法办理人
+        /// </summary>
+        Task<ISessionContext> GetHandlerRandomAsync(WorkflowStep step, CancellationToken cancellationToken);
+    }
 }

+ 95 - 0
src/Hotline.Application/Orders/OrderApplication.cs

@@ -45,6 +45,7 @@ using PanGu;
 using SqlSugar;
 using System.Data;
 using System.Dynamic;
+using ExtendedNumerics.Exceptions;
 using FluentValidation;
 using Hotline.FlowEngine.Definitions;
 using Hotline.FlowEngine.Notifications;
@@ -110,6 +111,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
     private readonly IRepository<OrderTsDetails> _orderTsDetailsRepository;
     private readonly IRepository<KnowledgeQuote> _knowledgeQuoteRepository;
     private readonly IRepository<OrderSpecial> _orderSpecialRepository;
+    private readonly IRepository<User> _userRepository;
     private readonly IWorkflowApplication _workflowApplication;
     private readonly ICircularRecordDomainService _circularRecordDomainService;
 
@@ -157,6 +159,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         IRepository<OrderTsDetails> orderTsDetailsRepository,
         IRepository<KnowledgeQuote> knowledgeQuoteRepository,
         IRepository<OrderSpecial> orderSpecialRepository,
+        IRepository<User> userRepository,
         IWorkflowApplication workflowApplication,
         ICircularRecordDomainService circularRecordDomainService)
     {
@@ -203,6 +206,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         _orderTsDetailsRepository = orderTsDetailsRepository;
         _knowledgeQuoteRepository = knowledgeQuoteRepository;
         _orderSpecialRepository = orderSpecialRepository;
+        _userRepository = userRepository;
         _workflowApplication = workflowApplication;
         _circularRecordDomainService = circularRecordDomainService;
     }
@@ -5232,5 +5236,96 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         }
     }
 
+    /// <summary>
+    /// 依据当前待办节点获取任意一个合法办理人
+    /// </summary>
+    public async Task<ISessionContext> GetHandlerRandomAsync(WorkflowStep step, CancellationToken cancellationToken)
+    {
+        User user;
+        switch (step.BusinessType)
+        {
+            case EBusinessType.Seat:
+                var roleSeat = _systemSettingCacheManager.GetSetting(SettingConstants.RoleZuoXi)?.SettingValue.FirstOrDefault();
+                if (string.IsNullOrEmpty(roleSeat))
+                    throw new UserFriendlyException($"未配置坐席角色, {SettingConstants.RoleZuoXi}", "未配置坐席角色");
+                user = await _userRepository.Queryable()
+                    .Includes(d=>d.Organization)
+                    .Where(d => d.Roles.Any(x => x.Name == roleSeat))
+                    .FirstAsync(cancellationToken);
+                if(user is null)
+                    throw UserFriendlyException.SameMessage("坐席角色未设置用户");
+               break;
+            case EBusinessType.Send:
+                var roleSend = _systemSettingCacheManager.GetSetting(SettingConstants.RolePaiDan)?.SettingValue.FirstOrDefault();
+                if (string.IsNullOrEmpty(roleSend))
+                    throw new UserFriendlyException($"未配置派单角色, {SettingConstants.RolePaiDan}", "未配置派单角色");
+                user = await _userRepository.Queryable()
+                    .Includes(d => d.Organization)
+                    .Where(d => d.Roles.Any(x => x.Name == roleSend))
+                    .FirstAsync(cancellationToken);
+                if (user is null)
+                    throw UserFriendlyException.SameMessage("派单角色未设置用户");
+                break;
+            case EBusinessType.CenterMonitor:
+                var roleCenterMonitor = _systemSettingCacheManager.GetSetting(SettingConstants.SeatsMonitor)?.SettingValue.FirstOrDefault();
+                if (string.IsNullOrEmpty(roleCenterMonitor))
+                    throw new UserFriendlyException($"未配置中心班长角色, {SettingConstants.SeatsMonitor}", "未配置中心班长角色");
+                user = await _userRepository.Queryable()
+                    .Includes(d => d.Organization)
+                    .Where(d => d.Roles.Any(x => x.Name == roleCenterMonitor))
+                    .FirstAsync(cancellationToken);
+                if (user is null)
+                    throw UserFriendlyException.SameMessage("中心班长角色未设置用户");
+                break;
+            case EBusinessType.CenterLeader:
+                var roleCenterLeader = _systemSettingCacheManager.GetSetting(SettingConstants.RoleCenterLeader)?.SettingValue.FirstOrDefault();
+                if (string.IsNullOrEmpty(roleCenterLeader))
+                    throw new UserFriendlyException($"未配置中心领导角色, {SettingConstants.RoleCenterLeader}", "未配置中心领导角色");
+                user = await _userRepository.Queryable()
+                    .Includes(d => d.Organization)
+                    .Where(d => d.Roles.Any(x => x.Name == roleCenterLeader))
+                    .FirstAsync(cancellationToken);
+                if (user is null)
+                    throw UserFriendlyException.SameMessage("中心领导角色未设置用户");
+                break;
+            case EBusinessType.Department:
+                var roleJingBanRen = _systemSettingCacheManager.GetSetting(SettingConstants.RoleJingBanRen)?.SettingValue.FirstOrDefault();
+                if (string.IsNullOrEmpty(roleJingBanRen))
+                    throw new UserFriendlyException($"未配置部门经办人角色, {SettingConstants.RoleJingBanRen}", "未配置部门经办人角色");
+                user = await _userRepository.Queryable()
+                    .Includes(d=>d.Organization)
+                    .Where(d => d.OrgId == step.HandlerOrgId && d.Roles.Any(x => x.Name == roleJingBanRen))
+                    .FirstAsync(cancellationToken);
+                if (user is null)
+                    throw new UserFriendlyException($"该部门经办人角色未设置用户,部门:{step.HandlerOrgId}, 角色:{SettingConstants.RoleJingBanRen}");
+                break;
+            case EBusinessType.DepartmentLeader:
+                var roleBuMenLingDao = _systemSettingCacheManager.GetSetting(SettingConstants.RoleLingDao)?.SettingValue.FirstOrDefault();
+                if (string.IsNullOrEmpty(roleBuMenLingDao))
+                    throw new UserFriendlyException($"未配置部门领导角色, {SettingConstants.RoleJingBanRen}", "未配置部门领导角色");
+                user = await _userRepository.Queryable()
+                    .Includes(d => d.Organization)
+                    .Where(d => d.OrgId == step.HandlerOrgId && d.Roles.Any(x => x.Name == roleBuMenLingDao))
+                    .FirstAsync(cancellationToken);
+                if (user is null)
+                    throw new UserFriendlyException($"该部门领导角色未设置用户,部门:{step.HandlerOrgId}, 角色:{SettingConstants.RoleJingBanRen}");
+                break;
+            default:
+                throw new OutOfRangeException(nameof(GetHandlerRandomAsync));
+        }
+
+        return new FakeSessionContext
+        {
+            UserId = user.Id,
+            UserName = user.Name,
+            OrgId = user.OrgId,
+            OrgName = user.Organization.Name,
+            OrgAreaCode = user.Organization.AreaCode,
+            OrgAreaName = user.Organization.AreaName,
+            OrgIsCenter = user.Organization.IsCenter,
+            OrgLevel = user.Organization.Level,
+        };
+    }
+
     #endregion
 }

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

@@ -729,6 +729,7 @@ namespace Hotline.FlowEngine.Workflows
                 .ExecuteCommandAsync();
 
             workflow.ActualHandleStepAcceptTime = currentStep.AcceptTime;
+            workflow.CurrentStepAcceptTime = currentStep.AcceptTime;
             await _workflowRepository.Updateable(workflow).ExecuteCommandAsync(cancellationToken);
 
             return workflow.ActualHandleStepAcceptTime;

+ 5 - 0
src/Hotline/Settings/SettingConstants.cs

@@ -190,6 +190,11 @@ namespace Hotline.Settings
         /// </summary>
         public const string RoleLingDao = "RoleLingDao";
 
+        /// <summary>
+        /// 中心领导
+        /// </summary>
+        public const string RoleCenterLeader = "RoleCenterLeader";
+
         /// <summary>
         /// 是否开启登录短信
         /// </summary>

+ 1 - 6
test/Hotline.Tests/Startup.cs

@@ -11,7 +11,6 @@ using Hotline.Application.Jobs;
 using Hotline.Application.StatisticalReport.CallReport;
 using Hotline.Authentications;
 using Hotline.CallCenter.Configs;
-using Hotline.CallCenter.Tels;
 using Hotline.Configurations;
 using Hotline.DI;
 using Hotline.EventBus;
@@ -19,7 +18,6 @@ using Hotline.File;
 using Hotline.FlowEngine.Workflows;
 using Hotline.Orders;
 using Hotline.Orders.DatabaseEventHandler;
-using Hotline.Pdf;
 using Hotline.Repository.SqlSugar;
 using Hotline.Repository.SqlSugar.DataPermissions;
 using Hotline.Repository.SqlSugar.Extensions;
@@ -35,7 +33,6 @@ using Mapster;
 using MediatR;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Identity;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
@@ -172,7 +169,7 @@ public class Startup
             services.AddScoped<RedPackController>();
             services.AddScoped<PushMessageController>();
             services.AddHttpContextAccessor();
-            services.AddScoped<ISessionContext, Controller.TestSessionContext>();
+            services.AddScoped<ISessionContext, Controller.DefaultSessionContext>();
             services.AddScoped<ISessionContextProvider, SessionContextProvider>();
             services.AddScoped<ICallApplication, XingTangCallApplication>();
             services.AddScoped<XingTangCallApplication>();
@@ -183,8 +180,6 @@ public class Startup
             services.AddXingTangDb(callCenterConfiguration.XingTang);
             services.AddScoped<IGuiderSystemService, TiqnQueService>();
             services.AddScoped<IWorkflowDomainService, WorkflowDomainService>();
-            services.AddScoped<IPdfManager, QuestPdfManager>();
-            services.AddScoped<ICallTelClient, XingTang.CallTelClient>();
 
             //ServiceLocator.Instance = services.BuildServiceProvider();
         }