|
@@ -5,7 +5,6 @@ using Hotline.Application.FlowEngine;
|
|
|
using Hotline.Application.OrderApp;
|
|
|
using Hotline.Authentications;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
-using Hotline.Caching.Services;
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
using Hotline.Configurations;
|
|
|
using Hotline.ContingencyManagement;
|
|
@@ -19,7 +18,6 @@ using Hotline.Settings.TimeLimitDomain;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.ContingencyManagement;
|
|
|
using Hotline.Share.Dtos.DataSharing.PusherHotlineDto;
|
|
|
-using Hotline.Share.Dtos.FlowEngine;
|
|
|
using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Dtos.OrderTranspond;
|
|
@@ -28,18 +26,15 @@ using Hotline.Share.Dtos.TrCallCenter;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Mq;
|
|
|
-using Hotline.Validators.FlowEngine;
|
|
|
using Mapster;
|
|
|
using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
-using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
-using Newtonsoft.Json;
|
|
|
using SqlSugar;
|
|
|
-using XF.Domain.Authentications;
|
|
|
using XF.Domain.Dependency;
|
|
|
using XF.Domain.Exceptions;
|
|
|
+using XF.Domain.Locks;
|
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Application.Subscribers
|
|
@@ -49,6 +44,7 @@ namespace Hotline.Application.Subscribers
|
|
|
/// </summary>
|
|
|
public class DataSharingSubscriber : ICapSubscribe, ITransientDependency
|
|
|
{
|
|
|
+ #region 注入
|
|
|
private readonly IRepository<OrderVisit> _orderVisitRepository;
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
@@ -81,6 +77,7 @@ namespace Hotline.Application.Subscribers
|
|
|
private readonly ICalcExpireTime _expireTime;
|
|
|
private readonly ISessionContextManager _sessionContextManager;
|
|
|
private readonly ILogger<DataSharingSubscriber> _logger;
|
|
|
+ private readonly IDistributedLock _distributedLock;
|
|
|
|
|
|
public DataSharingSubscriber(
|
|
|
IRepository<OrderVisit> orderVisitRepository,
|
|
@@ -114,7 +111,8 @@ namespace Hotline.Application.Subscribers
|
|
|
ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
|
ICalcExpireTime expireTime,
|
|
|
ISessionContextManager sessionContextManager,
|
|
|
- ILogger<DataSharingSubscriber> logger)
|
|
|
+ ILogger<DataSharingSubscriber> logger,
|
|
|
+ IDistributedLock distributedLock)
|
|
|
{
|
|
|
_orderSendBackRepository = orderSendBackRepository;
|
|
|
_workflowApplication = workflowApplication;
|
|
@@ -148,7 +146,9 @@ namespace Hotline.Application.Subscribers
|
|
|
_expireTime = expireTime;
|
|
|
_sessionContextManager = sessionContextManager;
|
|
|
_logger = logger;
|
|
|
+ _distributedLock = distributedLock;
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
/// <summary>
|
|
|
/// 接收工单退回结果
|
|
@@ -613,165 +613,181 @@ namespace Hotline.Application.Subscribers
|
|
|
[CapSubscribe(Hotline.Share.Mq.EventNames.SharingOrderEvlResult)]
|
|
|
public async Task OrderVisitProvince(ProvinceOrderVisitDto dto, CancellationToken cancellationToken)
|
|
|
{
|
|
|
- var orderVisit = await _orderVisitRepository.Queryable()
|
|
|
- .Includes(x => x.Order)
|
|
|
- .Includes(x => x.OrderVisitDetails)
|
|
|
- .Where(x => x.Order.ReceiveProvinceNo == dto.ProvinceNo &&
|
|
|
- x.VisitState == Share.Enums.Order.EVisitState.WaitForVisit).FirstAsync(cancellationToken);
|
|
|
-
|
|
|
- if (orderVisit != null)
|
|
|
+ var order = await _orderRepository.Queryable().Where(x => x.ReceiveProvinceNo == dto.ProvinceNo).FirstAsync();
|
|
|
+ if (order == null)
|
|
|
+ return;
|
|
|
+ var distributedLockKey = $"provinceordervisit_{order.Id}";
|
|
|
+ //分布式锁,如果锁成功,则执行
|
|
|
+ if (await _distributedLock.AcquireAsync(distributedLockKey, TimeSpan.FromMinutes(3), cancellationToken))
|
|
|
{
|
|
|
- //处理评价结果
|
|
|
- var processingResult = dto.OrgProcessingResults;
|
|
|
- Kv orgProcessingResults = null;
|
|
|
- if (!string.IsNullOrEmpty(processingResult))
|
|
|
+ //处理原始的回访逻辑
|
|
|
+ var orderVisit = await _orderVisitRepository.Queryable()
|
|
|
+ .Includes(x => x.Order)
|
|
|
+ .Includes(x => x.OrderVisitDetails)
|
|
|
+ .Where(x => x.Order.ReceiveProvinceNo == dto.ProvinceNo &&
|
|
|
+ x.VisitState == Share.Enums.Order.EVisitState.WaitForVisit).FirstAsync(cancellationToken);
|
|
|
+
|
|
|
+ if (orderVisit != null)
|
|
|
{
|
|
|
- var dicData = await _systemDicDataRepository.GetAsync(x => x.DicTypeCode == SysDicTypeConsts.VisitSatisfaction &&
|
|
|
- x.DicDataValue == processingResult, cancellationToken);
|
|
|
- if (dicData != null)
|
|
|
- {
|
|
|
- orgProcessingResults = new Kv();
|
|
|
- orgProcessingResults.Key = dicData.DicDataValue;
|
|
|
- orgProcessingResults.Value = dicData.DicDataName;
|
|
|
- }
|
|
|
-
|
|
|
- if (orgProcessingResults != null)
|
|
|
+ //处理评价结果
|
|
|
+ var processingResult = dto.OrgProcessingResults;
|
|
|
+ Kv orgProcessingResults = null;
|
|
|
+ if (!string.IsNullOrEmpty(processingResult))
|
|
|
{
|
|
|
- //主表
|
|
|
- orderVisit.VisitState = Share.Enums.Order.EVisitState.Visited;
|
|
|
- orderVisit.VisitTime = dto.VisitTime;
|
|
|
- orderVisit.VisitType = dto.VisitType;
|
|
|
- orderVisit.IsCanHandle = orgProcessingResults.Key == "2";
|
|
|
- orderVisit.IsCanAiVisit = false;
|
|
|
- orderVisit.NowEvaluate = orgProcessingResults;
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
+ var dicData = await _systemDicDataRepository.GetAsync(x => x.DicTypeCode == SysDicTypeConsts.VisitSatisfaction &&
|
|
|
+ x.DicDataValue == processingResult, cancellationToken);
|
|
|
+ if (dicData != null)
|
|
|
{
|
|
|
- orderVisit.EmployeeId = _systemSettingCacheManager.DefaultVisitEmployeeId;
|
|
|
+ orgProcessingResults = new Kv();
|
|
|
+ orgProcessingResults.Key = dicData.DicDataValue;
|
|
|
+ orgProcessingResults.Value = dicData.DicDataName;
|
|
|
}
|
|
|
|
|
|
- await _orderVisitRepository.UpdateAsync(orderVisit, cancellationToken);
|
|
|
- //子表
|
|
|
- for (int i = 0; i < orderVisit.OrderVisitDetails.Count; i++)
|
|
|
+ if (orgProcessingResults != null)
|
|
|
{
|
|
|
- if (orderVisit.OrderVisitDetails[i].VisitTarget == EVisitTarget.Seat)
|
|
|
+ //主表
|
|
|
+ orderVisit.VisitState = Share.Enums.Order.EVisitState.Visited;
|
|
|
+ orderVisit.VisitTime = dto.VisitTime;
|
|
|
+ orderVisit.VisitType = dto.VisitType;
|
|
|
+ orderVisit.IsCanHandle = orgProcessingResults.Key == "2";
|
|
|
+ orderVisit.IsCanAiVisit = false;
|
|
|
+ orderVisit.NowEvaluate = orgProcessingResults;
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
{
|
|
|
- orderVisit.OrderVisitDetails[i].VoiceEvaluate = (EVoiceEvaluate)int.Parse(orgProcessingResults.Key);
|
|
|
- orderVisit.OrderVisitDetails[i].SeatEvaluate = (ESeatEvaluate)int.Parse(orgProcessingResults.Key);
|
|
|
+ orderVisit.EmployeeId = _systemSettingCacheManager.DefaultVisitEmployeeId;
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ await _orderVisitRepository.UpdateAsync(orderVisit, cancellationToken);
|
|
|
+ //子表
|
|
|
+ for (int i = 0; i < orderVisit.OrderVisitDetails.Count; i++)
|
|
|
{
|
|
|
- orderVisit.OrderVisitDetails[i].OrgProcessingResults = orgProcessingResults;
|
|
|
+ if (orderVisit.OrderVisitDetails[i].VisitTarget == EVisitTarget.Seat)
|
|
|
+ {
|
|
|
+ orderVisit.OrderVisitDetails[i].VoiceEvaluate = (EVoiceEvaluate)int.Parse(orgProcessingResults.Key);
|
|
|
+ orderVisit.OrderVisitDetails[i].SeatEvaluate = (ESeatEvaluate)int.Parse(orgProcessingResults.Key);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ orderVisit.OrderVisitDetails[i].OrgProcessingResults = orgProcessingResults;
|
|
|
+ }
|
|
|
+
|
|
|
+ orderVisit.OrderVisitDetails[i].VisitContent = dto.VisitContent;
|
|
|
+ orderVisit.OrderVisitDetails[i].ScreenByEndTime = await _orderDomainService.GetScreenByEndTime();
|
|
|
}
|
|
|
|
|
|
- orderVisit.OrderVisitDetails[i].VisitContent = dto.VisitContent;
|
|
|
- orderVisit.OrderVisitDetails[i].ScreenByEndTime = await _orderDomainService.GetScreenByEndTime();
|
|
|
- }
|
|
|
-
|
|
|
- await _orderVisitedDetailRepository.UpdateRangeAsync(orderVisit.OrderVisitDetails, cancellationToken);
|
|
|
- //工单
|
|
|
- orderVisit.Order.Visited(orgProcessingResults.Key, orgProcessingResults.Value);
|
|
|
- await _orderRepository.UpdateAsync(orderVisit.Order);
|
|
|
-
|
|
|
- ////处理网站通知差评数据
|
|
|
- //if (orderVisit.Order.Source == ESource.Hotline && orderVisit.OrderVisitDetails.Any(x => x.OrgHandledAttitude?.Key == "1" || x.OrgHandledAttitude?.Key == "2" || x.OrgProcessingResults?.Key == "1" || x.OrgProcessingResults?.Key == "2"))
|
|
|
- //{
|
|
|
- // //包含不满意数据,重新生成新的回访
|
|
|
- // var newOrderVisit = _mapper.Map<OrderVisit>(orderVisit);
|
|
|
- // newOrderVisit.InitId();
|
|
|
- // newOrderVisit.VisitState = EVisitState.NoSatisfiedWaitForVisit;
|
|
|
- // newOrderVisit.VisitTime = null;
|
|
|
- // newOrderVisit.IsCanHandle = false;
|
|
|
- // newOrderVisit.IsCanAiVisit = false;
|
|
|
- // newOrderVisit.AiVisitCount = 0;
|
|
|
- // await _orderVisitRepository.AddAsync(newOrderVisit, cancellationToken);
|
|
|
- // var list = _mapper.Map<List<OrderVisitDetail>>(orderVisit.OrderVisitDetails);
|
|
|
- // list.ForEach(x =>
|
|
|
- // {
|
|
|
- // x.VisitId = newOrderVisit.Id;
|
|
|
- // x.VoiceEvaluate = null;
|
|
|
- // x.VoiceEvaluate = null;
|
|
|
- // x.OrgHandledAttitude = null;
|
|
|
- // x.OrgNoSatisfiedReason = null;
|
|
|
- // x.OrgProcessingResults = null;
|
|
|
- // x.VisitContent = "";
|
|
|
- // });
|
|
|
- // await _orderVisitedDetailRepository.AddRangeAsync(list, cancellationToken);
|
|
|
- //}
|
|
|
+ await _orderVisitedDetailRepository.UpdateRangeAsync(orderVisit.OrderVisitDetails, cancellationToken);
|
|
|
+ //工单
|
|
|
+ orderVisit.Order.Visited(orgProcessingResults.Key, orgProcessingResults.Value);
|
|
|
+ await _orderRepository.UpdateAsync(orderVisit.Order);
|
|
|
+
|
|
|
+ ////处理网站通知差评数据
|
|
|
+ //if (orderVisit.Order.Source == ESource.Hotline && orderVisit.OrderVisitDetails.Any(x => x.OrgHandledAttitude?.Key == "1" || x.OrgHandledAttitude?.Key == "2" || x.OrgProcessingResults?.Key == "1" || x.OrgProcessingResults?.Key == "2"))
|
|
|
+ //{
|
|
|
+ // //包含不满意数据,重新生成新的回访
|
|
|
+ // var newOrderVisit = _mapper.Map<OrderVisit>(orderVisit);
|
|
|
+ // newOrderVisit.InitId();
|
|
|
+ // newOrderVisit.VisitState = EVisitState.NoSatisfiedWaitForVisit;
|
|
|
+ // newOrderVisit.VisitTime = null;
|
|
|
+ // newOrderVisit.IsCanHandle = false;
|
|
|
+ // newOrderVisit.IsCanAiVisit = false;
|
|
|
+ // newOrderVisit.AiVisitCount = 0;
|
|
|
+ // await _orderVisitRepository.AddAsync(newOrderVisit, cancellationToken);
|
|
|
+ // var list = _mapper.Map<List<OrderVisitDetail>>(orderVisit.OrderVisitDetails);
|
|
|
+ // list.ForEach(x =>
|
|
|
+ // {
|
|
|
+ // x.VisitId = newOrderVisit.Id;
|
|
|
+ // x.VoiceEvaluate = null;
|
|
|
+ // x.VoiceEvaluate = null;
|
|
|
+ // x.OrgHandledAttitude = null;
|
|
|
+ // x.OrgNoSatisfiedReason = null;
|
|
|
+ // x.OrgProcessingResults = null;
|
|
|
+ // x.VisitContent = "";
|
|
|
+ // });
|
|
|
+ // await _orderVisitedDetailRepository.AddRangeAsync(list, cancellationToken);
|
|
|
+ //}
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //处理省下行回访
|
|
|
- var order = await _orderRepository.Queryable().Where(x => x.ReceiveProvinceNo == dto.ProvinceNo).FirstAsync();
|
|
|
- if (order != null && order.Status <= EOrderStatus.Filed)
|
|
|
+ else
|
|
|
{
|
|
|
- //判断是否有发布数据
|
|
|
- var orderPublish = await _orderPublishRepository.Queryable()
|
|
|
- .Includes(x => x.Order).Where(x => x.Order.ReceiveProvinceNo == dto.ProvinceNo).FirstAsync(cancellationToken);
|
|
|
- if (orderPublish == null)
|
|
|
+ //处理省下行回访
|
|
|
+ // var order = await _orderRepository.Queryable().Where(x => x.ReceiveProvinceNo == dto.ProvinceNo).FirstAsync();
|
|
|
+ if (order != null && order.Status <= EOrderStatus.Filed)
|
|
|
{
|
|
|
- orderPublish = new OrderPublish();
|
|
|
- orderPublish.OrderId = order.Id;
|
|
|
- orderPublish.No = order.No;
|
|
|
- orderPublish.PublishState = false;
|
|
|
- orderPublish.ArrangeTitle = order.Title;
|
|
|
- orderPublish.ArrangeContent = order.Content;
|
|
|
- orderPublish.ArrangeOpinion = order.FileOpinion;
|
|
|
- orderPublish.ProPublishState = false;
|
|
|
- orderPublish.FeedBackPhone = order.Contact;
|
|
|
- orderPublish.CreatorName = order.CenterToOrgHandlerId;
|
|
|
- await _orderPublishRepository.AddAsync(orderPublish);
|
|
|
- order.Publish(orderPublish.PublishState);
|
|
|
- }
|
|
|
+ //判断是否有发布数据
|
|
|
+ var orderPublish = await _orderPublishRepository.Queryable()
|
|
|
+ .Includes(x => x.Order).Where(x => x.Order.ReceiveProvinceNo == dto.ProvinceNo).FirstAsync(cancellationToken);
|
|
|
+ if (orderPublish == null)
|
|
|
+ {
|
|
|
+ orderPublish = new OrderPublish();
|
|
|
+ orderPublish.OrderId = order.Id;
|
|
|
+ orderPublish.No = order.No;
|
|
|
+ orderPublish.PublishState = false;
|
|
|
+ orderPublish.ArrangeTitle = order.Title;
|
|
|
+ orderPublish.ArrangeContent = order.Content;
|
|
|
+ orderPublish.ArrangeOpinion = order.FileOpinion;
|
|
|
+ orderPublish.ProPublishState = false;
|
|
|
+ orderPublish.FeedBackPhone = order.Contact;
|
|
|
+ orderPublish.CreatorName = order.CenterToOrgHandlerId;
|
|
|
+ await _orderPublishRepository.AddAsync(orderPublish);
|
|
|
+ order.Publish(orderPublish.PublishState);
|
|
|
+ }
|
|
|
|
|
|
- orderVisit = new OrderVisit();
|
|
|
- orderVisit.No = order.No;
|
|
|
- orderVisit.OrderId = order.Id;
|
|
|
- orderVisit.PublishTime = DateTime.Now;
|
|
|
- orderVisit.IsCanHandle = true;
|
|
|
- orderVisit.EmployeeId = order.CenterToOrgHandlerId;
|
|
|
- orderVisit.VisitState = EVisitState.None;
|
|
|
- orderVisit.VisitTime = dto.VisitTime;
|
|
|
- orderVisit.VisitType = dto.VisitType;
|
|
|
- orderVisit.IsCanAiVisit = false;
|
|
|
- var VisitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction)
|
|
|
- .Where(x => x.DicDataValue == dto.OrgProcessingResults).Select(m => new Kv { Key = m.DicDataValue, Value = m.DicDataName })
|
|
|
- .FirstOrDefault();
|
|
|
- var satisfy = VisitSatisfaction;
|
|
|
- orderVisit.NowEvaluate = satisfy;
|
|
|
- string visitId = await _orderVisitRepository.AddAsync(orderVisit);
|
|
|
-
|
|
|
- //新增回访信息
|
|
|
- var visitedDetail = new List<OrderVisitDetail>();
|
|
|
-
|
|
|
- //新增坐席回访
|
|
|
- var seatDetail = new OrderVisitDetail();
|
|
|
- seatDetail.VisitId = visitId;
|
|
|
- seatDetail.VisitTarget = EVisitTarget.Seat;
|
|
|
- seatDetail.VoiceEvaluate = EVoiceEvaluate.Satisfied;
|
|
|
- seatDetail.SeatEvaluate = ESeatEvaluate.Satisfied;
|
|
|
- visitedDetail.Add(seatDetail);
|
|
|
-
|
|
|
- //新增部门回访
|
|
|
- var orgDetail = new OrderVisitDetail();
|
|
|
- orgDetail.VisitId = visitId;
|
|
|
- orgDetail.VisitOrgCode = order.ActualHandleOrgCode;
|
|
|
- orgDetail.VisitOrgName = order.ActualHandleOrgName;
|
|
|
- orgDetail.VisitTarget = EVisitTarget.Org;
|
|
|
- orgDetail.ScreenByEndTime = await _orderDomainService.GetScreenByEndTime();
|
|
|
-
|
|
|
- orgDetail.OrgProcessingResults = satisfy;
|
|
|
-
|
|
|
- visitedDetail.Add(orgDetail);
|
|
|
- //TODO 自贡办件态度
|
|
|
-
|
|
|
-
|
|
|
- await _orderVisitedDetailRepository.AddRangeAsync(visitedDetail, cancellationToken);
|
|
|
- //order.Visited(satisfy.Key, satisfy.Value);
|
|
|
- //order.Status = EOrderStatus.Visited;
|
|
|
- //await _orderRepository.UpdateAsync(order, cancellationToken);
|
|
|
+ orderVisit = new OrderVisit();
|
|
|
+ orderVisit.No = order.No;
|
|
|
+ orderVisit.OrderId = order.Id;
|
|
|
+ orderVisit.PublishTime = DateTime.Now;
|
|
|
+ orderVisit.IsCanHandle = true;
|
|
|
+ orderVisit.EmployeeId = order.CenterToOrgHandlerId;
|
|
|
+ orderVisit.VisitState = EVisitState.None;
|
|
|
+ orderVisit.VisitTime = dto.VisitTime;
|
|
|
+ orderVisit.VisitType = dto.VisitType;
|
|
|
+ orderVisit.IsCanAiVisit = false;
|
|
|
+ var VisitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction)
|
|
|
+ .Where(x => x.DicDataValue == dto.OrgProcessingResults).Select(m => new Kv { Key = m.DicDataValue, Value = m.DicDataName })
|
|
|
+ .FirstOrDefault();
|
|
|
+ var satisfy = VisitSatisfaction;
|
|
|
+ orderVisit.NowEvaluate = satisfy;
|
|
|
+ string visitId = await _orderVisitRepository.AddAsync(orderVisit);
|
|
|
+
|
|
|
+ //新增回访信息
|
|
|
+ var visitedDetail = new List<OrderVisitDetail>();
|
|
|
+
|
|
|
+ //新增坐席回访
|
|
|
+ var seatDetail = new OrderVisitDetail();
|
|
|
+ seatDetail.VisitId = visitId;
|
|
|
+ seatDetail.VisitTarget = EVisitTarget.Seat;
|
|
|
+ seatDetail.VoiceEvaluate = EVoiceEvaluate.Satisfied;
|
|
|
+ seatDetail.SeatEvaluate = ESeatEvaluate.Satisfied;
|
|
|
+ visitedDetail.Add(seatDetail);
|
|
|
+
|
|
|
+ //新增部门回访
|
|
|
+ var orgDetail = new OrderVisitDetail();
|
|
|
+ orgDetail.VisitId = visitId;
|
|
|
+ orgDetail.VisitOrgCode = order.ActualHandleOrgCode;
|
|
|
+ orgDetail.VisitOrgName = order.ActualHandleOrgName;
|
|
|
+ orgDetail.VisitTarget = EVisitTarget.Org;
|
|
|
+ orgDetail.ScreenByEndTime = await _orderDomainService.GetScreenByEndTime();
|
|
|
+
|
|
|
+ orgDetail.OrgProcessingResults = satisfy;
|
|
|
+
|
|
|
+ visitedDetail.Add(orgDetail);
|
|
|
+ //TODO 自贡办件态度
|
|
|
+
|
|
|
+
|
|
|
+ await _orderVisitedDetailRepository.AddRangeAsync(visitedDetail, cancellationToken);
|
|
|
+ //order.Visited(satisfy.Key, satisfy.Value);
|
|
|
+ //order.Status = EOrderStatus.Visited;
|
|
|
+ //await _orderRepository.UpdateAsync(order, cancellationToken);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ //执行完成释放分布式锁
|
|
|
+ await _distributedLock.ReleaseAsync(distributedLockKey, cancellationToken);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new UserFriendlyException($"分布式锁定失败, orderId: {order.Id}");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1313,5 +1329,15 @@ namespace Hotline.Application.Subscribers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 分布式执行省工单重派业务
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [CapSubscribe(EventNames.HotlineOrderAddAnonymous)]
|
|
|
+ public async Task HotlineOrderAddAnonymous(AddOrderDto dto, CancellationToken cancellationToken)
|
|
|
+ {
|
|
|
+ await _orderApplication.ReceiveOrderFromExternalAsync(dto, cancellationToken);
|
|
|
+ }
|
|
|
}
|
|
|
}
|