using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 建立取放貨請求類別 /// public class TP009CreateLoadUnloadRequestDto : CommonMessage { /// /// 當下任務編號 /// /// A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMDDHH][Sequnce * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 站點編號 /// [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// /// 任務模式 /// /// /// 0 = Store In
/// 1 = Store Out
///
[Required, JsonPropertyName("task_mode"), JsonPropertyOrder(103)] public TaskActionMode TaskMode { get; set; } /// /// 事件類別 /// /// /// 0 = Load
/// 1 = Unload
///
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(104)] public LoadUnloadEvent EventType { get; set; } /// /// 取得建立取放貨請求 /// /// 交易名稱 /// 軟體編號 /// 任務編號 /// 當前任務編號 /// 站點編號 /// 任務模式 /// 事件類別 /// 建立取放貨請求 public static TP009CreateLoadUnloadRequestDto Get(TransactionName transNmae, string softwareID, string taskID, string currentTaskID, string stationID, TaskActionMode taskMode, LoadUnloadEvent eventType) { return new TP009CreateLoadUnloadRequestDto() { Timetick = DateTime.Now, TransactionName = transNmae.ToTransactionName(), SoftwareID = softwareID, TaskID = taskID, CurrentTaskID = currentTaskID, StationID = stationID, TaskMode = taskMode, EventType = eventType }; } } /// /// 建立取放貨回應類別 /// public class FP010CreateLoadUnloadResponseDto : CommonMessage { /// /// 當下任務編號 /// /// A[YYYYMMDDHH][Sequence * 5]/S[YYYYMMDDHH][Sequnce * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 站點編號 /// [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// /// 任務模式 /// /// /// 0 = Store In
/// 1 = Store Out
///
[Required, JsonPropertyName("task_mode"), JsonPropertyOrder(103)] public TaskActionMode TaskMode { get; set; } /// /// 事件類別 /// /// /// 0 = Load
/// 1 = Unload
///
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(104)] public LoadUnloadEvent EventType { get; set; } /// /// 結果代碼 /// /// /// 0 = Success
/// 1 = Reject
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(105)] public CreateLoadUnloadResultCode ResultCode { get; set; } } }