|
@@ -146,6 +146,7 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<OrderPushType> _orderPushTypeRepository;
|
|
|
private readonly IRepository<OrderRevoke> _orderRevokeRepository;
|
|
|
private readonly IOrderTerminateRepository _orderTerminateRepository;
|
|
|
+ private readonly ISystemLogApplication _systemLogApplication;
|
|
|
|
|
|
public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
@@ -211,7 +212,8 @@ public class OrderController : BaseController
|
|
|
IRepository<OrderRevoke> orderRevokeRepository,
|
|
|
BaseDataApplication baseDataApplication,
|
|
|
IOrderTerminateRepository orderTerminateRepository,
|
|
|
- ITypedCache<string> typeCache)
|
|
|
+ ITypedCache<string> typeCache,
|
|
|
+ ISystemLogApplication systemLogApplication)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -278,6 +280,7 @@ public class OrderController : BaseController
|
|
|
_orderRevokeRepository = orderRevokeRepository;
|
|
|
_typeCache = typeCache;
|
|
|
_baseDataApplication = baseDataApplication;
|
|
|
+ _systemLogApplication = systemLogApplication;
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -3495,6 +3498,13 @@ public class OrderController : BaseController
|
|
|
var exists = await _orderRepository.AnyAsync(d => d.CallId == dto.CallId, HttpContext.RequestAborted);
|
|
|
if (exists)
|
|
|
throw new UserFriendlyException($"来电已保存工单, phone:{dto.FromPhone}, callId: {dto.CallId}", "来电已保存工单");
|
|
|
+ exists = await _systemLogApplication.HasByIpUrlAsync(dto.CallId);
|
|
|
+ if (exists)
|
|
|
+ {
|
|
|
+ // IpUrl 里面存的是 callId, 用来判断是工单的 CallId 是否已经被修复过了.
|
|
|
+ // 存入的地方是 Hotline.Application.CallCenter.OrderRelateCallHandlerAsync
|
|
|
+ throw new UserFriendlyException($"来电已保存工单, phone:{dto.FromPhone}, callId: {dto.CallId} !", "来电已保存工单!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
var order = _mapper.Map<Orders.Order>(dto);
|