using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 完成取放貨回報類別 /// public class TP011FinishLoadUnloadReportDto : 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; } /// /// 取得完成取放貨回報 /// /// 交易名稱 /// 軟體編號 /// 任務編號 /// 當前任務編號 /// 站點編號 /// 任務模式 /// 事件類別 /// 完成取放貨回報 public static TP011FinishLoadUnloadReportDto Get(TransactionName transName, string softwareID, string taskId, string currentTaskID, string stationID, TaskActionMode taskMod, LoadUnloadEvent eventType) { return new TP011FinishLoadUnloadReportDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, TaskID = taskId, CurrentTaskID = currentTaskID, StationID = stationID, TaskMode = taskMod, EventType = eventType }; } } /// /// 完成取放貨回應類別 /// public class FP012FinishLoadUnloadAckDto : 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 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(105)] public ReplyCode ReplyCode { get; set; } } }