using Kean.Domain.Stock.Commands;
using System;
using System.Threading.Tasks;
namespace Kean.Domain.Stock.SharedServices
{
///
/// 出库
///
public sealed class Record
{
private readonly ICommandBus _commandBus;
///
/// 依赖注入
///
public Record(ICommandBus commandBus) =>
_commandBus = commandBus;
///
/// 处理程序
///
/// 托盘条码
/// 操作者
/// 标签
public Task Handler(
string transaction,
string barcode,
int original,
int destination,
int @operator,
string tag,
DateTime beginTime,
DateTime timestamp) =>
_commandBus.Execute(new RecordCommand
{
Transaction = transaction,
Barcode = barcode,
Original = original,
Destination = destination,
Operator = @operator,
Tag = tag,
BeginTime = beginTime,
EndTime = timestamp
});
}
}