using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 允許取放貨回報類別 /// public class FP013PermitLoadUnloadReportDto : CommonMessage { /// /// 當下任務編號 /// /// A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMSSHH][Sequnce * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 結果代碼 /// /// /// 0 = Permit
/// 1 = Not Permit
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)] public PermitLoadUnloadResultCode ResultCode { get; set; } } /// /// 允許取放貨回應類別 /// public class TP014PermitLoadUnloadAckDto : CommonMessage { /// /// 當下任務編號 /// /// A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMSSHH][Sequnce * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 回應代碼 /// /// /// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(102)] public ReplyCode ReplyCode { get; set; } /// /// 取得允許取放貨回應 /// /// 交易名稱 /// 軟體編號 /// 任務編號 /// 當下任務編號 /// 回應代碼 /// 允許取放貨回應 public static TP014PermitLoadUnloadAckDto Get(TransactionName transName, string softwareID, string taskID, string currentTaskID, ReplyCode replyCode) { return new TP014PermitLoadUnloadAckDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, TaskID = taskID, CurrentTaskID = currentTaskID, ReplyCode = replyCode }; } } }