Kaynağa Gözat

config update

admin 1 yıl önce
ebeveyn
işleme
d5dc23bd7a

+ 43 - 8
src/Hotline.Api/Controllers/OrderController.cs

@@ -17,6 +17,8 @@ using MapsterMapper;
 using MediatR;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore.Migrations.Operations;
+using MongoDB.Driver.Linq;
 using System.Runtime.CompilerServices;
 using XF.Domain.Authentications;
 using XF.Domain.Exceptions;
@@ -68,6 +70,46 @@ public class OrderController : BaseController
         _mediator = mediator;
     }
 
+    /// <summary>
+    /// 查询(工单发布)
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <returns></returns>
+    [HttpGet("publish-order-list")]
+    public async Task<PagedDto<PublishDto>> PublishOrderList([FromQuery] QueryOrderPublishDto dto)
+    {
+        var (total,items) = await _orderRepository.Queryable()
+            .Includes(d => d.OrderPublished)
+            .Includes(d=>d.Employee)
+            .WhereIF(!string.IsNullOrEmpty(dto.OrderTitle), d => d.Title.Contains(dto.OrderTitle!))
+            .WhereIF(dto.PubState == EPubState.Pub, d=> d.Progress == EProgress.Published || d.Progress== EProgress.Visited)
+            .WhereIF(dto.PubState == EPubState.NoPub, d=> d.Progress == EProgress.Managing)
+            .WhereIF(!string.IsNullOrEmpty(dto.PubMan), d => d.Employee.Name.Contains(dto.PubMan!) || d.Employee.StaffNo.Contains(dto.PubMan!))
+            .WhereIF(dto.PubRange!= null,d=>d.OrderPublished.PublishState == dto.PubRange)
+            .WhereIF(dto.AcceptTypes.Any(),d=>dto.AcceptTypes.Contains(d.AcceptType))
+            .WhereIF(dto.HotspotIds.Any(),d=> dto.HotspotIds.Contains(d.HotspotId))
+            .WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart)
+            .WhereIF(dto.CreationTimeEnd.HasValue, d => d.CreationTime <= dto.CreationTimeEnd)
+            .WhereIF(dto.FiledTimeStart.HasValue,d=>d.OrderPublished.CreationTime>= dto.CreationTimeStart)
+            .WhereIF(dto.FiledTimeEnd.HasValue,d=> d.OrderPublished.CreationTime <= dto.CreationTimeEnd)
+            .OrderByDescending(d => d.CreationTime)
+            .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
+
+        return new PagedDto<PublishDto>(total,_mapper.Map<IReadOnlyList<PublishDto>>(items));
+    }
+
+    ///// <summary>
+    ///// 发布工单
+    ///// </summary>
+    ///// <returns></returns>
+    //[HttpPost("publish-order")]
+    //public async Task PublishOrder([FromBody]PublishOrderDto dto)
+    //{
+    //    OrderPublished orderPublished = new OrderPublished();
+    //    orderPublished.PublishState = dto.PublishState;
+    //    orderPublished.ArrangeContent = dto.ArrangeContent;
+    //}
+
     /// <summary>
     /// 工单列表
     /// </summary>
@@ -311,13 +353,6 @@ public class OrderController : BaseController
 
 
 
-
-    //public async Task<PagedDto<PublishDto>> CanPublishOrder([FromQuery] QueryOrderPublishDto dto)
-    //{
-
-
-    //    return null;
-    //}
-
+   
 
 }

+ 2 - 2
src/Hotline.Api/Controllers/ReportController.cs

@@ -10,10 +10,10 @@ namespace Hotline.Api.Controllers;
 [Route("api/report")]
 public class ReportController : ControllerBase
 {
-    private readonly IOptionsSnapshot<DeviceConfigs> _options;
+    private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
     private readonly IDeviceEventHandler _deviceEventHandler;
 
-    public ReportController(IOptionsSnapshot<DeviceConfigs> options, IDeviceEventHandler deviceEventHandler)
+    public ReportController(IOptionsSnapshot<CallCenterConfiguration> options, IDeviceEventHandler deviceEventHandler)
     {
         _options = options;
         _deviceEventHandler = deviceEventHandler;

+ 2 - 2
src/Hotline.Api/Controllers/TestController.cs

@@ -40,7 +40,7 @@ public class TestController : BaseController
 {
     private readonly ILogger<TestController> _logger;
     private readonly IAuthorizeGenerator _authorizeGenerator;
-    private readonly IOptionsSnapshot<DeviceConfigs> _options;
+    private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
     private readonly ISessionContext _sessionContext;
     private readonly IUserRepository _userRepository;
 
@@ -64,7 +64,7 @@ public class TestController : BaseController
         INewRockClient client,
         ILogger<TestController> logger,
         IAuthorizeGenerator authorizeGenerator,
-        IOptionsSnapshot<DeviceConfigs> options,
+        IOptionsSnapshot<CallCenterConfiguration> options,
         ISessionContext sessionContext,
         IUserRepository userRepository,
         //ICacheManager<User> cache

+ 82 - 82
src/Hotline.Api/Controllers/TestSdkController.cs

@@ -24,12 +24,12 @@ namespace Hotline.Api.Controllers
     {
         private readonly INewRockClient _client;
         private readonly ILogger<TestController> _logger;
-        private readonly IOptionsSnapshot<DeviceConfigs> _options;
+        private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
 
         public TestSdkController(
             INewRockClient client,
             ILogger<TestController> logger,
-            IOptionsSnapshot<DeviceConfigs> options
+            IOptionsSnapshot<CallCenterConfiguration> options
             )
         {
             _client = client;
@@ -48,8 +48,8 @@ namespace Hotline.Api.Controllers
         {
             var result = await _client.QueryDeviceInfo(
                 new QueryDeviceInfoRequest { Attribute = "Query", DeviceInfo = string.Empty },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<QueryDeviceInfoResponse?>(result));
         }
@@ -64,8 +64,8 @@ namespace Hotline.Api.Controllers
         {
             var result = await _client.QueryExt(
                 new QueryExtRequest() { Attribute = "Query", Ext = new Ext() { Id = extid } },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted
             );
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<QueryExtResponse?>(result));
@@ -83,8 +83,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Query",
                 Group = new QueryExtGroup() { Id = groupid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<QueryExtGroupResponse?>(result));
         }
@@ -101,8 +101,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Query",
                 Menu = new QueryMenuMenu() { Id = menuid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<QueryMenuResponse?>(result));
         }
@@ -121,8 +121,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Query",
                 Trunk = new QueryTrunkTrunk() { Id = trunkid }
             },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+               _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<QueryTrunkResponse?>(result));
         }
