using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.WarehouseExecutionSystem.Models { /// /// 棧板供收狀態回報類別 /// public class TW011PalletSupplyStatusReportDto : CommonMessage { /// /// 軟體編號 /// [Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)] public string SoftwareID { get; set; } /// /// 站點編號 /// [Required, StringLength(16), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// /// 棧板供應狀態 /// /// /// 0 = Full
/// 1 = Empty
///
[Required, JsonPropertyName("pallet_status"), JsonPropertyOrder(103)] public PalletSupplyStatus PalletStatus { get; set; } /// /// 取得棧板供收狀態回報 /// /// 交易名稱 /// 軟體編號 /// 站點編號 /// 棧板供收狀態 /// 棧板供收狀態回報 public static TW011PalletSupplyStatusReportDto Get(TransactionName transName, string softwareID, string stationID, PalletSupplyStatus palletStatus) { return new TW011PalletSupplyStatusReportDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, StationID = stationID, PalletStatus = palletStatus }; } } /// /// 棧板供收狀態回應類別 /// public class FW012PalletSupplyStatusAckDto : CommonMessage { /// /// 軟體編號 /// [Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)] public string SoftwareID { get; set; } /// /// 站點編號 /// [Required, StringLength(16), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// /// 棧板供應狀態 /// /// /// 0 = Full
/// 1 = Empty
///
[Required, JsonPropertyName("pallet_status"), JsonPropertyOrder(103)] public PalletSupplyStatus PalletStatus { get; set; } /// /// 回應代碼 /// /// /// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(104)] public ReplyCode ReplyCode { get; set; } /// /// 取得棧板供收狀態回應 /// /// 交易名稱 /// 軟體編號 /// 站點編號 /// 棧板供收狀態 /// 回應代碼 /// 棧板供收狀態回應 public static FW012PalletSupplyStatusAckDto Get(TransactionName transName, string softwareID, string stationID, PalletSupplyStatus palletStatus, bool replyCode) { return new FW012PalletSupplyStatusAckDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, StationID = stationID, PalletStatus = palletStatus, ReplyCode = replyCode ? ReplyCode.OK : ReplyCode.NG }; } } }