|
|
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models { /// <summary>
/// 建立命令請求類別
/// </summary>
public class TP001CreateCommandRequestDto : CommonMessage { /// <summary>
/// 建構式
/// </summary>
public TP001CreateCommandRequestDto() { MaterialID = new List<string>(); } /// <summary>
/// 任務模式
/// </summary>
/// <value>
/// 0 = Store In <br/>
/// 1 = Store Out <br/>
/// </value>
[Required, JsonPropertyName("task_mode"), JsonPropertyOrder(101)] public TaskActionMode TaskMode { get; set; } /// <summary>
/// 起始位置
/// </summary>
[Required, StringLength(9), JsonPropertyName("from"), JsonPropertyOrder(102)] public string From { get; set; } /// <summary>
/// 目的位置
/// </summary>
[Required, StringLength(9), JsonPropertyName("to"), JsonPropertyOrder(103)] public string To { get; set; } /// <summary>
/// 載具編號清單
/// </summary>
/// <remarks>棧板編號/物流箱編號</remarks>
[JsonPropertyName("carrier_id"), JsonPropertyOrder(104)] public string CarrierID { get; set; } /// <summary>
/// 物料編號清單
/// </summary>
[JsonPropertyName("material_id"), JsonPropertyOrder(105)] public List<string> MaterialID { get; set; } /// <summary>
/// 取得建立命令請求
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="taskID">任務編號</param>
/// <param name="taskMode">任務模式</param>
/// <param name="from">起始位置</param>
/// <param name="to">目的位置</param>
/// <param name="carrierID">載具編號</param>
/// <param name="materialID">物料編號清單</param>
/// <returns>建立命令請求</returns>
public static TP001CreateCommandRequestDto Get(TransactionName transName, string softwareID, string taskID, TaskActionMode taskMode, string from, string to, string carrierID, List<string> materialID = null) { return new TP001CreateCommandRequestDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, TaskID = taskID, TaskMode = taskMode, From = from, To = to, CarrierID = carrierID, MaterialID = materialID }; } } /// <summary>
/// 建立命令回應類別
/// </summary>
public class FP002CreateCommandResponseDto : CommonMessage { /// <summary>
/// 結果代碼
/// </summary>
/// <value>
/// 0 = Success <br/>
/// 1 = Reject <br/>
/// 2 = Source Not Exist <br/>
/// 3 = Destination Not Exist <br/>
/// </value>
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(101)] public CreateCommandResultCode ResultCode { get; set; } } }
|