|
@@ -3,11 +3,13 @@ using Hotline.CallCenter.BlackLists;
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
using Hotline.CallCenter.Tels;
|
|
|
using Hotline.Orders;
|
|
|
+using Hotline.Repository.SqlSugar.CallCenter;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
|
using Hotline.Share.Dtos.TrCallCenter;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
+using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Tools;
|
|
|
using Hotline.Users;
|
|
|
using MapsterMapper;
|
|
@@ -34,6 +36,8 @@ public abstract class DefaultCallApplication : ICallApplication
|
|
|
private readonly ISessionContext _sessionContext;
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly ILogger<DefaultCallApplication> _logger;
|
|
|
+ private readonly ICallDomainService _callDomainService;
|
|
|
+ private readonly IOrderVisitDomainService _orderVisitDomainService;
|
|
|
|
|
|
public DefaultCallApplication(
|
|
|
IRepository<Tel> telRepository,
|
|
@@ -47,7 +51,9 @@ public abstract class DefaultCallApplication : ICallApplication
|
|
|
IUserCacheManager userCacheManager,
|
|
|
ISessionContext sessionContext,
|
|
|
IMapper mapper,
|
|
|
- ILogger<DefaultCallApplication> logger)
|
|
|
+ ILogger<DefaultCallApplication> logger,
|
|
|
+ IOrderVisitDomainService orderVisitDomainService,
|
|
|
+ ICallDomainService callDomainService)
|
|
|
{
|
|
|
_telRepository = telRepository;
|
|
|
_telGroupRepository = telGroupRepository;
|
|
@@ -61,6 +67,8 @@ public abstract class DefaultCallApplication : ICallApplication
|
|
|
_sessionContext = sessionContext;
|
|
|
_mapper = mapper;
|
|
|
_logger = logger;
|
|
|
+ _orderVisitDomainService = orderVisitDomainService;
|
|
|
+ _callDomainService = callDomainService;
|
|
|
}
|
|
|
|
|
|
public DefaultCallApplication()
|
|
@@ -361,6 +369,29 @@ public abstract class DefaultCallApplication : ICallApplication
|
|
|
.ToListAsync(cancellationToken);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 根据 OrderId 返回用户电话评价枚举
|
|
|
+ /// 默认返回 默认满意
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="orderId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public virtual async Task<EVoiceEvaluate> GetReplyVoiceOrDefaultByOrderIdAsync(string orderId)
|
|
|
+ {
|
|
|
+ var callNative = await _callDomainService.GetByOrderIdAsync(orderId);
|
|
|
+ if (callNative is null || callNative.ReplyTxt.IsNullOrEmpty())
|
|
|
+ return EVoiceEvaluate.DefaultSatisfied;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ return _orderVisitDomainService.GetVisitEvaluateByReplyTxt<EVoiceEvaluate>(callNative.ReplyTxt!.Trim());
|
|
|
+ }
|
|
|
+ catch (UserFriendlyException)
|
|
|
+ {
|
|
|
+ return EVoiceEvaluate.DefaultSatisfied;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#region tianrun 临时方案
|
|
|
|
|
|
public virtual Task<TrCallRecord?> GetTianrunCallAsync(string callId, CancellationToken cancellationToken)
|