@@ -139,8 +139,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Query",
                 Visitor = new QueryVisitorVisitor() { Id = visitorid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<QueryVisitorResponse?>(result));
         }
@@ -158,8 +158,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Query",
                 Outer = new QueryOuterOuter() { Id = outerid }
             },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+               _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<QueryOuterResponse?>(result));
         }
@@ -183,8 +183,8 @@ namespace Hotline.Api.Controllers
                 {
                     Id = extid
                 },
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -203,8 +203,8 @@ namespace Hotline.Api.Controllers
                 {
                     Id = visitorId
                 }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -223,8 +223,8 @@ namespace Hotline.Api.Controllers
                 {
                     Id = outerId
                 }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -261,8 +261,8 @@ namespace Hotline.Api.Controllers
                     Api = "7"
                 }
             },
-            _options.Value.ReceiveKey,
-            _options.Value.Expired,
+           _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
             HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<AssginConfigExtResponse?>(result));
         }
@@ -289,8 +289,8 @@ namespace Hotline.Api.Controllers
                         "210"
                     }
                 }
-            }, _options.Value.ReceiveKey,
-            _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
             HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<AssginConfigGroupResponse?>(result));
         }
@@ -313,8 +313,8 @@ namespace Hotline.Api.Controllers
                     Repeat = "3",
                     InfoLength = "5",
                 }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -333,8 +333,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Hold",
                 Ext = new Ext() { Id = extid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             //_logger.LogInformation(result.Manufacturer);
         }
@@ -350,8 +350,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Unhold",
                 Ext = new Ext() { Id = extid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -371,8 +371,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Mute",
                 Ext = new Ext() { Id = extid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -388,8 +388,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Unmute",
                 Ext = new Ext() { Id = extid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -414,8 +414,8 @@ namespace Hotline.Api.Controllers
                         new ExtToExtExt() { Id = fromextid },
                         new ExtToExtExt() { Id = toextid }
                     }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize(result));
         }
