|
|
using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization;
namespace Mirle.Component.API.WarehouseExecutionSystem.Models { /// <summary>
/// 量測物料重量請求類別
/// </summary>
public class FW015MaterialWeightRequestDto : CommonMessage { /// <summary>
/// 軟體編號
/// </summary>
[Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)] public string SoftwareID { get; set; } /// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// <summary>
/// 取得量測物料重量請求
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="stationID">站點編號</param>
/// <returns>量測物料重量請求</returns>
public static FW015MaterialWeightRequestDto Get(TransactionName transName, string softwareID, string stationID) { return new FW015MaterialWeightRequestDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, StationID = stationID }; } } /// <summary>
/// 量測物料重量回應類別
/// </summary>
public class TW016MaterialWeightResponseDto : CommonMessage { /// <summary>
/// 軟體編號
/// </summary>
[Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)] public string SoftwareID { get; set; } /// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// <summary>
/// 物料重量
/// </summary>
[Required, JsonPropertyName("material_weight"), JsonPropertyOrder(103)] public int MaterialWeight { get; set; } /// <summary>
/// 結果代碼
/// </summary>
/// <value>
/// 0 = Success <br/>
/// 1 = Too Light <br/>
/// 2 = Too Heavy <br/>
/// 3 = No Weight <br/>
/// </value>
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)] public MaterialInspectResultCode ResultCode { get; set; } /// <summary>
/// 取得量測物料重量回報
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="stationID">站點編號</param>
/// <param name="materialWeight">物料重量</param>
/// <param name="resultCode">物料重量檢測結果代碼</param>
/// <returns>量測物料重量回報</returns>
public static TW016MaterialWeightResponseDto Get(TransactionName transName, string softwareID, string stationID, int materialWeight, MaterialInspectResultCode resultCode) { return new TW016MaterialWeightResponseDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, StationID = stationID, MaterialWeight = materialWeight, ResultCode = resultCode }; } } }
|