You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
using Kean.Domain.Wcs.Events;
|
|
using Kean.Domain.Wcs.SharedServices.Proxies;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Kean.Domain.Wcs.EventHandlers
|
|
{
|
|
/// <summary>
|
|
/// 同步输出成功时,处理状态 999
|
|
/// </summary>
|
|
public sealed class SyncOutputSuccessEventHandler_999 : EventHandler<SyncOutputSuccessEvent>
|
|
{
|
|
private readonly TaskProxy _taskProxy; // 任务代理
|
|
|
|
/// <summary>
|
|
/// 依赖注入
|
|
/// </summary>
|
|
public SyncOutputSuccessEventHandler_999(
|
|
TaskProxy taskProxy)
|
|
{
|
|
_taskProxy = taskProxy;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 处理程序
|
|
/// </summary>
|
|
public override async Task Handle(SyncOutputSuccessEvent @event, CancellationToken cancellationToken)
|
|
{
|
|
if (@event.State == 999)
|
|
{
|
|
if (@event.Task > 0)
|
|
{
|
|
await _taskProxy.Complete(@event.Task);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|