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.
 
 
 
 
 

112 lines
4.1 KiB

using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
/// <summary>
/// 建立取放貨請求類別
/// </summary>
public class TP009CreateLoadUnloadRequestDto : CommonMessage
{
/// <summary>
/// 當下任務編號
/// </summary>
/// <remarks>A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMDDHH][Sequnce * 5]</remarks>
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
public string CurrentTaskID { get; set; }
/// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
public string StationID { get; set; }
/// <summary>
/// 任務模式
/// </summary>
/// <value>
/// 0 = Store In <br/>
/// 1 = Store Out <br/>
/// </value>
[Required, JsonPropertyName("task_mode"), JsonPropertyOrder(103)]
public TaskActionMode TaskMode { get; set; }
/// <summary>
/// 事件類別
/// </summary>
/// <value>
/// 0 = Load <br/>
/// 1 = Unload <br/>
/// </value>
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(104)]
public LoadUnloadEvent EventType { get; set; }
/// <summary>
/// 取得建立取放貨請求
/// </summary>
/// <param name="transNmae">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="taskID">任務編號</param>
/// <param name="currentTaskID">當前任務編號</param>
/// <param name="stationID">站點編號</param>
/// <param name="taskMode">任務模式</param>
/// <param name="eventType">事件類別</param>
/// <returns>建立取放貨請求</returns>
public static TP009CreateLoadUnloadRequestDto Get(TransactionName transNmae, string softwareID, string taskID,
string currentTaskID, string stationID, TaskActionMode taskMode, LoadUnloadEvent eventType)
{
return new TP009CreateLoadUnloadRequestDto()
{
Timetick = DateTime.Now,
TransactionName = transNmae.ToTransactionName(),
SoftwareID = softwareID,
TaskID = taskID,
CurrentTaskID = currentTaskID,
StationID = stationID,
TaskMode = taskMode,
EventType = eventType
};
}
}
/// <summary>
/// 建立取放貨回應類別
/// </summary>
public class FP010CreateLoadUnloadResponseDto : CommonMessage
{
/// <summary>
/// 當下任務編號
/// </summary>
/// <remarks>A[YYYYMMDDHH][Sequence * 5]/S[YYYYMMDDHH][Sequnce * 5]</remarks>
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
public string CurrentTaskID { get; set; }
/// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
public string StationID { get; set; }
/// <summary>
/// 任務模式
/// </summary>
/// <value>
/// 0 = Store In <br/>
/// 1 = Store Out <br/>
/// </value>
[Required, JsonPropertyName("task_mode"), JsonPropertyOrder(103)]
public TaskActionMode TaskMode { get; set; }
/// <summary>
/// 事件類別
/// </summary>
/// <value>
/// 0 = Load <br/>
/// 1 = Unload <br/>
/// </value>
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(104)]
public LoadUnloadEvent EventType { get; set; }
/// <summary>
/// 結果代碼
/// </summary>
/// <value>
/// 0 = Success <br/>
/// 1 = Reject <br/>
/// </value>
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(105)]
public CreateLoadUnloadResultCode ResultCode { get; set; }
}
}