|
@@ -4,6 +4,7 @@ using Hotline.Application.FlowEngine;
|
|
|
using Hotline.Application.Orders;
|
|
|
using Hotline.Authentications;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
+using Hotline.Caching.Services;
|
|
|
using Hotline.Configurations;
|
|
|
using Hotline.ContingencyManagement;
|
|
|
using Hotline.File;
|
|
@@ -24,7 +25,9 @@ using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Mq;
|
|
|
using MapsterMapper;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
+using XF.Domain.Authentications;
|
|
|
using XF.Domain.Dependency;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
@@ -63,6 +66,8 @@ namespace Hotline.Application.Subscribers
|
|
|
private readonly IRepository<ContingencyManagementOrders> _contingencyManagementOrdersRepository;
|
|
|
private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
private readonly ICallApplication _callApplication;
|
|
|
+ private readonly IRepository<OrderPublish> _orderPublishRepository;
|
|
|
+ private readonly ISystemDicDataCacheManager _sysDicDataCacheManager;
|
|
|
|
|
|
public DataSharingSubscriber(
|
|
|
IRepository<OrderVisit> orderVisitRepository,
|
|
@@ -91,7 +96,9 @@ namespace Hotline.Application.Subscribers
|
|
|
IRepository<OrderRevoke> orderRevokeRepository,
|
|
|
IRepository<ContingencyManagementOrders> contingencyManagementOrdersRepository,
|
|
|
IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
- ICallApplication callApplication)
|
|
|
+ ICallApplication callApplication,
|
|
|
+ IRepository<OrderPublish> orderPublishRepository,
|
|
|
+ ISystemDicDataCacheManager sysDicDataCacheManager)
|
|
|
{
|
|
|
_orderSendBackRepository = orderSendBackRepository;
|
|
|
_workflowApplication = workflowApplication;
|
|
@@ -120,6 +127,8 @@ namespace Hotline.Application.Subscribers
|
|
|
_contingencyManagementOrdersRepository = contingencyManagementOrdersRepository;
|
|
|
_appOptions = appOptions;
|
|
|
_callApplication = callApplication;
|
|
|
+ _orderPublishRepository = orderPublishRepository;
|
|
|
+ _sysDicDataCacheManager = sysDicDataCacheManager;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -537,7 +546,79 @@ namespace Hotline.Application.Subscribers
|
|
|
else
|
|
|
{
|
|
|
//处理省下行回访
|
|
|
+ var order = await _orderRepository.Queryable().Where(x => x.ProvinceNo == dto.ProvinceNo).FirstAsync();
|
|
|
+ if (order !=null)
|
|
|
+ {
|
|
|
+ //判断是否有发布数据
|
|
|
+ var orderPublish = await _orderPublishRepository.Queryable()
|
|
|
+ .Includes(x => x.Order).
|
|
|
+ Where(x => x.Order.ProvinceNo == 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.VisitState = EVisitState.WaitForVisit;
|
|
|
+ orderVisit.PublishTime = DateTime.Now;
|
|
|
+ orderVisit.IsCanHandle = true;
|
|
|
+ orderVisit.EmployeeId = order.CenterToOrgHandlerId;
|
|
|
+ orderVisit.VisitState = EVisitState.Visited;
|
|
|
+ orderVisit.VisitTime = dto.VisitTime;
|
|
|
+ orderVisit.VisitType = dto.VisitType;
|
|
|
+ orderVisit.IsCanAiVisit = false;
|
|
|
+ orderVisit.IsCanHandle = 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.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);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|