using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.WarehouseExecutionSystem.Models
{
///
/// 建立命令請求類別
///
public class FW001CreateCommandRequestDto : CommonMessage
{
///
/// 搬運命令序號
///
/// W[YYYYMMDDHH][Sequnece * 5]
[Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(101)]
public string CommandSequnceNumber { get; set; }
///
/// 命令類別
///
///
/// 0 = Store In
/// 1 = Store Out
/// 2 = Task Inventory
/// 3 = Station To Staion
/// 4 = Storage To Storage
/// 5 = Take Inventory Operation
/// 6 = Task Inventory Adjust
/// 7 = Maintenance Loc
///
[Required, JsonPropertyName("cmd_mode"), JsonPropertyOrder(102)]
public CommandMode CommandMode { get; set; }
///
/// 搬運命令優先權重
///
/// 0 - 9
/// 0 最優先
[Required, JsonPropertyName("cmd_priority"), JsonPropertyOrder(103)]
public int CommandPriority { get; set; }
///
/// 起始位置
///
[Required, StringLength(9), JsonPropertyName("from"), JsonPropertyOrder(104)]
public string From { get; set; }
///
/// 目的位置
///
[Required, StringLength(9), JsonPropertyName("to"), JsonPropertyOrder(105)]
public string To { get; set; }
///
/// 路線清單
///
[Required, JsonPropertyName("route"), JsonPropertyOrder(106)]
public List Route { get; set; }
///
/// 設備路線清單
///
[Required, JsonPropertyName("eqpt_route"), JsonPropertyOrder(107)]
public List EquipmemntRoute { get; set; }
///
/// 載具編號
///
[JsonPropertyName("carrier_id"), JsonPropertyOrder(108)]
public string CarrierID { get; set; }
}
///
/// 建立命令回應類別
///
public class TW002CreateCommandResponseDto : CommonMessage
{
///
/// 搬運命令序號
///
/// W[YYYYMMDDHH][Sequence * 5]
[Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(3)]
public string CommandSequnceNumber { get; set; }
///
/// 結果代碼
///
///
/// 0 = Success
/// 1 = Reject
/// 2 = Dismantel Command Error
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
public CreateCommandResultCode ResultCode { get; set; }
///
/// 取得建立命令回應
///
/// 交易名稱
/// 搬運命令序號
/// 建立命令結果代碼
/// 建立命令回應
public static TW002CreateCommandResponseDto Get(TransactionName transName, string commandSequenceNumber, CreateCommandResultCode resultCode)
{
return new TW002CreateCommandResponseDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
CommandSequnceNumber = commandSequenceNumber,
ResultCode = resultCode
};
}
}
}