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