|
@@ -6,6 +6,7 @@ using Hotline.Application.ExportExcel;
|
|
|
using Hotline.Application.FlowEngine;
|
|
|
using Hotline.Application.Orders;
|
|
|
using Hotline.Application.Quality;
|
|
|
+using Hotline.Application.Snapshot;
|
|
|
using Hotline.Application.Systems;
|
|
|
using Hotline.Authentications;
|
|
|
using Hotline.Caching.Interfaces;
|
|
@@ -40,7 +41,9 @@ 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.Org;
|
|
|
using Hotline.Share.Dtos.Settings;
|
|
|
+using Hotline.Share.Dtos.Snapshot;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
@@ -49,6 +52,8 @@ using Hotline.Share.Enums.Settings;
|
|
|
using Hotline.Share.Mq;
|
|
|
using Hotline.Share.Requests;
|
|
|
using Hotline.Share.Tools;
|
|
|
+using Hotline.Snapshot;
|
|
|
+using Hotline.Snapshot.Interfaces;
|
|
|
using Hotline.Tools;
|
|
|
using Hotline.Users;
|
|
|
using Hotline.YbEnterprise.Sdk;
|
|
@@ -68,20 +73,6 @@ using XF.Domain.Entities;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
using XF.Utility.EnumExtensions;
|
|
|
-using Hotline.Application.Contracts.Validators.FlowEngine;
|
|
|
-using Hotline.Authentications;
|
|
|
-using Hotline.Share.Dtos.CallCenter;
|
|
|
-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;
|
|
@@ -380,7 +371,7 @@ public class OrderController : BaseController
|
|
|
public async Task<PagedDto<PublishDto>> PublishOrderList([FromQuery] QueryOrderPublishDto dto)
|
|
|
{
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
|
- .Includes(d=>d.OrderTags)
|
|
|
+ .Includes(d => d.OrderTags)
|
|
|
//.Includes(d => d.OrderPublish)
|
|
|
.Where(x => x.Status == EOrderStatus.Filed)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.StartsWith(dto.Keyword!))
|
|
@@ -389,9 +380,9 @@ public class OrderController : BaseController
|
|
|
//.WhereIF(dto.PubState == EPubState.Pub, d => d.Status >= EOrderStatus.Published)
|
|
|
//.WhereIF(dto.PubState == EPubState.NoPub, d => d.Status == EOrderStatus.Filed)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.SourceChannelCode == dto.Channel)
|
|
|
- //.WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTagCode == dto.OrderTag!) //工单标签
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTags.Any(ot=>ot.DicDataValue == dto.OrderTag)) //工单标签
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName == dto.CenterToOrgHandlerName!) //派单人
|
|
|
+ //.WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTagCode == dto.OrderTag!) //工单标签
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTags.Any(ot => ot.DicDataValue == dto.OrderTag)) //工单标签
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName == dto.CenterToOrgHandlerName!) //派单人
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.NameOrNo), d => d.AcceptorName == dto.NameOrNo! || d.AcceptorStaffNo == dto.NameOrNo!) //受理人/坐席
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.ActualHandleOrgName), d => d.ActualHandleOrgName.Contains(dto.ActualHandleOrgName)) //接办部门(综合查询模糊)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
@@ -1174,10 +1165,10 @@ 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)
|
|
|
+ if (_appOptions.Value.IsZiGong == true)
|
|
|
{
|
|
|
voiceEvaluate = EnumExtensions.GetEnumKeyValueList<EVoiceEvaluate>();
|
|
|
- seatEvaluate=EnumExtensions.GetEnumKeyValueList<ESeatEvaluate>();
|
|
|
+ seatEvaluate = EnumExtensions.GetEnumKeyValueList<ESeatEvaluate>();
|
|
|
}
|
|
|
var visitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction);
|
|
|
var visitManner = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitManner);
|
|
@@ -1991,7 +1982,7 @@ public class OrderController : BaseController
|
|
|
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));
|
|
|
}
|
|
|
|
|
@@ -2071,19 +2062,20 @@ 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
|
|
|
- {
|
|
|
+ /// <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;
|
|
|
if (workflow.NextHandlers.Any() && workflow.NextHandlers.Count() == 1)
|
|
|
{
|
|
@@ -2099,77 +2091,79 @@ public class OrderController : BaseController
|
|
|
var currentStep =
|
|
|
workflowEntuty.Steps.FirstOrDefault(d => d.Status == EWorkflowStepStatus.WaitForAccept || d.Status == EWorkflowStepStatus.WaitForHandle);
|
|
|
|
|
|
- NextStepsWithOpinionDto<NextStepOption> next = null;
|
|
|
+ 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;
|
|
|
+ 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 (!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 == "中心终审"));
|
|
|
- }
|
|
|
- }
|
|
|
+ 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();
|
|
|
+ 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++;
|
|
|
+ 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.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()}";
|
|
|
+ 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>
|
|
|
/// 延期查询流程办理下一步可选节点
|
|
@@ -3412,7 +3406,7 @@ public class OrderController : BaseController
|
|
|
.Includes(d => d.OrderPublish)
|
|
|
.Includes(d => d.OrderPushTypes)
|
|
|
.Includes(d => d.OrderComplements)
|
|
|
- .Includes(d=>d.OrderTags)
|
|
|
+ .Includes(d => d.OrderTags)
|
|
|
//.Includes(d => d.OrderScreens)
|
|
|
.Includes(d => d.OrderVisits.Where(x => x.VisitState == EVisitState.Visited).ToList(), x => x.OrderVisitDetails)
|
|
|
.Includes(d => d.OrderVisits.Where(x => x.VisitState == EVisitState.Visited).ToList(), x => x.Employee)
|
|
@@ -3751,7 +3745,7 @@ public class OrderController : BaseController
|
|
|
foreach (var item in dto.Tags)
|
|
|
{
|
|
|
orderTags.Add(new SystemDicData() { Id = item });
|
|
|
- }
|
|
|
+ }
|
|
|
order.OrderTags = orderTags;
|
|
|
}
|
|
|
|
|
@@ -3991,19 +3985,19 @@ public class OrderController : BaseController
|
|
|
var pushTypes = dto.OrderPushTypes.Select(x => x.PushType);
|
|
|
order.PushType = string.Join(",", pushTypes);
|
|
|
}
|
|
|
- if (dto.Tags != null && dto.Tags.Any())
|
|
|
- {
|
|
|
- var orderTags = new List<SystemDicData>();
|
|
|
- foreach (var item in dto.Tags)
|
|
|
- {
|
|
|
- orderTags.Add(new SystemDicData() { Id = item });
|
|
|
- }
|
|
|
- order.OrderTags = orderTags;
|
|
|
- }
|
|
|
+ if (dto.Tags != null && dto.Tags.Any())
|
|
|
+ {
|
|
|
+ var orderTags = new List<SystemDicData>();
|
|
|
+ foreach (var item in dto.Tags)
|
|
|
+ {
|
|
|
+ orderTags.Add(new SystemDicData() { Id = item });
|
|
|
+ }
|
|
|
+ order.OrderTags = orderTags;
|
|
|
+ }
|
|
|
|
|
|
- //处理工单的期满时间
|
|
|
- //首先是工单编辑页面提交的、流程已经开启、工单未归档的工单才能修改期满时间
|
|
|
- if (dto.IsEdit && !string.IsNullOrEmpty(order.WorkflowId) && order.Status < EOrderStatus.Filed && dto.AcceptTypeCode != acceptTypeCode)
|
|
|
+ //处理工单的期满时间
|
|
|
+ //首先是工单编辑页面提交的、流程已经开启、工单未归档的工单才能修改期满时间
|
|
|
+ if (dto.IsEdit && !string.IsNullOrEmpty(order.WorkflowId) && order.Status < EOrderStatus.Filed && dto.AcceptTypeCode != acceptTypeCode)
|
|
|
{
|
|
|
//查询当前工单的实际办理节点,如果在热线中心不处理,如果在部门需要更新期满时间
|
|
|
var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withSteps: true, withTraces: true,
|
|
@@ -4031,7 +4025,7 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- await _orderRepository.UpdateNav(order, new UpdateNavRootOptions { IgnoreColumns = ["CallId"] }).Include(d => d.OrderExtension).Include(d=>d.OrderTags).ExecuteCommandAsync();
|
|
|
+ await _orderRepository.UpdateNav(order, new UpdateNavRootOptions { IgnoreColumns = ["CallId"] }).Include(d => d.OrderExtension).Include(d => d.OrderTags).ExecuteCommandAsync();
|
|
|
|
|
|
//订阅此事件的内部处理工单数据只能更新各自业务的字段,不能全部更新
|
|
|
//修改工单其他处理事件 (受理短信)
|
|
@@ -4250,7 +4244,7 @@ public class OrderController : BaseController
|
|
|
continue;
|
|
|
}
|
|
|
throw;
|
|
|
- }
|
|
|
+ }
|
|
|
var stepInfo = nextSteps.Steps.FirstOrDefault(m => m.BusinessType == EBusinessType.Send);
|
|
|
if (stepInfo == null)
|
|
|
{
|
|
@@ -4342,7 +4336,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>();
|