|
@@ -1,4 +1,8 @@
|
|
|
-using DataSharing.Share.Dtos.DaoShu110;
|
|
|
+using DataSharing.DaoShu110;
|
|
|
+using DataSharing.Extensions;
|
|
|
+using DataSharing.RawData;
|
|
|
+using DataSharing.Share.Dtos;
|
|
|
+using DataSharing.Share.Dtos.DaoShu110;
|
|
|
using DotNetCore.CAP;
|
|
|
using MapsterMapper;
|
|
|
using MediatR;
|
|
@@ -6,16 +10,10 @@ using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Newtonsoft.Json;
|
|
|
using Newtonsoft.Json.Converters;
|
|
|
-using Sharing.Share.Dtos.DataSharing.Province;
|
|
|
using System.Net;
|
|
|
using System.Text;
|
|
|
using XF.Domain.Filters;
|
|
|
using XF.Domain.Repository;
|
|
|
-using Hotline.Share.Dtos.Order;
|
|
|
-using DataSharing.Share.Dtos;
|
|
|
-using DataSharing.Extensions;
|
|
|
-using DataSharing.DaoShu110;
|
|
|
-using DataSharing.RawData;
|
|
|
|
|
|
namespace DataSharing.Host.Controllers
|
|
|
{
|
|
@@ -32,24 +30,30 @@ namespace DataSharing.Host.Controllers
|
|
|
private readonly IRepository<DsPoliceSendChainAlarmDs> _dsPoliceSendChainAlarmDsRepository;
|
|
|
private readonly IRepository<DsPoliceSendChainDealDs> _dsPoliceSendChainDealDsRepository;
|
|
|
private readonly IRepository<DsKnowledgeRawData> _dsKnowledgeRawDataRepository;
|
|
|
+ private readonly IRepository<DsOrder> _dsOrderRepository;
|
|
|
+ private readonly IRepository<DsReceivePoliceData> _dsReceivePoliceDataRepository;
|
|
|
|
|
|
- /// <summary>
|
|
|
- ///
|
|
|
- /// </summary>
|
|
|
- /// <param name="mapper"></param>
|
|
|
- /// <param name="capPublisher"></param>
|
|
|
- /// <param name="mediator"></param>
|
|
|
- /// <param name="channelConfigurationManager"></param>
|
|
|
- /// <param name="dsPoliceSendChainAlarmDsRepository"></param>
|
|
|
- /// <param name="dsPoliceSendChainDealDsRepository"></param>
|
|
|
- /// <param name="dsKnowledgeRawDataRepository"></param>
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="mapper"></param>
|
|
|
+ /// <param name="capPublisher"></param>
|
|
|
+ /// <param name="mediator"></param>
|
|
|
+ /// <param name="channelConfigurationManager"></param>
|
|
|
+ /// <param name="dsPoliceSendChainAlarmDsRepository"></param>
|
|
|
+ /// <param name="dsPoliceSendChainDealDsRepository"></param>
|
|
|
+ /// <param name="dsKnowledgeRawDataRepository"></param>
|
|
|
+ /// <param name="dsOrderRepository"></param>
|
|
|
+ /// <param name="dsReceivePoliceDataRepository"></param>
|
|
|
public PoliceDSController(IMapper mapper,
|
|
|
ICapPublisher capPublisher,
|
|
|
IMediator mediator,
|
|
|
IChannelConfigurationManager channelConfigurationManager,
|
|
|
IRepository<DsPoliceSendChainAlarmDs> dsPoliceSendChainAlarmDsRepository,
|
|
|
IRepository<DsPoliceSendChainDealDs> dsPoliceSendChainDealDsRepository,
|
|
|
- IRepository<DsKnowledgeRawData> dsKnowledgeRawDataRepository)
|
|
|
+ IRepository<DsKnowledgeRawData> dsKnowledgeRawDataRepository,
|
|
|
+ IRepository<DsOrder> dsOrderRepository,
|
|
|
+ IRepository<DsReceivePoliceData> dsReceivePoliceDataRepository)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_capPublisher = capPublisher;
|
|
@@ -58,6 +62,8 @@ namespace DataSharing.Host.Controllers
|
|
|
_dsPoliceSendChainAlarmDsRepository = dsPoliceSendChainAlarmDsRepository;
|
|
|
_dsPoliceSendChainDealDsRepository = dsPoliceSendChainDealDsRepository;
|
|
|
_dsKnowledgeRawDataRepository = dsKnowledgeRawDataRepository;
|
|
|
+ _dsOrderRepository = dsOrderRepository;
|
|
|
+ _dsReceivePoliceDataRepository = dsReceivePoliceDataRepository;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -98,6 +104,8 @@ namespace DataSharing.Host.Controllers
|
|
|
// json 转 实体类
|
|
|
if (!string.IsNullOrEmpty(jsonRes))
|
|
|
chainAlarm = System.Text.Json.JsonSerializer.Deserialize<ChainAlarm_DS>(jsonRes);
|
|
|
+
|
|
|
+ await InitRawData("service/api/ds/110To12345/chainAlarm", base64String, jsonRes, chainAlarm?.AlarmReceiptNumber);
|
|
|
}
|
|
|
|
|
|
#region 数据验证
|
|
@@ -114,7 +122,7 @@ namespace DataSharing.Host.Controllers
|
|
|
{
|
|
|
|
|
|
//组装业务系统工单数据
|
|
|
- AddOrderDto orderDto = new()
|
|
|
+ Hotline.Share.Dtos.Order.AddOrderDto orderDto = new()
|
|
|
{
|
|
|
ExternalId = chainAlarm.AlarmReceiptNumber,
|
|
|
// AcceptorStaffNo = policeReceive.RegisterNo,
|
|
@@ -207,6 +215,8 @@ namespace DataSharing.Host.Controllers
|
|
|
if (!string.IsNullOrEmpty(jsonRes))
|
|
|
// json 转 实体类
|
|
|
chainDeal = System.Text.Json.JsonSerializer.Deserialize<ChainDeal_DS>(jsonRes);
|
|
|
+
|
|
|
+ await InitRawData("service/api/ds/110To12345/chainDeal", base64String, jsonRes, chainDeal?.AlarmReceiptNumber);
|
|
|
}
|
|
|
|
|
|
#region 数据验证
|
|
@@ -282,6 +292,8 @@ namespace DataSharing.Host.Controllers
|
|
|
if (!string.IsNullOrEmpty(jsonRes))
|
|
|
// json 转 实体类
|
|
|
openData = System.Text.Json.JsonSerializer.Deserialize<OpenData>(jsonRes);
|
|
|
+
|
|
|
+ await InitRawData("service/api/ds/12345To110/chainAlarm", base64String, jsonRes, openData?.AlarmReceiptNumber);
|
|
|
}
|
|
|
bool bRun = true;
|
|
|
if (string.IsNullOrEmpty(openData.StartDate) || !IsDate(openData.StartDate))
|
|
@@ -369,6 +381,8 @@ namespace DataSharing.Host.Controllers
|
|
|
if (!string.IsNullOrEmpty(jsonRes))
|
|
|
// json 转 实体类
|
|
|
openData = System.Text.Json.JsonSerializer.Deserialize<OpenData>(jsonRes);
|
|
|
+
|
|
|
+ await InitRawData("service/api/ds/12345To110/chainDeal", base64String, jsonRes, openData?.AlarmReceiptNumber);
|
|
|
}
|
|
|
bool bRun = true;
|
|
|
|
|
@@ -463,6 +477,8 @@ namespace DataSharing.Host.Controllers
|
|
|
if (!string.IsNullOrEmpty(jsonRes))
|
|
|
// json 转 实体类
|
|
|
get_Knowledge = System.Text.Json.JsonSerializer.Deserialize<Get_Knowledge>(jsonRes);
|
|
|
+
|
|
|
+ await InitRawData("service/api/ds/get_knowledge_info", base64String, jsonRes, null);
|
|
|
}
|
|
|
|
|
|
bool bRun = true;
|
|
@@ -546,6 +562,8 @@ namespace DataSharing.Host.Controllers
|
|
|
if (!string.IsNullOrEmpty(jsonRes))
|
|
|
// json 转 实体类
|
|
|
get_Knowledge = System.Text.Json.JsonSerializer.Deserialize<Get_Knowledge>(jsonRes);
|
|
|
+
|
|
|
+ await InitRawData("service/api/ds/get_knowledge_content", base64String, jsonRes, null);
|
|
|
}
|
|
|
|
|
|
if (string.IsNullOrEmpty(get_Knowledge.id))
|
|
@@ -584,6 +602,9 @@ namespace DataSharing.Host.Controllers
|
|
|
#endregion
|
|
|
|
|
|
#region 私有方法
|
|
|
+
|
|
|
+ #region 工单办结
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 工单办结
|
|
|
/// </summary>
|
|
@@ -591,52 +612,72 @@ namespace DataSharing.Host.Controllers
|
|
|
/// <returns></returns>
|
|
|
private async Task InitChainDeal(ChainDeal_DS policeReceiveChainDealDs)
|
|
|
{
|
|
|
+ var orderData = await _dsOrderRepository.GetAsync(p => p.ExternalId == policeReceiveChainDealDs.AlarmReceiptNumber);
|
|
|
+ if (orderData is null)
|
|
|
+ return;
|
|
|
+
|
|
|
if (policeReceiveChainDealDs.DisposalType == 1)//正常办理
|
|
|
{
|
|
|
- OrderDto orderDto = new()
|
|
|
+ Hotline.Share.Dtos.DataSharing.PusherHotlineDto.OrderResultDto orderResultDto = new()
|
|
|
{
|
|
|
- ExternalId = policeReceiveChainDealDs.AlarmReceiptNumber,
|
|
|
- ActualHandleTime = Convert.ToDateTime(policeReceiveChainDealDs.FeedbackTime),
|
|
|
- ActualOpinion = policeReceiveChainDealDs.DisposalSituation,
|
|
|
- ActualHandlerId = policeReceiveChainDealDs.FeedbackPersonNumber,
|
|
|
- ActualHandlerName = policeReceiveChainDealDs.FeedbackPersonName,
|
|
|
- ActualHandleOrgCode = policeReceiveChainDealDs.FeedbackUnitCode,
|
|
|
- ActualHandleOrgName = policeReceiveChainDealDs.FeedbackUnitName
|
|
|
+ OrderId = orderData.OrderId,
|
|
|
+ FinishType = "1",
|
|
|
+ Opinion = policeReceiveChainDealDs.DisposalSituation
|
|
|
};
|
|
|
- // orderFlowDto.Order.ActualHandleTime = policeReceiveChainDealDs.WarehousingTime;
|
|
|
- //orderFlowDto.Order.ActualOpinion = policeReceiveChainDealDs.DisposalSituation;
|
|
|
- //向业务系统推送消息
|
|
|
- // await _capPublisher.PublishAsync(DataSharing.Share.Mq.EventNames.SharingPoliceHandle, orderDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ await _capPublisher.PublishAsync(DataSharing.Share.Mq.EventNames.SharingOrderReultSend, orderResultDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
+
|
|
|
}
|
|
|
else if (policeReceiveChainDealDs.DisposalType == 2)//退回
|
|
|
{
|
|
|
- ReturnFeedbackDto feedbackDto = new()
|
|
|
+ Hotline.Share.Dtos.DataSharing.PusherHotlineDto.OrderResultDto orderResultDto = new()
|
|
|
{
|
|
|
- CaseSerial = policeReceiveChainDealDs.AlarmReceiptNumber,
|
|
|
- DealDept = policeReceiveChainDealDs.ReturnUnit,
|
|
|
- DealName = policeReceiveChainDealDs.ReturnName,
|
|
|
- ApplyTime = Convert.ToDateTime(policeReceiveChainDealDs.ReturnTime),
|
|
|
- Reason = policeReceiveChainDealDs.ReturnOpinion
|
|
|
+ OrderId = orderData.OrderId,
|
|
|
+ FinishType = "0",
|
|
|
+ Opinion = policeReceiveChainDealDs.ReturnOpinion
|
|
|
};
|
|
|
//向业务系统推送消息
|
|
|
- // await _capPublisher.PublishAsync(DataSharing.Share.Mq.EventNames.SharingPoliceReturn, feedbackDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ await _capPublisher.PublishAsync(DataSharing.Share.Mq.EventNames.SharingOrderReultSend, orderResultDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
+
|
|
|
}
|
|
|
else if (policeReceiveChainDealDs.DisposalType == 3)//回访
|
|
|
{
|
|
|
- PublishVisitDto publishVisitDto = new()
|
|
|
+ Hotline.Share.Dtos.Order.ProvinceOrderVisitDto orderVisitDto = new()
|
|
|
{
|
|
|
+ ProvinceNo = orderData.ProvinceNo,
|
|
|
VisitTime = Convert.ToDateTime(policeReceiveChainDealDs.RevisitTime),
|
|
|
- VisitRemark = policeReceiveChainDealDs.VisitContent,
|
|
|
- SubjectResultSatifyCode = policeReceiveChainDealDs.VisitResult,
|
|
|
+ VisitContent = policeReceiveChainDealDs.VisitContent,
|
|
|
+ OrgProcessingResults = policeReceiveChainDealDs.VisitResult,
|
|
|
VisitType = Hotline.Share.Enums.Order.EVisitType.ArtificialVisit
|
|
|
};
|
|
|
- publishVisitDto.Order.ExternalId = policeReceiveChainDealDs.AlarmReceiptNumber;
|
|
|
|
|
|
//向业务系统推送消息
|
|
|
- // await _capPublisher.PublishAsync(DataSharing.Share.Mq.EventNames.SharingPoliceVisit, publishVisitDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ await _capPublisher.PublishAsync(DataSharing.Share.Mq.EventNames.SharingOrderEvlResult, orderVisitDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
|
|
|
+ #region 写入原始数据
|
|
|
+ /// <summary>
|
|
|
+ /// 写入原始数据
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="externalId"></param>
|
|
|
+ /// <param name="serviceInterface"></param>
|
|
|
+ /// <param name="receiveRawData"></param>
|
|
|
+ /// <param name="receiveData"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private async Task InitRawData(string serviceInterface, string receiveRawData, string receiveData, string? externalId)
|
|
|
+ {
|
|
|
+ DsReceivePoliceData dsReceivePoliceData = new()
|
|
|
+ {
|
|
|
+ ExternalId = externalId,
|
|
|
+ ServiceInterface = serviceInterface,
|
|
|
+ ReceiveRawData = receiveRawData,
|
|
|
+ ReceiveData = receiveData
|
|
|
+ };
|
|
|
+ await _dsReceivePoliceDataRepository.AddAsync(dsReceivePoliceData, HttpContext.RequestAborted);
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
#region 获取RAW传入的Base64_Json
|
|
|
/// <summary>
|