|
@@ -1,4 +1,5 @@
|
|
|
using DotNetCore.CAP;
|
|
|
+using Hotline.Caching.Interfaces;
|
|
|
using Hotline.FlowEngine.Notifications;
|
|
|
using Hotline.FlowEngine.WorkflowModules;
|
|
|
using Hotline.FlowEngine.Workflows;
|
|
@@ -10,6 +11,7 @@ using Hotline.Share.Enums.Order;
|
|
|
using MapsterMapper;
|
|
|
using MediatR;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
+using XF.Domain.Constants;
|
|
|
|
|
|
namespace Hotline.Application.Handlers.FlowEngine;
|
|
|
|
|
@@ -19,6 +21,7 @@ public class WorkflowRecallHandler : INotificationHandler<RecallNotify>
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
|
private readonly IWorkflowDomainService _workflowDomainService;
|
|
|
private readonly ITimeLimitDomainService _timeLimitDomainService;
|
|
|
+ private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
private readonly ICapPublisher _capPublisher;
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly ILogger<WorkflowRecallHandler> _logger;
|
|
@@ -28,6 +31,7 @@ public class WorkflowRecallHandler : INotificationHandler<RecallNotify>
|
|
|
IOrderRepository orderRepository,
|
|
|
IWorkflowDomainService workflowDomainService,
|
|
|
ITimeLimitDomainService timeLimitDomainService,
|
|
|
+ ISystemSettingCacheManager systemSettingCacheManager,
|
|
|
ICapPublisher capPublisher,
|
|
|
IMapper mapper,
|
|
|
ILogger<WorkflowRecallHandler> logger)
|
|
@@ -36,6 +40,7 @@ public class WorkflowRecallHandler : INotificationHandler<RecallNotify>
|
|
|
_orderRepository = orderRepository;
|
|
|
_workflowDomainService = workflowDomainService;
|
|
|
_timeLimitDomainService = timeLimitDomainService;
|
|
|
+ _systemSettingCacheManager = systemSettingCacheManager;
|
|
|
_capPublisher = capPublisher;
|
|
|
_mapper = mapper;
|
|
|
_logger = logger;
|
|
@@ -57,11 +62,24 @@ public class WorkflowRecallHandler : INotificationHandler<RecallNotify>
|
|
|
_mapper.Map(workflow, order);
|
|
|
if (notification.TargetStep.StepType is EStepType.Start)
|
|
|
{
|
|
|
+ var isRecallToSeatDesignated = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsRecallToSeatDesignated).SettingValue[0]);
|
|
|
order.Status = EOrderStatus.SpecialToUnAccept;
|
|
|
- order.BackToUnsign();
|
|
|
+ if (isRecallToSeatDesignated)
|
|
|
+ {
|
|
|
+ if (data.HandlerType is EHandlerType.Role or EHandlerType.AssignedUser)
|
|
|
+ {
|
|
|
+ var handler = data.NextHandlers.First();
|
|
|
+ order.SignerId = handler.Key;
|
|
|
+ order.SignerName = handler.Value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ order.BackToUnsign();
|
|
|
+ }
|
|
|
}
|
|
|
await _orderRepository.UpdateAsync(order, false, cancellationToken);
|
|
|
- break;
|
|
|
+ break;
|
|
|
case WorkflowModuleConsts.KnowledgeAdd:
|
|
|
case WorkflowModuleConsts.KnowledgeUpdate:
|
|
|
case WorkflowModuleConsts.KnowledgeDelete:
|