|
@@ -79,6 +79,10 @@ using Microsoft.AspNetCore.DataProtection;
|
|
|
using Hotline.Share.Tools;
|
|
|
using NETCore.Encrypt;
|
|
|
using Hotline.Ai.Quality;
|
|
|
+using Hotline.EventBus;
|
|
|
+using Hotline.JudicialManagement.Notifies;
|
|
|
+using Hotline.Snapshot.Notifications;
|
|
|
+using XF.Domain.Entities;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -1098,199 +1102,6 @@ ICallApplication callApplication,
|
|
|
"RGDH9951150024082950312",
|
|
|
"RGDH9951150024080750198",
|
|
|
"RGDH9951150024083050009",
|
|
|
-"RGDH9951150024083150167",
|
|
|
-"RGDH9951150024083150102",
|
|
|
-"RGDH9951150024083050052",
|
|
|
-"RGDH9951150024080750184",
|
|
|
-"RGDH9951150024083050108",
|
|
|
-"RGDH9951150024083050314",
|
|
|
-"RGDH9951150024083050363",
|
|
|
-"RGDH9951150024083150243",
|
|
|
-"RGDH9951150024082850303",
|
|
|
-"QT9951150024082150023",
|
|
|
-"RGDH9951150024080750185",
|
|
|
-"RGDH9951150024083150065",
|
|
|
-"RGDH9951150024082850032",
|
|
|
-"RGDH9951150024082950295",
|
|
|
-"RGDH9951150024080750189",
|
|
|
-"RGDH9951150024082650189",
|
|
|
-"RGDH9951150024083050008",
|
|
|
-"RGDH9951150024082950036",
|
|
|
-"RGDH9951150024082850341",
|
|
|
-"RGDH9951150024080750215",
|
|
|
-"RGDH9951150024081450005",
|
|
|
-"RGDH9951150024080750212",
|
|
|
-"RGDH9951150024083050137",
|
|
|
-"RGDH9951150024082450124",
|
|
|
-"RGDH9951150024083150188",
|
|
|
-"RGDH9951150024083150083",
|
|
|
-"RGDH9951150024082850082",
|
|
|
-"RGDH9951150024080750174",
|
|
|
-"RGDH9951150024082950371",
|
|
|
-"RGDH9951150024082950114",
|
|
|
-"RGDH9951150024083050339",
|
|
|
-"RGDH9951150024080750217",
|
|
|
-"RGDH9951150024082950040",
|
|
|
-"RGDH9951150024083050031",
|
|
|
-"RGDH9951150024083150267",
|
|
|
-"RGDH9951150024083050064",
|
|
|
-"RGDH9951150024072650086",
|
|
|
-"RGDH9951150024082950360",
|
|
|
-"RGDH9951150024080750195",
|
|
|
-"RGDH9951150024080750210",
|
|
|
-"RGDH9951150024082950250",
|
|
|
-"RGDH9951150024083050145",
|
|
|
-"RGDH9951150024083050356",
|
|
|
-"RGDH9951150024080750194",
|
|
|
-"RGDH9951150024080750173",
|
|
|
-"RGDH9951150024080750213",
|
|
|
-"RGDH9951150024080750218",
|
|
|
-"RGDH9951150024083150271",
|
|
|
-"RGDH9951150024083150134",
|
|
|
-"RGDH9951150024080750179",
|
|
|
-"RGDH9951150024083050140",
|
|
|
-"RGDH9951150024083150262",
|
|
|
-"RGDH9951150024083050119",
|
|
|
-"RGDH9951150024083150177",
|
|
|
-"RGDH9951150024083050146",
|
|
|
-"RGDH9951150024080750223",
|
|
|
-"RGDH9951150024080750221",
|
|
|
-"RGDH9951150024083150130",
|
|
|
-"RGDH9951150024080750209",
|
|
|
-"RGDH9951150024083150237",
|
|
|
-"RGDH9951150024082850095",
|
|
|
-"RGDH9951150024082850223",
|
|
|
-"RGDH9951150024083050077",
|
|
|
-"RGDH9951150024082950118",
|
|
|
-"RGDH9951150024082850056",
|
|
|
-"RGDH9951150024082550177",
|
|
|
-"RGDH9951150024083050358",
|
|
|
-"RGDH9951150024080750193",
|
|
|
-"RGDH9951150024082150011",
|
|
|
-"RGDH9951150024082950167",
|
|
|
-"RGDH9951150024083050201",
|
|
|
-"RGDH9951150024082850048",
|
|
|
-"RGDH9951150024083150161",
|
|
|
-"RGDH9951150024083050300",
|
|
|
-"RGDH9951150024083150016",
|
|
|
-"RGDH9951150024083150101",
|
|
|
-"RGDH9951150024082850207",
|
|
|
-"RGDH9951150024083150144",
|
|
|
-"RGDH9951150024082750300",
|
|
|
-"RGDH9951150024083050230",
|
|
|
-"RGDH9951150024080750211",
|
|
|
-"RGDH9951150024082750379",
|
|
|
-"RGDH9951150024082850252",
|
|
|
-"RGDH9951150024083050204",
|
|
|
-"RGDH9951150024080750176",
|
|
|
-"RGDH9951150024080750190",
|
|
|
-"RGDH9951150024083150027",
|
|
|
-"RGDH9951150024082850308",
|
|
|
-"RGDH9951150024082850070",
|
|
|
-"RGDH9951150024082950068",
|
|
|
-"RGDH9951150024083050002",
|
|
|
-"RGDH9951150024083050130",
|
|
|
-"RGDH9951150024083050060",
|
|
|
-"RGDH9951150024082950282",
|
|
|
-"RGDH9951150024082950320",
|
|
|
-"RGDH9951150024082850312",
|
|
|
-"RGDH9951150024083150040",
|
|
|
-"RGDH9951150024080750202",
|
|
|
-"RGDH9951150024083150216",
|
|
|
-"RGDH9951150024082750156",
|
|
|
-"RGDH9951150024082850224",
|
|
|
-"RGDH9951150024083150238",
|
|
|
-"RGDH9951150024083050327",
|
|
|
-"RGDH9951150024082950090",
|
|
|
-"RGDH9951150024083150131",
|
|
|
-"RGDH9951150024080750187",
|
|
|
-"RGDH9951150024082350072",
|
|
|
-"RGDH9951150024080750177",
|
|
|
-"RGDH9951150024082950010",
|
|
|
-"RGDH9951150024082850263",
|
|
|
-"RGDH9951150024082850087",
|
|
|
-"RGDH9951150024083050234",
|
|
|
-"RGDH9951150024083150098",
|
|
|
-"RGDH9951150024083050166",
|
|
|
-"RGDH9951150024082850339",
|
|
|
-"RGDH9951150024083150157",
|
|
|
-"RGDH9951150024080150214",
|
|
|
-"RGDH9951150024083150149",
|
|
|
-"RGDH9951150024083150264",
|
|
|
-"RGDH9951150024080750200",
|
|
|
-"RGDH9951150024083150116",
|
|
|
-"RGDH9951150024082950188",
|
|
|
-"RGDH9951150024083050148",
|
|
|
-"RGDH9951150024082750338",
|
|
|
-"RGDH9951150024082950268",
|
|
|
-"RGDH9951150024083050337",
|
|
|
-"RGDH9951150024082250263",
|
|
|
-"RGDH9951150024080750196",
|
|
|
-"RGDH9951150024080750192",
|
|
|
-"RGDH9951150024082850272",
|
|
|
-"RGDH9951150024082650290",
|
|
|
-"RGDH9951150024083150117",
|
|
|
-"RGDH9951150024080750207",
|
|
|
-"RGDH9951150024080750201",
|
|
|
-"RGDH9951150024080750188",
|
|
|
-"RGDH9951150024083050011",
|
|
|
-"RGDH9951150024083050067",
|
|
|
-"RGDH9951150024083050193",
|
|
|
-"RGDH9951150024082850242",
|
|
|
-"RGDH9951150024082950121",
|
|
|
-"RGDH9951150024080750222",
|
|
|
-"RGDH9951150024082950280",
|
|
|
-"RGDH9951150024080750205",
|
|
|
-"RGDH9951150024083050334",
|
|
|
-"RGDH9951150024083150235",
|
|
|
-"RGDH9951150024082950156",
|
|
|
-"RGDH9951150024080750220",
|
|
|
-"RGDH9951150024082750209",
|
|
|
-"RGDH9951150024083150046",
|
|
|
-"RGDH9951150024080750214",
|
|
|
-"RGDH9951150024082850116",
|
|
|
-"RGDH9951150024083050082",
|
|
|
-"RGDH9951150024083150118",
|
|
|
-"RGDH9951150024082950338",
|
|
|
-"RGDH9951150024082950359",
|
|
|
-"RGDH9951150024083150156",
|
|
|
-"RGDH9951150024083150072",
|
|
|
-"RGDH9951150024082150001",
|
|
|
-"RGDH9951150024082850186",
|
|
|
-"RGDH9951150024082750377",
|
|
|
-"RGDH9951150024083150166",
|
|
|
-"RGDH9951150024083050255",
|
|
|
-"RGDH9951150024083050190",
|
|
|
-"RGDH9951150024080750175",
|
|
|
-"RGDH9951150024083050184",
|
|
|
-"RGDH9951150024083050021",
|
|
|
-"RGDH9951150024082850317",
|
|
|
-"RGDH9951150024082950146",
|
|
|
-"RGDH9951150024083150172",
|
|
|
-"RGDH9951150024083050354",
|
|
|
-"RGDH9951150024082850305",
|
|
|
-"RGDH9951150024082850351",
|
|
|
-"RGDH9951150024082950340",
|
|
|
-"RGDH9951150024083150273",
|
|
|
-"RGDH9951150024080750208",
|
|
|
-"RGDH9951150024083150053",
|
|
|
-"RGDH9951150024082850291",
|
|
|
-"RGDH9951150024082950104",
|
|
|
-"RGDH9951150024082850247",
|
|
|
-"RGDH9951150024082850320",
|
|
|
-"RGDH9951150024083050285",
|
|
|
-"RGDH9951150024082850011",
|
|
|
-"RGDH9951150024083050174",
|
|
|
-"RGDH9951150024083150212",
|
|
|
-"RGDH9951150024083050323",
|
|
|
-"RGDH9951150024080750224",
|
|
|
-"RGDH9951150024083150244",
|
|
|
-"RGDH9951150024080750199",
|
|
|
-"RGDH9951150024082850269",
|
|
|
-"RGDH9951150024082850053",
|
|
|
-"RGDH9951150024082950342",
|
|
|
-"RGDH9951150024082950046",
|
|
|
-"RGDH9951150024082950194"
|
|
|
};
|
|
|
_logger.LogWarning($"推送数据共:{provinceNos.Count}");
|
|
|
|
|
@@ -1479,4 +1290,144 @@ ICallApplication callApplication,
|
|
|
var strString = dto.AppId + dto.Timestamp;
|
|
|
return dto.AppId + EncryptProvider.AESEncrypt(strString, dto.Secret, dto.AppId);
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 归档handle错误数据处理
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("end_order_data_dispose")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task EndOrderDataDispose([FromBody] string No)
|
|
|
+ {
|
|
|
+ var orderNo = await _orderRepository.Queryable().Where(x => x.No == No).FirstAsync(HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ var workflow = await _workflowRepository.Queryable().Where(x => x.ExternalId == orderNo.Id).FirstAsync(HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ var notification = await _workflowStepRepository.Queryable().Includes(x=>x.Workflow,w=>w.Steps).Where(x => x.ExternalId == orderNo.Id && x.BusinessType == EBusinessType.File && x.StepType == EStepType.End).FirstAsync(HttpContext.RequestAborted);
|
|
|
+ var order = await _orderDomainService.GetOrderAsync(orderNo.Id,
|
|
|
+ withExtension: true, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ //order.CheckIfFiled();
|
|
|
+ //order.UpdateHandlingStatus(workflow.IsInCountersign);
|
|
|
+ _mapper.Map(workflow, order);
|
|
|
+ var now = DateTime.Now;
|
|
|
+ var handleDuration = order.CenterToOrgTime.HasValue && order.ActualHandleTime.HasValue
|
|
|
+ ? // _timeLimitDomainService.CalcWorkTime(
|
|
|
+ await _expireTime.CalcWorkTime(
|
|
|
+ order.CenterToOrgTime.Value,
|
|
|
+ order.ActualHandleTime.Value, order.ProcessType is EProcessType.Zhiban)
|
|
|
+ : 0;
|
|
|
+ var fileDuration = order.CenterToOrgTime.HasValue
|
|
|
+ ? //_timeLimitDomainService.CalcWorkTime(
|
|
|
+ await _expireTime.CalcWorkTime(
|
|
|
+ order.CenterToOrgTime.Value,
|
|
|
+ now, order.ProcessType is EProcessType.Zhiban)
|
|
|
+ : 0;
|
|
|
+ var allDuration = order.StartTime.HasValue
|
|
|
+ ? // _timeLimitDomainService.CalcWorkTime(
|
|
|
+ await _expireTime.CalcWorkTime(
|
|
|
+ order.StartTime.Value, now,
|
|
|
+ order.ProcessType is EProcessType.Zhiban)
|
|
|
+ : 0;
|
|
|
+ var creationTimeHandleDurationWorkday = order.ActualHandleTime.HasValue
|
|
|
+ ? //_timeLimitDomainService.CalcWorkTimeEx(
|
|
|
+ await _expireTime.CalcWorkTimeEx(
|
|
|
+ order.CreationTime, now,
|
|
|
+ order.ProcessType is EProcessType.Zhiban)
|
|
|
+ : 0;
|
|
|
+ var centerToOrgHandleDurationWorkday = order.ActualHandleTime.HasValue && order.CenterToOrgTime.HasValue
|
|
|
+ ? //_timeLimitDomainService.CalcWorkTimeEx(
|
|
|
+ await _expireTime.CalcWorkTimeEx(
|
|
|
+ order.CenterToOrgTime.Value, now,
|
|
|
+ order.ProcessType is EProcessType.Zhiban)
|
|
|
+ : 0;
|
|
|
+ creationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday <= 0 ? 10 : creationTimeHandleDurationWorkday;
|
|
|
+ centerToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday <= 0 ? 10 : centerToOrgHandleDurationWorkday;
|
|
|
+
|
|
|
+ order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
|
|
|
+ order.FileUserId = notification.HandlerId;
|
|
|
+ order.FileUserName = notification.HandlerName;
|
|
|
+ order.FileUserOrgId = notification.HandlerOrgId;
|
|
|
+ order.FileUserOrgName = notification.HandlerOrgName;
|
|
|
+ order.FileOrgIsCenter = notification.HandlerOrgIsCenter;
|
|
|
+ order.FileOpinion = notification.Opinion;
|
|
|
+
|
|
|
+ //记录冗余归档数据
|
|
|
+ if (notification.Workflow.Steps.Any(x => x.BusinessType == Share.Enums.FlowEngine.EBusinessType.Send))
|
|
|
+ {
|
|
|
+ order.FileUserRole = EFileUserType.Dispatch;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ order.FileUserRole = EFileUserType.Seat;
|
|
|
+ }
|
|
|
+ if (order.ProcessType == EProcessType.Jiaoban)
|
|
|
+ {
|
|
|
+ order.FileUserRole = EFileUserType.Org;
|
|
|
+ }
|
|
|
+
|
|
|
+ //是否已解决
|
|
|
+ order.IsResolved = true;
|
|
|
+
|
|
|
+ await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
+ //var callRecord = await _trCallRecordRepository.GetAsync(p => p.CallAccept == order.CallId, cancellationToken); //由CallAccept改为OtherAccept
|
|
|
+ //var callRecord = await _trCallRecordRepository.GetAsync(p => p.OtherAccept == order.CallId, cancellationToken);
|
|
|
+ //var orderFlowDto = new OrderFlowDto
|
|
|
+ //{
|
|
|
+ // Order = _mapper.Map<OrderDto>(order),
|
|
|
+ // WorkflowTrace = _mapper.Map<WorkflowTraceDto>(notification.Trace)
|
|
|
+ //};
|
|
|
+ //// if (callRecord != null)
|
|
|
+ //// {
|
|
|
+ //// orderFlowDto.TrCallRecordDto = _mapper.Map<TrCallDto>(callRecord);
|
|
|
+ //// }
|
|
|
+ //if (order.SourceChannelCode == AppDefaults.SourceChannel.DianHua &&
|
|
|
+ // !string.IsNullOrEmpty(order.CallId))
|
|
|
+ //{
|
|
|
+ // if (_appOptions.Value.GetDefaultAppScopeConfiguration().CallCenterType == AppDefaults.CallCenterType.TianRun)
|
|
|
+ // {
|
|
|
+ // // var callRecord = await _trCallRecordRepository.GetAsync(p => p.OtherAccept == order.CallId, cancellationToken);
|
|
|
+ // var callRecord = await _callApplication.GetTianrunCallAsync(order.CallId, HttpContext.RequestAborted);
|
|
|
+ // if (callRecord != null)
|
|
|
+ // {
|
|
|
+ // orderFlowDto.TrCallRecordDto = _mapper.Map<TrCallDto>(callRecord);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else if (_appOptions.Value.GetDefaultAppScopeConfiguration().CallCenterType == AppDefaults.CallCenterType.XingTang)
|
|
|
+ // {
|
|
|
+ // var call = await _callApplication.GetCallAsync(order.CallId, HttpContext.RequestAborted);
|
|
|
+ // if (call is not null)
|
|
|
+ // {
|
|
|
+ // orderFlowDto.TrCallRecordDto = _mapper.Map<TrCallDto>(call);
|
|
|
+
|
|
|
+ // // 工单开始办理如果获取的通话记录是呼出并且录音文件是空就不推送通话记录
|
|
|
+ // // 如果 通话记录是呼入, 并且没有录音文件
|
|
|
+ // if (_systemSettingCacheManager.OrderStartHandlerPushCallIsNull && call.Direction == ECallDirection.Out && call.AudioFile.IsNullOrEmpty())
|
|
|
+ // {
|
|
|
+ // orderFlowDto.TrCallRecordDto = null;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
+ //这里需要判断是否是警情退回
|
|
|
+ //orderFlowDto.IsNonPoliceReturn = notification.Dto.External == null ? false : notification.Dto.External.IsPoliceReturn;
|
|
|
+ //await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFiled, orderFlowDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ //await _publisher.PublishAsync(new SnapshotOrderFiledNotification(order.Id), PublishStrategy.ParallelWhenAll, HttpContext.RequestAborted);
|
|
|
+ //await _orderDomainService.OrderAutomaticPublishAsync(order, HttpContext.RequestAborted);
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // //写入质检 针对受理之后直接结束的工单
|
|
|
+ // await _qualityApplication.AddQualityAsync(EQualitySource.Accepted, order.Id, cancellationToken);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError($"写入质检异常!orderId: {order.Id}, \r\n{e.Message}");
|
|
|
+ //}
|
|
|
+
|
|
|
+ //司法行政监督管理-工单处理
|
|
|
+ //如果没开启则不处理
|
|
|
+ //var isOpenJudicialManagement = _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenJudicialManagement)?.SettingValue[0];
|
|
|
+ //if (isOpenJudicialManagement == "true")
|
|
|
+ // await _publisher.PublishAsync(new JudicialManagementOrderNotify(order), PublishStrategy.ParallelWhenAll, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
}
|