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.
58 lines
1.7 KiB
58 lines
1.7 KiB
3 months ago
|
using Kean.Domain.Wcs.Commands;
|
||
|
using System;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace Kean.Domain.Wcs.SharedServices
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 发送输出命令
|
||
|
/// </summary>
|
||
|
public sealed class SendOutput
|
||
|
{
|
||
|
private readonly ICommandBus _commandBus; // 命令总线
|
||
|
|
||
|
/// <summary>
|
||
|
/// 依赖注入
|
||
|
/// </summary>
|
||
|
public SendOutput(ICommandBus commandBus)
|
||
|
{
|
||
|
_commandBus = commandBus;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 处理程序
|
||
|
/// </summary>
|
||
|
/// <param name="task">任务号</param>
|
||
|
/// <param name="warehouse">库房</param>
|
||
|
/// <param name="function">功能码</param>
|
||
|
/// <param name="priority">优先级</param>
|
||
|
/// <param name="barcode">条码</param>
|
||
|
/// <param name="original">起始设备</param>
|
||
|
/// <param name="destination">终止设备</param>
|
||
|
/// <param name="timestamp">时间戳</param>
|
||
|
public Task Handler(
|
||
|
int task,
|
||
|
string warehouse,
|
||
|
int function,
|
||
|
int priority,
|
||
|
string barcode,
|
||
|
string original,
|
||
|
string destination,
|
||
|
string endWarehouse,
|
||
|
DateTime timestamp,
|
||
|
int @operator) => _commandBus.Execute(new SendOutputCommand
|
||
|
{
|
||
|
Task = task,
|
||
|
Warehouse = warehouse,
|
||
|
Function = function,
|
||
|
Priority = priority,
|
||
|
Barcode = barcode,
|
||
|
Original = original,
|
||
|
Destination = destination,
|
||
|
EndWarehouse = endWarehouse,
|
||
|
Timestamp = timestamp,
|
||
|
Operator = @operator.ToString()
|
||
|
});
|
||
|
}
|
||
|
}
|