|
@@ -9,10 +9,12 @@ using Hotline.Repository.SqlSugar.Orders;
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Share.Dtos.FlowEngine;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
+using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Mq;
|
|
|
using MapsterMapper;
|
|
|
using MediatR;
|
|
|
using XF.Domain.Exceptions;
|
|
|
+using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Application.Handlers.FlowEngine;
|
|
|
|
|
@@ -27,8 +29,9 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
|
private readonly ICapPublisher _capPublisher;
|
|
|
private readonly IMapper _mapper;
|
|
|
+ private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
|
|
|
- public EndWorkflowHandler(
|
|
|
+ public EndWorkflowHandler(
|
|
|
IKnowledgeDomainService knowledgeDomainService,
|
|
|
IOrderDomainService orderDomainService,
|
|
|
ITelDomainService telDomainService,
|
|
@@ -36,7 +39,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
|
ISystemOrganizeRepository orgRepository,
|
|
|
IOrderRepository orderRepository,
|
|
|
ICapPublisher capPublisher,
|
|
|
- IMapper mapper
|
|
|
+ IMapper mapper,
|
|
|
+ IRepository<OrderScreen> orderScreenRepository
|
|
|
)
|
|
|
{
|
|
|
_knowledgeDomainService = knowledgeDomainService;
|
|
@@ -47,7 +51,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
|
_orderRepository = orderRepository;
|
|
|
_capPublisher = capPublisher;
|
|
|
_mapper = mapper;
|
|
|
- }
|
|
|
+ _orderScreenRepository = orderScreenRepository;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>Handles a notification</summary>
|
|
|
/// <param name="notification">The notification</param>
|
|
@@ -88,6 +93,15 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
|
}, cancellationToken: cancellationToken);
|
|
|
|
|
|
break;
|
|
|
- }
|
|
|
+ case WorkflowModuleConsts.OrderScreen:
|
|
|
+ var screen = await _orderScreenRepository.GetAsync(workflow.ExternalId, cancellationToken);
|
|
|
+ if (screen != null)
|
|
|
+ {
|
|
|
+ screen.Status = EScreenStatus.End;
|
|
|
+ screen.ReplyContent = workflow.ActualOpinion;
|
|
|
+ await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|