|
@@ -7,8 +7,9 @@ using Hotline.Application.Orders;
|
|
|
using Hotline.Application.Quality;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.CallCenter.Configs;
|
|
|
-using Hotline.ContingencyManagement;
|
|
|
+using Hotline.ContingencyManagement.Notifies;
|
|
|
using Hotline.Enterprise;
|
|
|
+using Hotline.EventBus;
|
|
|
using Hotline.File;
|
|
|
using Hotline.FlowEngine.Definitions;
|
|
|
using Hotline.FlowEngine.WorkflowModules;
|
|
@@ -27,7 +28,6 @@ using Hotline.Settings;
|
|
|
using Hotline.Settings.Hotspots;
|
|
|
using Hotline.Settings.TimeLimits;
|
|
|
using Hotline.Share.Dtos;
|
|
|
-using Hotline.Share.Dtos.ContingencyManagement;
|
|
|
using Hotline.Share.Dtos.Enterprise;
|
|
|
using Hotline.Share.Dtos.FlowEngine;
|
|
|
using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
@@ -125,8 +125,7 @@ public class OrderController : BaseController
|
|
|
private readonly ICallApplication _callApplication;
|
|
|
private readonly IOptionsSnapshot<CallCenterConfiguration> _callcenterOptions;
|
|
|
private readonly IOrderSendBackAuditApplication _orderSendBackAuditApplication;
|
|
|
- private readonly IRepository<ContingencyManagementOrders> _contingencyManagementOrdersRepository;
|
|
|
- private readonly IRepository<ContingencyManagementHotspot> _contingencyManagementHotspotRepository;
|
|
|
+ private readonly Publisher _publisher;
|
|
|
|
|
|
public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
@@ -185,8 +184,7 @@ public class OrderController : BaseController
|
|
|
IOptionsSnapshot<CallCenterConfiguration> callcenterOptions,
|
|
|
IRepository<OrderModifyingRecords> orderModifyingRecordsRepository,
|
|
|
IOrderSendBackAuditApplication orderSendBackAuditApplication,
|
|
|
- IRepository<ContingencyManagementOrders> contingencyManagementOrdersRepository,
|
|
|
- IRepository<ContingencyManagementHotspot> contingencyManagementHotspotRepository
|
|
|
+ Publisher publisher
|
|
|
)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
@@ -245,8 +243,7 @@ public class OrderController : BaseController
|
|
|
_callApplication = callApplication;
|
|
|
_callcenterOptions = callcenterOptions;
|
|
|
_orderSendBackAuditApplication = orderSendBackAuditApplication;
|
|
|
- _contingencyManagementOrdersRepository = contingencyManagementOrdersRepository;
|
|
|
- _contingencyManagementHotspotRepository = contingencyManagementHotspotRepository;
|
|
|
+ _publisher = publisher;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -322,50 +319,12 @@ public class OrderController : BaseController
|
|
|
publishPublishOrder.Order = _mapper.Map<OrderDto>(order);
|
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderPublishOrder, publishPublishOrder);
|
|
|
|
|
|
+ //推应急管理局
|
|
|
+ //是否开启
|
|
|
var isOpenContingencyManagement = _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenContingencyManagement)?.SettingValue[0];
|
|
|
if (isOpenContingencyManagement == "true")
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- //应急管理局业务处理
|
|
|
- //是否是指定热点
|
|
|
- if (await _contingencyManagementHotspotRepository.AnyAsync(p => p.Id == order.HotspotId, HttpContext.RequestAborted))
|
|
|
- {
|
|
|
- var orderData = await _contingencyManagementOrdersRepository.GetAsync(p => p.Id == order.Id, HttpContext.RequestAborted);
|
|
|
- //不存在新增
|
|
|
- if (orderData == null)
|
|
|
- {
|
|
|
- orderData = new ContingencyManagementOrders();
|
|
|
- orderData = _mapper.Map<ContingencyManagementOrders>(order);
|
|
|
- orderData.Id = order.Id;
|
|
|
- orderData.ArrangementOpinion = order.ActualOpinion;
|
|
|
- orderData.ArrangeTitle = order.Title;
|
|
|
- orderData.ArrangeContent = order.Content;
|
|
|
- orderData.PushState = "0";
|
|
|
- await _contingencyManagementOrdersRepository.AddAsync(orderData, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //存在修改
|
|
|
- _mapper.Map(order, orderData);
|
|
|
- orderData.ArrangementOpinion = order.ActualOpinion;
|
|
|
- orderData.ArrangeTitle = order.Title;
|
|
|
- orderData.ArrangeContent = order.Content;
|
|
|
- orderData.PushState = "0";
|
|
|
- await _contingencyManagementOrdersRepository.UpdateAsync(orderData, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- //推送消息
|
|
|
- var pushaData = _mapper.Map<ContingencyManagementOrdersDto>(orderData);
|
|
|
- pushaData.Id = orderData.Id;
|
|
|
- //推送消息
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderContingencyManagement,
|
|
|
- pushaData, Hotline.Share.Mq.EventNames.HotlineOrderContingencyManagementState);
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
+ await _publisher.PublishAsync(new ContingencyManagementNotify(order), PublishStrategy.ParallelNoWait, HttpContext.RequestAborted);
|
|
|
+
|
|
|
var orderVisit = new OrderVisit();
|
|
|
orderVisit.No = order.No;
|
|
|
orderVisit.OrderId = order.Id;
|
|
@@ -500,51 +459,11 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderPublishOrder, publishPublishOrder);
|
|
|
|
|
|
+ //推应急管理局
|
|
|
+ //是否开启
|
|
|
var isOpenContingencyManagement = _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenContingencyManagement)?.SettingValue[0];
|
|
|
if (isOpenContingencyManagement == "true")
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- //应急管理局业务处理
|
|
|
- //是否是指定热点
|
|
|
- if (await _contingencyManagementHotspotRepository.AnyAsync(p => p.Id == order.HotspotId, HttpContext.RequestAborted))
|
|
|
- {
|
|
|
- var orderData = await _contingencyManagementOrdersRepository.GetAsync(p => p.Id == order.Id, HttpContext.RequestAborted);
|
|
|
- //不存在新增
|
|
|
- if (orderData == null)
|
|
|
- {
|
|
|
- orderData = new ContingencyManagementOrders();
|
|
|
- orderData = _mapper.Map<ContingencyManagementOrders>(order);
|
|
|
- orderData.Id = order.Id;
|
|
|
- orderData.ArrangementOpinion = dto.ArrangeOpinion;
|
|
|
- orderData.ArrangeTitle = dto.ArrangeTitle;
|
|
|
- orderData.ArrangeContent = dto.ArrangeContent;
|
|
|
- orderData.PushState = "0";
|
|
|
- await _contingencyManagementOrdersRepository.AddAsync(orderData, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //存在修改
|
|
|
- _mapper.Map(order, orderData);
|
|
|
- orderData.ArrangementOpinion = dto.ArrangeOpinion;
|
|
|
- orderData.ArrangeTitle = dto.ArrangeTitle;
|
|
|
- orderData.ArrangeContent = dto.ArrangeContent;
|
|
|
- orderData.PushState = "0";
|
|
|
- await _contingencyManagementOrdersRepository.UpdateAsync(orderData, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- var pushaData = _mapper.Map<ContingencyManagementOrdersDto>(orderData);
|
|
|
- pushaData.Id = order.Id;
|
|
|
- pushaData.CreationTime = order.CreationTime;
|
|
|
- //推送消息
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderContingencyManagement,
|
|
|
- pushaData, Hotline.Share.Mq.EventNames.HotlineOrderContingencyManagementState, HttpContext.RequestAborted);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
+ await _publisher.PublishAsync(new ContingencyManagementNotify(order), PublishStrategy.ParallelNoWait, HttpContext.RequestAborted);
|
|
|
|
|
|
var orderVisit = new OrderVisit();
|
|
|
orderVisit.No = order.No;
|