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

47 lines
1.5 KiB

3 months ago
using Kean.Domain.Task.Events;
using Kean.Domain.Task.Repositories;
using Kean.Domain.Task.SharedServices.Proxies;
using System.Threading;
namespace Kean.Domain.Task.EventHandlers
{
/// <summary>
/// 创建输送命令成功时,下达控制任务
/// </summary>
public sealed class BypassHithumSuccessEventHandler_Wcs : EventHandler<BypassHithumSuccessEvent>
{
private readonly WcsProxy _wcsProxy; // 控制域
private readonly IWarehouseRepository _warehouseRepository;
/// <summary>
/// 依赖注入
/// </summary>
public BypassHithumSuccessEventHandler_Wcs(
IWarehouseRepository warehouseRepository,
WcsProxy wcsProxy)
{
_warehouseRepository = warehouseRepository;
_wcsProxy = wcsProxy;
}
/// <summary>
/// 处理程序
/// </summary>
public override async System.Threading.Tasks.Task Handle(BypassHithumSuccessEvent @event, CancellationToken cancellationToken)
{
await _wcsProxy.SendOutput(
@event.Id,
@event.Original.Warehouse.ToString(),
4,
@event.Priority ?? 0,
@event.Barcode,
@event.Original.Device,
@event.Destination.Device,
@event.Destination.Warehouse.ToString(),
@event.Timestamp,
@event.Operator);
}
}
}