山东雷驰
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.
 
 
 
 

45 lines
1.3 KiB

using Kean.Domain.Task.Events;
using Kean.Domain.Task.SharedServices.Proxies;
using System.Threading;
namespace Kean.Domain.Task.EventHandlers
{
/// <summary>
/// 创建下架命令成功时,下达控制任务
/// </summary>
public sealed class OutfeedSuccessEventHandler_Wcs : EventHandler<OutfeedSuccessEvent>
{
private readonly WcsProxy _wcsProxy; // 控制域
/// <summary>
/// 依赖注入
/// </summary>
public OutfeedSuccessEventHandler_Wcs(
WcsProxy wcsProxy)
{
_wcsProxy = wcsProxy;
}
/// <summary>
/// 处理程序
/// </summary>
public override async System.Threading.Tasks.Task Handle(OutfeedSuccessEvent @event, CancellationToken cancellationToken)
{
if (!@event.Manual && !@event.Previous.HasValue)
{
await _wcsProxy.SendOutput(
@event.Id,
@event.Original.Warehouse.ToString(),
2,
@event.Priority ?? 0,
@event.Barcode,
@event.Original.Device,
@event.Destination.Device,
@event.Destination.Warehouse.ToString(),
@event.Timestamp,
@event.Operator);
}
}
}
}