|
@@ -1,12 +1,15 @@
|
|
|
using DotNetCore.CAP;
|
|
|
using Hotline.Api.Filter;
|
|
|
using Hotline.Application.CallCenter;
|
|
|
+using Hotline.Application.Contracts.Validators.FlowEngine;
|
|
|
using Hotline.Application.ExportExcel;
|
|
|
using Hotline.Application.FlowEngine;
|
|
|
using Hotline.Application.Orders;
|
|
|
using Hotline.Application.Quality;
|
|
|
using Hotline.Application.Systems;
|
|
|
+using Hotline.Authentications;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
+using Hotline.CallCenter.Calls;
|
|
|
using Hotline.Configurations;
|
|
|
using Hotline.ContingencyManagement.Notifies;
|
|
|
using Hotline.EventBus;
|
|
@@ -18,7 +21,6 @@ using Hotline.Import;
|
|
|
using Hotline.Orders;
|
|
|
using Hotline.Orders.Notifications;
|
|
|
using Hotline.OrderTranspond;
|
|
|
-using Hotline.Permissions;
|
|
|
using Hotline.Push.FWMessage;
|
|
|
using Hotline.Push.Notifies;
|
|
|
using Hotline.Repository.SqlSugar.CallCenter;
|
|
@@ -30,9 +32,12 @@ using Hotline.Settings.Hotspots;
|
|
|
using Hotline.Settings.TimeLimitDomain;
|
|
|
using Hotline.Settings.TimeLimits;
|
|
|
using Hotline.Share.Dtos;
|
|
|
+using Hotline.Share.Dtos.CallCenter;
|
|
|
using Hotline.Share.Dtos.FlowEngine;
|
|
|
using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
+using Hotline.Share.Dtos.Order.Detail;
|
|
|
+using Hotline.Share.Dtos.Order.Handle;
|
|
|
using Hotline.Share.Dtos.Order.Migration;
|
|
|
using Hotline.Share.Dtos.Order.Publish;
|
|
|
using Hotline.Share.Dtos.Settings;
|
|
@@ -41,6 +46,7 @@ using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Enums.Push;
|
|
|
using Hotline.Share.Enums.Settings;
|
|
|
+using Hotline.Share.Mq;
|
|
|
using Hotline.Share.Requests;
|
|
|
using Hotline.Share.Tools;
|
|
|
using Hotline.Tools;
|
|
@@ -56,7 +62,6 @@ using MiniExcelLibs;
|
|
|
using SqlSugar;
|
|
|
using System.Text;
|
|
|
using System.Text.Json;
|
|
|
-using Hotline.Share.Dtos.Order.Handle;
|
|
|
using XF.Domain.Authentications;
|
|
|
using XF.Domain.Cache;
|
|
|
using XF.Domain.Entities;
|
|
@@ -66,12 +71,18 @@ using XF.Utility.EnumExtensions;
|
|
|
using Hotline.Application.Contracts.Validators.FlowEngine;
|
|
|
using Hotline.Authentications;
|
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
|
-using NPOI.SS.Formula.Functions;
|
|
|
-using System.Threading;
|
|
|
using Hotline.Share.Mq;
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
+using Hotline.FlowEngine.Notifications;
|
|
|
using Hotline.Share.Dtos.Order.Detail;
|
|
|
using Hotline.Share.Dtos.File;
|
|
|
+using Hotline.Share.Dtos.Org;
|
|
|
+using Hotline.Snapshot.Interfaces;
|
|
|
+using Hotline.Snapshot.Notifications;
|
|
|
+using Hotline.Snapshot;
|
|
|
+using Hotline.Application.Snapshot;
|
|
|
+using Hotline.Share.Dtos.Snapshot;
|
|
|
+using OrderDto = Hotline.Share.Dtos.Order.OrderDto;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -126,7 +137,6 @@ public class OrderController : BaseController
|
|
|
private readonly IOrderApplication _orderApplication;
|
|
|
private readonly IPushDomainService _pushDomainService;
|
|
|
private readonly ILogger<OrderController> _logger;
|
|
|
- private readonly ITypedCache<YbEnterpriseToken> _cacheResponse;
|
|
|
private readonly IRepository<OrderSendBackAudit> _orderSendBackAuditRepository;
|
|
|
private readonly IRepository<User> _userRepository;
|
|
|
private readonly IExportApplication _exportApplication;
|
|
@@ -147,6 +157,10 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<OrderRevoke> _orderRevokeRepository;
|
|
|
private readonly IOrderTerminateRepository _orderTerminateRepository;
|
|
|
private readonly ISystemLogApplication _systemLogApplication;
|
|
|
+ private readonly IRepository<OrderCarboncopy> _orderCarboncopy;
|
|
|
+ private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
|
+ private readonly IOrderSnapshotApplication _orderSnapshotApplication;
|
|
|
+ private readonly IIndustryRepository _industryRepository;
|
|
|
|
|
|
public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
@@ -212,8 +226,12 @@ public class OrderController : BaseController
|
|
|
IRepository<OrderRevoke> orderRevokeRepository,
|
|
|
BaseDataApplication baseDataApplication,
|
|
|
IOrderTerminateRepository orderTerminateRepository,
|
|
|
+ IRepository<OrderCarboncopy> orderCarboncopy,
|
|
|
ITypedCache<string> typeCache,
|
|
|
- ISystemLogApplication systemLogApplication)
|
|
|
+ ISystemLogApplication systemLogApplication,
|
|
|
+ IOrderSnapshotRepository orderSnapshotRepository,
|
|
|
+ IIndustryRepository industryRepository,
|
|
|
+ IOrderSnapshotApplication orderSnapshotApplication)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -257,7 +275,6 @@ public class OrderController : BaseController
|
|
|
_logger = logger;
|
|
|
_orderApplication = orderApplication;
|
|
|
_pushDomainService = pushDomainService;
|
|
|
- _cacheResponse = cacheResponse;
|
|
|
_orderSendBackAuditRepository = orderSendBackAuditRepository;
|
|
|
_userRepository = userRepository;
|
|
|
_exportApplication = exportApplication;
|
|
@@ -277,10 +294,14 @@ public class OrderController : BaseController
|
|
|
_callNativeRepository = callNativeRepository;
|
|
|
_baseDataApplication = baseDataApplication;
|
|
|
_orderTerminateRepository = orderTerminateRepository;
|
|
|
+ _orderCarboncopy = orderCarboncopy;
|
|
|
_orderRevokeRepository = orderRevokeRepository;
|
|
|
_typeCache = typeCache;
|
|
|
_baseDataApplication = baseDataApplication;
|
|
|
_systemLogApplication = systemLogApplication;
|
|
|
+ _orderSnapshotRepository = orderSnapshotRepository;
|
|
|
+ _industryRepository = industryRepository;
|
|
|
+ _orderSnapshotApplication = orderSnapshotApplication;
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -412,14 +433,17 @@ public class OrderController : BaseController
|
|
|
[HttpPost("batch-publish")]
|
|
|
public async Task BatchPublishOrder([FromBody] BatchPublishOrderDto dto)
|
|
|
{
|
|
|
+ //任务 127 市州通用-会签件需支持批量发布
|
|
|
+ //会签件也需支持批量发布;若会签件要批量发布,就默认不公开,只对实际办理部门进行回访即可
|
|
|
var hasHuiQian = await _orderRepository.Queryable().AnyAsync(x => dto.Ids.Contains(x.Id) && x.CounterSignType != null);
|
|
|
+ //var hasHuiQian = await _orderRepository.Queryable().AnyAsync(x => dto.Ids.Contains(x.Id));
|
|
|
if (hasHuiQian)
|
|
|
throw UserFriendlyException.SameMessage("选择的工单中含有会签工单, 不能批量发布. 请排除会签工单.");
|
|
|
|
|
|
var hasProvince = await _orderRepository.Queryable().AnyAsync(x => dto.Ids.Contains(x.Id) && x.Source == ESource.ProvinceStraight);
|
|
|
//if (hasProvince)
|
|
|
// throw UserFriendlyException.SameMessage("选择的工单中含有省工单, 不能批量发布. 请排除省工单.");
|
|
|
- if (_appOptions.Value.IsYiBin)
|
|
|
+ if (_appOptions.Value.IsYiBin || _appOptions.Value.IsZiGong)
|
|
|
{
|
|
|
hasProvince = await _orderRepository.Queryable().AnyAsync(x => dto.Ids.Contains(x.Id) && x.IsProvince);
|
|
|
}
|
|
@@ -543,7 +567,7 @@ public class OrderController : BaseController
|
|
|
orderVisit.EmployeeId = string.Empty;
|
|
|
}
|
|
|
|
|
|
- if (order is { FileOrgIsCenter:true, CounterSignType: null } && !order.IsProvince)
|
|
|
+ if (order is { FileOrgIsCenter: true, CounterSignType: null } && !order.IsProvince)
|
|
|
{
|
|
|
orderVisit.VisitState = EVisitState.Visited;
|
|
|
orderVisit.VisitTime = DateTime.Now;
|
|
@@ -564,6 +588,8 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
|
|
|
string visitId = await _orderVisitRepository.AddAsync(orderVisit);
|
|
|
+ await _orderSnapshotApplication.UpdateLabelAsync(order.Id, dto.SnapshotLabels);
|
|
|
+
|
|
|
|
|
|
//新增回访信息
|
|
|
var visitedDetail = new List<OrderVisitDetail>();
|
|
@@ -725,6 +751,12 @@ public class OrderController : BaseController
|
|
|
res.idNames = order.CounterSignType == null
|
|
|
? null
|
|
|
: idNames.Where(d => d.Key != idName.Key).ToList();
|
|
|
+
|
|
|
+ if (_systemSettingCacheManager.Snapshot)
|
|
|
+ {
|
|
|
+ res.IsSnapshot = await _orderSnapshotRepository.AnyAsync(m => m.Id == order.Id);
|
|
|
+ res.SnapshotLabel = _sysDicDataCacheManager.SnapshotOrderLabel;
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
@@ -858,6 +890,15 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (_systemSettingCacheManager.Snapshot)
|
|
|
+ {
|
|
|
+ await _orderSnapshotRepository.GetAsync(pubentity.OrderId)
|
|
|
+ .Then(m =>
|
|
|
+ {
|
|
|
+ pubentity.Labels = m.Labels;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
return pubentity;
|
|
|
}
|
|
|
|
|
@@ -1074,17 +1115,36 @@ public class OrderController : BaseController
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("visit/basedata")]
|
|
|
- public Dictionary<string, dynamic> VisitBaseData() => new Dictionary<string, dynamic>
|
|
|
+ public Dictionary<string, dynamic> VisitBaseData()
|
|
|
+ {
|
|
|
+ var voiceEvaluate = EnumExts.GetDescriptions<EVoiceEvaluate>();
|
|
|
+ var seatEvaluate = EnumExts.GetDescriptions<ESeatEvaluate>();
|
|
|
+ if (_appOptions.Value.IsZiGong == true)
|
|
|
{
|
|
|
- { "seatEvaluate", EnumExts.GetDescriptions<ESeatEvaluate>() },
|
|
|
+ voiceEvaluate = EnumExtensions.GetEnumKeyValueList<EVoiceEvaluate>();
|
|
|
+ seatEvaluate = EnumExtensions.GetEnumKeyValueList<ESeatEvaluate>();
|
|
|
+ }
|
|
|
+ var visitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction);
|
|
|
+ var visitManner = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitManner);
|
|
|
+ if (_appOptions.Value.IsZiGong == false)
|
|
|
+ {
|
|
|
+ seatEvaluate = seatEvaluate.Where(m => new int[] { -1, 1, 3 }.Contains(m.Key) == false).ToList();
|
|
|
+ visitSatisfaction = visitSatisfaction.Where(x => x.DicDataValue != "-1").ToList();
|
|
|
+ visitManner = visitManner.Where(x => x.DicDataValue != "-1").ToList();
|
|
|
+ }
|
|
|
+
|
|
|
+ return new Dictionary<string, dynamic>
|
|
|
+ {
|
|
|
+ { "seatEvaluate", seatEvaluate },
|
|
|
{ "visitType", EnumExts.GetDescriptions<EVisitType>() },
|
|
|
- { "voiceEvaluate", EnumExts.GetDescriptions<EVoiceEvaluate>() },
|
|
|
- { "visitSatisfaction", _sysDicDataCacheManager.GetVisitSatisfaction().Where(m => m.DicDataValue != "-1").ToList() },
|
|
|
- { "visitMananer", _sysDicDataCacheManager.VisitMananer.Where(x => x.DicDataValue != "-1").ToList() },
|
|
|
+ { "voiceEvaluate", voiceEvaluate},
|
|
|
+ { "visitSatisfaction", visitSatisfaction },
|
|
|
+ { "visitMananer", visitManner},
|
|
|
{ "visitStateQuery", EnumExts.GetDescriptions<EVisitStateQuery>() },
|
|
|
{ "sourceChannel", _sysDicDataCacheManager.SourceChannel },
|
|
|
{ "aiVisitResult", EnumExts.GetDescriptions<EAiVisitResult>() }
|
|
|
};
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 回访详情
|
|
@@ -1112,14 +1172,20 @@ public class OrderController : BaseController
|
|
|
// x => x.OrderId == orderVisit.OrderId && x.AgainState == EAgainState.DoAgain, HttpContext.RequestAborted);
|
|
|
var voiceEvaluate = EnumExts.GetDescriptions<EVoiceEvaluate>();
|
|
|
var seatEvaluate = EnumExts.GetDescriptions<ESeatEvaluate>();
|
|
|
+ if (_appOptions.Value.IsZiGong==true)
|
|
|
+ {
|
|
|
+ voiceEvaluate = EnumExtensions.GetEnumKeyValueList<EVoiceEvaluate>();
|
|
|
+ seatEvaluate=EnumExtensions.GetEnumKeyValueList<ESeatEvaluate>();
|
|
|
+ }
|
|
|
+ var visitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction);
|
|
|
+ var visitManner = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitManner);
|
|
|
if (_appOptions.Value.IsZiGong == false)
|
|
|
{
|
|
|
- seatEvaluate = seatEvaluate.Where(m => new int[] { 1, 3 }.Contains(m.Key) == false).ToList();
|
|
|
+ seatEvaluate = seatEvaluate.Where(m => new int[] { -1, 1, 3 }.Contains(m.Key) == false).ToList();
|
|
|
+ visitSatisfaction = visitSatisfaction.Where(x => x.DicDataValue != "-1").ToList();
|
|
|
+ visitManner = visitManner.Where(x => x.DicDataValue != "-1").ToList();
|
|
|
}
|
|
|
-
|
|
|
- var visitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction).Where(x => x.DicDataValue != "-1");
|
|
|
var dissatisfiedReason = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.DissatisfiedReason);
|
|
|
- var visitManner = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitManner).Where(x => x.DicDataValue != "-1");
|
|
|
//var callRecord = await _trCallRecordRepository.GetAsync(x => x.CallAccept == orderVisit.CallId); //由CallAccept改为OtherAccept
|
|
|
//var callRecord = await _trCallRecordRepository.GetAsync(x => x.OtherAccept == orderVisit.CallId && string.IsNullOrEmpty(x.OtherAccept) == false, HttpContext.RequestAborted);
|
|
|
var recordingFileUrl = "";
|
|
@@ -1919,11 +1985,11 @@ public class OrderController : BaseController
|
|
|
if (int.Parse(setting?.SettingValue[0]) != 0 && !_sessionContext.OrgIsCenter)
|
|
|
{
|
|
|
int count = await _orderDelayRepository.CountAsync(x =>
|
|
|
- x.OrderId == delaydto.OrderId && x.ApplyOrgCode == _sessionContext.RequiredOrgId && x.DelayState == EDelayState.Pass);
|
|
|
+ x.OrderId == delaydto.OrderId && x.ApplyOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == _sessionContext.RequiredOrgId.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) && x.DelayState == EDelayState.Pass);
|
|
|
if (_appOptions.Value.IsZiGong)
|
|
|
{
|
|
|
count = await _orderDelayRepository.CountAsync(x =>
|
|
|
- x.OrderId == delaydto.OrderId && x.ApplyOrgCode == _sessionContext.RequiredOrgId &&
|
|
|
+ x.OrderId == delaydto.OrderId && x.ApplyOrgCode == _sessionContext.RequiredOrgId &&
|
|
|
(x.DelayState == EDelayState.Pass || x.DelayState == EDelayState.NoPass));
|
|
|
}
|
|
|
|
|
@@ -2003,6 +2069,98 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 批量审批延期
|
|
|
+ /// </summary>
|
|
|
+ [HttpPost("delay/batch_audit")]
|
|
|
+ [LogFilter("批量审批延期")]
|
|
|
+ public async Task<string> BatchAuditDelay([FromBody] BatchDelayNextFlowDto dto) {
|
|
|
+ var result = new StringBuilder();
|
|
|
+ var fail = 0;
|
|
|
+ var success = 0;
|
|
|
+ foreach (var item in dto.DelayId)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var workflow = dto.NextWorkflow;
|
|
|
+ var delay = await _orderDelayRepository.Queryable().Includes(x=>x.Order).Where(x=>x.Id == item).FirstAsync(HttpContext.RequestAborted);
|
|
|
+ workflow.WorkflowId = delay.WorkflowId;
|
|
|
+ var workflowEntuty = await _workflowDomainService.GetWorkflowAsync(workflow.WorkflowId, withDefine: true, withSteps: true,cancellationToken: HttpContext.RequestAborted);
|
|
|
+ var currentStep =
|
|
|
+ workflowEntuty.Steps.FirstOrDefault(d => d.Status == EWorkflowStepStatus.WaitForAccept || d.Status == EWorkflowStepStatus.WaitForHandle);
|
|
|
+
|
|
|
+ NextStepsWithOpinionDto<NextStepOption> next = null;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ next = await _workflowApplication.GetNextStepsAsync(delay.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ catch (UserFriendlyException e)
|
|
|
+ {
|
|
|
+ if (e.Message.Contains("未找到对应节点"))
|
|
|
+ {
|
|
|
+ result.Append("无权审核:" + delay.No);
|
|
|
+ fail++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (next == null) continue;
|
|
|
+
|
|
|
+ if (!delay.Order.IsProvince)
|
|
|
+ {
|
|
|
+ if (next.Steps.Any(x => x.Value == "省审批"))
|
|
|
+ {
|
|
|
+ next.Steps.Remove(next.Steps.First(x => x.Value == "省审批"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!_sessionContext.OrgIsCenter && currentStep.Name != "中心初审")
|
|
|
+ {
|
|
|
+ if (next.Steps.Any(x => x.Value == "中心终审"))
|
|
|
+ {
|
|
|
+ next.Steps.Remove(next.Steps.First(x => x.Value == "中心终审"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var isBatch = next.Steps.Where(x => x.Value == workflow.NextStepName).Any();
|
|
|
+ if (isBatch)
|
|
|
+ {
|
|
|
+ var step = next.Steps.Where(x => x.Value == workflow.NextStepName).FirstOrDefault();
|
|
|
+ workflow.NextStepCode = step.Key;
|
|
|
+ workflow.NextStepName = step.Value;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ result.Append("无权审核:" + delay.No);
|
|
|
+ fail++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ workflow.StepId = next.StepId;
|
|
|
+ workflow.ReviewResult = dto.IsPass ? EReviewResult.Approval : EReviewResult.Failed;
|
|
|
+
|
|
|
+ if (workflow.ReviewResult == EReviewResult.Approval) {
|
|
|
+ await _workflowDomainService.NextAsync(_sessionContext, workflow,cancellationToken: HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var reject = workflow.Adapt<RejectDto>();
|
|
|
+ await _workflowApplication.RejectAsync(reject, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ success++;
|
|
|
+ }
|
|
|
+ catch (UserFriendlyException e)
|
|
|
+ {
|
|
|
+ result.Append(e.Message);
|
|
|
+ fail++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $"总共: {dto.DelayId.Length}, 成功: {success}, 失败: {fail}, 失败原因: {result.ToString()}";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 延期查询流程办理下一步可选节点
|
|
|
/// </summary>
|
|
@@ -3186,12 +3344,31 @@ public class OrderController : BaseController
|
|
|
[HttpGet("history_all")]
|
|
|
public async Task<PagedDto<OrderDto>> QueryAll([FromQuery] QueryOrderHistoryDto dto)
|
|
|
{
|
|
|
- var (total, items) = await _orderRepository.Queryable()
|
|
|
+ var query = _orderRepository.Queryable()
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.PhoneNo), d => d.Contact == dto.PhoneNo)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrderId), d => d.Id != dto.OrderId)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!));
|
|
|
+
|
|
|
+ //随手拍
|
|
|
+ bool.TryParse(
|
|
|
+ _systemSettingCacheManager.GetSetting(SettingConstants.Snapshot)?.SettingValue[0],
|
|
|
+ out bool isSnapshotEnable);
|
|
|
+ if (isSnapshotEnable && !string.IsNullOrEmpty(dto.IndustryId))
|
|
|
+ {
|
|
|
+ query.Where(d => d.OrderSnapshot.IndustryId == dto.IndustryId);
|
|
|
+ }
|
|
|
+
|
|
|
+ //var (total, items) = await _orderRepository.Queryable()
|
|
|
+ // .WhereIF(!string.IsNullOrEmpty(dto.PhoneNo), d => d.Contact == dto.PhoneNo)
|
|
|
+ // .WhereIF(!string.IsNullOrEmpty(dto.OrderId), d => d.Id != dto.OrderId)
|
|
|
+ // .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
|
|
|
+ // .OrderByDescending(d => d.CreationTime)
|
|
|
+ // .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ var (total, items) = await query
|
|
|
.OrderByDescending(d => d.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
}
|
|
|
|
|
@@ -3343,6 +3520,10 @@ public class OrderController : BaseController
|
|
|
var delayModel = order.OrderDelays.MaxBy(x => x.CreationTime);
|
|
|
if (delayModel != null)
|
|
|
{
|
|
|
+ if (delayModel.IsProDelay)
|
|
|
+ {
|
|
|
+ dto.ProvinceDelayString = "该工单已向省平台发送延期申请!延期状态:" + delayModel.DelayState.GetDescription();
|
|
|
+ }
|
|
|
var workFlow = await _workflowRepository.GetAsync(delayModel.WorkflowId);
|
|
|
switch (delayModel.DelayState)
|
|
|
{
|
|
@@ -3365,6 +3546,7 @@ public class OrderController : BaseController
|
|
|
else
|
|
|
{
|
|
|
dto.DelayString = "";
|
|
|
+ dto.ProvinceDelayString = "";
|
|
|
}
|
|
|
|
|
|
//dto.CanPrevious = canPrevious;
|
|
@@ -3473,12 +3655,32 @@ public class OrderController : BaseController
|
|
|
dto.ProvinceRevokeString = "该工单已由省平台发送撤单!请直接归档办理!";
|
|
|
}
|
|
|
|
|
|
+ //省甄别
|
|
|
+ var orderScreen = await _orderScreenRepository.Queryable().Where(x => x.OrderId == order.Id && x.IsProScreen == true).OrderByDescending(x => x.CreationTime)
|
|
|
+ .FirstAsync();
|
|
|
+ if (orderScreen != null)
|
|
|
+ {
|
|
|
+ dto.ProvinceScreenString = "该工单已向省平台发送甄别申请!甄别状态:" + orderScreen.Status.GetDescription();
|
|
|
+ }
|
|
|
+
|
|
|
//终止
|
|
|
var orderTerminateList = await _orderTerminateRepository.Queryable().Where(x => x.OrderId == order.Id).ToListAsync();
|
|
|
dto.OrderTerminateStatus = orderTerminateList.Any(x => x.Status == ETerminateStatus.End) ? "同意" :
|
|
|
orderTerminateList.Any(x => x.Status == ETerminateStatus.Refuse) ? "不同意" :
|
|
|
orderTerminateList.Any(x => x.Status == ETerminateStatus.Approval || x.Status == ETerminateStatus.SendBack) ? "审批中" : null;
|
|
|
|
|
|
+ if (_systemSettingCacheManager.Snapshot)
|
|
|
+ {
|
|
|
+ await _orderSnapshotRepository.Queryable()
|
|
|
+ .Where(m => m.Id == order.Id)
|
|
|
+ .Select(m => new { m.IndustryId, m.IndustryName })
|
|
|
+ .FirstAsync(HttpContext.RequestAborted)
|
|
|
+ .Then(async snapshot =>
|
|
|
+ {
|
|
|
+ dto.IndustryName = snapshot.IndustryName;
|
|
|
+ dto.IndustryId = snapshot.IndustryId;
|
|
|
+ });
|
|
|
+ }
|
|
|
dto.IsReTransact = await _orderSpecialRepository.Queryable()
|
|
|
.Where(x => x.OrderId == dto.Id && x.SpecialType == ESpecialType.ReTransact).AnyAsync();
|
|
|
|
|
@@ -3537,6 +3739,20 @@ public class OrderController : BaseController
|
|
|
|
|
|
await _orderDomainService.AddAsync(order, true, HttpContext.RequestAborted);
|
|
|
|
|
|
+ if (_systemSettingCacheManager.Snapshot && dto.IndustryId.NotNullOrEmpty() && dto.IndustryName.NotNullOrEmpty())
|
|
|
+ {
|
|
|
+ var snapshot = new OrderSnapshot
|
|
|
+ {
|
|
|
+ Id = order.Id,
|
|
|
+ IndustryId = dto.IndustryId,
|
|
|
+ IndustryName = dto.IndustryName
|
|
|
+ };
|
|
|
+ await _orderSnapshotRepository.AddAsync(snapshot, HttpContext.RequestAborted);
|
|
|
+ order.Latitude = 29.33924;
|
|
|
+ order.Longitude = 104.779307;
|
|
|
+ await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
//订阅此事件的内部处理工单数据只能更新各自业务的字段,不能全部更新
|
|
|
//新增工单其他处理事件 (受理短信)
|
|
|
if (!string.IsNullOrEmpty(order.Contact) && order.Contact.Length == 11)
|
|
@@ -3567,11 +3783,11 @@ public class OrderController : BaseController
|
|
|
await _callApplication.RelateTianrunCallWithOrderAsync(order.CallId, order.Id, HttpContext.RequestAborted);
|
|
|
|
|
|
//内容分词
|
|
|
- await _orderApplication.OrderParticiple(dto.Content, order.Id, order.CreationTime, HttpContext.RequestAborted);
|
|
|
+ await _orderApplication.OrderParticiple(dto.Content, order.Id, order.No, order.Title, order.CreationTime, HttpContext.RequestAborted);
|
|
|
//敏感分词
|
|
|
await _orderApplication.OrderSensitiveParticiple(dto.Content, order.Id, HttpContext.RequestAborted);
|
|
|
-
|
|
|
-
|
|
|
+ //知识库引用
|
|
|
+ await _orderApplication.AddKnowledgeQuote(order.Id, order.Title, order.No, order.KnowledgeQuote, HttpContext.RequestAborted);
|
|
|
////sms
|
|
|
//try
|
|
|
//{
|
|
@@ -3708,7 +3924,7 @@ public class OrderController : BaseController
|
|
|
await _orderCopyRepository.AddAsync(copy, HttpContext.RequestAborted);
|
|
|
|
|
|
if (order.Content != dto.Content)
|
|
|
- await _orderApplication.OrderParticiple(dto.Content, dto.Id, order.CreationTime, HttpContext.RequestAborted);
|
|
|
+ await _orderApplication.OrderParticiple(dto.Content, dto.Id, order.No, order.Title, order.CreationTime, HttpContext.RequestAborted);
|
|
|
if (dto.RepeatableEventDetails?.Any() ?? false)
|
|
|
{
|
|
|
var reAdds = dto.RepeatableEventDetails.Where(x => string.IsNullOrEmpty(x.OrderId) && !x.IsDeleted)
|
|
@@ -3794,6 +4010,8 @@ public class OrderController : BaseController
|
|
|
|
|
|
//敏感分词
|
|
|
await _orderApplication.OrderSensitiveParticiple(dto.Content, order.Id, HttpContext.RequestAborted);
|
|
|
+ //知识库引用
|
|
|
+ await _orderApplication.AddKnowledgeQuote(order.Id, order.Title, order.No, order.KnowledgeQuote, HttpContext.RequestAborted);
|
|
|
|
|
|
return new { Id = order.Id, No = order.No, Password = order.Password, CallId = order.CallId };
|
|
|
}
|
|
@@ -3910,6 +4128,19 @@ public class OrderController : BaseController
|
|
|
if (orderId.NotNullOrEmpty())
|
|
|
{
|
|
|
outDto.Opinion = await _typeCache.GetAsync($"tmp_opinion_{orderId}{_sessionContext.UserId}", HttpContext.RequestAborted);
|
|
|
+ outDto.Content = (await _orderRepository.GetAsync(orderId, HttpContext.RequestAborted))?.Content;
|
|
|
+ }
|
|
|
+
|
|
|
+ //随手拍
|
|
|
+ bool.TryParse(_systemSettingCacheManager.GetSetting(SettingConstants.Snapshot)?.SettingValue[0],
|
|
|
+ out bool isSnapshotEnable);
|
|
|
+ if (isSnapshotEnable)
|
|
|
+ {
|
|
|
+ var orderSnapshot = await _orderSnapshotRepository.GetAsync(orderId, HttpContext.RequestAborted);
|
|
|
+ if (orderSnapshot != null && string.CompareOrdinal(orderSnapshot.IndustryName, "安全隐患") == 0)
|
|
|
+ {
|
|
|
+ outDto.Steps = outDto.Steps.Where(d => d.BusinessType != EBusinessType.Send).ToList();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return outDto;
|
|
@@ -3928,7 +4159,13 @@ public class OrderController : BaseController
|
|
|
$"非法参数, {string.Join(',', validResult.Errors.Select(d => d.ErrorMessage))}");
|
|
|
var order = await _orderApplication.SaveOrderWorkflowInfo(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
- var workflow = await _workflowDomainService.GetWorkflowAsync(dto.Workflow.WorkflowId, withSteps: true, withTraces: true,
|
|
|
+ // 随手拍业务处理
|
|
|
+ if (_systemSettingCacheManager.Snapshot)
|
|
|
+ {
|
|
|
+ await _orderSnapshotApplication.SaveOrderWorkflowInfo(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ var workflow = await _workflowDomainService.GetWorkflowAsync(dto.Workflow.WorkflowId, withDefine: true, withSteps: true, withTraces: true,
|
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
|
|
|
|
//await _workflowApplication.NextAsync(dto.WorkflowDto, order.ExpiredTime, HttpContext.RequestAborted);
|
|
@@ -3946,6 +4183,77 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 工单批量标注是否安全生产
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPut("sign/bath")]
|
|
|
+ public async Task<string> OrderSignBathAsync([FromBody] OrderSignBathInDto dto)
|
|
|
+ {
|
|
|
+ var stringBuilder = new StringBuilder();
|
|
|
+ foreach (var orderId in dto.OrderIds)
|
|
|
+ {
|
|
|
+ var order = await _orderRepository.GetAsync(orderId, HttpContext.RequestAborted);
|
|
|
+ if (order is null)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ var snapshot = await _orderSnapshotApplication.UpdateSafetyAsync(orderId, dto.IsSafetyDepartment, dto.Remark);
|
|
|
+ if (snapshot is null)
|
|
|
+ {
|
|
|
+ stringBuilder.Append($"随手拍: {order.No} 不存在");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withDefine: true, withSteps: true, withTraces: true,
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ NextStepsWithOpinionDto<NextStepOption> nextSteps;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ nextSteps = await _workflowApplication.GetNextStepsAsync(order.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ catch (UserFriendlyException e)
|
|
|
+ {
|
|
|
+ if (e.Message.Contains("未找到对应节点"))
|
|
|
+ {
|
|
|
+ stringBuilder.AppendLine($"{order.No} 修改成功");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ var stepInfo = nextSteps.Steps.FirstOrDefault(m => m.BusinessType == EBusinessType.Send);
|
|
|
+ if (stepInfo == null)
|
|
|
+ {
|
|
|
+ stringBuilder.Append($"下一步节点: [派单组] 未找到");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ var data = new OrderHandleFlowDto
|
|
|
+ {
|
|
|
+ OrderId = orderId,
|
|
|
+ IsSafetyDepartment = dto.IsSafetyDepartment
|
|
|
+ };
|
|
|
+ var workflowDto = new NextWorkflowDto
|
|
|
+ {
|
|
|
+ WorkflowId = order.WorkflowId,
|
|
|
+ StepId = nextSteps.StepId,
|
|
|
+ NextStepCode = stepInfo.Key,
|
|
|
+ NextStepName = stepInfo.Value,
|
|
|
+ Opinion = dto.Remark,
|
|
|
+ BackToCountersignEnd = false,
|
|
|
+ IsSms = false,
|
|
|
+ IsForwarded = false,
|
|
|
+ HandlerType = EHandlerType.OrgLevel,
|
|
|
+ BusinessType = EBusinessType.Send,
|
|
|
+ FlowDirection = EFlowDirection.CenterToCenter,
|
|
|
+ };
|
|
|
+ var startStep = workflow.Steps.First(d => d.Id == nextSteps.StepId);
|
|
|
+ await HandleOrderAsync(order, workflow, startStep, data, workflowDto, HttpContext.RequestAborted);
|
|
|
+ stringBuilder.AppendLine($"{orderId} 标注完成;");
|
|
|
+ }
|
|
|
+ return stringBuilder.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
private async Task HandleOrderAsync(Order order, Workflow workflow, WorkflowStep startStep, OrderHandleFlowDto orderHandleFlowDto,
|
|
|
BasicWorkflowDto workflowDto, CancellationToken cancellationToken)
|
|
|
{
|
|
@@ -3996,14 +4304,6 @@ public class OrderController : BaseController
|
|
|
}).Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
- //if (workflowDto.BusinessType == EBusinessType.Seat)
|
|
|
- //{
|
|
|
- // await _orderRepository.Updateable().SetColumns(o => new Order()
|
|
|
- // {
|
|
|
- // Status = EOrderStatus.WaitForAccept
|
|
|
- // }).Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
- //}
|
|
|
-
|
|
|
await _workflowDomainService.NextAsync(_sessionContext, nextDto, order.ExpiredTime, isAutoFillSummaryOpinion, cancellationToken);
|
|
|
break;
|
|
|
case EOrderAssignMode.CrossLevel:
|
|
@@ -4013,7 +4313,7 @@ public class OrderController : BaseController
|
|
|
orderHandleFlowDto.CrossSteps = orderHandleFlowDto.CrossSteps.OrderBy(d => d.Sort).ToList();
|
|
|
var stepCount = orderHandleFlowDto.CrossSteps.Count;
|
|
|
var unhandleSteps = new List<WorkflowStep> { startStep };
|
|
|
- for (int i = 0; i < stepCount; i++)
|
|
|
+ for (int i = 0;i < stepCount;i++)
|
|
|
{
|
|
|
var crossStep = orderHandleFlowDto.CrossSteps[i];
|
|
|
var tempSteps = new List<WorkflowStep>();
|
|
@@ -4044,12 +4344,98 @@ public class OrderController : BaseController
|
|
|
|
|
|
break;
|
|
|
case EOrderAssignMode.MainAndSecondary:
|
|
|
+ //主协办暂只支持指派给部门办理,且主办部门有且只有一个一级部门
|
|
|
+ nextDto = _mapper.Map<NextWorkflowDto>(workflowDto);
|
|
|
+ nextDto.WorkflowId = startStep.WorkflowId;
|
|
|
+ nextDto.StepId = startStep.Id;
|
|
|
+ nextDto.HandlerType = EHandlerType.OrgLevel;
|
|
|
+ nextDto.FlowDirection = EFlowDirection.CenterToOrg;
|
|
|
+ var secondaryOrgs = orderHandleFlowDto.SecondaryOrgs.DistinctBy(d => d.Id).ToList();
|
|
|
+ var nextHandleOrgs = secondaryOrgs
|
|
|
+ .Where(d => d.Level == 1 && d.Id.StartsWith(OrgSeedData.CenterId))
|
|
|
+ .ToList();
|
|
|
+ if (nextHandleOrgs.Any())
|
|
|
+ nextDto.NextHandlers.AddRange(nextHandleOrgs.Select(d => new FlowStepHandler
|
|
|
+ {
|
|
|
+ Key = d.Id,
|
|
|
+ Value = d.Name,
|
|
|
+ OrgId = d.Id,
|
|
|
+ OrgName = d.Name
|
|
|
+ }));
|
|
|
+ nextDto.IsStartCountersign = nextDto.NextHandlers.Count > 1;
|
|
|
+
|
|
|
+ await HandleNextInMainAndSecondaryAsync(_sessionContext, workflow.WorkflowDefinition,
|
|
|
+ secondaryOrgs, nextDto, order.ExpiredTime, isAutoFillSummaryOpinion,
|
|
|
+ cancellationToken);
|
|
|
+
|
|
|
+ //抄送
|
|
|
+ var ccs = orderHandleFlowDto.Copys
|
|
|
+ .Where(d => !string.IsNullOrEmpty(d.OrgId)
|
|
|
+ || !string.IsNullOrEmpty(d.RoleId)
|
|
|
+ || !string.IsNullOrEmpty(d.UserId))
|
|
|
+ .Select(d => _mapper.Map<OrderCarboncopy>(d))
|
|
|
+ .Distinct()
|
|
|
+ .ToList();
|
|
|
+ ccs.ForEach(d => d.OrderId = order.Id);
|
|
|
+ await _orderCarboncopy.AddRangeAsync(ccs, HttpContext.RequestAborted);
|
|
|
+
|
|
|
break;
|
|
|
default:
|
|
|
throw new ArgumentOutOfRangeException();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private async Task HandleNextInMainAndSecondaryAsync(ISessionContext current, WorkflowDefinition definition, List<OrgDto> orgs,
|
|
|
+ NextWorkflowDto? flowDto, DateTime? expiredTime, bool isAutoFillSummaryOpinion, CancellationToken cancellation)
|
|
|
+ {
|
|
|
+ if (flowDto is null || !flowDto.NextHandlers.Any()) return;
|
|
|
+ var currentSteps = await _workflowDomainService.NextAsync(current, flowDto, expiredTime,
|
|
|
+ isAutoFillSummaryOpinion, cancellation);
|
|
|
+
|
|
|
+ foreach (var currentStep in currentSteps)
|
|
|
+ {
|
|
|
+ var currentStepHandlerOrgId = currentStep?.HandlerOrgId;
|
|
|
+ if (string.IsNullOrEmpty(currentStepHandlerOrgId))
|
|
|
+ throw new UserFriendlyException($"数据异常, 待办部门id为空, stepId: {currentStep.Id}");
|
|
|
+ var nextStepHandlerOrgLevel = currentStepHandlerOrgId.CalcOrgLevel() + 1;
|
|
|
+ var nextHandlers = orgs.Where(d => d.Level == nextStepHandlerOrgLevel && d.Id.StartsWith(currentStepHandlerOrgId))
|
|
|
+ .Select(d => new FlowStepHandler
|
|
|
+ {
|
|
|
+ Key = d.Id,
|
|
|
+ Value = d.Name,
|
|
|
+ OrgId = d.Id,
|
|
|
+ OrgName = d.Name
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
+ if (nextHandlers.Any())
|
|
|
+ {
|
|
|
+ var nextStepDefine = definition.FindStepDefines(currentStep.NextSteps.Select(d => d.Code))
|
|
|
+ .FirstOrDefault(d =>
|
|
|
+ d.HandlerType == EHandlerType.OrgLevel &&
|
|
|
+ d.HandlerTypeItems.Any(x => x.Key == nextStepHandlerOrgLevel.ToString()));
|
|
|
+ if (nextStepDefine == null)
|
|
|
+ throw new UserFriendlyException($"流程模板未配置该部门等级, defineId: {definition.Id}, level: {nextStepHandlerOrgLevel}");
|
|
|
+
|
|
|
+ var nextDto = new NextWorkflowDto
|
|
|
+ {
|
|
|
+ WorkflowId = flowDto.WorkflowId,
|
|
|
+ StepId = currentStep.Id,
|
|
|
+ NextStepCode = nextStepDefine.Code,
|
|
|
+ NextStepName = nextStepDefine.Name,
|
|
|
+ FlowDirection = EFlowDirection.OrgToOrg,
|
|
|
+ HandlerType = nextStepDefine.HandlerType,
|
|
|
+ StepType = nextStepDefine.StepType,
|
|
|
+ IsSms = false,
|
|
|
+ NextHandlers = nextHandlers,
|
|
|
+ IsStartCountersign = nextHandlers.Count > 1,
|
|
|
+ BusinessType = nextStepDefine.BusinessType,
|
|
|
+ };
|
|
|
+
|
|
|
+ await HandleNextInMainAndSecondaryAsync(current, definition, orgs, nextDto, expiredTime, isAutoFillSummaryOpinion, cancellation);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private async Task AverageSendOrderAsync(NextWorkflowDto nextDto, CancellationToken cancellationToken)
|
|
|
{
|
|
|
// 平均派单
|
|
@@ -4085,6 +4471,7 @@ public class OrderController : BaseController
|
|
|
throw UserFriendlyException.SameMessage("该工单未开启流程");
|
|
|
var dto = await _workflowApplication.GetNextStepsAsync(order.WorkflowId, HttpContext.RequestAborted);
|
|
|
dto.ExpiredTime = order.ExpiredTime;
|
|
|
+ dto.Content = order.Content;
|
|
|
var rsp = _mapper.Map<NextStepsWithOpinionDto<RecommendStepOption>>(dto);
|
|
|
foreach (var step in rsp.Steps)
|
|
|
{
|
|
@@ -4108,6 +4495,7 @@ public class OrderController : BaseController
|
|
|
.ToList().Adapt<List<SystemDicDataOutDto>>();
|
|
|
|
|
|
rsp.CounterSignType = order.CounterSignType;
|
|
|
+ await _orderSnapshotApplication.GetNextStepsDatabaseAsync(rsp, orderId);
|
|
|
return rsp;
|
|
|
}
|
|
|
|
|
@@ -4238,8 +4626,12 @@ public class OrderController : BaseController
|
|
|
////todo 自贡add 4
|
|
|
//FocusOnEvents.Add(new Kv { Key = "4", Value = "24小时办结" });
|
|
|
|
|
|
+ var industryItems = await _industryRepository.Queryable()
|
|
|
+ .Select(d => new { d.Id, d.Name, })
|
|
|
+ .ToListAsync();
|
|
|
var rsp = new
|
|
|
{
|
|
|
+ Industry = industryItems,
|
|
|
TranspondCity = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.TranspondCity),
|
|
|
ChannelOptions = _sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.SourceChannel),
|
|
|
AcceptTypeOptions = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.AcceptType),
|
|
@@ -4373,6 +4765,19 @@ public class OrderController : BaseController
|
|
|
return _mapper.Map<IReadOnlyList<OrderFlowTraceDto>>(traces);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 流转到坐席的次数
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("count-of-flow-to-seat/{orderId}")]
|
|
|
+ public async Task<int> FlowToSeatCountAsync(string orderId)
|
|
|
+ {
|
|
|
+ var order = await _orderRepository.Queryable()
|
|
|
+ .Includes(d => d.WorkflowTraces)
|
|
|
+ .FirstAsync(d => d.Id == orderId, HttpContext.RequestAborted);
|
|
|
+ return order.WorkflowTraces.Count(d => d.IsOrigin && d.BusinessType == EBusinessType.Seat);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 工单待办
|
|
@@ -4549,14 +4954,23 @@ public class OrderController : BaseController
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("waited/center/base")]
|
|
|
- public async Task<object> WaitedForCenterBaseData()
|
|
|
+ public async Task<Dictionary<string, object>> WaitedForCenterBaseData()
|
|
|
{
|
|
|
- var rsp = new
|
|
|
+ var rsp = new Dictionary<string, object>
|
|
|
{
|
|
|
- OrderStatus = EnumExts.GetDescriptions<EOrderStatus>(),
|
|
|
- ExpiredStatus = EnumExts.GetDescriptions<EExpiredStatus>(),
|
|
|
- StepNames = new string[] { "话务部", "派单组", "班长审批" }
|
|
|
+ {"orderStatus" , EnumExts.GetDescriptions<EOrderStatus>() },
|
|
|
+ {"expiredStatus", EnumExts.GetDescriptions<EExpiredStatus>() },
|
|
|
+ { "stepNames" , new string[] { "话务部", "派单组", "班长审批" } },
|
|
|
};
|
|
|
+
|
|
|
+ if (_systemSettingCacheManager.Snapshot)
|
|
|
+ {
|
|
|
+ var industry = await _industryRepository.Queryable()
|
|
|
+ .Select(d => new { d.Id, d.Name, })
|
|
|
+ .ToListAsync();
|
|
|
+ rsp.Add("industry", industry);
|
|
|
+ }
|
|
|
+
|
|
|
return rsp;
|
|
|
}
|
|
|
|
|
@@ -4695,7 +5109,7 @@ public class OrderController : BaseController
|
|
|
dto.Handler = handler;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (oneSendBack || twoSendBack)
|
|
|
{
|
|
|
var sendBack = await _orderSendBackAuditRepository.Queryable()
|