Parcourir la source

Merge branch 'test' into lib/test

libin il y a 5 jours
Parent
commit
3df22605e5

+ 27 - 1
src/Hotline.Api/Controllers/CorsJobController.cs

@@ -1,13 +1,20 @@
-using Hotline.Application.Jobs;
+using Hotline.Api.Realtimes;
+using Hotline.Application.Jobs;
+using Hotline.CallCenter.Calls;
 using Hotline.Orders;
+using Hotline.Realtimes;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
+using XF.Domain.Repository;
 
 namespace Hotline.Api.Controllers
 {
     public class CorsJobController: BaseController
     {
         private readonly IOrderDomainService _orderDomainService;
+        private readonly IRepository<TrCallRecord> _trcallrecordRepoository;
+        private readonly IRealtimeService _realtimeService;
+
         public CorsJobController(IOrderDomainService orderDomainService)
         {
             _orderDomainService = orderDomainService;
@@ -24,5 +31,24 @@ namespace Hotline.Api.Controllers
         {
             await _orderDomainService.SendOverTimeSms(HttpContext.RequestAborted);
         }
+
+        /// <summary>
+        /// 推送当天等待(1分钟一次)
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet("send-todaywaitnum")]
+        [AllowAnonymous]
+        public async Task SendToDayWaitNum()
+        {
+            try
+            {
+                int count = await _trcallrecordRepoository.Queryable()
+                    .Where(x => x.CreatedTime.Date == DateTime.Now.Date)
+                    .Where(x => x.QueueTims > 0 && x.Duration == 0)
+                    .CountAsync();
+                await _realtimeService.TodayWaitNumAsync(count, HttpContext.RequestAborted);
+            }
+            catch { }
+        }
     }
 }

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

@@ -168,7 +168,7 @@ internal static class StartupExtensions
                 services
                     .AddScoped<ICallApplication, TianRunCallApplication>()
                     .AddScoped<ITrApplication, TrApplication>()
-                    .AddHostedService<CurrentWaitNumService>()
+                    //.AddHostedService<CurrentWaitNumService>()
                     //.AddHostedService<TelsStatusRefreshService>()
                     .AddTrSdk(callCenterConfiguration.TianRun.Address,
                         callCenterConfiguration.TianRun.Username,

+ 2 - 2
src/Hotline.Application/OrderApp/OrderApplication.cs

@@ -5636,8 +5636,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
 				UserName = x.HandlerName,
 				StepName = x.Name,
 				SendOrderNum = 0,
-				ReSendOrderNum =0,
 				NoSendOrderNum = SqlFunc.AggregateDistinctCount(w.ExternalId),
+				ReSendOrderNum =0,
 			});
         
 		var items2 =  _workflowTraceRepository.Queryable()
@@ -5664,7 +5664,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
 				ReSendOrderNum = SqlFunc.AggregateDistinctCount(wt.ExternalId),
 			});
 
-        var items = await _orderRepository.UnionAll(itemsHandled, itemsNo, itemsHandled)
+        var items = await _orderRepository.UnionAll(itemsHandled, itemsNo, items2)
          .GroupBy(x => new { x.UserId, x.UserName, x.StepName })
          .Select(x => new BiOrderSendVo
          {