Forráskód Böngészése

Merge branch 'dev' into feature_sendovertimesms

Dun.Jason 8 hónapja
szülő
commit
9d8ae955b3
86 módosított fájl, 788 hozzáadás és 539 törlés
  1. 4 4
      src/Hotline.Ai.Jths/AiJthsStartupExtensions.cs
  2. 55 55
      src/Hotline.Ai.Jths/AiVisitConfig.cs
  3. 71 1
      src/Hotline.Api/Controllers/Bi/BiOrderController.cs
  4. 1 0
      src/Hotline.Api/Controllers/CommonPController.cs
  5. 17 2
      src/Hotline.Api/Controllers/IdentityController.cs
  6. 4 0
      src/Hotline.Api/Controllers/OrderController.cs
  7. 1 0
      src/Hotline.Api/Controllers/PbxController.cs
  8. 1 0
      src/Hotline.Api/Controllers/QualityController.cs
  9. 0 3
      src/Hotline.Api/Program.cs
  10. 19 19
      src/Hotline.Api/StartupExtensions.cs
  11. 16 11
      src/Hotline.Api/StartupHelper.cs
  12. 42 24
      src/Hotline.Api/config/appsettings.Development.json
  13. 2 1
      src/Hotline.Application/ContingencyManagement/ContingencyManagementNotifyHandler.cs
  14. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/AlertExtToExtNotificationHandler.cs
  15. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/AlertExtToOuterNotificationHandler.cs
  16. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/AlertMenuToOuterNotificationHandler.cs
  17. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/AlertVisitorToExtNotificationHandler.cs
  18. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/DtmfNotificationHandler.cs
  19. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/FailedNotificationHandler.cs
  20. 2 8
      src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToExtNotificationHandler.cs
  21. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToOuterNotificationHandler.cs
  22. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/RingMenuToExtNotificationHandler.cs
  23. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/RingVisitorToExtNotificationHandler.cs
  24. 2 2
      src/Hotline.Application/Handlers/CallCenter/ExtState/BusyNotificationHandler.cs
  25. 3 5
      src/Hotline.Application/Handlers/CallCenter/ExtState/IdleNotificationHandler.cs
  26. 2 2
      src/Hotline.Application/Handlers/CallCenter/ExtState/OfflineNotificationHandler.cs
  27. 2 2
      src/Hotline.Application/Handlers/CallCenter/ExtState/OnlineNotificationHandler.cs
  28. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToExtNoificationHandler.cs
  29. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToOuterNotificationHandler.cs
  30. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerViisitorToExtNotificationHandler.cs
  31. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToExtNotificationHandler.cs
  32. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterNotificationHandler.cs
  33. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterToExtNotificationHandler.cs
  34. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredVisitorToExtNotificationHandler.cs
  35. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndExtNotificationHandler.cs
  36. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterOneNotificationHandler.cs
  37. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterTwoNotificationHandler.cs
  38. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeOuterAndOuterNotificationHandler.cs
  39. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndExtNotificationHandler.cs
  40. 2 7
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndMenuNotificationHandler.cs
  41. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndOuterNotificationHandler.cs
  42. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorOffNotificationHandler.cs
  43. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/CdrNotificationHandler.cs
  44. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/DivertVisitorToExtNotificationHandler.cs
  45. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnOuterToMenuNotificationHandler.cs
  46. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnVisitorToMenuNotificationHandler.cs
  47. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/IncomingNotificationHandler.cs
  48. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/InviteNotificationHandler.cs
  49. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/QueueVisitorToGroupBusyNotificationHandler.cs
  50. 3 3
      src/Hotline.Application/Handlers/CallCenter/System/BootupNotificationHandler.cs
  51. 2 2
      src/Hotline.Application/Handlers/CallCenter/Transient/TransientOuterNotificationHandler.cs
  52. 2 2
      src/Hotline.Application/Handlers/CallCenter/Transient/TransinetVisitorNotificationHandler.cs
  53. 13 13
      src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs
  54. 1 0
      src/Hotline.Application/Handlers/FlowEngine/WorkflowStartHandler.cs
  55. 19 18
      src/Hotline.Application/Handlers/Order/TranspondCityNotifyHandler.cs
  56. 2 1
      src/Hotline.Application/JudicialManagement/AddPassTheBuckOrderNotifyHandler.cs
  57. 2 1
      src/Hotline.Application/JudicialManagement/JudicialManagementOrderNotifyHandler.cs
  58. 2 1
      src/Hotline.Application/Mappers/CallMapperConfigs.cs
  59. 23 1
      src/Hotline.Application/Orders/IOrderApplication.cs
  60. 156 12
      src/Hotline.Application/Orders/OrderApplication.cs
  61. 3 0
      src/Hotline.Application/Quality/AiOrderQualityHandler.cs
  62. 1 6
      src/Hotline.Application/Quality/QualityApplication.cs
  63. 63 63
      src/Hotline.Application/Visit/AiOrderVisitService.cs
  64. 0 12
      src/Hotline.Application/Visit/IOrderVisitApplication.cs
  65. 0 30
      src/Hotline.Application/Visit/OrderVisitApplication.cs
  66. 10 0
      src/Hotline.Share/Dtos/Identity/LoginDto.cs
  67. 26 0
      src/Hotline.Share/Requests/PagedKeywordRequest.cs
  68. 15 15
      src/Hotline.YbEnterprise.Sdk/EnterpriseConfig.cs
  69. 7 10
      src/Hotline.YbEnterprise.Sdk/EnterpriseService.cs
  70. 1 0
      src/Hotline.YbEnterprise.Sdk/HotlineYbEnterpriseStartupExtensions.cs
  71. 1 0
      src/Hotline/CallCenter/Calls/CallDomainService.cs
  72. 1 0
      src/Hotline/CallCenter/Ivrs/IvrDomainService.cs
  73. 1 0
      src/Hotline/CallCenter/Manage/VoiceFileDomainService.cs
  74. 1 0
      src/Hotline/CallCenter/Tels/TelDomainService.cs
  75. 13 0
      src/Hotline/Configurations/AiQualityConfiguration.cs
  76. 4 3
      src/Hotline/Configurations/AppConfiguration.cs
  77. 12 0
      src/Hotline/Configurations/EnterpriseConfiguration.cs
  78. 1 1
      src/Hotline/DI/EAppScope.cs
  79. 55 0
      src/Hotline/DI/InjectionAttribute.cs
  80. 0 37
      src/Hotline/EventBus/HandlerInjectAttribute.cs
  81. 1 1
      src/Hotline/FlowEngine/Workflows/IWorkflowDomainService.cs
  82. 19 13
      src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs
  83. 2 76
      src/Hotline/Push/FWMessage/PushDomainService.cs
  84. 1 0
      src/Hotline/Users/UserDomainService.cs
  85. 11 8
      src/XF.Domain/Dependency/DependencyInjectionExtensions.cs
  86. 8 4
      src/XingTang.Sdk/XingtangSeatOperation.cs

+ 4 - 4
src/Hotline.Ai.Jths/AiJthsStartupExtensions.cs

@@ -24,8 +24,8 @@ namespace Hotline.Ai.Jths
 			return services;
 		}
 	}
-	public class AiQualityConfig
-	{
-		public string Url { get; set; }
-	}
+	//public class AiQualityConfig
+	//{
+	//	public string Url { get; set; }
+	//}
 }

+ 55 - 55
src/Hotline.Ai.Jths/AiVisitConfig.cs

@@ -1,70 +1,70 @@
 
-namespace Hotline.Ai.Jths
-{
-    public class AiVisitConfig
-    {
-        public string Url { get; set; }
-        public string Appkey { get; set; }
-        public string ServiceVersion { get; set; }
-        //public string SceneUid { get; set; }
-        //public string RuleUid { get;set; }
+//namespace Hotline.Ai.Jths
+//{
+//    public class AiVisitConfig
+//    {
+//        public string Url { get; set; }
+//        public string Appkey { get; set; }
+//        public string ServiceVersion { get; set; }
+//        //public string SceneUid { get; set; }
+//        //public string RuleUid { get;set; }
 
-        ///// <summary>
-        ///// 来电名称
-        ///// </summary>
-        //public string VisitFromNameKey { get; set; }
+//        ///// <summary>
+//        ///// 来电名称
+//        ///// </summary>
+//        //public string VisitFromNameKey { get; set; }
 
 
-        ///// <summary>
-        ///// 来电性别
-        ///// </summary>
-        //public string VisitFromGenderKey { get; set; }
+//        ///// <summary>
+//        ///// 来电性别
+//        ///// </summary>
+//        //public string VisitFromGenderKey { get; set; }
 
-        ///// <summary>
-        ///// 来电时间
-        ///// </summary>
-        //public string VisitCreationTimeKey { get; set; }
+//        ///// <summary>
+//        ///// 来电时间
+//        ///// </summary>
+//        //public string VisitCreationTimeKey { get; set; }
 
-        ///// <summary>
-        ///// 工单标题
-        ///// </summary>
-        //public string VisitOrderTitleKey { get; set; }
+//        ///// <summary>
+//        ///// 工单标题
+//        ///// </summary>
+//        //public string VisitOrderTitleKey { get; set; }
 
-        ///// <summary>
-        ///// 是否来电工单
-        ///// </summary>
-        //public string VisitIsCallOrder { get; set; }
+//        ///// <summary>
+//        ///// 是否来电工单
+//        ///// </summary>
+//        //public string VisitIsCallOrder { get; set; }
 
-        ///// <summary>
-        ///// 是否联系
-        ///// </summary>
-        //public string QuestionIdZone { get; set; }
+//        ///// <summary>
+//        ///// 是否联系
+//        ///// </summary>
+//        //public string QuestionIdZone { get; set; }
 
 
-        ///// <summary>
-        ///// 是否解决
-        ///// </summary>
-        //public string QuestionIdOne { get; set; }
+//        ///// <summary>
+//        ///// 是否解决
+//        ///// </summary>
+//        //public string QuestionIdOne { get; set; }
 
-        ///// <summary>
-        ///// 办件结果满意度
-        ///// </summary>
-        //public string QuestionIdTwo { get; set;}
+//        ///// <summary>
+//        ///// 办件结果满意度
+//        ///// </summary>
+//        //public string QuestionIdTwo { get; set;}
 
-        ///// <summary>
-        ///// 坐席是否满意
-        ///// </summary>
-        //public string QuestionIdThree { get; set; }
+//        ///// <summary>
+//        ///// 坐席是否满意
+//        ///// </summary>
+//        //public string QuestionIdThree { get; set; }
 
-        ///// <summary>
-        ///// 办件结果不满意原因
-        ///// </summary>
-        //public string VisitContentIdOne { get; set; }
+//        ///// <summary>
+//        ///// 办件结果不满意原因
+//        ///// </summary>
+//        //public string VisitContentIdOne { get; set; }
 
-        ///// <summary>
-        ///// 坐席不满意原因
-        ///// </summary>
-        //public string VisitContentIdTwo { get; set;}
+//        ///// <summary>
+//        ///// 坐席不满意原因
+//        ///// </summary>
+//        //public string VisitContentIdTwo { get; set;}
 
-    }
-}
+//    }
+//}

+ 71 - 1
src/Hotline.Api/Controllers/Bi/BiOrderController.cs

@@ -3398,5 +3398,75 @@ namespace Hotline.Api.Controllers.Bi
 
             return ExcelStreamResult(stream, "热点满意度明细数据");
         }
