|
@@ -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,
|
|
@@ -3495,6 +3496,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);
|