1234567891011121314151617181920212223242526272829303132333435363738 |
- using Hotline.FlowEngine.Notifies;
- using Hotline.KnowledgeBase;
- using Hotline.Settings;
- using Hotline.Share.Enums.Order;
- using MediatR;
- namespace Hotline.Application.Handlers.FlowEngine;
- public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
- {
- private readonly KnowledgeDomainService _knowledgeDomainService;
- public EndWorkflowHandler(KnowledgeDomainService knowledgeDomainService)
- {
- _knowledgeDomainService = knowledgeDomainService;
- }
- /// <summary>Handles a notification</summary>
- /// <param name="notification">The notification</param>
- /// <param name="cancellationToken">Cancellation token</param>
- public async Task Handle(EndWorkflowNotify notification, CancellationToken cancellationToken)
- {
- var workflow = notification.Workflow;
- switch (workflow.ModuleCode)
- {
- case WorkflowModuleConsts.KnowledgeAdd://新增
- case WorkflowModuleConsts.KnowledgeUpdate://修改
- case WorkflowModuleConsts.KnowledgeDelete://删除
- await _knowledgeDomainService.EndWorkKnowledge(workflow, cancellationToken);
- break;
- case WorkflowModuleConsts.TelRestApply:
- //TODO 审核通过
- //notification.Workflow.ExternalId;
- break;
- }
- }
- }
|