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

41 lines
1.2 KiB

3 months ago
using Kean.Domain.Task.Events;
using Kean.Domain.Task.SharedServices.Proxies;
using System.Threading;
namespace Kean.Domain.Task.EventHandlers
{
/// <summary>
/// 任务完成命令成功时,移动库存
/// </summary>
[EventHandlerIndex(0)]
public sealed class CompleteSuccessEventHandler_Stock : EventHandler<CompleteSuccessEvent>
{
private readonly StockProxy _stockProxy; // 仓储域
/// <summary>
/// 依赖注入
/// </summary>
public CompleteSuccessEventHandler_Stock(
StockProxy stockProxy)
{
_stockProxy = stockProxy;
}
/// <summary>
/// 处理程序
/// </summary>
public override async System.Threading.Tasks.Task Handle(CompleteSuccessEvent @event, CancellationToken cancellationToken)
{
await _stockProxy.Relocate(
@event.Type.ToString(),
@event.Barcode,
@event.Spec,
@event.Original,
@event.Destination,
@event.Operator,
@event.Tag,
(@event.Created, @event.Timestamp));
}
}
}