@@ -433,8 +433,8 @@ namespace Hotline.Api.Controllers
                 Ext = new ExtToOuterExtRequest() { Id = fromextid },
                 Outer = new ExtToOuterOuterRequest() { To = to }
             },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+               _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -450,8 +450,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Connect",
                 Visitor = new VisitorToExtVisitor() { Id = visid },
                 Ext = new VisitorToExtExt() { Id = toextid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -471,8 +471,8 @@ namespace Hotline.Api.Controllers
                 Visitor = new VisitorToOuterVisitor() { Id = visid },
                 Outer = new VisitorToOuterOuter() { To = outerphonenum, Display = display },
 
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -490,8 +490,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Connect",
                 Visitor = new VisitorToMenuVisitor() { Id = visid },
                 Menu = new VisitorToMenuMenu() { Id = menuid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -510,8 +510,8 @@ namespace Hotline.Api.Controllers
                 Outer = new OuterToExtOuter() { Id = outer },
                 Ext = new OuterToExtExt() { Id = extid }
             },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+               _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -529,8 +529,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Connect",
                 Outer = new List<OuterToOuterOuterModel>() { new OuterToOuterOuterModel() { Id = outerid }, new OuterToOuterOuterModel() { To = outerphonenum } },
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -548,8 +548,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Connect",
                 Outer = new OuterToMenuOuter() { Id = outerid },
                 Menu = new OuterToMenuMenu() { Id = menuid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -567,8 +567,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Connect",
                 Menu = new MenuToExtMenu() { Id = menuid },
                 Ext = new MenuToExtExt() { Id = extid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -586,8 +586,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Connect",
                 Menu = new MenuToOuterMenu() { Id = menuid },
                 Outer = new MenuToOuterOuter() { To = outernum }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -609,8 +609,8 @@ namespace Hotline.Api.Controllers
                         new TwoWayOuterOuter(){ To = outerone},
                         new TwoWayOuterOuter(){ To = outertwo}
                     }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -630,8 +630,8 @@ namespace Hotline.Api.Controllers
                 Ext = new VoiceNewsFlashExt() { Id = extid }
             };
 
-            var result = await _client.VoiceNewsFlash(model, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            var result = await _client.VoiceNewsFlash(model, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -651,8 +651,8 @@ namespace Hotline.Api.Controllers
                 Visitor = new VoiceNewsFlashVisitor() { Id = visiitorid }
             };
 
-            var result = await _client.VoiceNewsFlash(model, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            var result = await _client.VoiceNewsFlash(model, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -672,8 +672,8 @@ namespace Hotline.Api.Controllers
                 Outer = new VoiceNewsFlashOuter() { Id = outerid }
             };
 
-            var result = await _client.VoiceNewsFlash(model, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            var result = await _client.VoiceNewsFlash(model, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -695,8 +695,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Conference",
                 Ext = new ConferenceMeetingExt() { Id = extid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -719,8 +719,8 @@ namespace Hotline.Api.Controllers
                 Attribute = "Queue",
                 Visitor = new VisitorToExtQueueVisitor() { Id = visitorid },
                 Ext = new VisitorToExtQueueExt() { Id = extid }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -739,8 +739,8 @@ namespace Hotline.Api.Controllers
                 Visitor = new VisitorToGroupQueueVisitor() { Id = visitorid },
                 Group = new VisitorToGroupQueueGroup() { Id = groupid }
             },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+               _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -762,8 +762,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Query",
                 VoiceFile = ""
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
             _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize<VoiceQueryListResponse?>(result));
         }
@@ -780,8 +780,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Remove",
                 VoiceFile = voiceFile
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 HttpContext.RequestAborted);
         }
 
@@ -802,8 +802,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Monitor",
                 Exts = new List<Ext>() { new Ext() { Id = firstTelNo }, new Ext() { Id = secondTelNo } }
-            }, _options.Value.ReceiveKey,
-             _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
              HttpContext.RequestAborted) ;
         }
 
@@ -822,8 +822,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Talk",
                 Ext = new Ext() { Id=telNo }
-            }, _options.Value.ReceiveKey,
-              _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
               HttpContext.RequestAborted);
         }
 
@@ -842,8 +842,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "Listen",
                 Ext = new Ext() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-             _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
              HttpContext.RequestAborted);
         }
 
@@ -869,8 +869,8 @@ namespace Hotline.Api.Controllers
             {
                 Attribute = "BargeinExt",
                 Exts = new List<Ext>() { new Ext() { Id=firstTelNo },new Ext() { Id=secondTelNo } }
-            },_options.Value.ReceiveKey,
-             _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
              HttpContext.RequestAborted);
         }
 

+ 2 - 1
src/Hotline.Api/StartupExtensions.cs

@@ -33,8 +33,9 @@ internal static class StartupExtensions
         builder.WebHost.UseUrls("http://*:50100");
 #endif
 
-        services.Configure<DeviceConfigs>(d => configuration.GetSection(nameof(DeviceConfigs)).Bind(d));
+        //services.Configure<DeviceConfigs>(d => configuration.GetSection(nameof(DeviceConfigs)).Bind(d));
         services.Configure<IdentityConfiguration>(d => configuration.GetSection(nameof(IdentityConfiguration)).Bind(d));
+        services.Configure<CallCenterConfiguration>(d => configuration.GetSection(nameof(CallCenterConfiguration)).Bind(d));
 
         // Add services to the container.
         services

+ 9 - 6
src/Hotline.Api/config/appsettings.Development.json

