using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.WarehouseExecutionSystem.Models { /// /// 取消命令請求類別 /// public class FW007CancelCommandRequestDto : CommonMessage { /// /// 搬運命令序號 /// /// W[YYYYMMDDHH][Sequence * 5] [Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(101)] public string CommandSequnceNumber { get; set; } /// /// 取消模式 /// /// /// 0 = Cancel
/// 1 = Force Cancel
/// 2 = Force Complete
///
[Required, JsonPropertyName("cancel_mode"), JsonPropertyOrder(102)] public CancelMode CancelMode { get; set; } } /// /// 取消命令回應類別 /// public class TW008CancelCommandResponseDto : CommonMessage { /// /// 搬運命令序號 /// /// W[YYYYMMDDHH][Sequence * 5] [Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(101)] public string CommandSequnceNumber { get; set; } /// /// 結果代碼 /// /// /// 0 = Success
/// 1 = Already Execute
/// 2 = Cancel Command Error
/// 3 = PLCC Unable Cancel
/// 4 = AGVC Unable Cancel
/// 5 = SHTC Unable Cancel
/// 6 = Command SequenceNumber Is Not Exist
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)] public CancelCommandResultCode ResultCode { get; set; } /// /// 取得取消命令回應 /// /// 交易名稱 /// 搬運命令序號 /// 取消命令結果代碼 /// 取消命令回應 public static TW008CancelCommandResponseDto Get(TransactionName transName, string commandSequnceNumber, CancelCommandResultCode resultCode) { return new TW008CancelCommandResponseDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), CommandSequnceNumber = commandSequnceNumber, ResultCode = resultCode }; } } }