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.
56 lines
1.4 KiB
56 lines
1.4 KiB
3 months ago
|
using Kean.Domain.Stock.Commands;
|
||
|
using Kean.Domain.Stock.Models;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace Kean.Domain.Stock.SharedServices
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 出库
|
||
|
/// </summary>
|
||
|
public sealed class PalletIn
|
||
|
{
|
||
|
private readonly ICommandBus _commandBus;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 依赖注入
|
||
|
/// </summary>
|
||
|
public PalletIn(ICommandBus commandBus) =>
|
||
|
_commandBus = commandBus;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 处理程序
|
||
|
/// </summary>
|
||
|
/// <param name="barcode">托盘条码</param>
|
||
|
/// <param name="operator">操作者</param>
|
||
|
/// <param name="tag">标签</param>
|
||
|
public async Task Handler(
|
||
|
string barcode,
|
||
|
int destination,
|
||
|
int material,
|
||
|
int @operator,
|
||
|
string tag)
|
||
|
{
|
||
|
StockLine line = new StockLine{
|
||
|
Material = material,
|
||
|
Quantity = 1,
|
||
|
Enabled = true,
|
||
|
IsLocal = "1",
|
||
|
QualityState = "ok"
|
||
|
};
|
||
|
List<StockLine> ls = new List<StockLine>();
|
||
|
ls.Add(line);
|
||
|
|
||
|
await _commandBus.Execute(new PalletInCommand
|
||
|
{
|
||
|
Barcode = barcode,
|
||
|
Destination = destination,
|
||
|
Lines = ls,
|
||
|
Operator = @operator,
|
||
|
Tag = tag
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|