@@ -1,11 +1,14 @@
 {
   "AllowedHosts": "*",
-  "DeviceConfigs": {
-    "Address": "http://192.168.100.100/xml",
-    "Authorize": true,
-    "ReceiveKey": "E1BBD1BB-A269-44",
-    "SendKey": "2A-BA92-160A3B1D",
-    "Expired": 86300 //认证过期时间(秒)
+  "CallCenterConfiguration": {
+    "CallCenterType": "XunShi",
+    "DeviceConfigs": {
+      "Address": "http://192.168.100.100/xml",
+      "Authorize": true,
+      "ReceiveKey": "E1BBD1BB-A269-44",
+      "SendKey": "2A-BA92-160A3B1D",
+      "Expired": 86300 //认证过期时间(秒)
+    }
   },
   "ConnectionStrings": {
     "Hotline": "PORT=5432;DATABASE=hotline;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;",

+ 11 - 11
src/Hotline.Application/Handlers/CallCenter/BaseHandler.cs

@@ -15,11 +15,11 @@ namespace Hotline.Application.Handlers.CallCenter
     public class BaseHandler
     {
         private readonly INewRockClient _newRockClient;
-        private readonly IOptionsSnapshot<DeviceConfigs> _options;
+        private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
         private readonly ICallRepository _callRepository;
         private readonly ICallCacheManager _callCacheManager;
         private readonly IRealtimeService _realtimeService;
-        public BaseHandler(INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options,ICallRepository callRepository,ICallCacheManager callCacheManager,IRealtimeService realtimeService)
+        public BaseHandler(INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> options,ICallRepository callRepository,ICallCacheManager callCacheManager,IRealtimeService realtimeService)
         {
             _newRockClient = newRockClient;
             _options = options;
@@ -47,7 +47,7 @@ namespace Hotline.Application.Handlers.CallCenter
                                     Menu = new OuterToMenuMenu() { Id = tomenuId },
                                     Outer = new OuterToMenuOuter() { Id = model.ConversationId },
                                     //VoiceFile = string.IsNullOrEmpty(ivrAnswer.PreVoice) ? "" : ivrAnswer.PreVoice,
-                                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                             case ECallType.VisitorCallIn:
                                 await _newRockClient.VisitorToMenu(new VisitorToMenuRequest()
@@ -56,7 +56,7 @@ namespace Hotline.Application.Handlers.CallCenter
                                     Menu = new VisitorToMenuMenu() { Id = tomenuId },
                                     Visitor = new VisitorToMenuVisitor() { Id = model.ConversationId },
                                     //VoiceFile = string.IsNullOrEmpty(ivrAnswer.PreVoice) ? "" : ivrAnswer.PreVoice,
-                                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                             default:
                                 throw new ArgumentOutOfRangeException();
@@ -80,7 +80,7 @@ namespace Hotline.Application.Handlers.CallCenter
                                     Attribute = "Queue",
                                     Ext = new VisitorToExtQueueExt() { Id = telNo },
                                     Visitor = new VisitorToExtQueueVisitor() { Id = model.ConversationId }
-                                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                             case ECallType.ExtToOuter:
                                 await _newRockClient.OuterToExt(new OuterToExtRequest()
@@ -88,7 +88,7 @@ namespace Hotline.Application.Handlers.CallCenter
                                     Attribute = "Connect",
                                     Ext = new OuterToExtExt() { Id = telNo },
                                     Outer = new OuterToExtOuter() { Id = model.ConversationId }
-                                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                             default:
                                 throw new ArgumentOutOfRangeException();
@@ -103,7 +103,7 @@ namespace Hotline.Application.Handlers.CallCenter
                             Attribute = "Queue",
                             Group = new VisitorToGroupQueueGroup() { Id = groupId },
                             Visitor = new VisitorToGroupQueueVisitor() { Id = model.ConversationId }
-                        }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                        }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
 
                         //处理队列记录
                         _callCacheManager.AddCallCache(model);
@@ -125,7 +125,7 @@ namespace Hotline.Application.Handlers.CallCenter
                                         //TODO DISPLAY属性待定
                                     }
                                 },
-                                    _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                    _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                             case ECallType.ExtToOuter:
                                 await _newRockClient.OuterToOuter(new OuterToOuterRequest()
@@ -135,7 +135,7 @@ namespace Hotline.Application.Handlers.CallCenter
                                         new(){Id = model.ConversationId},
                                             new(){To = phoneNo},
                                         }
-                                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                             default:
                                 throw new ArgumentOutOfRangeException();
@@ -150,14 +150,14 @@ namespace Hotline.Application.Handlers.CallCenter
                                 {
                                     Attribute = "Clear",
                                     Visitor = new ClearCallVisitor() { Id = model.ConversationId },
-                                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                             case ECallType.ExtToOuter:
                                 await _newRockClient.ClearCall(new ClearCallRequest()
                                 {
                                     Attribute = "Clear",
                                     Outer = new ClearCallOuter() { Id = model.ConversationId },
-                                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                                 break;
                         }
                         break;

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

@@ -18,7 +18,7 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
         private readonly ICallDetailRepository _callDetailRepository;
 
 
-        public DtmfNotificationHandler(IIvrDomainService ivrDomainService, ICallDetailRepository callDetailRepository, ICallRepository callRepository, INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options,ICallCacheManager callCacheManager,IRealtimeService realtimeService) :base(newRockClient, options,callRepository, callCacheManager,realtimeService)
+        public DtmfNotificationHandler(IIvrDomainService ivrDomainService, ICallDetailRepository callDetailRepository, ICallRepository callRepository, INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> options,ICallCacheManager callCacheManager,IRealtimeService realtimeService) :base(newRockClient, options,callRepository, callCacheManager,realtimeService)
         {
             _ivrDomainService = ivrDomainService;
             _callDetailRepository = callDetailRepository;

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

@@ -16,7 +16,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         private readonly ICallRepository _callRepository;
         private readonly ICallDetailRepository _callDetailRepository;
         private readonly IIvrDomainService _ivrDomainService;
-        public EndOfAnnOuterToMenuNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IIvrDomainService ivrDomainService, INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options,ICallCacheManager callCacheManager,IRealtimeService realtimeService) : base(newRockClient, options,callRepository,callCacheManager, realtimeService)
+        public EndOfAnnOuterToMenuNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IIvrDomainService ivrDomainService, INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> options,ICallCacheManager callCacheManager,IRealtimeService realtimeService) : base(newRockClient, options,callRepository,callCacheManager, realtimeService)
         {
             _callRepository = callRepository;
             _callDetailRepository = callDetailRepository;

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

@@ -18,7 +18,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         private readonly ICallDetailRepository _callDetailRepository;
         private readonly IIvrDomainService _ivrDomainService;
 
-        public EndOfAnnVisitorToMenuNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IIvrDomainService ivrDomainService,INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options,ICallCacheManager callCacheManager,IRealtimeService realtimeService):base(newRockClient,options,callRepository,callCacheManager, realtimeService)
+        public EndOfAnnVisitorToMenuNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IIvrDomainService ivrDomainService,INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> options,ICallCacheManager callCacheManager,IRealtimeService realtimeService):base(newRockClient,options,callRepository,callCacheManager, realtimeService)
         {
             _callRepository = callRepository;
             _callDetailRepository = callDetailRepository;

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

@@ -26,7 +26,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         private readonly ISystemSettingCacheManager _systemSettingCacheManager;
         private readonly IIvrCacheManager _ivrCacheManager;
         private readonly INewRockClient _newRockClient;
-        private readonly IOptionsSnapshot<DeviceConfigs> _options;
+        private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
         private readonly ITypedCache<List<TrunkIvrManager>> _worktimeCache;
         private readonly ILogger<IncomingNotificationHandler> _logger;
         private readonly ITrunkIvrManagerRepository _trunkIvrManagerRepository;
@@ -39,7 +39,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
             ISystemSettingCacheManager systemSettingCacheManager,
             IIvrCacheManager ivrCacheManager,
             INewRockClient newRockClient,
-            IOptionsSnapshot<DeviceConfigs> options,
+            IOptionsSnapshot<CallCenterConfiguration> options,
             ITypedCache<List<TrunkIvrManager>> worktimeCache,
             ILogger<IncomingNotificationHandler> logger,
             ITrunkIvrManagerRepository trunkIvrManagerRepository,
@@ -105,7 +105,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
                                     Menu = new VisitorToMenuMenu() { Id = ivr.No },
                                     Visitor = new VisitorToMenuVisitor() { Id = notification.Visitor.Id }
                                 },
-                                _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                                _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
 
                             //写入进入IVR流程
                             model.InIvrTime = DateTime.Now;
@@ -131,7 +131,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
                                 Visitor = new VisitorToGroupQueueVisitor() { Id = notification.Visitor.Id },
                                 Group = new VisitorToGroupQueueGroup() { Id = correct.ReturnValue }
                             },
-                            _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                            _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
                             model.InQueueTime = DateTime.Now;
                             await _callRepository.UpdateAsync(model, cancellationToken);
                             //处理队列记录

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

@@ -21,9 +21,9 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         private readonly IUserCacheManager _userCacheManager;
         private readonly IBlacklistDomainService _blacklistDomainService;
         private readonly INewRockClient _newRockClient;
-        private readonly IOptionsSnapshot<DeviceConfigs> _options;
+        private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
         private readonly IOptionsSnapshot<WorkTimeSettings> _workTimeOptions;
-        public InviteNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IUserCacheManager userCacheManager, IBlacklistDomainService blacklistDomainService, INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options, IOptionsSnapshot<WorkTimeSettings> workTimeOptions)
+        public InviteNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IUserCacheManager userCacheManager, IBlacklistDomainService blacklistDomainService, INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> options, IOptionsSnapshot<WorkTimeSettings> workTimeOptions)
         {
             _callRepository = callRepository;
             _callDetailRepository = callDetailRepository;
@@ -89,14 +89,14 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
                     {
                         Id = notification.Visitor.Id
                     }
-                }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
             }
             else
             {
                 await _newRockClient.AcceptVisitor(
                     new AcceptVisitorRequest()
                     { Attribute = "Accept", Visitor = new AcceptVisitorModel() { Id = notification.Visitor.Id } },
-                    _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                    _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
             }
         }
     }

