You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

106 lines
4.0 KiB

using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.WarehouseExecutionSystem.Models
{
/// <summary>
/// 棧板供收狀態回報類別
/// </summary>
public class TW011PalletSupplyStatusReportDto : CommonMessage
{
/// <summary>
/// 軟體編號
/// </summary>
[Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)]
public string SoftwareID { get; set; }
/// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(16), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
public string StationID { get; set; }
/// <summary>
/// 棧板供應狀態
/// </summary>
/// <value>
/// 0 = Full <br/>
/// 1 = Empty <br/>
/// </value>
[Required, JsonPropertyName("pallet_status"), JsonPropertyOrder(103)]
public PalletSupplyStatus PalletStatus { get; set; }
/// <summary>
/// 取得棧板供收狀態回報
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="stationID">站點編號</param>
/// <param name="palletStatus">棧板供收狀態</param>
/// <returns>棧板供收狀態回報</returns>
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
};
}
}
/// <summary>
/// 棧板供收狀態回應類別
/// </summary>
public class FW012PalletSupplyStatusAckDto : CommonMessage
{
/// <summary>
/// 軟體編號
/// </summary>
[Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)]
public string SoftwareID { get; set; }
/// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(16), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
public string StationID { get; set; }
/// <summary>
/// 棧板供應狀態
/// </summary>
/// <value>
/// 0 = Full <br/>
/// 1 = Empty <br/>
/// </value>
[Required, JsonPropertyName("pallet_status"), JsonPropertyOrder(103)]
public PalletSupplyStatus PalletStatus { get; set; }
/// <summary>
/// 回應代碼
/// </summary>
/// <value>
/// 0 = OK <br/>
/// 1 = NG <br/>
/// </value>
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(104)]
public ReplyCode ReplyCode { get; set; }
/// <summary>
/// 取得棧板供收狀態回應
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="stationID">站點編號</param>
/// <param name="palletStatus">棧板供收狀態</param>
/// <param name="replyCode">回應代碼</param>
/// <returns>棧板供收狀態回應</returns>
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
};
}
}
}