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.
 
 
 
 
 

72 lines
2.6 KiB

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