-    }
+
+        /// <summary>
+        /// 热点受理类型统计
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpGet("hotspot-accepttype-statistics")]
+        public async Task<object> HotspotAndAcceptTypeStatistics([FromQuery] HotspotAndAcceptTypeStatisticsReq dto)
+        {
+
+	        var (areaList, returnList) = await _orderApplication.HotspotAndAcceptTypeStatistics(dto);
+
+	        return new { AreaList = areaList, Data = returnList };
+        }
+
+		/// <summary>
+		/// 热点受理类型统计导出
+		/// </summary>
+		/// <param name="dto"></param>
+		/// <returns></returns>
+		[HttpPost("hotspot-accepttype-statistics-export")]
+        public async Task<FileStreamResult> HotspotAndAcceptTypeStatisticsExport([FromBody] HotspotAndAcceptTypeStatisticsReq dto)
+        {
+	        var returnList = await _orderApplication.HotspotAndAcceptTypeStatisticsExport(dto);
+	        var table = _orderApplication.InitHotspotTable(returnList, dto.AddColumnName, dto.HotspotLevel);
+	        var stream = ExcelHelper.CreateStream(table);
+	        return ExcelStreamResult(stream, "热点受理类型统计");
+        }
+
+		/// <summary>
+		/// 热点受理类型明细
+		/// </summary>
+		/// <param name="dto"></param>
+		/// <returns></returns>
+		[HttpGet("hotspot-accepttype-statistics-detail")]
+        public async Task<PagedDto<OrderDto>> HotspotAndAcceptTypeStatisticsDetail([FromQuery] HotspotAndAcceptTypeStatisticsDetailReq dto)
+        {
+	        var (total, items) = await _orderApplication.HotspotAndAcceptTypeStatisticsDetail(dto).ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
+	        return  new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
+		}
+		/// <summary>
+		/// 热点受理类型明细导出
+		/// </summary>
+		/// <param name="dto"></param>
+		/// <returns></returns>
+		[HttpPost("hotspot-accepttype-statistics-detail-export")]
+        public async Task<FileStreamResult> HotspotAndAcceptTypeStatisticsDetailExport([FromBody] ExportExcelDto<HotspotAndAcceptTypeStatisticsDetailReq> dto)
+        {
+	        var query = _orderApplication.HotspotAndAcceptTypeStatisticsDetail(dto.QueryDto);
+
+	        List<Order> orders;
+	        if (dto.IsExportAll)
+	        {
+		        orders = await query.ToListAsync(HttpContext.RequestAborted);
+	        }
+	        else
+	        {
+		        var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
+		        orders = items;
+	        }
+	        var ordersDtos = _mapper.Map<ICollection<OrderDto>>(orders);
+	        dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
+	        var dtos = ordersDtos
+		        .Select(stu => _mapper.Map(stu, typeof(OrderDto), dynamicClass))
+		        .Cast<object>()
+		        .ToList();
+
+	        var stream = ExcelHelper.CreateStream(dtos);
+	        return ExcelStreamResult(stream, "热点受理类型明细");
+        }
+	}
 }

+ 1 - 0
src/Hotline.Api/Controllers/CommonPController.cs

@@ -20,6 +20,7 @@ using Microsoft.Extensions.Options;
 using XF.Domain.Authentications;
 using XF.Domain.Exceptions;
 using XF.Domain.Repository;
+using Hotline.Configurations;
 
 namespace Hotline.Api.Controllers
 {

+ 17 - 2
src/Hotline.Api/Controllers/IdentityController.cs

@@ -7,7 +7,9 @@ using System.Security.Cryptography;
 using System.Text;
 using Hotline.Api.Filter;
 using Hotline.Application.Systems;
+using Hotline.Configurations;
 using Hotline.Settings;
+using Microsoft.Extensions.Options;
 using XC.RSAUtil;
 using XF.Domain.Constants;
 using XF.Domain.Exceptions;
@@ -16,6 +18,7 @@ namespace Hotline.Api.Controllers;
 
 public class IdentityController : BaseController
 {
+    private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
     private readonly IIdentityAppService _identityAppService;
     private readonly ISystemSettingCacheManager _systemSettingCacheManager;
     private readonly ISystemLogApplication _iSystemLogApplication;
@@ -57,8 +60,13 @@ Q9PP8NTEmKqdI3WVFYqW/OlOFC6sjiscTOOn9Tc5Mrcn8ocCjAPjkhkCCVRMiJnv
 jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
 -----END RSA PRIVATE KEY-----";
 
-    public IdentityController(IIdentityAppService identityAppService, ISystemSettingCacheManager systemSettingCacheManager, ISystemLogApplication iSystemLogApplication)
+    public IdentityController(
+        IOptionsSnapshot<AppConfiguration> appOptions,
+        IIdentityAppService identityAppService, 
+        ISystemSettingCacheManager systemSettingCacheManager, 
+        ISystemLogApplication iSystemLogApplication)
     {
+        _appOptions = appOptions;
         _identityAppService = identityAppService;
         _systemSettingCacheManager = systemSettingCacheManager;
         _iSystemLogApplication = iSystemLogApplication;
@@ -101,7 +109,14 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
         var LoginImage = _systemSettingCacheManager.GetSetting(SettingConstants.LoginImage).SettingValue;
         var IsLoginMessageCode = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsLoginMessageCode).SettingValue[0]);
 
-        return new LoginPageInfoDto() { SysName = SysName, LoginImage = LoginImage, IsLoginMessageCode = IsLoginMessageCode };
+        return new LoginPageInfoDto
+        {
+            SysName = SysName, 
+            LoginImage = LoginImage, 
+            IsLoginMessageCode = IsLoginMessageCode,
+            AppScope = _appOptions.Value.AppScope,
+            CallCenterType = _appOptions.Value.GetDefaultAppScopeConfiguration().CallCenterType
+        };
     }
 
     private LoginDto Decrypt(LoginDto dto)

+ 4 - 0
src/Hotline.Api/Controllers/OrderController.cs

@@ -7,6 +7,7 @@ using Hotline.Application.Orders;
 using Hotline.Application.Quality;
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Configs;
+using Hotline.Configurations;
 using Hotline.ContingencyManagement;
 using Hotline.ContingencyManagement.Notifies;
 using Hotline.Enterprise;
@@ -4468,6 +4469,9 @@ public class OrderController : BaseController
                     cancellationToken: HttpContext.RequestAborted);
             }
 
+            //todo
+            //宜宾需求:1. 坐席申请特提:指派给申请人办理 2. 派单员申请特提:所有派单员都能办 3.其他特提场景:按节点原配置办理
+
             var processType = dto.FlowDirection == EFlowDirection.OrgToCenter || dto.FlowDirection == EFlowDirection.CenterToCenter
                 ? EProcessType.Zhiban
                 : EProcessType.Jiaoban;

+ 1 - 0
src/Hotline.Api/Controllers/PbxController.cs

@@ -31,6 +31,7 @@ using Microsoft.AspNetCore.Authorization;
 using Microsoft.Extensions.Options;
 using XF.Domain.Repository;
 using Tr.Sdk;
