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.4 KiB
45 lines
1.4 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 ApplyOutSuccessEventHandler_Wcs : EventHandler<ApplyOutSuccessEvent>
|
|
{
|
|
private readonly WcsProxy _wcsProxy; // 控制域
|
|
|
|
/// <summary>
|
|
/// 依赖注入
|
|
/// </summary>
|
|
public ApplyOutSuccessEventHandler_Wcs(
|
|
WcsProxy wcsProxy)
|
|
{
|
|
_wcsProxy = wcsProxy;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 处理程序
|
|
/// </summary>
|
|
public override async System.Threading.Tasks.Task Handle(ApplyOutSuccessEvent @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);
|
|
}
|
|
}
|
|
}
|
|
}
|