using AutoMapper; using Kean.Domain.Wcs.Events; using Kean.Domain.Wcs.Models; using Kean.Domain.Wcs.Repositories; using Kean.Domain.Wcs.SharedServices.Proxies; using System; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace Kean.Domain.Wcs.EventHandlers { /// /// 接受输入成功时,处理类型 0:CELL表的 初始化 /// public sealed class AcceptInputSuccessEventHandler_0 : EventHandler { private readonly TaskProxy _taskProxy; // 任务代理 private readonly INotification _notification; // private readonly IWcsRepository _wcsRepository; // 控制仓库 private readonly Kean.Infrastructure.Soap.LED.LedService _ledService; private readonly ICommandBus _commandBus; // 命令总线 private readonly IMapper _mapper; // 模型映射 /// /// 依赖注入 /// public AcceptInputSuccessEventHandler_0( TaskProxy taskProxy, ICommandBus commandBus, IMapper mapper, IWcsRepository wcsRepository, Kean.Infrastructure.Soap.LED.LedService ledService, INotification notification) { _commandBus = commandBus; _mapper = mapper; _taskProxy = taskProxy; _wcsRepository = wcsRepository; _ledService = ledService; _notification = notification; _commandBus = commandBus; } /// /// 处理程序 /// public override async Task Handle(AcceptInputSuccessEvent @event, CancellationToken cancellationToken) { if (@event.Function == "0") { //await _wcsRepository.InitCell(); } } } }