|
@@ -14,6 +14,7 @@ using Hotline.CallCenter.Calls;
|
|
using Hotline.CallCenter.Configs;
|
|
using Hotline.CallCenter.Configs;
|
|
using Hotline.CallCenter.Ivrs;
|
|
using Hotline.CallCenter.Ivrs;
|
|
using Hotline.CallCenter.Tels;
|
|
using Hotline.CallCenter.Tels;
|
|
|
|
+using Hotline.Configurations;
|
|
using Hotline.ContingencyManagement;
|
|
using Hotline.ContingencyManagement;
|
|
using Hotline.FlowEngine;
|
|
using Hotline.FlowEngine;
|
|
using Hotline.FlowEngine.Definitions;
|
|
using Hotline.FlowEngine.Definitions;
|
|
@@ -44,6 +45,7 @@ using Hotline.Users;
|
|
using MapsterMapper;
|
|
using MapsterMapper;
|
|
using MediatR;
|
|
using MediatR;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
+using Microsoft.AspNetCore.Builder.Extensions;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Options;
|
|
using Microsoft.Extensions.Options;
|
|
using MiniExcelLibs;
|
|
using MiniExcelLibs;
|
|
@@ -117,6 +119,7 @@ public class TestController : BaseController
|
|
private readonly IRepository<Tel> _telRepository;
|
|
private readonly IRepository<Tel> _telRepository;
|
|
private readonly IOrderDomainService _orderDomainService;
|
|
private readonly IOrderDomainService _orderDomainService;
|
|
private readonly ICallApplication _callApplication;
|
|
private readonly ICallApplication _callApplication;
|
|
|
|
+ private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
//private readonly ITypedCache<List<User>> _cache;
|
|
//private readonly ITypedCache<List<User>> _cache;
|
|
@@ -170,9 +173,10 @@ IRepository<EnforcementOrdersHandler> enforcementOrdersHandlerRepository,
|
|
IRepository<ContingencyManagementHotspot> contingencyManagementHotspotRepository,
|
|
IRepository<ContingencyManagementHotspot> contingencyManagementHotspotRepository,
|
|
IRepository<Hotspot> hotspotRepository,
|
|
IRepository<Hotspot> hotspotRepository,
|
|
IOrderDomainService orderDomainService,
|
|
IOrderDomainService orderDomainService,
|
|
-ICallApplication callApplication
|
|
|
|
-,
|
|
|
|
-ICalcExpireTime expireTime)
|
|
|
|
|
|
+ICallApplication callApplication,
|
|
|
|
+ IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
|
+ ISystemSettingCacheManager systemSettingCacheManager
|
|
|
|
+ )
|
|
{
|
|
{
|
|
_logger = logger;
|
|
_logger = logger;
|
|
//_authorizeGenerator = authorizeGenerator;
|
|
//_authorizeGenerator = authorizeGenerator;
|
|
@@ -218,7 +222,8 @@ ICalcExpireTime expireTime)
|
|
_telRepository = telRepository;
|
|
_telRepository = telRepository;
|
|
_orderDomainService = orderDomainService;
|
|
_orderDomainService = orderDomainService;
|
|
_callApplication = callApplication;
|
|
_callApplication = callApplication;
|
|
- _expireTime = expireTime;
|
|
|
|
|
|
+ _appOptions = appOptions;
|
|
|
|
+ _systemSettingCacheManager = systemSettingCacheManager;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -440,14 +445,14 @@ ICalcExpireTime expireTime)
|
|
foreach (var item in list)
|
|
foreach (var item in list)
|
|
{
|
|
{
|
|
var creationTimeHandleDurationWorkday = item.FiledTime.HasValue
|
|
var creationTimeHandleDurationWorkday = item.FiledTime.HasValue
|
|
- ?
|
|
|
|
|
|
+ ?
|
|
//_timeLimitDomainService.CalcWorkTimeEx(
|
|
//_timeLimitDomainService.CalcWorkTimeEx(
|
|
await _expireTime.CalcWorkTimeEx(
|
|
await _expireTime.CalcWorkTimeEx(
|
|
item.CreationTime, item.FiledTime.Value,
|
|
item.CreationTime, item.FiledTime.Value,
|
|
item.ProcessType is EProcessType.Zhiban)
|
|
item.ProcessType is EProcessType.Zhiban)
|
|
: 0;
|
|
: 0;
|
|
var centerToOrgHandleDurationWorkday = item.FiledTime.HasValue && item.CenterToOrgTime.HasValue
|
|
var centerToOrgHandleDurationWorkday = item.FiledTime.HasValue && item.CenterToOrgTime.HasValue
|
|
- ?
|
|
|
|
|
|
+ ?
|
|
//_timeLimitDomainService.CalcWorkTimeEx(
|
|
//_timeLimitDomainService.CalcWorkTimeEx(
|
|
await _expireTime.CalcWorkTimeEx(
|
|
await _expireTime.CalcWorkTimeEx(
|
|
item.CenterToOrgTime.Value, item.FiledTime.Value,
|
|
item.CenterToOrgTime.Value, item.FiledTime.Value,
|
|
@@ -659,7 +664,7 @@ ICalcExpireTime expireTime)
|
|
[HttpGet("t2")]
|
|
[HttpGet("t2")]
|
|
public async Task<string> GetCacheAllowAnonymous()
|
|
public async Task<string> GetCacheAllowAnonymous()
|
|
{
|
|
{
|
|
- var systemAdministrator = _systemSettingCacheManager.GetSetting(SettingConstants.SystemAdministrator)?.SettingValue[0];
|
|
|
|
|
|
+ var systemAdministrator = _systemSettingCacheManager.GetSetting(SettingConstants.SystemAdministrator)?.SettingValue[0];
|
|
return systemAdministrator;
|
|
return systemAdministrator;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -670,205 +675,10 @@ ICalcExpireTime expireTime)
|
|
return systemAdministrator;
|
|
return systemAdministrator;
|
|
}
|
|
}
|
|
|
|
|
|
- [AllowAnonymous]
|
|
|
|
- [HttpPost("t3")]
|
|
|
|
- public async Task TestExportExcel()
|
|
|
|
|
|
+ [HttpGet("t4")]
|
|
|
|
+ public async Task<string> Test4()
|
|
{
|
|
{
|
|
- var orders = await _orderRepository.Queryable()
|
|
|
|
- //.Includes(d => d.Workflow, x => x.Steps.Where(d => d.BusinessType == EBusinessType.Send))
|
|
|
|
- //.Where(d=>d.Workflow.Steps.Any(d=>d.BusinessType == EBusinessType.Send))
|
|
|
|
- .Where(d => d.Status != EOrderStatus.WaitForAccept && d.CenterToOrgTime == null)
|
|
|
|
- .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- var orderIds = orders.Select(d => d.Id).ToList();
|
|
|
|
- var steps = await _workflowStepRepository.Queryable()
|
|
|
|
- .Where(d => orderIds.Contains(d.ExternalId) &&
|
|
|
|
- d.BusinessType == EBusinessType.Send &&
|
|
|
|
- d.Status == EWorkflowStepStatus.Handled)
|
|
|
|
- .OrderBy(d => d.CreationTime)
|
|
|
|
- .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- _logger.LogWarning($"取到steps: {steps.Count} 条");
|
|
|
|
- var updateOrders = new List<Order>();
|
|
|
|
- foreach (var order in orders)
|
|
|
|
- {
|
|
|
|
- var step = steps.Where(d => d.ExternalId == order.Id)
|
|
|
|
- .OrderBy(d => d.CreationTime)
|
|
|
|
- .FirstOrDefault();
|
|
|
|
- if (step is null) continue;
|
|
|
|
-
|
|
|
|
- order.CenterToOrgTime = step.HandleTime;
|
|
|
|
- order.CenterToOrgHandlerId = step.HandlerId;
|
|
|
|
- order.CenterToOrgHandlerName = step.HandlerName;
|
|
|
|
- order.CenterToOrgOpinion = step.Opinion;
|
|
|
|
-
|
|
|
|
- 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 && order.FiledTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.CenterToOrgTime.Value, order.FiledTime.Value, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- //var allDuration = order.StartTime.HasValue
|
|
|
|
- // ? _timeLimitDomainService.CalcWorkTime(order.StartTime.Value, order.FiledTime.Value,
|
|
|
|
- // order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- // : 0;
|
|
|
|
- order.SetHandleDuration();
|
|
|
|
- order.SetFileDuration();
|
|
|
|
-
|
|
|
|
- order.HandleDurationWorkday = handleDuration;
|
|
|
|
- order.FileDurationWorkday = fileDuration;
|
|
|
|
-
|
|
|
|
- updateOrders.Add(order);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- _logger.LogWarning($"更新工单:{updateOrders.Count} 条");
|
|
|
|
- await _orderRepository.UpdateRangeAsync(updateOrders, HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- [AllowAnonymous]
|
|
|
|
- [HttpPost("t4")]
|
|
|
|
- public async Task TestExportExcel1()
|
|
|
|
- {
|
|
|
|
- var numbers = new List<string>
|
|
|
|
- {
|
|
|
|
- "20240623000180",
|
|
|
|
- "20240622000097",
|
|
|
|
- "20240621000055",
|
|
|
|
- "20240622000185",
|
|
|
|
- "20240623000025",
|
|
|
|
- "20240621000099",
|
|
|
|
- "20240621000270",
|
|
|
|
- "20240622000060",
|
|
|
|
- "20240621000144",
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- var orders = await _orderRepository.Queryable()
|
|
|
|
- .Includes(d => d.OrderExtension)
|
|
|
|
- .Where(d => numbers.Contains(d.No))
|
|
|
|
- .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
- _logger.LogWarning($"order count: {orders.Count}");
|
|
|
|
-
|
|
|
|
- var workflowIds = orders.Select(d => d.WorkflowId).ToList();
|
|
|
|
- var workflows = await _workflowRepository.Queryable()
|
|
|
|
- .Includes(d => d.Steps, x => x.WorkflowTrace)
|
|
|
|
- .Where(d => workflowIds.Contains(d.Id))
|
|
|
|
- .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- //var workflowIds = orders.Select(d => d.WorkflowId).ToList();
|
|
|
|
- //var workflows = await _workflowRepository.Queryable()
|
|
|
|
- // .Includes(d => d.Steps, x => x.WorkflowTrace)
|
|
|
|
- // //.Includes(d=>d.Traces)
|
|
|
|
- // .Where(d => workflowIds.Contains(d.Id))
|
|
|
|
- // .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- var updateOrders = new List<Order>();
|
|
|
|
- foreach (var order in orders)
|
|
|
|
- {
|
|
|
|
- var workflow = workflows.First(d => d.Id == order.WorkflowId);
|
|
|
|
-
|
|
|
|
- _mapper.Map(workflow, order);
|
|
|
|
- var now = order.FiledTime.Value;//DateTime.Now;
|
|
|
|
- var handleDuration = order.StartTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.StartTime.Value, now, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- var fileDuration = order.CenterToOrgTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.CenterToOrgTime.Value, now, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- var allDuration = order.StartTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.StartTime.Value, now, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- var creationTimeHandleDurationWorkday = order.ActualHandleTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.CreationTime, now, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- var centerToOrgHandleDurationWorkday = order.ActualHandleTime.HasValue && order.CenterToOrgTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.CenterToOrgTime.Value, now, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
-
|
|
|
|
- //order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
|
|
|
|
-
|
|
|
|
- order.HandleDurationWorkday = handleDuration;
|
|
|
|
- order.FileDurationWorkday = fileDuration;
|
|
|
|
- order.AllDurationWorkday = allDuration;
|
|
|
|
- order.CreationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday;
|
|
|
|
- order.CenterToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday;
|
|
|
|
-
|
|
|
|
- //计算实际办结时长
|
|
|
|
- order.SetHandleDuration();
|
|
|
|
- order.SetFileDuration();
|
|
|
|
- order.SetAllDuration();
|
|
|
|
- order.SetCreationTimeHandleDurationWorkday();
|
|
|
|
- order.SetCenterToOrgHandleDurationWorkday();
|
|
|
|
-
|
|
|
|
- var endStep = workflow.Steps.FirstOrDefault(d => d.StepType == EStepType.End);
|
|
|
|
- //var endTrace = workflow.Steps.FirstOrDefault(d => d.WorkflowTrace.StepType == EStepType.End)?.WorkflowTrace;
|
|
|
|
- if (endStep is null)
|
|
|
|
- {
|
|
|
|
- _logger.LogWarning($"endStep 为空, orderNo:{order.No}");
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var step = workflow.Steps.FirstOrDefault(d => d.Id == endStep.PrevStepId);
|
|
|
|
- //var trace = workflow.Steps.FirstOrDefault(d => d.WorkflowTrace.Id == endTrace.PrevStepId)?.WorkflowTrace;
|
|
|
|
- if (step is null)
|
|
|
|
- {
|
|
|
|
- _logger.LogWarning($"step 为空, orderNo:{order.No}");
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var trace = step.WorkflowTrace;
|
|
|
|
- order.FileUserId = trace.HandlerId;
|
|
|
|
- order.FileUserName = trace.HandlerName;
|
|
|
|
- order.FileUserOrgId = trace.HandlerOrgId;
|
|
|
|
- order.FileUserOrgName = trace.HandlerOrgName;
|
|
|
|
- order.FileOpinion = trace.Opinion;
|
|
|
|
-
|
|
|
|
- //记录冗余归档数据
|
|
|
|
- if (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;//notification.Dto.External == null ? false : notification.Dto.External.IsResolved;
|
|
|
|
-
|
|
|
|
- //await _orderRepository.UpdateAsync(order, cancellationToken);
|
|
|
|
- updateOrders.Add(order);
|
|
|
|
-
|
|
|
|
- //var callRecord = await _trCallRecordRepository.GetAsync(p => p.CallAccept == order.CallId, cancellationToken); //由CallAccept改为OtherAccept
|
|
|
|
- var orderFlowDto = new OrderFlowDto
|
|
|
|
- {
|
|
|
|
- Order = _mapper.Map<OrderDto>(order),
|
|
|
|
- WorkflowTrace = _mapper.Map<WorkflowTraceDto>(trace)
|
|
|
|
- };
|
|
|
|
- var callRecord = await _trCallRecordRepository.GetAsync(p => p.OtherAccept == order.CallId, HttpContext.RequestAborted);
|
|
|
|
- if (callRecord != null)
|
|
|
|
- {
|
|
|
|
- orderFlowDto.TrCallRecordDto = _mapper.Map<TrCallDto>(callRecord);
|
|
|
|
- }
|
|
|
|
- //这里需要判断是否是警情退回
|
|
|
|
- orderFlowDto.IsNonPoliceReturn = false;//notification.Dto.External == null ? false : notification.Dto.External.IsPoliceReturn;
|
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFiled, orderFlowDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
- //写入质检 针对受理之后直接结束的工单
|
|
|
|
- await _qualityApplication.AddQualityAsync(EQualitySource.Accepted, order.Id, HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- //司法行政监督管理-工单处理
|
|
|
|
- //await _enforcementApplication.AddEnforcementOrderAsync(order, HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //_logger.LogWarning($"更新orders:{updateOrders.Count}");
|
|
|
|
- //await _orderRepository.UpdateRangeAsync(updateOrders, HttpContext.RequestAborted);
|
|
|
|
|
|
+ return DateTime.Now.ToString("O");
|
|
}
|
|
}
|
|
|
|
|
|
[AllowAnonymous]
|
|
[AllowAnonymous]
|
|
@@ -897,234 +707,255 @@ ICalcExpireTime expireTime)
|
|
return $"{publicKey} \r\n {privateKey}";
|
|
return $"{publicKey} \r\n {privateKey}";
|
|
}
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// 处理错误工单数据
|
|
|
|
- /// </summary>
|
|
|
|
- /// <returns></returns>
|
|
|
|
- [HttpGet("handle-order-data")]
|
|
|
|
[AllowAnonymous]
|
|
[AllowAnonymous]
|
|
- public async Task HandleData()
|
|
|
|
|
|
+ [HttpGet("republish")]
|
|
|
|
+ public async Task Republish()
|
|
{
|
|
{
|
|
- //var steps = await _workflowStepRepository.Queryable()
|
|
|
|
- // .LeftJoin<Order>((ws, d) => ws.ExternalId == d.Id)
|
|
|
|
- // .Where((ws, d) => d.Status == EOrderStatus.Handling && d.ProcessType == EProcessType.Zhiban && ws.Status == EWorkflowStepStatus.Handled && ws.StepType == EStepType.End)
|
|
|
|
- // .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
- var steps = await _workflowStepRepository.Queryable()
|
|
|
|
- .LeftJoin<Order>((ws, d) => ws.ExternalId == d.Id)
|
|
|
|
- .Where((ws, d) => d.Status == EOrderStatus.Handling && d.ProcessType == EProcessType.Zhiban && ws.Status == EWorkflowStepStatus.Handled && ws.StepType == EStepType.End)
|
|
|
|
- .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- _logger.LogInformation($"取到数据{steps.Count}条");
|
|
|
|
- foreach (var step in steps)
|
|
|
|
|
|
+ var provinceNos = new List<string>
|
|
{
|
|
{
|
|
- var order = await _orderDomainService.GetOrderAsync(step.ExternalId,
|
|
|
|
- withExtension: true, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
- var now = step.HandleTime.Value;
|
|
|
|
- var handleDuration = order.CenterToOrgTime.HasValue && order.ActualHandleTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.CenterToOrgTime.Value, order.ActualHandleTime.Value, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- var fileDuration = order.CenterToOrgTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.CenterToOrgTime.Value, now, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- var allDuration = order.StartTime.HasValue
|
|
|
|
- ? await _expireTime.CalcWorkTime(order.StartTime.Value, now, order.ProcessType is EProcessType.Zhiban)
|
|
|
|
- : 0;
|
|
|
|
- var creationTimeHandleDurationWorkday = order.ActualHandleTime.HasValue
|
|
|
|
- ?
|
|
|
|
- // _timeLimitDomainService.CalcWorkTimeEx(order.CreationTime, now,
|
|
|
|
- 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;
|
|
|
|
- order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
|
|
|
|
- order.FileUserId = step.HandlerId;// notification.Trace.HandlerId;
|
|
|
|
- order.FileUserName = step.HandlerName;// notification.Trace.HandlerName;
|
|
|
|
- order.FileUserOrgId = step.HandlerOrgId;// notification.Trace.HandlerOrgId;
|
|
|
|
- order.FileUserOrgName = step.HandlerOrgName;// notification.Trace.HandlerOrgName;
|
|
|
|
- order.FileOrgIsCenter = step.HandlerOrgIsCenter; //notification.Trace.HandlerOrgIsCenter;
|
|
|
|
- order.FileOpinion = step.Opinion;//.Dto.Opinion;
|
|
|
|
- order.FileUserRole = EFileUserType.Seat;
|
|
|
|
- order.IsResolved = false;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- order.ActualHandleStepCode = step.Code;
|
|
|
|
- order.ActualHandleStepName = step.Name;
|
|
|
|
- order.ActualHandleStepId = step.Id;
|
|
|
|
- order.ActualHandleStepCreateTime = step.CreationTime;
|
|
|
|
- order.ActualHandleStepAcceptTime = step.AcceptTime;
|
|
|
|
- order.ActualHandleTime = step.HandleTime;
|
|
|
|
- order.ActualHandlerId = step.HandlerId;
|
|
|
|
- order.ActualHandlerName = step.HandlerName;
|
|
|
|
- order.ActualHandleOrgCode = step.HandlerOrgId;
|
|
|
|
- order.ActualHandleOrgName = step.HandlerOrgName;
|
|
|
|
- order.ActualHandleOrgAreaCode = step.HandlerOrgAreaCode;
|
|
|
|
- order.ActualHandleOrgAreaName = step.HandlerOrgAreaName;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- order.CurrentStepId = order.ActualHandleStepId;
|
|
|
|
- order.CurrentStepCode = order.ActualHandleStepCode;
|
|
|
|
- order.CurrentStepName = order.ActualHandleStepName;
|
|
|
|
- order.CurrentStepCreateTime = order.ActualHandleStepCreateTime;
|
|
|
|
- order.CurrentStepAcceptTime = order.ActualHandleStepAcceptTime;
|
|
|
|
- order.CurrentHandleTime = order.ActualHandleTime;
|
|
|
|
- order.CurrentHandlerId = order.ActualHandlerId;
|
|
|
|
- order.CurrentHandlerName = order.ActualHandlerName;
|
|
|
|
- order.CurrentHandleOrgName = order.ActualHandleOrgName;
|
|
|
|
- order.CurrentHandleOrgId = order.ActualHandleOrgCode;
|
|
|
|
- order.CurrentHandleOrgAreaCode = order.ActualHandleOrgAreaCode;
|
|
|
|
- order.CurrentHandleOrgAreaName = order.ActualHandleOrgAreaName;
|
|
|
|
-
|
|
|
|
- await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
|
- //var workflowTrace = await _workflowTraceRepository.Queryable().Where(x => x.WorkflowId == step.WorkflowId && x.Code == "end").OrderByDescending(x=>x.HandleTime).FirstAsync();
|
|
|
|
- //var orderFlowDto = new OrderFlowDto
|
|
|
|
- //{
|
|
|
|
- // Order = _mapper.Map<OrderDto>(order)
|
|
|
|
- //};
|
|
|
|
- //if (workflowTrace!=null)
|
|
|
|
- //{
|
|
|
|
- // orderFlowDto.WorkflowTrace = _mapper.Map<WorkflowTraceDto>(workflowTrace);
|
|
|
|
- //}
|
|
|
|
- //if (order.SourceChannelCode == AppDefaults.SourceChannel.DianHua &&
|
|
|
|
- // !string.IsNullOrEmpty(order.CallId))
|
|
|
|
- //{
|
|
|
|
-
|
|
|
|
- // var call = await _callApplication.GetCallAsync(order.CallId, HttpContext.RequestAborted);
|
|
|
|
- // if (call is not null)
|
|
|
|
- // orderFlowDto.TrCallRecordDto = _mapper.Map<TrCallDto>(call);
|
|
|
|
- //}
|
|
|
|
- //await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFiled, orderFlowDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// 处理工单流程错误数据 话务部直接归档件 没有归档节点
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="StartTime"></param>
|
|
|
|
- /// <param name="EndTime"></param>
|
|
|
|
- /// <returns></returns>
|
|
|
|
- [HttpGet("oders_workflow_step")]
|
|
|
|
- [AllowAnonymous]
|
|
|
|
- public async Task AddJudicialManagementOrders()
|
|
|
|
- {
|
|
|
|
|
|
+ "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}");
|
|
|
|
|
|
- var steps = await _workflowStepRepository.Queryable()
|
|
|
|
- .LeftJoin<Order>((ws, d) => ws.ExternalId == d.Id)
|
|
|
|
- .Where((ws, d) => d.Status == EOrderStatus.Handling && ws.NextStepCode == "end" && ws.Status == EWorkflowStepStatus.Handled && ws.StepType == EStepType.Start)
|
|
|
|
|
|
+ var unpublishOrders = await _orderRepository.Queryable()
|
|
|
|
+ .Where(d => provinceNos.Contains(d.ProvinceNo) &&
|
|
|
|
+ !string.IsNullOrEmpty(d.ProvinceNo) &&
|
|
|
|
+ d.Status >= EOrderStatus.Filed)
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
- _logger.LogInformation($"取到数据 {steps.Count} 条");
|
|
|
|
- foreach (var item in steps)
|
|
|
|
|
|
+ _logger.LogWarning($"准备开始推送:{unpublishOrders.Count}");
|
|
|
|
+
|
|
|
|
+ foreach (var order in unpublishOrders)
|
|
{
|
|
{
|
|
- ///组装数据
|
|
|
|
- //Workflow workflow
|
|
|
|
- Workflow workflow = await _workflowDomainService.GetWorkflowAsync(item.WorkflowId, withDefine: true, withSteps: true,
|
|
|
|
- cancellationToken: HttpContext.RequestAborted);
|
|
|
|
- //WorkflowStep startStep
|
|
|
|
- var startStep = workflow.Steps.FirstOrDefault(x => x.StepType == EStepType.Start);
|
|
|
|
- if (startStep is null) continue;
|
|
|
|
- //BasicWorkflowDto dto
|
|
|
|
- BasicWorkflowDto dto = new BasicWorkflowDto
|
|
|
|
- {
|
|
|
|
- NextStepCode = "end",
|
|
|
|
- NextStepName = "结束",
|
|
|
|
- BackToCountersignEnd = false,
|
|
|
|
- FlowDirection = null,
|
|
|
|
- HandlerType = 0,
|
|
|
|
- StepType = 0,
|
|
|
|
- NextHandlers = new List<FlowStepHandler>(),
|
|
|
|
- IsSms = false,
|
|
|
|
- NextMainHandler = "",
|
|
|
|
- IsStartCountersign = false,
|
|
|
|
- External = new External
|
|
|
|
- {
|
|
|
|
- TimeLimit = null,
|
|
|
|
- TimeLimitUnit = null,
|
|
|
|
- IsPoliceReturn = false,
|
|
|
|
- IsResolved = false,
|
|
|
|
- },
|
|
|
|
- BusinessType = EBusinessType.File,
|
|
|
|
- ReviewResult = 0,
|
|
|
|
- Remark = null,
|
|
|
|
- Opinion = startStep.Opinion,
|
|
|
|
- Files = new List<Share.Dtos.File.FileDto>()
|
|
|
|
- };
|
|
|
|
- //ISessionContext current
|
|
|
|
- ISessionContext current = new ProvinceSessionContext
|
|
|
|
|
|
+ var trace = await _workflowTraceRepository.Queryable()
|
|
|
|
+ .FirstAsync(d => d.WorkflowId == order.WorkflowId && d.StepType == EStepType.End,
|
|
|
|
+ HttpContext.RequestAborted);
|
|
|
|
+ var orderFlowDto = new OrderFlowDto
|
|
{
|
|
{
|
|
- //UserId = startStep.HandlerId,
|
|
|
|
- //UserName = startStep.HandlerName,
|
|
|
|
- OrgId = startStep.HandlerOrgId,
|
|
|
|
- OrgName = startStep.HandlerOrgName,
|
|
|
|
- OrgAreaCode = startStep.HandlerOrgAreaCode,
|
|
|
|
- OrgAreaName = startStep.HandlerOrgAreaName,
|
|
|
|
- OrgLevel = 1
|
|
|
|
|
|
+ Order = _mapper.Map<OrderDto>(order),
|
|
|
|
+ WorkflowTrace = _mapper.Map<WorkflowTraceDto>(trace)
|
|
};
|
|
};
|
|
|
|
|
|
- //StepDefine firstStepDefine
|
|
|
|
- StepDefine firstStepDefine = workflow.WorkflowDefinition.FindStepDefine(startStep.NextStepCode);
|
|
|
|
- //FlowAssignInfo flowAssignInfo
|
|
|
|
- ////如果发起会签需检查是否支持发起会签
|
|
|
|
- //var startStepDefine = workflow.WorkflowDefinition.FindStartStepDefine();
|
|
|
|
-
|
|
|
|
- //下一节点是否为动态节点
|
|
|
|
- var isNextDynamic = false;
|
|
|
|
-
|
|
|
|
- FlowAssignInfo flowAssignInfo =
|
|
|
|
- await _workflowApplication.GetNextStepFlowAssignInfoAsync(workflow, startStep, dto, firstStepDefine, isNextDynamic, HttpContext.RequestAborted);
|
|
|
|
- //DateTime? expiredTime
|
|
|
|
- DateTime? expiredTime = startStep.StepExpiredTime;
|
|
|
|
-
|
|
|
|
- ///
|
|
|
|
- await _mediator.Publish(
|
|
|
|
- new StartWorkflowNotify(workflow, dto, flowAssignInfo, startStep.WorkflowTrace), HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- //firstStep是否为end,t: 实际办理节点为startStep, 并且handlerId赋值 f: 实际办理节点为firstStep, handlerId未赋值
|
|
|
|
- workflow.UpdateActualStepWhenHandle(startStep,
|
|
|
|
- current.RequiredUserId, current.UserName,
|
|
|
|
- current.RequiredOrgId, current.OrgName,
|
|
|
|
- current.OrgAreaCode, current.OrgAreaName,
|
|
|
|
- current.OrgLevel);
|
|
|
|
-
|
|
|
|
- workflow.UpdateCurrentStepWhenHandle(startStep,
|
|
|
|
- current.OrgAreaCode, current.OrgAreaName, current.OrgLevel);
|
|
|
|
-
|
|
|
|
- var endTrace = await _workflowDomainService.EndAsync(workflow, dto, firstStepDefine,
|
|
|
|
- startStep, current, expiredTime, HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- _logger.LogInformation($"处理完成");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- [HttpGet("order_participle")]
|
|
|
|
- [AllowAnonymous]
|
|
|
|
- public async Task OrderParticiple()
|
|
|
|
- {
|
|
|
|
- var tels = new List<Tel>();
|
|
|
|
- for (int i = 5001; i <= 5010; i++)
|
|
|
|
- {
|
|
|
|
- tels.Add(new Tel
|
|
|
|
|
|
+ if (order.SourceChannelCode == AppDefaults.SourceChannel.DianHua &&
|
|
|
|
+ !string.IsNullOrEmpty(order.CallId))
|
|
{
|
|
{
|
|
- No = i.ToString()
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ if (_appOptions.Value.GetDefaultAppScopeConfiguration().CallCenterType == AppDefaults.CallCenterType.TianRun)
|
|
|
|
+ {
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- for (int i = 8001; i <= 9069; i++)
|
|
|
|
- {
|
|
|
|
- tels.Add(new Tel
|
|
|
|
- {
|
|
|
|
- No = i.ToString()
|
|
|
|
- });
|
|
|
|
|
|
+ //这里需要判断是否是警情退回
|
|
|
|
+ orderFlowDto.IsNonPoliceReturn = false;
|
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFiled, orderFlowDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
+ _logger.LogWarning($"推送完成: {order.ProvinceNo}");
|
|
}
|
|
}
|
|
-
|
|
|
|
- await _telRepository.AddRangeAsync(tels, HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _logger.LogWarning($"推送完成");
|
|
}
|
|
}
|
|
}
|
|
}
|