+using Hotline.Configurations;
 
 namespace Hotline.Api.Controllers
 {

+ 1 - 0
src/Hotline.Api/Controllers/QualityController.cs

@@ -20,6 +20,7 @@ using Hotline.Api.Filter;
 using Hotline.Application.CallCenter;
 using Hotline.CallCenter.Configs;
 using Microsoft.Extensions.Options;
+using Hotline.Configurations;
 
 namespace Hotline.Api.Controllers
 {

+ 0 - 3
src/Hotline.Api/Program.cs

@@ -1,7 +1,4 @@
-using EnumsNET;
 using Hotline.Api;
-using Hotline.EventBus;
-using Novacode;
 using Serilog;
 
 Log.Logger = new LoggerConfiguration()

+ 19 - 19
src/Hotline.Api/StartupExtensions.cs

@@ -1,4 +1,5 @@
-using FluentValidation;
+using System.Reflection;
+using FluentValidation;
 using FluentValidation.AspNetCore;
 using Hotline.Api.Realtimes;
 using Hotline.Application;
@@ -19,15 +20,13 @@ using XF.Utility.MQ;
 using Hotline.Ai.Jths;
 using Hotline.Api.Sdk;
 using Hotline.CallCenter.Configs;
-using Hotline.YbEnterprise.Sdk;
-using Hotline.Share.Dtos.SendSms;
 using Hotline.Wex;
 using Hotline.Application.CallCenter.Calls;
 using Hotline.Application.CallCenter;
 using Hotline.CallCenter.Calls;
 using Swashbuckle.AspNetCore.SwaggerUI;
-using Hotline.EventBus;
-using MediatR.Pipeline;
+using Hotline.Configurations;
+using Hotline.DI;
 
 namespace Hotline.Api;
 
@@ -44,11 +43,12 @@ internal static class StartupExtensions
 #if DEBUG
         builder.WebHost.UseUrls("http://*:50100");
 #endif
-
+        
         services.Configure<IdentityConfiguration>(d => configuration.GetSection(nameof(IdentityConfiguration)).Bind(d));
 
         var appConfigurationSection = configuration.GetRequiredSection(nameof(AppConfiguration));
         var appConfiguration = appConfigurationSection.Get<AppConfiguration>();
+        if (appConfiguration is null) throw new ArgumentNullException(nameof(appConfiguration));
         services.Configure<AppConfiguration>(d => appConfigurationSection.Bind(d));
 
         var callCenterConfigurationSection = configuration.GetRequiredSection(nameof(CallCenterConfiguration));
@@ -59,7 +59,13 @@ internal static class StartupExtensions
 
         // Add services to the container.
         services
-            .BatchInjectServices()
+            .BatchInjectServices(d =>
+            {
+                var attr = d.GetCustomAttribute(typeof(InjectionAttribute)) as InjectionAttribute;
+                if (attr is null) return true;
+                return attr.IsEnable(appConfiguration.AppScope,
+                    appConfiguration.GetDefaultAppScopeConfiguration().CallCenterType);
+            })
             .RegisterRepository()
             .AddApplication()
             .AddScoped(typeof(IPasswordHasher<>), typeof(PasswordHasher<>))
@@ -107,20 +113,14 @@ internal static class StartupExtensions
         {
             case AppDefaults.AppScope.YiBin:
                 //jths 
-                services.AddAiJths(configuration.GetSection("AiQuality").Get<AiQualityConfig>().Url);
-
-                var aiVisitConfigSection = configuration.GetSection("AiVisit");
-                var aiVisitConfig = aiVisitConfigSection.Get<AiVisitConfig>();
+                services.AddAiJths(appConfiguration.YiBin.AiQuality.Url);
                 services.AddAiVisitService(
-                    aiVisitConfig.Url,
-                    aiVisitConfig.Appkey,
-                    aiVisitConfig.ServiceVersion);
-                services.Configure<AiVisitConfig>(d => aiVisitConfigSection.Bind(d));
+                    appConfiguration.YiBin.AiVisit.Url,
+                    appConfiguration.YiBin.AiVisit.Appkey,
+                    appConfiguration.YiBin.AiVisit.ServiceVersion);
 
                 //宜宾企业服务
-                services.Configure<EnterpriseConfig>(d => configuration.GetSection("Enterprise").Bind(d));
-                var enterpriseConfig = configuration.GetSection("Enterprise").Get<EnterpriseConfig>();
-                services.AddYbEnterpriseSdk(enterpriseConfig?.AddressUrl);
+                services.AddYbEnterpriseSdk(appConfiguration.YiBin.Enterprise.AddressUrl);
                 break;
             case AppDefaults.AppScope.ZiGong:
                 break;
@@ -195,7 +195,7 @@ internal static class StartupExtensions
             app.UseSwagger();
             app.UseSwaggerUI(c =>
             {
-                c.DocExpansion(DocExpansion.None);
+                //c.DocExpansion(DocExpansion.None);
                 //c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
             });
         }

+ 16 - 11
src/Hotline.Api/StartupHelper.cs

@@ -5,6 +5,8 @@ using Hotline.Application;
 using Hotline.Application.Jobs;
 using Hotline.Application.Orders;
 using Hotline.CallCenter.Configs;
+using Hotline.Configurations;
+using Hotline.DI;
 using Hotline.EventBus;
 using Hotline.Identity;
 using Hotline.Repository.SqlSugar;
@@ -328,18 +330,21 @@ namespace Hotline.Api
             {
                 cfg.TypeEvaluator = d =>
                 {
-                    var attr = d.GetCustomAttribute(typeof(HandlerInjectAttribute)) as HandlerInjectAttribute;
+                    var attr = d.GetCustomAttribute(typeof(InjectionAttribute)) as InjectionAttribute;
                     if (attr is null) return true;
-                    if (!attr.Enable) return false;
-                    switch (attr.EventHandlerType)
-                    {
-                        case EEventHandlerType.CallCenter:
-                            return attr.Label == appConfiguration.GetDefaultAppScopeConfiguration().CallCenterType;
-                        default:
-                            return attr.AppScopes.ToString()
-                                .Split(',', StringSplitOptions.RemoveEmptyEntries)
-                                .Any(x => string.Compare(x, appConfiguration.AppScope, StringComparison.Ordinal) == 0);
-                    }
+                    return attr.IsEnable(appConfiguration.AppScope,
+                        appConfiguration.GetDefaultAppScopeConfiguration().CallCenterType);
+
+                    //if (!attr.Enable) return false;
+                    //switch (attr.EventHandlerType)
+                    //{
+                    //    case EEventHandlerType.CallCenter:
+                    //        return attr.Label == appConfiguration.GetDefaultAppScopeConfiguration().CallCenterType;
+                    //    default:
+                    //        return attr.AppScopes.ToString()
+                    //            .Split(',', StringSplitOptions.RemoveEmptyEntries)
+                    //            .Any(x => string.Compare(x, appConfiguration.AppScope, StringComparison.Ordinal) == 0);
+                    //}
                 };
                 //cfg.RegisterServicesFromAssemblyContaining<Program>();
                 cfg.RegisterServicesFromAssembly(typeof(ApplicationStartupExtensions).Assembly);

+ 42 - 24
src/Hotline.Api/config/appsettings.Development.json

@@ -1,9 +1,27 @@
 {
   "AllowedHosts": "*",
   "AppConfiguration": {
-    "AppScope": "YiBin",
+    "AppScope": "ZiGong",
     "YiBin": {
-      "CallCenterType": "TianRun" //XunShi、WeiErXin、TianRun、XingTang
+      "CallCenterType": "TianRun", //XunShi、WeiErXin、TianRun、XingTang
+      //智能回访
+      "AiVisit": {
+        "Url": "http://118.122.73.80:19061",
+        "Appkey": "MTAwMDAx",
+        "ServiceVersion": "V1.0.0" //接口版本号
+      },
+      //智能质检
+      "AiQuality": {
+        "Url": "http://118.122.73.80:19072/" // 正式
+        //"Url": "http://118.122.73.80:19072/", // 测试
+      },
+      //企业服务
+      "Enterprise": {
+        "AddressUrl": "http://10.12.185.227:8834/",
+        "ClientId": "1462598736",
+        "ClientSecret": "6nZtVK4rKfnsncGymUHB",
+        "TenantId": "000000"
+      }
     },
     "ZiGong": {
       "CallCenterType": "XingTang"
@@ -41,7 +59,7 @@
     }
   },
   "ConnectionStrings": {
-    "Hotline": "PORT=5432;DATABASE=hotline_dev;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;"
+    "Hotline": "PORT=5432;DATABASE=hotline;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;"
   },
   "Cache": {
     "Host": "110.188.24.182",
@@ -120,28 +138,28 @@
   //  "Password": "12345678aa",
   //  "Ip": "222.213.23.229"
   //},
-  //智能回访
-  "AiVisit": {
-    "Url": "http://118.122.73.80:19061",
-    "Appkey": "MTAwMDAx",
-    "ServiceVersion": "V1.0.0" //接口版本号
-  },
-  //智能质检
-  "AiQuality": {
-    "Url": "http://118.122.73.80:19072/" // 正式
-    //"Url": "http://118.122.73.80:19072/", // 测试
-  },
-  //企业服务
-  "Enterprise": {
-    "AddressUrl": "http://10.12.185.227:8834/",
-    "ClientId": "1462598736",
-    "ClientSecret": "6nZtVK4rKfnsncGymUHB",
-    "TenantId": "000000"
-  },
+  ////智能回访
+  //"AiVisit": {
+  //  "Url": "http://118.122.73.80:19061",
+  //  "Appkey": "MTAwMDAx",
+  //  "ServiceVersion": "V1.0.0" //接口版本号
+  //},
+  ////智能质检
+  //"AiQuality": {
+  //  "Url": "http://118.122.73.80:19072/" // 正式
+  //  //"Url": "http://118.122.73.80:19072/", // 测试
+  //},
+  ////企业服务
+  //"Enterprise": {
+  //  "AddressUrl": "http://10.12.185.227:8834/",
+  //  "ClientId": "1462598736",
+  //  "ClientSecret": "6nZtVK4rKfnsncGymUHB",
+  //  "TenantId": "000000"
+  //},
 
-  "SendSms": {
-    "Url": "http://localhost:50108/api/v1/PushMessage/addwaitmsg"
-  }
+  //"SendSms": {
+  //  "Url": "http://localhost:50108/api/v1/PushMessage/addwaitmsg"
+  //}
 
 
 }

+ 2 - 1
src/Hotline.Application/ContingencyManagement/ContingencyManagementNotifyHandler.cs

@@ -1,6 +1,7 @@
 using DotNetCore.CAP;
 using Hotline.ContingencyManagement;
 using Hotline.ContingencyManagement.Notifies;
+using Hotline.DI;
 using Hotline.EventBus;
 using Hotline.Share.Dtos.ContingencyManagement;
 using MapsterMapper;
@@ -9,7 +10,7 @@ using XF.Domain.Repository;
 
 namespace Hotline.Application.ContingencyManagement
 {
-    [HandlerInject(AppScopes = EAppScope.YiBin)]
+    [Injection(AppScopes = EAppScope.YiBin)]
     public class ContingencyManagementNotifyHandler : INotificationHandler<ContingencyManagementNotify>
     {
         private readonly IRepository<ContingencyManagementOrders> _contingencyManagementOrdersRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/AlertExtToExtNotificationHandler.cs

@@ -1,5 +1,5 @@
 using Hotline.Caching.Interfaces;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -9,7 +9,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AlertExtToExtNotificationHandler : INotificationHandler<AlertExtToExtNotification>
     {
         private readonly IRealtimeService _realtimeService;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/AlertExtToOuterNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -10,7 +10,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AlertExtToOuterNotificationHandler:INotificationHandler<AlertExtToOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/AlertMenuToOuterNotificationHandler.cs

@@ -1,12 +1,12 @@
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AlertMenuToOuterNotificationHandler:INotificationHandler<AlertMenuToOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/AlertVisitorToExtNotificationHandler.cs

@@ -1,12 +1,12 @@
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AlertVisitorToExtNotificationHandler: INotificationHandler<AlertVisitorToExtNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/DtmfNotificationHandler.cs

@@ -2,7 +2,7 @@
 using Hotline.CallCenter.Calls;
 using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Ivrs;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -12,7 +12,7 @@ using NewRock.Sdk;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class DtmfNotificationHandler : NewRockBaseHandler, INotificationHandler<DtmfNotification>
     {
         private readonly IIvrDomainService _ivrDomainService;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/FailedNotificationHandler.cs

@@ -1,11 +1,11 @@
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class FailedNotificationHandler:INotificationHandler<FailedNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 8
src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToExtNotificationHandler.cs

@@ -1,20 +1,14 @@
 using Hotline.Caching.Interfaces;
-using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Hotline.DI;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class RingExtToExtNotificationHandler : INotificationHandler<RingExtToExtNotification>
     {
         private readonly IRealtimeService _realtimeService;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToOuterNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using Hotline.Tools;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class RingExtToOuterNotificationHandler : INotificationHandler<RingExtToOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/RingMenuToExtNotificationHandler.cs

@@ -1,10 +1,10 @@
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class RingMenuToExtNotificationHandler:INotificationHandler<RingMenuToExtNotification>
     {
         //TODO 无法定位数据暂无操作

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/RingVisitorToExtNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.CallState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class RingVisitorToExtNotificationHandler : INotificationHandler<RingVisitorToExtNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/ExtState/BusyNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Tels;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
@@ -8,7 +8,7 @@ using XF.Domain.Cache;
 
 namespace Hotline.Application.Handlers.CallCenter.ExtState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class BusyNotificationHandler : INotificationHandler<BusyNotification>
     {
         private readonly ITelRepository _telRepository;

+ 3 - 5
src/Hotline.Application/Handlers/CallCenter/ExtState/IdleNotificationHandler.cs

@@ -1,12 +1,10 @@
 using Hotline.Caching.Interfaces;
-using Hotline.Caching.Services;
 using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Devices;
 using Hotline.CallCenter.Tels;
-using Hotline.EventBus;
-using Hotline.NewRock;
+using Hotline.Configurations;
+using Hotline.DI;
 using Hotline.Realtimes;
-using Hotline.Repository.SqlSugar.CallCenter;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
@@ -17,7 +15,7 @@ using XF.Domain.Exceptions;
 
 namespace Hotline.Application.Handlers.CallCenter.ExtState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class IdleNotificationHandler : INotificationHandler<IdleNotification>
     {
         private readonly ITelRepository _telRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/ExtState/OfflineNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Tels;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
@@ -8,7 +8,7 @@ using XF.Domain.Cache;
 
 namespace Hotline.Application.Handlers.CallCenter.ExtState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class OfflineNotificationHandler: INotificationHandler<OfflineNotification>
     {
         private readonly ITelRepository _telRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/ExtState/OnlineNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Tels;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
@@ -8,7 +8,7 @@ using XF.Domain.Cache;
 
 namespace Hotline.Application.Handlers.CallCenter.ExtState
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class OnlineNotificationHandler : INotificationHandler<OnlineNotification>
     {
         private readonly ITelRepository _telRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToExtNoificationHandler.cs

@@ -1,5 +1,5 @@
 using Hotline.Caching.Interfaces;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AnswerExtToExtNoificationHandler : INotificationHandler<AnswerExtToExtNotification>
     {
         private readonly IUserCacheManager _userCacheManager;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToOuterNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -9,7 +9,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AnswerExtToOuterNotificationHandler : INotificationHandler<AnswerExtToOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerViisitorToExtNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -9,7 +9,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AnswerViisitorToExtNotificationHandler : INotificationHandler<AnswerViisitorToExtNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToExtNotificationHandler.cs

@@ -1,5 +1,5 @@
 using Hotline.Caching.Interfaces;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AnsweredExtToExtNotificationHandler : INotificationHandler<AnsweredExtToExtNotification>
     {
         private readonly IUserCacheManager _userCacheManager;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -9,7 +9,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AnsweredExtToOuterNotificationHandler : INotificationHandler<AnsweredExtToOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterToExtNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -9,7 +9,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AnsweredExtToOuterToExtNotificationHandler : INotificationHandler<AnsweredExtToOuterToExtNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredVisitorToExtNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class AnsweredVisitorToExtNotificationHandler : INotificationHandler<AnsweredVisitorToExtNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndExtNotificationHandler.cs

@@ -1,5 +1,5 @@
 using Hotline.Caching.Interfaces;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeExtAndExtNotificationHandler : INotificationHandler<ByeExtAndExtNotification>
     {
         private readonly IUserCacheManager _userCacheManager;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterOneNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -9,7 +9,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeExtAndOuterOneNotificationHandler : INotificationHandler<ByeExtAndOuterOneNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterTwoNotificationHandler.cs

@@ -1,7 +1,7 @@
 using Hotline.Caching.Interfaces;
 using Hotline.Caching.Services;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -10,7 +10,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeExtAndOuterTwoNotificationHandler : INotificationHandler<ByeExtAndOuterTwoNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeOuterAndOuterNotificationHandler.cs

@@ -1,12 +1,12 @@
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeOuterAndOuterNotificationHandler : INotificationHandler<ByeOuterAndOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndExtNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeVisitorAndExtNotificationHandler : INotificationHandler<ByeVisitorAndExtNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 7
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndMenuNotificationHandler.cs

@@ -1,20 +1,15 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Hotline.DI;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeVisitorAndMenuNotificationHandler : INotificationHandler<ByeVisitorAndMenuNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndOuterNotificationHandler.cs

@@ -1,11 +1,11 @@
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeVisitorAndOuterNotificationHandler : INotificationHandler<ByeVisitorAndOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorOffNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -9,7 +9,7 @@ using Serilog.Enrichers.Span;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class ByeVisitorOffNotificationHandler : INotificationHandler<ByeVisitorOffNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/CdrNotificationHandler.cs

@@ -1,7 +1,7 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
 using Hotline.CallCenter.Tels;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Dtos.Realtime;
 using Hotline.Share.Enums.CallCenter;
@@ -10,7 +10,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class CdrNotificationHandler : INotificationHandler<CdrNotification>
     {
         private readonly ICallRecordRepository _callRecordRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/DivertVisitorToExtNotificationHandler.cs

@@ -1,12 +1,12 @@
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class DivertVisitorToExtNotificationHandler : INotificationHandler<DivertVisitorToExtNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnOuterToMenuNotificationHandler.cs

@@ -2,7 +2,7 @@
 using Hotline.CallCenter.Calls;
 using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Ivrs;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -12,7 +12,7 @@ using NewRock.Sdk;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class EndOfAnnOuterToMenuNotificationHandler : NewRockBaseHandler, INotificationHandler<EndOfAnnOuterToMenuNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnVisitorToMenuNotificationHandler.cs

@@ -2,7 +2,7 @@
 using Hotline.CallCenter.Calls;
 using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Ivrs;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -12,7 +12,7 @@ using NewRock.Sdk;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class EndOfAnnVisitorToMenuNotificationHandler : NewRockBaseHandler, INotificationHandler<EndOfAnnVisitorToMenuNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/IncomingNotificationHandler.cs

@@ -1,7 +1,7 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
 using Hotline.CallCenter.Configs;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Settings;
 using Hotline.Share.Enums.CallCenter;
@@ -19,7 +19,7 @@ using XF.Domain.Repository;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class IncomingNotificationHandler : INotificationHandler<IncomingNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/InviteNotificationHandler.cs

@@ -2,7 +2,7 @@
 using Hotline.CallCenter.BlackLists;
 using Hotline.CallCenter.Calls;
 using Hotline.CallCenter.Configs;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Settings;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
@@ -15,7 +15,7 @@ using NewRock.Sdk.Control.Request;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class InviteNotificationHandler : INotificationHandler<InviteNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/QueueVisitorToGroupBusyNotificationHandler.cs

@@ -1,13 +1,13 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Realtimes;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.FlowControl
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class QueueVisitorToGroupBusyNotificationHandler : INotificationHandler<QueueVisitorToGroupBusyNotification>
     {
         private readonly ICallCacheManager _callCacheManager;

+ 3 - 3
src/Hotline.Application/Handlers/CallCenter/System/BootupNotificationHandler.cs

@@ -3,8 +3,8 @@ using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Devices;
 using Hotline.CallCenter.Ivrs;
 using Hotline.CallCenter.Tels;
-using Hotline.EventBus;
-using Hotline.NewRock;
+using Hotline.Configurations;
+using Hotline.DI;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 using Microsoft.Extensions.DependencyInjection;
@@ -12,7 +12,7 @@ using Microsoft.Extensions.Options;
 
 namespace Hotline.Application.Handlers.CallCenter.System
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class BootupNotificationHandler : INotificationHandler<BootupNotification>
     {
         private readonly ITelGroupRepository _telGroupRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/Transient/TransientOuterNotificationHandler.cs

@@ -1,6 +1,6 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using Hotline.Tools;
@@ -8,7 +8,7 @@ using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.Transient
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class TransientOuterNotificationHandler : INotificationHandler<TransientOuterNotification>
     {
         private readonly ICallRepository _callRepository;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/Transient/TransinetVisitorNotificationHandler.cs

@@ -1,11 +1,11 @@
 using Hotline.CallCenter.Calls;
-using Hotline.EventBus;
+using Hotline.DI;
 using Hotline.Share.Notifications.NewRockCallCenter;
 using MediatR;
 
 namespace Hotline.Application.Handlers.CallCenter.Transient
 {
-    [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
+    [Injection(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
     public class TransinetVisitorNotificationHandler : INotificationHandler<TransientVisitorNotification>
     {
         private readonly ICallRepository _callRepository;

+ 13 - 13
src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs

@@ -4,6 +4,7 @@ using Hotline.Application.JudicialManagement;
 using Hotline.Application.Orders;
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Tels;
+using Hotline.Configurations;
 using Hotline.EventBus;
 using Hotline.FlowEngine.Notifications;
 using Hotline.FlowEngine.WorkflowModules;
@@ -38,46 +39,44 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
     private readonly ITimeLimitDomainService _timeLimitDomainService;
     private readonly ILogger<WorkflowEndHandler> _logger;
     private readonly IKnowledgeRepository _knowledgeRepository;
-    private readonly IEnforcementApplication _enforcementApplication;
     private readonly ICallApplication _callApplication;
     private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
     private readonly ISystemSettingCacheManager _systemSettingCacheManager;
     private readonly Publisher _publisher;
 
     public WorkflowEndHandler(
+        IMapper mapper,
         IKnowledgeDomainService knowledgeDomainService,
         IOrderDomainService orderDomainService,
         IOrderApplication orderApplication,
         ITelDomainService telDomainService,
         IOrderRepository orderRepository,
-        ICapPublisher capPublisher,
-        IMapper mapper,
+        IKnowledgeRepository knowledgeRepository,
         IRepository<OrderDelay> orderDelayRepository,
+        ICapPublisher capPublisher,
         ITimeLimitDomainService timeLimitDomainService,
-        IKnowledgeRepository knowledgeRepository,
-        ILogger<WorkflowEndHandler> logger,
-        IEnforcementApplication enforcementApplication,
         ICallApplication callApplication,
         IOptionsSnapshot<AppConfiguration> appOptions,
         ISystemSettingCacheManager systemSettingCacheManager,
-        Publisher publisher)
+        Publisher publisher,
+        ILogger<WorkflowEndHandler> logger
+        )
     {
+        _mapper = mapper;
         _knowledgeDomainService = knowledgeDomainService;
         _orderDomainService = orderDomainService;
         _orderApplication = orderApplication;
         _telDomainService = telDomainService;
         _orderRepository = orderRepository;
-        _capPublisher = capPublisher;
-        _mapper = mapper;
+        _knowledgeRepository = knowledgeRepository;
         _orderDelayRepository = orderDelayRepository;
+        _capPublisher = capPublisher;
         _timeLimitDomainService = timeLimitDomainService;
-        _logger = logger;
-        _knowledgeRepository = knowledgeRepository;
-        _enforcementApplication = enforcementApplication;
         _callApplication = callApplication;
         _appOptions = appOptions;
         _systemSettingCacheManager = systemSettingCacheManager;
         _publisher = publisher;
+        _logger = logger;
     }
 
     /// <summary>Handles a notification</summary>
@@ -217,7 +216,8 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
                     var isOpenJudicialManagement = _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenJudicialManagement)?.SettingValue[0];
                     if (isOpenJudicialManagement == "true")
                         await _publisher.PublishAsync(new JudicialManagementOrderNotify(order), PublishStrategy.ParallelWhenAll, cancellationToken);
-
+                    //推诿工单
+                    // await _enforcementApplication.AddPassTheBuckOrderAsync(order, _sessionContext.OrgId, _sessionContext.OrgName, cancellationToken);
                     break;
                 //case WorkflowModuleConsts.OrderScreen:
                 //    var screen = await _orderScreenRepository.GetAsync(workflow.ExternalId, cancellationToken);

+ 1 - 0
src/Hotline.Application/Handlers/FlowEngine/WorkflowStartHandler.cs

@@ -2,6 +2,7 @@
 using Hotline.Application.CallCenter;
 using Hotline.Application.Quality;
 using Hotline.CallCenter.Configs;
+using Hotline.Configurations;
 using Hotline.FlowEngine.Notifications;
 using Hotline.FlowEngine.WorkflowModules;
 using Hotline.KnowledgeBase;

+ 19 - 18
src/Hotline.Application/Handlers/Order/TranspondCityNotifyHandler.cs

@@ -10,11 +10,12 @@ using MediatR;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
 using System;
+using Hotline.DI;
 using XF.Domain.Repository;
 
 namespace Hotline.Application.Handlers.Order
 {
-    [HandlerInject(AppScopes = EAppScope.YiBin)]
+    [Injection(AppScopes = EAppScope.YiBin)]
     public class TranspondCityNotifyHandler : INotificationHandler<OrderStartWorkflowNotify>
     {
         private readonly IMapper _mapper;
@@ -53,27 +54,27 @@ namespace Hotline.Application.Handlers.Order
         public async Task Handle(OrderStartWorkflowNotify notification, CancellationToken cancellationToken)
         {
             try
-        {
-            var id = notification.Id;
-            var order = await _orderRepository.GetAsync(id, cancellationToken);
-            if (order != null)
             {
-                //是否市州互转
-                if (order.Transpond.HasValue && order.Transpond.Value)
+                var id = notification.Id;
+                var order = await _orderRepository.GetAsync(id, cancellationToken);
+                if (order != null)
                 {
-                    var orderDto = _mapper.Map<OrderDto>(order);
-                    await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderTranspondCity, orderDto);
-                    //保存本地数据
-                    TranspondCityRawData cityRawData = new TranspondCityRawData
+                    //是否市州互转
+                    if (order.Transpond.HasValue && order.Transpond.Value)
                     {
-                        OrderCode = order.No,
-                        TransferOutTime = DateTime.Now,
-                        CityName = order.TranspondCityName,
-                        Direction = ETranspondDirection.Out
-                    };
+                        var orderDto = _mapper.Map<OrderDto>(order);
+                        await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderTranspondCity, orderDto);
+                        //保存本地数据
+                        TranspondCityRawData cityRawData = new TranspondCityRawData
+                        {
+                            OrderCode = order.No,
+                            TransferOutTime = DateTime.Now,
+                            CityName = order.TranspondCityName,
+                            Direction = ETranspondDirection.Out
+                        };
 
-                    await _transpondCityRawDataRepository.AddAsync(cityRawData, cancellationToken);
-                }
+                        await _transpondCityRawDataRepository.AddAsync(cityRawData, cancellationToken);
+                    }
                 }
 
             }

+ 2 - 1
src/Hotline.Application/JudicialManagement/AddPassTheBuckOrderNotifyHandler.cs

@@ -1,4 +1,5 @@
 using Hotline.Caching.Interfaces;
+using Hotline.DI;
 using Hotline.EventBus;
 using Hotline.JudicialManagement;
 using Hotline.JudicialManagement.Notifies;
@@ -11,7 +12,7 @@ using XF.Domain.Repository;
 
 namespace Hotline.Application.JudicialManagement
 {
-    [HandlerInject(AppScopes = EAppScope.YiBin)]
+    [Injection(AppScopes = EAppScope.YiBin)]
     public class AddPassTheBuckOrderNotifyHandler : INotificationHandler<AddPassTheBuckOrderNotify>
     {
         private readonly IRepository<EnforcementOrderHander> _enforcementOrderHanderRepository;

+ 2 - 1
src/Hotline.Application/JudicialManagement/JudicialManagementOrderNotifyHandler.cs

@@ -1,4 +1,5 @@
 using Hotline.Caching.Interfaces;
+using Hotline.DI;
 using Hotline.EventBus;
 using Hotline.JudicialManagement;
 using Hotline.JudicialManagement.Notifies;
@@ -11,7 +12,7 @@ using XF.Domain.Repository;
 
 namespace Hotline.Application.JudicialManagement
 {
-    [HandlerInject(AppScopes = EAppScope.YiBin)]
+    [Injection(AppScopes = EAppScope.YiBin)]
     public class JudicialManagementOrderNotifyHandler : INotificationHandler<JudicialManagementOrderNotify>
     {
         private readonly IRepository<EnforcementHotspot> _enforcementHotspotRepository;

+ 2 - 1
src/Hotline.Application/Mappers/CallMapperConfigs.cs

@@ -94,8 +94,9 @@ namespace Hotline.Application.Mappers
                 .Map(d => d.StaffNo, s => s.UserCode)
                 .Map(d => d.TelNo, s => s.Ext)
                 .Map(d => d.OperateState, s => s.ExecutionState)
-                .Map(d => d.OperateStateText, s => s.ExtutionStateText)
+                //.Map(d => d.OperateStateText, s => s.GetExecutionStateText())
                 .Map(d => d.OperateTime, s => s.ExecutionTime)
+                .AfterMapping((s, d) => d.OperateStateText = s.GetExecutionStateText())
                 ;
 
             config.ForType<CallNative, TrCallDto>()

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

@@ -193,5 +193,27 @@ namespace Hotline.Application.Orders
         /// <returns></returns>
         ISugarQueryable<OrderBiCentreDataListVo> CentreDataList(ReportPagedRequest dto);
 
-    }
+		/// <summary>
+		/// 热点受理类型统计
+        /// </summary>
+		/// <param name="dto"></param>
+		/// <returns></returns>
+		Task<(List<SystemDicData> acceptTypes, object items)> HotspotAndAcceptTypeStatistics(HotspotAndAcceptTypeStatisticsReq dto);
+
+
+		/// <summary>
+		/// 热点受理类型统计--导出
+		/// </summary>
+		/// <param name="dto"></param>
+		/// <returns></returns>
+		Task<DataTable> HotspotAndAcceptTypeStatisticsExport(HotspotAndAcceptTypeStatisticsReq dto);
+
+        /// <summary>
+        /// 热点受理类型明细
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        ISugarQueryable<Order> HotspotAndAcceptTypeStatisticsDetail(HotspotAndAcceptTypeStatisticsDetailReq dto);
+
+	}
 }

+ 156 - 12
src/Hotline.Application/Orders/OrderApplication.cs

@@ -72,9 +72,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
     private readonly IRepository<SystemArea> _systemAreaRepository;
     private readonly IRepository<Hotspot> _hotspotRepository;
     private readonly IRepository<WorkflowStep> _workflowStepRepository;
+    private readonly IRepository<SystemDicData> _systemDicDataRepository;
 
 
-    public OrderApplication(
+	public OrderApplication(
         IOrderDomainService orderDomainService,
         IOrderRepository orderRepository,
         IWorkflowDomainService workflowDomainService,
@@ -94,8 +95,9 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         IRepository<OrderSpecialDetail> orderSpecialDetailRepository,
         IRepository<SystemArea> systemAreaRepository,
         IRepository<Hotspot> hotspotRepository,
-        IRepository<WorkflowStep> workflowStepRepository
-        )
+        IRepository<WorkflowStep> workflowStepRepository,
+        IRepository<SystemDicData> systemDicDataRepository
+		)
     {
         _orderDomainService = orderDomainService;
         _workflowDomainService = workflowDomainService;
@@ -117,7 +119,9 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         _systemAreaRepository = systemAreaRepository;
         _hotspotRepository = hotspotRepository;
         _workflowStepRepository = workflowStepRepository;
-    }
+        _systemDicDataRepository = systemDicDataRepository;
+
+	}
 
     /// <summary>
     /// 更新工单办理期满时间(延期调用,其他不调用)
@@ -1454,15 +1458,155 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         }
         return query;
     }
-    #region private
 
-    /// <summary>
-    /// 接受外部工单(除省平台)
-    /// </summary>
-    /// <param name="dto"></param>
-    /// <param name="cancellationToken"></param>
-    /// <returns></returns>
-    private async Task<AddOrderResponse> ReceiveOrderFromOtherPlatformAsync(AddOrderDto dto, List<FileDto> files,
+	/// <summary>
+	/// 热点受理类型统计
+	/// </summary>
+	/// <param name="dto"></param>
+	/// <returns></returns>
+	public async Task<(List<SystemDicData> acceptTypes, object items)> HotspotAndAcceptTypeStatistics(HotspotAndAcceptTypeStatisticsReq dto)
+	{
+		dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
+		var dicList = _systemDicDataRepository.Queryable().Where(x => x.DicTypeCode == "AcceptType").OrderBy(x => x.Sort).MergeTable();
+		var endIndex = (2 * dto.HotspotLevel).ToString();
+		var hotspotList = _hotspotRepository.Queryable().Where(x => SqlFunc.Length(x.Id) == int.Parse(endIndex))
+			.Select(x => new
+			{
+				HotspotId = x.Id,
+				HotspotName = x.HotSpotFullName,
+			}).MergeTable();
+    
+		var orderList = _orderRepository.Queryable().Where(x => x.CreationTime >= dto.StartTime && x.CreationTime < dto.EndTime)
+			.Select(x => new
+			{
+				HotspotId = x.HotspotId.Substring(0, int.Parse(endIndex)),
+				AcceptTypeCode = x.AcceptTypeCode,
+			}).MergeTable();
+
+		var hotListAndOrder = hotspotList.LeftJoin(orderList, (it, o) => it.HotspotId == o.HotspotId)
+			 .GroupBy((it, o) => new
+			 {
+				 it.HotspotId,
+				 it.HotspotName,
+				 AcceptTypeCode = o.AcceptTypeCode,
+			 })
+			 .OrderBy((it, o) => it.HotspotId)
+			 .Select((it, o) => new
+			 {
+				 HotspotId = it.HotspotId,
+				 HotspotName = it.HotspotName,
+				 AcceptTypeCode = o.AcceptTypeCode,
+				 Count = SqlFunc.AggregateCount(it.HotspotId)
+			 }).MergeTable();
+
+		var returnList = await dicList.LeftJoin(hotListAndOrder, (pp, dd) => pp.DicDataValue == dd.AcceptTypeCode)
+		   .GroupBy((pp, dd) => new
+		   {
+			   HotspotId = dd.HotspotId,
+			   HotspotName = dd.HotspotName,
+			   AcceptTypeCode = pp.DicDataValue,
+			   AcceptType = pp.DicDataName,
+		   })
+		   .OrderBy((pp, dd) => dd.HotspotId)
+		   .Select((pp, dd) => new
+		   {
+			   HotspotId = dd.HotspotId,
+			   HotspotName = dd.HotspotName,
+			   AcceptTypeCode = pp.DicDataValue,
+			   AcceptType = pp.DicDataName,
+			   Count = SqlFunc.AggregateSum(dd.Count)
+		   }).ToPivotListAsync(q => q.AcceptTypeCode, q => new { q.HotspotName, q.HotspotId }, q => q.Sum(x => x.Count));
+
+		var titleList = await _systemDicDataRepository.Queryable().Where(x => x.DicTypeCode == "AcceptType").OrderBy(x => x.Sort).ToListAsync();
+		return (titleList, returnList);
+	}
+
+	/// <summary>
+	/// 热点受理类型统计--导出
+	/// </summary>
+	/// <param name="dto"></param>
+	/// <returns></returns>
+	public async Task<DataTable> HotspotAndAcceptTypeStatisticsExport(HotspotAndAcceptTypeStatisticsReq dto)
+	{
+		dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
+		var dicList = _systemDicDataRepository.Queryable().Where(x => x.DicTypeCode == "AcceptType").OrderBy(x => x.Sort).MergeTable();
+		var endIndex = (2 * dto.HotspotLevel).ToString();
+		var hotspotList = _hotspotRepository.Queryable().Where(x => SqlFunc.Length(x.Id) == int.Parse(endIndex))
+			.Select(x => new
+			{
+				HotspotId = x.Id,
+				HotspotName = x.HotSpotFullName,
+			}).MergeTable();
+
+		var orderList = _orderRepository.Queryable().Where(x => x.CreationTime >= dto.StartTime && x.CreationTime < dto.EndTime)
+			.Select(x => new
+			{
+				HotspotId = x.HotspotId.Substring(0, int.Parse(endIndex)),
+				AcceptTypeCode = x.AcceptTypeCode,
+			}).MergeTable();
+
+		var hotListAndOrder = hotspotList.LeftJoin(orderList, (it, o) => it.HotspotId == o.HotspotId)
+			 .GroupBy((it, o) => new
+			 {
+				 it.HotspotId,
+				 it.HotspotName,
+				 AcceptTypeCode = o.AcceptTypeCode,
+			 })
+			 .OrderBy((it, o) => it.HotspotId)
+			 .Select((it, o) => new
+			 {
+				 HotspotId = it.HotspotId,
+				 HotspotName = it.HotspotName,
+				 AcceptTypeCode = o.AcceptTypeCode,
+				 Count = SqlFunc.AggregateCount(it.HotspotId)
+			 }).MergeTable();
+
+
+		var returnList = await dicList.LeftJoin(hotListAndOrder, (pp, dd) => pp.DicDataValue == dd.AcceptTypeCode)
+		   .GroupBy((pp, dd) => new
+		   {
+			   HotspotId = dd.HotspotId,
+			   HotspotName = dd.HotspotName,
+			   AcceptTypeCode = pp.DicDataValue,
+			   AcceptType = pp.DicDataName,
+		   })
+		   .OrderBy((pp, dd) => dd.HotspotId)
+		   .Select((pp, dd) => new
+		   {
+			   HotspotId = dd.HotspotId,
+			   HotspotName = dd.HotspotName,
+			   AcceptTypeCode = pp.DicDataValue,
+			   AcceptType = pp.DicDataName,
+			   Count = SqlFunc.AggregateSum(dd.Count)
+		   }).ToPivotTableAsync(q => q.AcceptTypeCode, q => new { q.HotspotName }, q => q.Sum(x => x.Count));
+		//returnList.Rows.RemoveAt(returnList.Rows.Count-1);
+		return returnList;
+	}
+
+	/// <summary>
+	/// 热点受理类型统计明细
+	/// </summary>
+	/// <param name="dto"></param>
+	/// <returns></returns>
+	public ISugarQueryable<Order> HotspotAndAcceptTypeStatisticsDetail(HotspotAndAcceptTypeStatisticsDetailReq dto)
+	{
+		dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
+		var query = _orderRepository.Queryable()
+			.Where(x => x.HotspotId.StartsWith(dto.HotspotId) && x.CreationTime >= dto.StartTime && x.CreationTime < dto.EndTime)
+			.WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), x => x.AcceptTypeCode.StartsWith(dto.AcceptTypeCode))
+            .OrderByDescending(x => x.CreationTime);
+		return query;
+	}
+
+	#region private
+
+	/// <summary>
+	/// 接受外部工单(除省平台)
+	/// </summary>
+	/// <param name="dto"></param>
+	/// <param name="cancellationToken"></param>
+	/// <returns></returns>
+	private async Task<AddOrderResponse> ReceiveOrderFromOtherPlatformAsync(AddOrderDto dto, List<FileDto> files,
         ISessionContext current, CancellationToken cancellationToken)
     {
         if (string.IsNullOrEmpty(dto.ExternalId))

+ 3 - 0
src/Hotline.Application/Quality/AiOrderQualityHandler.cs

@@ -9,10 +9,13 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Hotline.DI;
+using Hotline.EventBus;
 using Hotline.Quality.Notifications;
 
 namespace Hotline.Application.Quality
 {
+    [Injection(AppScopes = EAppScope.YiBin)]
 	public class AiOrderQualityHandler : INotificationHandler<AiOrderQualityNotify>
 	{
 		private readonly IAiQualityService _aiQualityService;

+ 1 - 6
src/Hotline.Application/Quality/QualityApplication.cs

@@ -25,6 +25,7 @@ using XF.Domain.Dependency;
 using XF.Domain.Exceptions;
 using XF.Domain.Repository;
 using Hotline.Share.Enums.CallCenter;
+using Hotline.Configurations;
 
 namespace Hotline.Application.Quality
 {
@@ -34,9 +35,7 @@ namespace Hotline.Application.Quality
         private readonly IMapper _mapper;
         private readonly IRepository<QualityDetail> _qualiteyDetail;
         private readonly IQualityRepository _qualityRepository;
-        private readonly IAiQualityService _aiQualityService;
         private readonly IOrderRepository _orderRepository;
-        //private readonly IRepository<TrCallRecord> _trCallRecordRepository;
         private readonly IRepository<QualityTemplate> _qualityTemplate;
         private readonly ISystemSettingCacheManager _systemSettingCacheManager;
         private readonly ILogger<Hotline.Quality.Quality> _logger;
@@ -50,8 +49,6 @@ namespace Hotline.Application.Quality
             IMapper mapper,
             IRepository<QualityDetail> qualiteyDetail,
             IQualityRepository qualityRepository,
-            IAiQualityService aiQualityService,
-            //IRepository<TrCallRecord> trCallRecordRepository,
             IRepository<QualityTemplate> qualityTemplate,
             IOrderRepository orderRepository,
             ISystemSettingCacheManager systemSettingCacheManager,
@@ -65,8 +62,6 @@ namespace Hotline.Application.Quality
             _mapper = mapper;
             _qualiteyDetail = qualiteyDetail;
             _qualityRepository = qualityRepository;
-            _aiQualityService = aiQualityService;
-            //_trCallRecordRepository = trCallRecordRepository;
             _qualityTemplate = qualityTemplate;
             _orderRepository = orderRepository;
             _systemSettingCacheManager = systemSettingCacheManager;

+ 63 - 63
src/Hotline.Application/Visit/AiOrderVisitService.cs

@@ -1,71 +1,71 @@
 
-using Hotline.Ai.Visit;
-using Hotline.Orders;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Org.BouncyCastle.Utilities;
-using XF.Domain.Repository;
+//using Hotline.Ai.Visit;
+//using Hotline.Orders;
+//using Microsoft.Extensions.DependencyInjection;
+//using Microsoft.Extensions.Hosting;
+//using Org.BouncyCastle.Utilities;
+//using XF.Domain.Repository;
 
-namespace Hotline.Application.Visit
-{
-    public class AiOrderVisitService : BackgroundService
-    {
-        private readonly IServiceScopeFactory _serviceScopeFactory;
+//namespace Hotline.Application.Visit
+//{
+//    public class AiOrderVisitService : BackgroundService
+//    {
+//        private readonly IServiceScopeFactory _serviceScopeFactory;
 
-        public AiOrderVisitService(IServiceScopeFactory serviceScopeFactory)
-        {
-            _serviceScopeFactory = serviceScopeFactory;
-        }
+//        public AiOrderVisitService(IServiceScopeFactory serviceScopeFactory)
+//        {
+//            _serviceScopeFactory = serviceScopeFactory;
+//        }
 
-        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
-        {
-            using var scope = _serviceScopeFactory.CreateScope();
-            var _aivisitService = scope.ServiceProvider.GetRequiredService<IAiVisitService>();
-            var _aivisitRepository = scope.ServiceProvider.GetRequiredService<IRepository<AiOrderVisit>>();
-            var _aiVisitDetailRepository = scope.ServiceProvider.GetRequiredService<IRepository<AiOrderVisitDetail>>();
-            var _orderVisitRepository = scope.ServiceProvider.GetRequiredService<IRepository<OrderVisit>>();
+//        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
+//        {
+//            using var scope = _serviceScopeFactory.CreateScope();
+//            var _aivisitService = scope.ServiceProvider.GetRequiredService<IAiVisitService>();
+//            var _aivisitRepository = scope.ServiceProvider.GetRequiredService<IRepository<AiOrderVisit>>();
+//            var _aiVisitDetailRepository = scope.ServiceProvider.GetRequiredService<IRepository<AiOrderVisitDetail>>();
+//            var _orderVisitRepository = scope.ServiceProvider.GetRequiredService<IRepository<OrderVisit>>();
 
-            int times = 300000;
-            while (!stoppingToken.IsCancellationRequested)
-            {
-                try
-                {
-                    var aivisitList = await _aivisitRepository.Queryable()
-                    .Includes(x => x.AiOrderVisitDetails,d=>d.OrderVisit).Where(x=>x.TaskState == Share.Enums.Ai.EAiOrderVisitTaskState.InProgress).ToListAsync();
-                    if (aivisitList != null)
-                    {
-                        foreach (var aivisit in aivisitList)
-                        {
-                            foreach (var aivisitDetail in aivisit.AiOrderVisitDetails)
-                            {
-                                if (!string.IsNullOrEmpty(aivisit.BatchUid) && !string.IsNullOrEmpty(aivisitDetail.TaskUid))
-                                {
-                                    var res = await _aivisitService.QueryAiVisitTask(aivisit.BatchUid, aivisitDetail.TaskUid, stoppingToken);
-                                    if(res!=null  && res.Status == 4)
-                                    {
-                                        aivisitDetail.AiOrderVisitState = Share.Enums.Ai.EAiOrderVisitState.LoseEfficacy;
-                                        await _aiVisitDetailRepository.UpdateAsync(aivisitDetail,stoppingToken);
-                                        aivisitDetail.OrderVisit.VisitState = Share.Enums.Order.EVisitState.WaitForVisit;
-                                        aivisitDetail.OrderVisit.IsCanAiVisit = true;
-                                        await _orderVisitRepository.UpdateAsync(aivisitDetail.OrderVisit,stoppingToken);
-                                        aivisit.VisitedFailCount++;
-                                        if ((aivisit.VisitedFailCount + aivisit.VisitedCount) == aivisit.HasVisitCount)
-                                        {
-                                            aivisit.TaskState = Share.Enums.Ai.EAiOrderVisitTaskState.Ended;
-                                        }
-                                        await _aivisitRepository.UpdateAsync(aivisit,stoppingToken);
-                                    }
-                                }
+//            int times = 300000;
+//            while (!stoppingToken.IsCancellationRequested)
+//            {
+//                try
+//                {
+//                    var aivisitList = await _aivisitRepository.Queryable()
+//                    .Includes(x => x.AiOrderVisitDetails,d=>d.OrderVisit).Where(x=>x.TaskState == Share.Enums.Ai.EAiOrderVisitTaskState.InProgress).ToListAsync();
+//                    if (aivisitList != null)
+//                    {
+//                        foreach (var aivisit in aivisitList)
+//                        {
+//                            foreach (var aivisitDetail in aivisit.AiOrderVisitDetails)
+//                            {
+//                                if (!string.IsNullOrEmpty(aivisit.BatchUid) && !string.IsNullOrEmpty(aivisitDetail.TaskUid))
+//                                {
+//                                    var res = await _aivisitService.QueryAiVisitTask(aivisit.BatchUid, aivisitDetail.TaskUid, stoppingToken);
+//                                    if(res!=null  && res.Status == 4)
+//                                    {
+//                                        aivisitDetail.AiOrderVisitState = Share.Enums.Ai.EAiOrderVisitState.LoseEfficacy;
+//                                        await _aiVisitDetailRepository.UpdateAsync(aivisitDetail,stoppingToken);
+//                                        aivisitDetail.OrderVisit.VisitState = Share.Enums.Order.EVisitState.WaitForVisit;
+//                                        aivisitDetail.OrderVisit.IsCanAiVisit = true;
+//                                        await _orderVisitRepository.UpdateAsync(aivisitDetail.OrderVisit,stoppingToken);
+//                                        aivisit.VisitedFailCount++;
+//                                        if ((aivisit.VisitedFailCount + aivisit.VisitedCount) == aivisit.HasVisitCount)
+//                                        {
+//                                            aivisit.TaskState = Share.Enums.Ai.EAiOrderVisitTaskState.Ended;
+//                                        }
+//                                        await _aivisitRepository.UpdateAsync(aivisit,stoppingToken);
+//                                    }
+//                                }
 
-                            }
-                        }
-                    }
+//                            }
+//                        }
+//                    }
                     
-                }
-                catch{}
-                await Task.Delay(times);
-            }
+//                }
+//                catch{}
+//                await Task.Delay(times);
+//            }
            
-        }
-    }
-}
+//        }
+//    }
+//}

+ 0 - 12
src/Hotline.Application/Visit/IOrderVisitApplication.cs

@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Hotline.Application.Visit
-{
-    public interface IOrderVisitApplication
-    {
-    }
-}

+ 0 - 30
src/Hotline.Application/Visit/OrderVisitApplication.cs

@@ -1,30 +0,0 @@
-using Hotline.Ai.Visit;
-using Hotline.Caching.Interfaces;
-using Hotline.Orders;
-using StackExchange.Redis;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using XF.Domain.Constants;
-using XF.Domain.Dependency;
-using XF.Domain.Repository;
-
-namespace Hotline.Application.Visit
-{
-    public class OrderVisitApplication : IOrderVisitApplication, IScopeDependency
-    {
-        private readonly IRepository<AiOrderVisit> _aiOrderVisitRepository;
-        private readonly IAiVisitService _aiVisitService;
-        private readonly ISystemSettingCacheManager _systemSettingCacheManager;
-
-        public OrderVisitApplication(IRepository<AiOrderVisit> aiOrderVisitRepository,IAiVisitService aiVisitService, ISystemSettingCacheManager systemSettingCacheManager)
-        {
-            _aiOrderVisitRepository = aiOrderVisitRepository;
-            _aiVisitService = aiVisitService;
-            _systemSettingCacheManager = systemSettingCacheManager;
-        }
-       
-    }
-}

+ 10 - 0
src/Hotline.Share/Dtos/Identity/LoginDto.cs

@@ -20,5 +20,15 @@ namespace Hotline.Share.Dtos.Identity
         public List<string> LoginImage { get; set; }
 
         public bool IsLoginMessageCode { get; set; }
+
+        /// <summary>
+        /// 应用范围
+        /// </summary>
+        public string AppScope { get; set; }
+
+        /// <summary>
+        /// 呼叫中心类型
+        /// </summary>
+        public string CallCenterType { get; set; }
     }
 }

+ 26 - 0
src/Hotline.Share/Requests/PagedKeywordRequest.cs

@@ -689,3 +689,29 @@ public class AcceptTypeStatisticsDto
     /// </summary>
     public string SumCountRate { get; set; }
 }
+
+public record HotspotAndAcceptTypeStatisticsReq
+{
+	public int HotspotLevel { get; set; }
+
+	public DateTime StartTime { get; set; }
+
+	public DateTime EndTime { get; set; }
+
+	/// <summary>
+	/// 导出列名
+	/// </summary>
+	public List<string> AddColumnName { get; set; } = new();
+
+}
+
+public record HotspotAndAcceptTypeStatisticsDetailReq : PagedRequest
+{
+	public string? AcceptTypeCode { get; set; }
+
+	public string HotspotId { get; set; }
+
+	public DateTime StartTime { get; set; }
+
+	public DateTime EndTime { get; set; }
+}

+ 15 - 15
src/Hotline.YbEnterprise.Sdk/EnterpriseConfig.cs

@@ -1,19 +1,19 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+//using System;
+//using System.Collections.Generic;
+//using System.Linq;
+//using System.Text;
+//using System.Threading.Tasks;
 
-namespace Hotline.YbEnterprise.Sdk
-{
-	public class EnterpriseConfig
-	{
-		public string AddressUrl { get; set; }
+//namespace Hotline.YbEnterprise.Sdk
+//{
+//	public class EnterpriseConfig
+//	{
+//		public string AddressUrl { get; set; }
 
-		public string ClientId { get; set; }
+//		public string ClientId { get; set; }
 
-		public string ClientSecret { get; set; }
+//		public string ClientSecret { get; set; }
 
-		public string TenantId { get; set; }
-	}
-}
+//		public string TenantId { get; set; }
+//	}
+//}

+ 7 - 10
src/Hotline.YbEnterprise.Sdk/EnterpriseService.cs

@@ -1,33 +1,30 @@
 using Hotline.Enterprise;
-using Hotline.Share.Dtos;
-using RestSharp;
-using System.Collections;
 using System.Net.Http.Headers;
 using System.Net.Http.Json;
 using System.Text;
+using Hotline.Configurations;
 using Hotline.Share.Dtos.Enterprise;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using XF.Domain.Cache;
 using XF.Domain.Exceptions;
-using XF.Domain.Dependency;
 
 namespace Hotline.YbEnterprise.Sdk
 {
-    public class EnterpriseService : IEnterpriseService, IScopeDependency
+    public class EnterpriseService : IEnterpriseService
     {
         private readonly IHttpClientFactory _httpClientFactory;
-        private readonly IOptionsSnapshot<EnterpriseConfig> _enterpriseOptions;
+        private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
         private readonly ITypedCache<YbEnterpriseToken> _tokenCache;
         private readonly ILogger<EnterpriseService> _logger;
         public EnterpriseService(
             IHttpClientFactory httpClientFactory,
-            IOptionsSnapshot<EnterpriseConfig> enterpriseOptions,
+            IOptionsSnapshot<AppConfiguration> appOptions,
             ITypedCache<YbEnterpriseToken> tokenCache,
             ILogger<EnterpriseService> logger)
         {
             _httpClientFactory = httpClientFactory;
-            _enterpriseOptions = enterpriseOptions;
+            _appOptions = appOptions;
             _tokenCache = tokenCache;
             _logger = logger;
         }
@@ -49,7 +46,7 @@ namespace Hotline.YbEnterprise.Sdk
                 Current = current,
                 Size = size
             };
-
+            
             var token = await GetTokenAsync(YbEnterpriseDefaults.KeyOfToken, cancellationToken);
             var result = await ExecuteAsync<YbEnterprisesRequest, YbEnterpriseResponse<YbEnterprisePaged>>(
                 YbEnterpriseDefaults.PathEnterprises,
@@ -72,7 +69,7 @@ namespace Hotline.YbEnterprise.Sdk
 
         private async Task<YbEnterpriseToken> GetTokenAsync(CancellationToken cancellationToken)
         {
-            var config = _enterpriseOptions.Value;
+            var config = _appOptions.Value.YiBin.Enterprise;
             string authorization = config.ClientId + ":" + config.ClientSecret;
             authorization = Convert.ToBase64String(Encoding.UTF8.GetBytes(authorization));
             var result = await ExecuteAsync<object, YbEnterpriseResponse<YbEnterpriseToken>>(

+ 1 - 0
src/Hotline.YbEnterprise.Sdk/HotlineYbEnterpriseStartupExtensions.cs

@@ -9,6 +9,7 @@ namespace Hotline.Api.Sdk
     {
         public static IServiceCollection AddYbEnterpriseSdk(this IServiceCollection services, string? baseAddress)
         {
+            services.AddScoped<IEnterpriseService, EnterpriseService>();
             if (!string.IsNullOrEmpty(baseAddress))
                 services.AddHttpClient(YbEnterpriseDefaults.HttpName, d =>
                 {

+ 1 - 0
src/Hotline/CallCenter/Calls/CallDomainService.cs

@@ -1,5 +1,6 @@
 using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Devices;
+using Hotline.Configurations;
 using Hotline.Share.Requests;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Options;

+ 1 - 0
src/Hotline/CallCenter/Ivrs/IvrDomainService.cs

@@ -1,6 +1,7 @@
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Devices;
+using Hotline.Configurations;
 using Hotline.Settings;
 using Hotline.Share.Dtos.CallCenter;
 using Hotline.Share.Enums.CallCenter;

+ 1 - 0
src/Hotline/CallCenter/Manage/VoiceFileDomainService.cs

@@ -1,5 +1,6 @@
 using Hotline.CallCenter.Configs;
 using Hotline.CallCenter.Devices;
+using Hotline.Configurations;
 using Hotline.Share.Requests;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Options;

+ 1 - 0
src/Hotline/CallCenter/Tels/TelDomainService.cs

@@ -12,6 +12,7 @@ using Hotline.CallCenter.Configs;
 using Microsoft.Extensions.Options;
 using Hotline.Share.Dtos.CallCenter;
 using Microsoft.Extensions.DependencyInjection;
+using Hotline.Configurations;
 
 namespace Hotline.CallCenter.Tels;
 

+ 13 - 0
src/Hotline/Configurations/AiQualityConfiguration.cs

@@ -0,0 +1,13 @@
+namespace Hotline.Configurations;
+
+public class AiQualityConfiguration
+{
+    public string Url { get; set; }
+}
+
+public class AiVisitConfiguration
+{
+    public string Url { get; set; }
+    public string Appkey { get; set; }
+    public string ServiceVersion { get; set; }
+}

+ 4 - 3
src/Hotline/AppConfiguration.cs → src/Hotline/Configurations/AppConfiguration.cs

@@ -4,7 +4,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace Hotline
+namespace Hotline.Configurations
 {
     public class AppConfiguration
     {
@@ -27,16 +27,17 @@ namespace Hotline
 
     public class YiBinConfiguration : DefaultAppScopeConfiguration
     {
+        public AiQualityConfiguration AiQuality { get; set; }
+        public AiVisitConfiguration AiVisit { get; set; }
+        public EnterpriseConfiguration Enterprise { get; set; }
     }
 
     public class ZiGongConfiguration : DefaultAppScopeConfiguration
     {
-
     }
 
     public class LuZhouConfiguration : DefaultAppScopeConfiguration
     {
-
     }
 
     public abstract class DefaultAppScopeConfiguration

+ 12 - 0
src/Hotline/Configurations/EnterpriseConfiguration.cs

@@ -0,0 +1,12 @@
+namespace Hotline.Configurations;
+
+public class EnterpriseConfiguration
+{
+    public string AddressUrl { get; set; }
+
+    public string ClientId { get; set; }
+
+    public string ClientSecret { get; set; }
+
+    public string TenantId { get; set; }
+}

+ 1 - 1
src/Hotline/EventBus/EAppScope.cs → src/Hotline/DI/EAppScope.cs

@@ -1,4 +1,4 @@
-namespace Hotline.EventBus;
+namespace Hotline.DI;
 
 /// <summary>
 /// 适用范围(prop名称与appsettings.json保持一致)

+ 55 - 0
src/Hotline/DI/InjectionAttribute.cs

@@ -0,0 +1,55 @@
+using Hotline.Configurations;
+
+namespace Hotline.DI
+{
+    [AttributeUsage(AttributeTargets.Class)]
+    public class InjectionAttribute : Attribute
+    {
+        /// <summary>
+        /// 适用范围
+        /// </summary>
+        public EAppScope AppScopes { get; set; }
+
+        /// <summary>
+        /// 是否启用
+        /// </summary>
+        public bool Enable { get; set; } = true;
+
+        /// <summary>
+        /// handler的业务类型
+        /// </summary>
+        public EEventHandlerType EventHandlerType { get; set; }
+
+        /// <summary>
+        /// value,value
+        /// </summary>
+        public string Label { get; set; }
+
+        public bool IsEnable(string? appScope, string? callcenterType)
+        {
+            if (!Enable) return false;
+            if (!string.IsNullOrEmpty(appScope))
+            {
+                return AppScopes.ToString()
+                    .Split(',', StringSplitOptions.RemoveEmptyEntries)
+                    .Any(x => string.Compare(x, appScope, StringComparison.Ordinal) == 0);
+            }
+
+            if (!string.IsNullOrEmpty(callcenterType))
+            {
+                switch (EventHandlerType)
+                {
+                    case EEventHandlerType.CallCenter:
+                        return Label == callcenterType;
+                }
+            }
+
+            return true;
+        }
+    }
+
+    public enum EEventHandlerType
+    {
+        CallCenter = 1
+    }
+}

+ 0 - 37
src/Hotline/EventBus/HandlerInjectAttribute.cs

@@ -1,37 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Hotline.EventBus
-{
-    [AttributeUsage(AttributeTargets.Class)]
-    public class HandlerInjectAttribute : Attribute
-    {
-        /// <summary>
-        /// 适用范围
-        /// </summary>
-        public EAppScope AppScopes { get; set; }
-
-        /// <summary>
-        /// 是否启用
-        /// </summary>
-        public bool Enable { get; set; } = true;
-
-        /// <summary>
-        /// handler的业务类型
-        /// </summary>
-        public EEventHandlerType EventHandlerType { get; set; }
-
-        /// <summary>
-        /// value,value
-        /// </summary>
-        public string Label { get; set; }
-    }
-
-    public enum EEventHandlerType
-    {
-        CallCenter = 1
-    }
-}

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

@@ -156,7 +156,7 @@ namespace Hotline.FlowEngine.Workflows
         /// 创建开始节点
         /// </summary>
         WorkflowStep CreateStartStep(Workflow workflow, StepDefine startStepDefine, BasicWorkflowDto dto,
-            FlowStepHandler handler, DateTime? expiredTime);
+            FlowStepHandler handler, DateTime? expiredTime, EFlowAssignType? flowAssignType = EFlowAssignType.User);
 
         /// <summary>
         /// 查询未完成节点

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

@@ -179,7 +179,7 @@ namespace Hotline.FlowEngine.Workflows
 
             //publish
             await _publisher.PublishAsync(new StartWorkflowNotify(workflow, dto, flowAssignInfo, trace),
-                PublishStrategy.ParallelNoWait, cancellationToken);
+                PublishStrategy.ParallelWhenAll, cancellationToken);
         }
 
         public async Task<Workflow> GetWorkflowAsync(string workflowId,
@@ -539,7 +539,7 @@ namespace Hotline.FlowEngine.Workflows
 
             await _publisher.PublishAsync(
                 new NextStepNotify(workflow, dto, flowAssignInfo, trace, nextStepDefine,
-                    current.RequiredOrgId, expiredTime.HasValue), PublishStrategy.ParallelNoWait,
+                    current.RequiredOrgId, expiredTime.HasValue), PublishStrategy.ParallelWhenAll,
                 cancellationToken);
         }
 
@@ -1283,7 +1283,7 @@ namespace Hotline.FlowEngine.Workflows
             workflow.Terminate(dto.Opinion);
             await _workflowRepository.UpdateAsync(workflow, cancellationToken);
 
-            await _publisher.PublishAsync(new TerminalWorkflowNotify(workflow), PublishStrategy.ParallelNoWait,
+            await _publisher.PublishAsync(new TerminalWorkflowNotify(workflow), PublishStrategy.ParallelWhenAll,
                 cancellationToken);
         }
 
@@ -1385,7 +1385,7 @@ namespace Hotline.FlowEngine.Workflows
             var endTrace = await EndAsync(workflow, basicDto, endStepDefine, currentStep, current,
                 expiredTime, cancellationToken: cancellationToken);
 
-            await _publisher.PublishAsync(new CancelWorkflowNotify(workflow), PublishStrategy.ParallelNoWait,
+            await _publisher.PublishAsync(new CancelWorkflowNotify(workflow), PublishStrategy.ParallelWhenAll,
                 cancellationToken);
         }
 
@@ -1406,7 +1406,8 @@ namespace Hotline.FlowEngine.Workflows
         /// 创建开始节点
         /// </summary>
         public WorkflowStep CreateStartStep(Workflow workflow, StepDefine startStepDefine,
-            BasicWorkflowDto dto, FlowStepHandler handler, DateTime? expiredTime)
+            BasicWorkflowDto dto, FlowStepHandler handler, DateTime? expiredTime,
+            EFlowAssignType? flowAssignType = EFlowAssignType.User)
         {
             //startstep
             var nextSteps = _mapper.Map<List<StepSimple>>(startStepDefine.NextSteps);
@@ -1419,7 +1420,7 @@ namespace Hotline.FlowEngine.Workflows
 
             var startStep = _mapper.Map<WorkflowStep>(startStepDefine);
             _mapper.Map(workflow, startStep);
-            startStep.FlowAssignType = EFlowAssignType.Org;
+            startStep.FlowAssignType = flowAssignType;
             startStep.Handlers = new List<Kv> { new(handler.Key, handler.Value) };
             //startStep.StepHandlers = stepHandlers;
             startStep.NextSteps = nextSteps;
@@ -1588,9 +1589,9 @@ namespace Hotline.FlowEngine.Workflows
 
         private async Task<WorkflowStep> CreateStartStepAsync(Workflow workflow, StepDefine startStepDefine,
             BasicWorkflowDto dto, FlowStepHandler handler, EWorkflowTraceType traceType,
-            DateTime? expiredTime, CancellationToken cancellationToken)
+            DateTime? expiredTime, EFlowAssignType? flowAssignType, CancellationToken cancellationToken)
         {
-            var startStep = CreateStartStep(workflow, startStepDefine, dto, handler, expiredTime);
+            var startStep = CreateStartStep(workflow, startStepDefine, dto, handler, expiredTime, flowAssignType);
             await _workflowStepRepository.AddAsync(startStep, cancellationToken);
             //await _workflowStepRepository.AddNav(startStep)
             //    .Include(d => d.StepHandlers)
@@ -1786,7 +1787,7 @@ namespace Hotline.FlowEngine.Workflows
             //create trace
             await CreateTraceAsync(workflow, countersignEndStep, EWorkflowTraceType.Normal, cancellationToken);
 
-            await _publisher.PublishAsync(new CountersignEndAssigned(workflow), PublishStrategy.ParallelNoWait,
+            await _publisher.PublishAsync(new CountersignEndAssigned(workflow), PublishStrategy.ParallelWhenAll,
                 cancellationToken);
             //}
 
@@ -1960,9 +1961,14 @@ namespace Hotline.FlowEngine.Workflows
             {
                 //newStep.FlowAssignType = EFlowAssignType.User;
                 // 是否中心  临时紧急修改 后续在流程模版定义是否原办理人退回类型 来实现流程 禅道200
-                newStep.FlowAssignType = !step.HandlerOrgIsCenter!.Value ? EFlowAssignType.Org : EFlowAssignType.Role;
-                if (newStep is { FlowAssignType: EFlowAssignType.Role, BusinessType: EBusinessType.Send })
-                    newStep.FlowAssignType = EFlowAssignType.User;
+                newStep.FlowAssignType = step.HandlerOrgIsCenter!.Value
+                    ? step.BusinessType is EBusinessType.Send
+                        ? EFlowAssignType.User
+                        : EFlowAssignType.Role
+                    : EFlowAssignType.Org;
+                //if (newStep is { FlowAssignType: EFlowAssignType.Role, BusinessType: EBusinessType.Send })
+                //    newStep.FlowAssignType = EFlowAssignType.User;
+
                 newStep.Assign(step.HandlerId, step.HandlerName, step.HandlerOrgId, step.HandlerOrgName, step.RoleId, step.RoleName);
             }
 
@@ -2235,7 +2241,7 @@ namespace Hotline.FlowEngine.Workflows
 
             var targetStepNew = targetIsStartStep
                 ? await CreateStartStepAsync(workflow, targetStepDefine, dto,
-                    dto.NextHandlers.First(), traceType, expiredTime, cancellationToken)
+                    dto.NextHandlers.First(), traceType, expiredTime, EFlowAssignType.Org, cancellationToken)
                 : (await CreateStepsAsync(workflow, targetStepDefine, targetPrevStep, dto,
                     flowAssignInfo.FlowAssignType, dto.NextHandlers,
                     null, EWorkflowStepStatus.WaitForAccept, ECountersignPosition.None, true, traceType,

+ 2 - 76
src/Hotline/Push/FWMessage/PushDomainService.cs

@@ -27,25 +27,20 @@ public class PushDomainService : IPushDomainService, IScopeDependency
     private readonly IMapper _mapper;
     private readonly IRepository<MessageTemplate> _messageTemplateRepository;
     private readonly ICapPublisher _capPublisher;
-    private readonly IHttpClientFactory _httpClientFactory;
     private readonly ILogger<PushDomainService> _logger;
-
+    
     /// <summary>
     /// 
     /// </summary>
     /// <param name="messageRepository"></param>
     /// <param name="mapper"></param>
-    /// <param name="mediator"></param>
     /// <param name="messageTemplateRepository"></param>
     /// <param name="capPublisher"></param>
-    /// <param name="httpClientFactory"></param>
     /// <param name="logger"></param>
-    /// <param name="sendSmsConfiguration"></param>
     public PushDomainService(IRepository<Message> messageRepository,
         IMapper mapper,
         IRepository<MessageTemplate> messageTemplateRepository,
         ICapPublisher capPublisher,
-        IHttpClientFactory httpClientFactory,
         ILogger<PushDomainService> logger
         )
     {
@@ -53,7 +48,6 @@ public class PushDomainService : IPushDomainService, IScopeDependency
         _mapper = mapper;
         _messageTemplateRepository = messageTemplateRepository;
         _capPublisher = capPublisher;
-        _httpClientFactory = httpClientFactory;
         _logger = logger;
     }
     #endregion
@@ -115,15 +109,6 @@ public class PushDomainService : IPushDomainService, IScopeDependency
         };
         //消息队列
         await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.SendSms, pushMessage, cancellationToken: cancellation);
-
-        ////http请求
-        //var result = await ExecuteAsync<PushMessageDto, SendSmsReponse>(_sendSmsConfiguration.Value.Url, pushMessage, cancellationToken: cancellation);
-        //if (result != null && result.code == 0)
-        //{
-        //    message.Status = EPushStatus.Success;
-        //    message.SendState = ESendState.Sending;
-        //    await _messageRepository.UpdateAsync(message, cancellation);
-        //}
     }
 
     /// <summary>
@@ -191,64 +176,5 @@ public class PushDomainService : IPushDomainService, IScopeDependency
             await _messageRepository.UpdateAsync(data, cancellation);
         }
     }
-
-    /// <summary>
-    /// 
-    /// </summary>
-    /// <typeparam name="TRequest"></typeparam>
-    /// <typeparam name="TResponse"></typeparam>
-    /// <param name="path"></param>
-    /// <param name="request"></param>
-    /// <param name="clientInitialize"></param>
-    /// <param name="cancellationToken"></param>
-    /// <returns></returns>
-    private async Task<TResponse?> ExecuteAsync<TRequest, TResponse>(string path, TRequest request,
-            Action<HttpClient>? clientInitialize = null, CancellationToken cancellationToken = default)
-    {
-        var client = _httpClientFactory.CreateClient("sendwaitsms");
-        clientInitialize?.Invoke(client);
-
-        using var responseMessage = await client.PostAsJsonAsync(path, request, cancellationToken);
-        responseMessage.EnsureSuccessStatusCode();
-        var result = await responseMessage.Content.ReadFromJsonAsync<TResponse>(cancellationToken: cancellationToken);
-        return result;
-    }
-
-
-    #region http请求
-
-    /// <summary>
-    /// 封装使用HttpClient调用WebService
-    /// </summary>
-    /// <param name="url">URL地址</param>
-    /// <param name="content">参数</param>
-    /// <returns></returns>
-    private async Task<string> PostHelper(string url, HttpContent content)
-    {
-        _logger.LogInformation($"准备推送短信, {nameof(PostHelper)}");
-        var result = string.Empty;
-        try
-        {
-            using var client = _httpClientFactory.CreateClient();
-            using (var response = await client.PostAsync(url, content))
-            {
-                if (response.StatusCode == HttpStatusCode.OK)
-                {
-                    result = await response.Content.ReadAsStringAsync();
-                    XmlDocument doc = new XmlDocument();
-                    doc.LoadXml(result);
-                    result = doc.InnerText;
-                }
-            }
-        }
-        catch (Exception ex)
-        {
-            _logger.LogError(ex.InnerException?.Message);
-            result = ex.Message;
-        }
-        _logger.LogInformation($"推送响应:{result}");
-        return result;
-    }
-
-    #endregion
+    
 }

+ 1 - 0
src/Hotline/Users/UserDomainService.cs

@@ -11,6 +11,7 @@ using XF.Domain.Dependency;
 using XF.Domain.Exceptions;
 using XF.Domain.Repository;
 using Microsoft.Extensions.DependencyInjection;
+using Hotline.Configurations;
 
 namespace Hotline.Users
 {

+ 11 - 8
src/XF.Domain/Dependency/DependencyInjectionExtensions.cs

@@ -6,35 +6,38 @@ namespace XF.Domain.Dependency;
 
 public static class DependencyInjectionExtensions
 {
-    public static IServiceCollection BatchInjectServices(this IServiceCollection services)
+    public static IServiceCollection BatchInjectServices(this IServiceCollection services, Func<Type, bool>? predicate = null)
     {
         var assemblies = GetAllAssembly();
 
-        InjectConventionServices(services, assemblies);
-        InjectBackgroundServices(services, assemblies);
+        predicate ??= d => true;
+        InjectConventionServices(services, assemblies, predicate);
+        InjectBackgroundServices(services, assemblies, predicate);
 
         return services;
     }
 
-    private static void InjectBackgroundServices(IServiceCollection services, List<Assembly> assemblies)
+    private static void InjectBackgroundServices(IServiceCollection services, List<Assembly> assemblies, Func<Type, bool> predicate)
     {
         var types = assemblies.SelectMany(t => t.GetTypes())
-            .Where(t => typeof(BackgroundService).IsAssignableFrom(t) && t.IsClass && !t.IsAbstract
-            && t.GetInterfaces().All(d => d != typeof(IIgnoreDependency))).ToList();
+            .Where(t => typeof(BackgroundService).IsAssignableFrom(t) &&
+                        t.IsClass && !t.IsAbstract && predicate(t) &&
+                        t.GetInterfaces().All(d => d != typeof(IIgnoreDependency))).ToList();
 
         foreach (var type in types)
         {
             services.AddSingleton(typeof(IHostedService), type);
         }
     }
-    private static void InjectConventionServices(IServiceCollection services, List<Assembly> assemblies)
+    private static void InjectConventionServices(IServiceCollection services, List<Assembly> assemblies, Func<Type, bool> predicate)
     {
         assemblies.SelectMany(d => d.GetTypes())
             .Where(d => d.GetInterfaces().Any(x =>
                 x == typeof(IScopeDependency)
                 || x == typeof(ISingletonDependency)
                 || x == typeof(ITransientDependency))
-                        && d.GetInterfaces().All(x => x != typeof(IIgnoreDependency)))
+                        && d.GetInterfaces().All(x => x != typeof(IIgnoreDependency))
+                        && predicate(d))
             .ToList()
             .ForEach(d => ServiceRegister.Register(services, d));
     }

+ 8 - 4
src/XingTang.Sdk/XingtangSeatOperation.cs

@@ -32,10 +32,14 @@ namespace XingTang.Sdk
         /// </summary>
         public int? ExecutionState { get; set; }
 
-        [SugarColumn(IsIgnore = true)] 
-        public string? ExtutionStateText => ExecutionState.HasValue
-            ? OperationDictionary[ExecutionState.Value]
-            : string.Empty;
+        public string? GetExecutionStateText()
+        {
+            if(!ExecutionState.HasValue) return string.Empty;
+            
+            return OperationDictionary.TryGetValue(ExecutionState.Value, out var text)
+                ? text
+                : "未知";
+        }
 
         /// <summary>
         /// 操作时间