|
@@ -147,6 +147,7 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<OrderPushType> _orderPushTypeRepository;
|
|
|
private readonly IRepository<OrderRevoke> _orderRevokeRepository;
|
|
|
private readonly IOrderTerminateRepository _orderTerminateRepository;
|
|
|
+ private readonly ISystemLogApplication _systemLogApplication;
|
|
|
private readonly IRepository<OrderCarboncopy> _orderCarboncopy;
|
|
|
|
|
|
public OrderController(
|
|
@@ -3499,6 +3500,13 @@ public class OrderController : BaseController
|
|
|
var exists = await _orderRepository.AnyAsync(d => d.CallId == dto.CallId, HttpContext.RequestAborted);
|
|
|
if (exists)
|
|
|
throw new UserFriendlyException($"来电已保存工单, phone:{dto.FromPhone}, callId: {dto.CallId}", "来电已保存工单");
|
|
|
+ exists = await _systemLogApplication.HasByIpUrlAsync(dto.CallId);
|
|
|
+ if (exists)
|
|
|
+ {
|
|
|
+ // IpUrl 里面存的是 callId, 用来判断是工单的 CallId 是否已经被修复过了.
|
|
|
+ // 存入的地方是 Hotline.Application.CallCenter.OrderRelateCallHandlerAsync
|
|
|
+ throw new UserFriendlyException($"来电已保存工单, phone:{dto.FromPhone}, callId: {dto.CallId} !", "来电已保存工单!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
var order = _mapper.Map<Orders.Order>(dto);
|
|
@@ -4066,16 +4074,16 @@ public class OrderController : BaseController
|
|
|
NextWorkflowDto? flowDto, DateTime? expiredTime, bool isAutoFillSummaryOpinion, CancellationToken cancellation)
|
|
|
{
|
|
|
if (flowDto is null || !flowDto.NextHandlers.Any()) return;
|
|
|
- var nextSteps = await _workflowDomainService.NextAsync(current, flowDto, expiredTime,
|
|
|
+ var currentSteps = await _workflowDomainService.NextAsync(current, flowDto, expiredTime,
|
|
|
isAutoFillSummaryOpinion, cancellation);
|
|
|
|
|
|
- foreach (var nextStep in nextSteps)
|
|
|
+ foreach (var currentStep in currentSteps)
|
|
|
{
|
|
|
- var nextStepHandlerOrgId = nextStep?.HandlerOrgId;
|
|
|
- if (string.IsNullOrEmpty(nextStepHandlerOrgId))
|
|
|
- throw new UserFriendlyException($"数据异常, 待办部门id为空, stepId: {nextStep.Id}");
|
|
|
- var nextStepHandlerOrgLevel = nextStepHandlerOrgId.CalcOrgLevel();
|
|
|
- var nextHandlers = orgs.Where(d => d.Level == nextStepHandlerOrgLevel && d.Id.StartsWith(nextStepHandlerOrgId))
|
|
|
+ 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,
|
|
@@ -4086,7 +4094,7 @@ public class OrderController : BaseController
|
|
|
.ToList();
|
|
|
if (nextHandlers.Any())
|
|
|
{
|
|
|
- var nextStepDefine = definition.FindStepDefines(nextStep.NextSteps.Select(d => d.Code))
|
|
|
+ var nextStepDefine = definition.FindStepDefines(currentStep.NextSteps.Select(d => d.Code))
|
|
|
.FirstOrDefault(d =>
|
|
|
d.HandlerType == EHandlerType.OrgLevel &&
|
|
|
d.HandlerTypeItems.Any(x => x.Key == nextStepHandlerOrgLevel.ToString()));
|
|
@@ -4096,7 +4104,7 @@ public class OrderController : BaseController
|
|
|
var nextDto = new NextWorkflowDto
|
|
|
{
|
|
|
WorkflowId = flowDto.WorkflowId,
|
|
|
- StepId = nextStep.Id,
|
|
|
+ StepId = currentStep.Id,
|
|
|
NextStepCode = nextStepDefine.Code,
|
|
|
NextStepName = nextStepDefine.Name,
|
|
|
FlowDirection = EFlowDirection.OrgToOrg,
|