OrderFinalManageHandler.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Hotline.FlowEngine;
  7. using Hotline.FlowEngine.Notifications;
  8. using Hotline.Orders;
  9. using MediatR;
  10. namespace Hotline.Application.Handlers.FlowEngine
  11. {
  12. public class OrderFinalManageHandler : INotificationHandler<OrderFinalManageNotify>
  13. {
  14. private readonly IOrderDomainService _orderDomainService;
  15. public OrderFinalManageHandler(IOrderDomainService orderDomainService)
  16. {
  17. _orderDomainService = orderDomainService;
  18. }
  19. /// <summary>Handles a notification</summary>
  20. /// <param name="notification">The notification</param>
  21. /// <param name="cancellationToken">Cancellation token</param>
  22. public async Task Handle(OrderFinalManageNotify notification, CancellationToken cancellationToken)
  23. {
  24. var workflow = notification.Workflow;
  25. switch (workflow.ModuleCode)
  26. {
  27. case WorkflowModuleConsts.OrderManage:
  28. await _orderDomainService.FinalManageAsync(notification.Workflow.ExternalId, cancellationToken);
  29. break;
  30. }
  31. }
  32. }
  33. }