|
@@ -1479,4 +1479,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);
|
|
|
+ }
|
|
|
}
|