+ 87 - 87
src/Hotline.NewRock/DeviceManager.cs

@@ -26,14 +26,14 @@ namespace Hotline.NewRock
     {
         private readonly INewRockClient _newRockClient;
         private readonly ICallRepository _callRepository;
-        private readonly IOptionsSnapshot<DeviceConfigs> _options;
+        private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
         private readonly IMapper _mapper;
         private readonly ITelGroupRepository _telGroupRepository;
         private readonly IUserCacheManager _userCacheManager;
         private readonly ITelRestRepository _telRestRepository;
         private readonly ITelCacheManager _telCacheManager;
 
-        public DeviceManager(INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options, IMapper mapper, ICallRepository callRepository, ITelGroupRepository telGroupRepository,IUserCacheManager userCacheManager, ITelRestRepository telRestRepository, ITelCacheManager telCacheManager)
+        public DeviceManager(INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> options, IMapper mapper, ICallRepository callRepository, ITelGroupRepository telGroupRepository,IUserCacheManager userCacheManager, ITelRestRepository telRestRepository, ITelCacheManager telCacheManager)
         {
             _newRockClient = newRockClient;
             _options = options;
@@ -53,7 +53,7 @@ namespace Hotline.NewRock
             {
                 var result = await _newRockClient.QueryExt(
                 new QueryExtRequest() { Attribute = "Query", Ext = new Ext { Id = TelNo } },
-                _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
 
                 if (result?.Ext.Outer != null)
                 {
@@ -127,7 +127,7 @@ namespace Hotline.NewRock
         {
             var result = await _newRockClient.QueryExt(
                 new QueryExtRequest() { Attribute = "Query", Ext = new Ext { Id = TelNo } },
-                _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+                _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
 
             switch (result.Ext.State)
             {
@@ -156,8 +156,8 @@ namespace Hotline.NewRock
         {
             var result = await _newRockClient.QueryDeviceInfo(
                 new QueryDeviceInfoRequest { Attribute = "Query", DeviceInfo = string.Empty },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
             var exts = result.Devices.Ext;
             return _mapper.Map<List<Tel>>(exts);
@@ -172,8 +172,8 @@ namespace Hotline.NewRock
         {
             var result = await _newRockClient.QueryDeviceInfo(
                 new QueryDeviceInfoRequest { Attribute = "Query", DeviceInfo = string.Empty },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
 
             var groups = result.Devices.Group;
@@ -191,8 +191,8 @@ namespace Hotline.NewRock
                 {
                     Attribute = "Query",
                     VoiceFile = "",
-                }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
             return result?.VoiceFile;
         }
@@ -201,8 +201,8 @@ namespace Hotline.NewRock
         {
             await _newRockClient.QueryExtGroup(new QueryExtGroupRequest()
                 { Attribute = "Query", Group = new QueryExtGroup() { Id = groupId } },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken
             );
         }
@@ -223,8 +223,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Query",
                 Ext = new Ext() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-            _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+            _options.Value.DeviceConfigs.Expired,
             cancellationToken);
 
             if (telModel == null)
@@ -232,8 +232,8 @@ namespace Hotline.NewRock
 
             await _newRockClient.ConfigExt(
                 new AssginConfigExtRequest() { Attribute = "Assign", Ext = new ConfigExt() { Lineid = telModel.Ext.LineId, Groups=Enumerable.Select<QueryExtGroup, string>(telModel.Ext.Group, x=>x.Id).ToList(), No_Disturb = "On" } },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -249,8 +249,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Query",
                 Ext = new Ext() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
 
             if (telModel == null)
@@ -258,8 +258,8 @@ namespace Hotline.NewRock
 
             await _newRockClient.ConfigExt(
                 new AssginConfigExtRequest() { Attribute = "Assign", Ext = new ConfigExt() { Lineid = telModel.Ext.LineId, Groups = Enumerable.Select<QueryExtGroup, string>(telModel.Ext.Group, x => x.Id).ToList(), No_Disturb = "Off" } },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -275,8 +275,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Remove",
                 VoiceFile = voiceName
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -318,8 +318,8 @@ namespace Hotline.NewRock
                     Exit = exit,
                     Repeat = repeat,
                 }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -367,8 +367,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Assign",
                 Group = groupModel
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -391,7 +391,7 @@ namespace Hotline.NewRock
 
             #region 清除分机组设置
 
-            await _newRockClient.ConfigExtGroup(new AssginConfigGroupRequest() { Attribute = "Assign", Group = new Group() { Id = groupId } }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+            await _newRockClient.ConfigExtGroup(new AssginConfigGroupRequest() { Attribute = "Assign", Group = new Group() { Id = groupId } }, _options.Value.DeviceConfigs.ReceiveKey, _options.Value.DeviceConfigs.Expired, cancellationToken);
 
             #endregion
 
@@ -445,8 +445,8 @@ namespace Hotline.NewRock
             groupModel.Ext = exts;
             await _newRockClient.ConfigExtGroup(
                 new AssginConfigGroupRequest() { Attribute = "Assign", Group = groupModel, },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken
                 );
         }
@@ -464,8 +464,8 @@ namespace Hotline.NewRock
                 {
                     Attribute = "Query",
                     Ext = new Ext() { Id = telNo }
-                }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
 
             if (telModel == null)
@@ -473,8 +473,8 @@ namespace Hotline.NewRock
 
             await _newRockClient.ConfigExt(
                 new AssginConfigExtRequest() { Attribute = "Assign", Ext = new ConfigExt() { Id = telNo,Lineid = lineId, Staffid = staffNo } },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
         #endregion
@@ -490,8 +490,8 @@ namespace Hotline.NewRock
         public async Task HoldAsync(string telNo, CancellationToken cancellationToken)
         {
             await _newRockClient.HoldOrUnHold(
-                new HoldSetRequest() { Attribute = "Hold", Ext = new Ext() { Id = telNo } }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                new HoldSetRequest() { Attribute = "Hold", Ext = new Ext() { Id = telNo } }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -504,8 +504,8 @@ namespace Hotline.NewRock
         public async Task UnHoldAsync(string telNo, CancellationToken cancellationToken)
         {
             await _newRockClient.HoldOrUnHold(
-                new HoldSetRequest() { Attribute = "Unhold", Ext = new Ext() { Id = telNo } }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                new HoldSetRequest() { Attribute = "Unhold", Ext = new Ext() { Id = telNo } }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -518,8 +518,8 @@ namespace Hotline.NewRock
         public async Task MuteAsync(string telNo, CancellationToken cancellationToken)
         {
             await _newRockClient.MuteOrUnMute(
-                new MuteSetRequest() { Attribute = "Mute", Ext = new Ext() { Id = telNo } }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                new MuteSetRequest() { Attribute = "Mute", Ext = new Ext() { Id = telNo } }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -533,8 +533,8 @@ namespace Hotline.NewRock
         {
             await _newRockClient.MuteOrUnMute(
                 new MuteSetRequest() { Attribute = "Unmute", Ext = new Ext() { Id = telNo } },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -553,8 +553,8 @@ namespace Hotline.NewRock
                 {
                     Id = extId
                 }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -570,8 +570,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Clear",
                 Visitor = new ClearCallVisitor() { Id = visitorId }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -587,8 +587,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Clear",
                 Outer = new ClearCallOuter() { Id = outerId }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -604,8 +604,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Accept",
                 Visitor = new AcceptVisitorModel() { Id = visitorId }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
         #endregion
@@ -626,8 +626,8 @@ namespace Hotline.NewRock
                 {
                     Attribute = "Connect",
                     Exts = new List<ExtToExtExt>() { new ExtToExtExt() { Id = from }, new ExtToExtExt() { Id = to } }
-                }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -649,8 +649,8 @@ namespace Hotline.NewRock
                         Outer = new ExtToOuterOuterRequest() { To = to },
                         Trunk = new ExtToOuterTrunkRequest() { Id = trunkid }
                     },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -669,8 +669,8 @@ namespace Hotline.NewRock
                 Attribute = "Connect",
                 Visitor = new VisitorToExtVisitor() { Id = visitorId },
                 Ext = new VisitorToExtExt() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -691,8 +691,8 @@ namespace Hotline.NewRock
                 Visitor = new VisitorToOuterVisitor() { Id = visitorId },
                 Outer = new VisitorToOuterOuter() { To = outerPhoneNum, Display = display },
 
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -711,8 +711,8 @@ namespace Hotline.NewRock
                 Attribute = "Connect",
                 Visitor = new VisitorToMenuVisitor() { Id = visitorId },
                 Menu = new VisitorToMenuMenu() { Id = menuId }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -730,8 +730,8 @@ namespace Hotline.NewRock
                 Attribute = "Queue",
                 Visitor = new VisitorToGroupQueueVisitor() { Id = visitorId },
                 Group = new VisitorToGroupQueueGroup() { Id = groupId }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -750,8 +750,8 @@ namespace Hotline.NewRock
                 Outer = new OuterToExtOuter() { Id = outerId },
                 Ext = new OuterToExtExt() { Id = telNo }
             },
-                _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -772,8 +772,8 @@ namespace Hotline.NewRock
                         new OuterToOuterOuterModel() { Id = outerId },
                         new OuterToOuterOuterModel() { To = outerPhoneNum }
                     },
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -792,8 +792,8 @@ namespace Hotline.NewRock
                 Attribute = "Connect",
                 Menu = new MenuToExtMenu() { Id = menuId },
                 Ext = new MenuToExtExt() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -812,8 +812,8 @@ namespace Hotline.NewRock
                 Attribute = "Connect",
                 Menu = new MenuToOuterMenu() { Id = menuId },
                 Outer = new MenuToOuterOuter() { To = outerPhoneNum }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -834,8 +834,8 @@ namespace Hotline.NewRock
                         new TwoWayOuterOuter(){ To = outerOne},
                         new TwoWayOuterOuter(){ To = outerTwo}
                     }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -853,8 +853,8 @@ namespace Hotline.NewRock
                 Attribute = "Connect",
                 VoiceFile = voiceFileName,
                 Ext = new VoiceNewsFlashExt() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -874,8 +874,8 @@ namespace Hotline.NewRock
                     Attribute = "Connect",
                     VoiceFile = voiceFileName,
                     Visitor = new VoiceNewsFlashVisitor() { Id = visitorId }
-                }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -894,8 +894,8 @@ namespace Hotline.NewRock
                     Attribute = "Connect",
                     VoiceFile = voiceFileName,
                     Outer = new VoiceNewsFlashOuter() { Id = outerId }
-                }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+                }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -911,8 +911,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Conference",
                 Ext = new ConferenceMeetingExt() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-                _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+                _options.Value.DeviceConfigs.Expired,
                 cancellationToken);
         }
 
@@ -950,8 +950,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Monitor",
                 Exts = new List<Ext>() { new Ext() { Id=firstTelNo },new Ext() { Id=secondTelNo } }
-            }, _options.Value.ReceiveKey,
-             _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+             _options.Value.DeviceConfigs.Expired,
              cancellationToken) ;
         }
 
@@ -970,8 +970,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Talk",
                 Ext = new Ext() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-              _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+              _options.Value.DeviceConfigs.Expired,
               cancellationToken) ;
         }
 
@@ -991,8 +991,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Listen",
                 Ext = new Ext() { Id = telNo }
-            }, _options.Value.ReceiveKey,
-              _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+              _options.Value.DeviceConfigs.Expired,
               cancellationToken);
         }
 
@@ -1017,8 +1017,8 @@ namespace Hotline.NewRock
             {
                 Attribute = "Bargein",
                 Exts = new List<Ext>() { new Ext() { Id = firstTelNo },new Ext() { Id=secondTelNo } }
-            }, _options.Value.ReceiveKey,
-              _options.Value.Expired,
+            }, _options.Value.DeviceConfigs.ReceiveKey,
+              _options.Value.DeviceConfigs.Expired,
               cancellationToken);
         }
 

