|
@@ -69,6 +69,7 @@ using Hotline.Share.Dtos.CallCenter;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using System.Threading;
|
|
|
using Hotline.Share.Mq;
|
|
|
+using Hotline.CallCenter.Calls;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -923,11 +924,14 @@ public class OrderController : BaseController
|
|
|
.WhereIF(dto.VisitStateQuery == EVisitStateQuery.SMSUnsatisfied, d => d.VisitState == EVisitState.SMSUnsatisfied)
|
|
|
.WhereIF(dto.VisitStateQuery == EVisitStateQuery.SMSVisiting, d => d.VisitState == EVisitState.SMSVisiting)
|
|
|
.WhereIF(dto.VisitStateQuery == EVisitStateQuery.NoPutThrough, d => d.IsPutThrough == false && d.VisitState != EVisitState.Visited)
|
|
|
+ .WhereIF(dto.VisitStateQuery == EVisitStateQuery.ChipVoiceVisiting, d => d.VisitState == EVisitState.AiVisiting)//任务 162:回访状态快捷查询条件
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Order.Title.StartsWith(dto.Keyword!))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.No), d => d.No == dto.No)
|
|
|
.WhereIF(dto.VisitType != null, d => d.VisitType == dto.VisitType)
|
|
|
- .WhereIF(dto.FiledType != null && dto.FiledType == FiledType.CenterFiled, d => d.Order.ProcessType == EProcessType.Zhiban)
|
|
|
- .WhereIF(dto.FiledType != null && dto.FiledType == FiledType.OrgFiled, d => d.Order.ProcessType == EProcessType.Jiaoban)
|
|
|
+ //.WhereIF(dto.FiledType != null && dto.FiledType == FiledType.CenterFiled, d => d.Order.ProcessType == EProcessType.Zhiban)
|
|
|
+ //.WhereIF(dto.FiledType != null && dto.FiledType == FiledType.OrgFiled, d => d.Order.ProcessType == EProcessType.Jiaoban)
|
|
|
+ .WhereIF(dto.FiledType != null && dto.FiledType == FiledType.CenterFiled, d => d.Order.FileOrgIsCenter == true)
|
|
|
+ .WhereIF(dto.FiledType != null && dto.FiledType == FiledType.OrgFiled, d => d.Order.FileOrgIsCenter == false)
|
|
|
.WhereIF(dto.IsCountersign != null && dto.IsCountersign == true, d => d.Order.CounterSignType != null)
|
|
|
.WhereIF(dto.IsCountersign != null && dto.IsCountersign == false, d => d.Order.CounterSignType == null)
|
|
|
.WhereIF(dto.QuerySelf.HasValue && dto.QuerySelf.Value, d => d.EmployeeId == _sessionContext.RequiredUserId)
|
|
@@ -1037,12 +1041,24 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
else if (_appOptions.Value.GetDefaultAppScopeConfiguration().CallCenterType == AppDefaults.CallCenterType.XingTang)
|
|
|
{
|
|
|
- var call = await _callApplication.GetCallAsync(orderVisit.CallId, HttpContext.RequestAborted);
|
|
|
+ CallNative? call = null;
|
|
|
+ if (orderVisit.CallId == null && orderVisit.VisitTime.HasValue)
|
|
|
+ {
|
|
|
+ call = await _callApplication.GetCallByTimeAndToNoAsync(orderVisit.Order.Contact, orderVisit.VisitTime.Value, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ call = await _callApplication.GetCallAsync(orderVisit.CallId, HttpContext.RequestAborted);
|
|
|
if (call is not null)
|
|
|
{
|
|
|
- recordingFileUrl = call.AudioFile;
|
|
|
- recordingBaseAddress = call.AudioFile;
|
|
|
- recordingAbsolutePath = call.AudioFile;
|
|
|
+ if (call.AudioFile.IsNullOrEmpty())
|
|
|
+ {
|
|
|
+ call = await _callApplication.GetCallByCallNoAsync(call.CallNo, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ if (call is not null)
|
|
|
+ {
|
|
|
+ recordingFileUrl = call.AudioFile;
|
|
|
+ recordingBaseAddress = call.AudioFile;
|
|
|
+ recordingAbsolutePath = call.AudioFile;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3374,7 +3390,6 @@ public class OrderController : BaseController
|
|
|
orderTerminateList.Any(x => x.Status == ETerminateStatus.Refuse) ? "不同意" :
|
|
|
orderTerminateList.Any(x => x.Status == ETerminateStatus.Approval || x.Status == ETerminateStatus.SendBack) ? "审批中" : null;
|
|
|
|
|
|
-
|
|
|
return _sessionContext.OrgIsCenter ? dto : dto.DataMask();
|
|
|
}
|
|
|
|
|
@@ -3673,7 +3688,7 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- await _orderRepository.UpdateNav(order).Include(d => d.OrderExtension).ExecuteCommandAsync();
|
|
|
+ await _orderRepository.UpdateNav(order, new UpdateNavRootOptions { IgnoreColumns = ["CallId"] }).Include(d => d.OrderExtension).ExecuteCommandAsync();
|
|
|
|
|
|
//订阅此事件的内部处理工单数据只能更新各自业务的字段,不能全部更新
|
|
|
//修改工单其他处理事件 (受理短信)
|
|
@@ -4307,6 +4322,23 @@ public class OrderController : BaseController
|
|
|
// return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
//}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 列表页面基础数据
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("waited/base-data")]
|
|
|
+ public async Task<object> WaitedBaseData()
|
|
|
+ {
|
|
|
+ var wfModule = await _workflowApplication.GetWorkflowModuleAsync(WorkflowModuleConsts.OrderHandle, HttpContext.RequestAborted);
|
|
|
+ var definition = wfModule.Definition;
|
|
|
+ var rsp = new
|
|
|
+ {
|
|
|
+ OrderStatusOptions = EnumExts.GetDescriptions<EOrderStatus>(),
|
|
|
+ CurrentStepOptions = definition?.Steps.Select(x => new Kv(x.Code, x.Name))
|
|
|
+ };
|
|
|
+ return rsp;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 工单待办
|
|
|
/// </summary>
|
|
@@ -4321,7 +4353,7 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
|
|
|
[HttpGet("waited/count")]
|
|
|
- public async Task<int> QueryWaitedCount([FromQuery]QueryOrderWaitedDto dto)
|
|
|
+ public async Task<int> QueryWaitedCount([FromQuery] QueryOrderWaitedDto dto)
|
|
|
{
|
|
|
return await _orderApplication
|
|
|
.QueryWaited(dto)
|
|
@@ -4332,11 +4364,13 @@ public class OrderController : BaseController
|
|
|
/// 查询坐席待办
|
|
|
/// </summary>
|
|
|
[HttpGet("waited/sign")]
|
|
|
- public async Task<List<OrderListOutDto>> QueryWaitedForSeat([FromQuery] QueryOrderWaitedDto dto)
|
|
|
+ public async Task<IReadOnlyList<OrderListOutDto>> QueryWaitedForSeat([FromQuery] QueryOrderWaitedDto dto)
|
|
|
{
|
|
|
- return await _orderApplication
|
|
|
+ var orders = await _orderApplication
|
|
|
.QueryWaitedForSeat(dto)
|
|
|
.ToPageListWithoutTotalAsync(dto, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ return _mapper.Map<IReadOnlyList<OrderListOutDto>>(orders);
|
|
|
}
|
|
|
|
|
|
[HttpGet("waited/sign/count")]
|
|
@@ -5480,7 +5514,8 @@ public class OrderController : BaseController
|
|
|
NextStepCode = special.NextStepCode,
|
|
|
NextStepName = special.NextStepName,
|
|
|
NextHandlers = special.NextHandlers,
|
|
|
- Opinion = dto.Opinion,
|
|
|
+ // Opinion = dto.Opinion,
|
|
|
+ Opinion = "【特提理由】" + special.Reason,
|
|
|
FlowDirection = special.FlowDirection,
|
|
|
HandlerType = special.HandlerType.Value,
|
|
|
BusinessType = special.BusinessType.Value
|
|
@@ -5982,71 +6017,71 @@ public class OrderController : BaseController
|
|
|
[HttpGet("sendback/base/{id}")]
|
|
|
public async Task<object> SendBackBaseData(string id)
|
|
|
{
|
|
|
- var order = await _orderRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
- var isInstaShot = order.SourceChannel.Contains("随手拍");
|
|
|
- var defaultStepKey = string.Empty;
|
|
|
- var defaultHandlerKey = string.Empty;
|
|
|
- List<Kv> orgs = new();
|
|
|
- if (order == null) throw UserFriendlyException.SameMessage("无效工单信息!");
|
|
|
- //中心会签调取方法
|
|
|
- var org = await _workflowDomainService.GetLevelOneOrgsAsync(order.WorkflowId, HttpContext.RequestAborted);
|
|
|
- orgs.AddRange(org);
|
|
|
- var step = await _workflowApplication.GetRecallStepsAsync(order.WorkflowId, HttpContext.RequestAborted);
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
- {
|
|
|
- step.Steps = step.Steps.Where(x => x.Key.ToLower() != "start").ToList();
|
|
|
- if (step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1).Any())
|
|
|
- {
|
|
|
- var stepdDefault = step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1)
|
|
|
- .FirstOrDefault();
|
|
|
- defaultStepKey = stepdDefault.Key;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (_appOptions.Value.IsYiBin)
|
|
|
- {
|
|
|
- if (order.ProcessType == EProcessType.Zhiban)
|
|
|
- {
|
|
|
- var stepdDefault = step.Steps.Where(x => x.Key.ToLower() == "start").FirstOrDefault();
|
|
|
- defaultStepKey = stepdDefault.Key;
|
|
|
- defaultHandlerKey = stepdDefault.Handler.Key;
|
|
|
-
|
|
|
- }
|
|
|
- if (order.ProcessType == EProcessType.Jiaoban)
|
|
|
- {
|
|
|
- if (step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1).Any())
|
|
|
- {
|
|
|
- var stepdDefault = step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1)
|
|
|
- .FirstOrDefault();
|
|
|
- defaultStepKey = stepdDefault.Key;
|
|
|
- defaultHandlerKey = stepdDefault.Handler.Key;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //获取部门信息
|
|
|
- var rsp = new
|
|
|
- {
|
|
|
- SpecialTimeType = EnumExts.GetDescriptions<ETimeType>(),
|
|
|
- SpecialReason = isInstaShot
|
|
|
- ? _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.InstaShotSpecialReason)
|
|
|
- : _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.SpecialReason),
|
|
|
- ReTransactErrorType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.ReTransactErrorType),
|
|
|
- IsTerminate =
|
|
|
- await _orderTerminateRepository.Queryable().Where(d => d.OrderId == order.Id && d.Status == ETerminateStatus.End).AnyAsync(),
|
|
|
- Step = step,
|
|
|
- Orgs = orgs,
|
|
|
- DefaultStepKey = defaultStepKey,
|
|
|
- DefaultHandlerKey= defaultHandlerKey
|
|
|
- };
|
|
|
- return rsp;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 部门批量重提 该部门及下级部门回访结果 不满意 未评价 视为满意
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost("org_batch_special")]
|
|
|
+ var order = await _orderRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
+ var isInstaShot = order.SourceChannel.Contains("随手拍");
|
|
|
+ var defaultStepKey = string.Empty;
|
|
|
+ var defaultHandlerKey = string.Empty;
|
|
|
+ List<Kv> orgs = new();
|
|
|
+ if (order == null) throw UserFriendlyException.SameMessage("无效工单信息!");
|
|
|
+ //中心会签调取方法
|
|
|
+ var org = await _workflowDomainService.GetLevelOneOrgsAsync(order.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ orgs.AddRange(org);
|
|
|
+ var step = await _workflowApplication.GetRecallStepsAsync(order.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
+ {
|
|
|
+ step.Steps = step.Steps.Where(x => x.Key.ToLower() != "start").ToList();
|
|
|
+ if (step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1).Any())
|
|
|
+ {
|
|
|
+ var stepdDefault = step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1)
|
|
|
+ .FirstOrDefault();
|
|
|
+ defaultStepKey = stepdDefault.Key;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_appOptions.Value.IsYiBin)
|
|
|
+ {
|
|
|
+ if (order.ProcessType == EProcessType.Zhiban)
|
|
|
+ {
|
|
|
+ var stepdDefault = step.Steps.Where(x => x.Key.ToLower() == "start").FirstOrDefault();
|
|
|
+ defaultStepKey = stepdDefault.Key;
|
|
|
+ defaultHandlerKey = stepdDefault.Handler.Key;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (order.ProcessType == EProcessType.Jiaoban)
|
|
|
+ {
|
|
|
+ if (step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1).Any())
|
|
|
+ {
|
|
|
+ var stepdDefault = step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1)
|
|
|
+ .FirstOrDefault();
|
|
|
+ defaultStepKey = stepdDefault.Key;
|
|
|
+ defaultHandlerKey = stepdDefault.Handler.Key;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //获取部门信息
|
|
|
+ var rsp = new
|
|
|
+ {
|
|
|
+ SpecialTimeType = EnumExts.GetDescriptions<ETimeType>(),
|
|
|
+ SpecialReason = isInstaShot
|
|
|
+ ? _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.InstaShotSpecialReason)
|
|
|
+ : _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.SpecialReason),
|
|
|
+ ReTransactErrorType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.ReTransactErrorType),
|
|
|
+ IsTerminate =
|
|
|
+ await _orderTerminateRepository.Queryable().Where(d => d.OrderId == order.Id && d.Status == ETerminateStatus.End).AnyAsync(),
|
|
|
+ Step = step,
|
|
|
+ Orgs = orgs,
|
|
|
+ DefaultStepKey = defaultStepKey,
|
|
|
+ DefaultHandlerKey = defaultHandlerKey
|
|
|
+ };
|
|
|
+ return rsp;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 部门批量重提 该部门及下级部门回访结果 不满意 未评价 视为满意
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("org_batch_special")]
|
|
|
[AllowAnonymous]
|
|
|
public async Task OrgBatchSpecial([FromBody] OrgBatchSpecialDto model)
|
|
|
{
|