|
@@ -2,6 +2,7 @@
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
using Hotline.CallCenter.Configs;
|
|
|
using Hotline.CallCenter.Ivrs;
|
|
|
+using Hotline.EventBus;
|
|
|
using Hotline.Realtimes;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
using Hotline.Share.Notifications.NewRockCallCenter;
|
|
@@ -11,12 +12,13 @@ using NewRock.Sdk;
|
|
|
|
|
|
namespace Hotline.Application.Handlers.CallCenter.FlowControl
|
|
|
{
|
|
|
- public class EndOfAnnOuterToMenuNotificationHandler:NewRockBaseHandler,INotificationHandler<EndOfAnnOuterToMenuNotification>
|
|
|
+ [HandlerInject(EventHandlerType = EEventHandlerType.CallCenter, Label = AppDefaults.CallCenterType.XunShi)]
|
|
|
+ public class EndOfAnnOuterToMenuNotificationHandler : NewRockBaseHandler, INotificationHandler<EndOfAnnOuterToMenuNotification>
|
|
|
{
|
|
|
private readonly ICallRepository _callRepository;
|
|
|
private readonly ICallDetailRepository _callDetailRepository;
|
|
|
private readonly IIvrDomainService _ivrDomainService;
|
|
|
- public EndOfAnnOuterToMenuNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IIvrDomainService ivrDomainService, INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> callcenterOptions,ICallCacheManager callCacheManager,IRealtimeService realtimeService) : base(newRockClient, callcenterOptions,callRepository,callCacheManager, realtimeService)
|
|
|
+ public EndOfAnnOuterToMenuNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository, IIvrDomainService ivrDomainService, INewRockClient newRockClient, IOptionsSnapshot<CallCenterConfiguration> callcenterOptions, ICallCacheManager callCacheManager, IRealtimeService realtimeService) : base(newRockClient, callcenterOptions, callRepository, callCacheManager, realtimeService)
|
|
|
{
|
|
|
_callRepository = callRepository;
|
|
|
_callDetailRepository = callDetailRepository;
|
|
@@ -25,13 +27,13 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
|
|
|
|
|
|
public async Task Handle(EndOfAnnOuterToMenuNotification notification, CancellationToken cancellationToken)
|
|
|
{
|
|
|
- var model =await _callRepository.GetAsync(
|
|
|
+ var model = await _callRepository.GetAsync(
|
|
|
x => x.ConversationId == notification.Outer.Id && x.FromNo == notification.Outer.From &&
|
|
|
- x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
|
|
|
- if (model!=null)
|
|
|
+ x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2), true, x => x.CreationTime, cancellationToken);
|
|
|
+ if (model != null)
|
|
|
{
|
|
|
model.CallStatus = ECallStatus.EndOfAnn;
|
|
|
- await _callRepository.UpdateAsync(model,cancellationToken);
|
|
|
+ await _callRepository.UpdateAsync(model, cancellationToken);
|
|
|
var detail = new CallDetail()
|
|
|
{
|
|
|
CallId = model.Id,
|
|
@@ -44,7 +46,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
|
|
|
};
|
|
|
await _callDetailRepository.AddAsync(detail, cancellationToken);
|
|
|
|
|
|
- var runModel = await _ivrDomainService.GetVoiceEndAnswerAsync(notification.MenuId,cancellationToken);
|
|
|
+ var runModel = await _ivrDomainService.GetVoiceEndAnswerAsync(notification.MenuId, cancellationToken);
|
|
|
|
|
|
await HandlerIvr(runModel, model, cancellationToken);
|
|
|
}
|