+ 5 - 5
src/Hotline.NewRock/Handlers/DeviceEventHandler.cs

@@ -29,7 +29,7 @@ namespace Hotline.NewRock.Handlers
             _logger = logger;
         }
 
-        public async Task HandleAsync(Stream eventStream, DeviceConfigs deviceConfigs,
+        public async Task HandleAsync(Stream eventStream, CallCenterConfiguration deviceConfigs,
             CancellationToken cancellationToken)
         {
             var sr = new StreamReader(eventStream);
@@ -42,8 +42,8 @@ namespace Hotline.NewRock.Handlers
                 //通话记录报告
                 var eventBase = content.DeserializeWithAuthorize<NewRockCdrEvent>();
                 if (eventBase.value == null) return;
-                if (deviceConfigs.Authorize && (eventBase.authorize == null ||
-                                                !eventBase.authorize.IsAuthorized(deviceConfigs.SendKey)))
+                if (deviceConfigs.DeviceConfigs.Authorize && (eventBase.authorize == null ||
+                                                !eventBase.authorize.IsAuthorized(deviceConfigs.DeviceConfigs.SendKey)))
                     throw new AuthenticationException("无有效身份认证信息");
 
                 var cdrRcv = content.DeserializeWithAuthorize<CdrEvent>();
@@ -53,8 +53,8 @@ namespace Hotline.NewRock.Handlers
             {
                 var eventBase = content.DeserializeWithAuthorize<NewRockEvent>();
                 if (eventBase.value == null) return;
-                if (deviceConfigs.Authorize && (eventBase.authorize == null ||
-                                                !eventBase.authorize.IsAuthorized(deviceConfigs.SendKey)))
+                if (deviceConfigs.DeviceConfigs.Authorize && (eventBase.authorize == null ||
+                                                !eventBase.authorize.IsAuthorized(deviceConfigs.DeviceConfigs.SendKey)))
                     throw new AuthenticationException("无有效身份认证信息");
 
                 switch (eventBase.value.Attribute)

+ 9 - 0
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -335,4 +335,13 @@ namespace Hotline.Share.Dtos.Order
         /// </summary>
         public string ArrangeContent { get; set; }
     }
+
+    public class PublishOrderDto
+    {
+        public string Id { get; set; }
+
+        public EPublishState PublishState { get; set; }
+
+        public string ArrangeContent { get; set; }
+    }
 }

+ 63 - 1
src/Hotline.Share/Dtos/Order/QueryOrderDto.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -81,6 +82,67 @@ namespace Hotline.Share.Dtos.Order
 
     public record QueryOrderPublishDto : PagedRequest
     {
-        
+        /// <summary>
+        /// 发布状态
+        /// </summary>
+        public EPubState PubState { get; set; }
+
+        /// <summary>
+        /// 工单标题
+        /// </summary>
+        public string OrderTitle { get; set; }
+
+        /// <summary>
+        /// 发布人
+        /// </summary>
+        public string PubMan { get; set; }
+
+        /// <summary>
+        /// 发布范围
+        /// </summary>
+        public EPublishState? PubRange { get; set; }
+
+        /// <summary>
+        /// 受理类型
+        /// </summary>
+        public List<EAcceptType> AcceptTypes { get; set; } = new();
+
+        /// <summary>
+        /// 热点分类
+        /// </summary>
+        public List<string> HotspotIds { get; set; } = new();
+
+        /// <summary>
+        /// 受理时间(工单创建时间)
+        /// </summary>
+        public DateTime? CreationTimeStart { get; set; }
+        public DateTime? CreationTimeEnd { get; set; }
+
+        /// <summary>
+        /// 归档时间
+        /// </summary>
+        public DateTime? FiledTimeStart { get; set; }
+        public DateTime? FiledTimeEnd { get; set; }
+
     }
+
+    public enum EPubState
+    {
+        /// <summary>
+        /// 全部
+        /// </summary>
+        [Description("全部")]
+        All = 0,
+        /// <summary>
+        /// 已发布
+        /// </summary>
+        [Description("已发布")]
+        Pub = 1,
+        /// <summary>
+        /// 未发布
+        /// </summary>
+        [Description("未发布")]
+        NoPub = 2
+    }
+
 }

+ 7 - 0
src/Hotline/CallCenter/Devices/DeviceConfigs.cs

@@ -12,4 +12,11 @@
         /// </summary>
         public int Expired { get; set; }
     }
+
+    public class CallCenterConfiguration
+    {
+        public string CallCenterType { get; set; }
+
+        public DeviceConfigs DeviceConfigs { get; set; }
+    }
 }

+ 1 - 1
src/Hotline/CallCenter/IDeviceEventHandler.cs

@@ -7,6 +7,6 @@ namespace Hotline.CallCenter
     /// </summary>
     public interface IDeviceEventHandler
     {
-        Task HandleAsync(Stream eventStream, DeviceConfigs deviceConfigs, CancellationToken cancellationToken);
+        Task HandleAsync(Stream eventStream, CallCenterConfiguration deviceConfigs, CancellationToken cancellationToken);
     }
 }

+ 0 - 2
src/Hotline/Orders/Order.cs

@@ -258,8 +258,6 @@ namespace Hotline.Orders
         [SugarColumn(DefaultValue = "f")]
         public bool IsPublicity { get; set; }
 
-        //public bool IsPub { get; set; }
-
 
         #endregion