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