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

49 lines
1.6 KiB

using Kean.Domain.Wcs.Events;
using Kean.Domain.Wcs.Models;
using Kean.Domain.Wcs.Repositories;
using Kean.Domain.Wcs.SharedServices.Proxies;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Kean.Domain.Wcs.EventHandlers
{
/// <summary>
/// 接受输入成功时,处理类型 4:车身出口29101,AGV申请出库托盘时,未找到出库任务,增加等待input指令
/// </summary>
public sealed class AcceptInputSuccessEventHandler_4 : EventHandler<AcceptInputSuccessEvent>
{
private readonly TaskProxy _taskProxy; // 任务代理
private readonly INotification _notification; //
private readonly IWcsRepository _wcsRepository; // 控制仓库
/// <summary>
/// 依赖注入
/// </summary>
public AcceptInputSuccessEventHandler_4(
TaskProxy taskProxy,
IWcsRepository wcsRepository,
INotification notification)
{
_taskProxy = taskProxy;
_notification = notification;
_wcsRepository = wcsRepository;
}
/// <summary>
/// 处理程序
/// </summary>
public override async Task Handle(AcceptInputSuccessEvent @event, CancellationToken cancellationToken)
{
if (@event.Function == "4")
{
Input input = new Input();
input.Function = "3";
input.Device = @event.Device;
input.State = 3;
await _wcsRepository.CreateInputForShenAgvOut(input);
}
}
}
}