|
@@ -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 { }
|
|
|
+ }
|
|
|
}
|
|
|
}
|