using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; namespace Mirle.Component.Database.Model.WES { /// /// 即時任務主檔類別 /// [Table("CUR_TASK_MST")] public class CurTaskMasterDto { /// /// 命令序號 /// /// W[YYYYMMDDHH][Sequence * 5] [Column(Name = "CMD_SNO")] [Required, Key, StringLength(20), JsonPropertyName("CMD_SNO"), JsonPropertyOrder(1)] public string CMD_SNO { get; set; } /// /// 任務編號 /// /// /// Warehouse Controller System Task ID
/// P[YYYYMMDDHH][Sequence * 5] (PLCC)
/// A[YYYYMMDDHH][Sequence * 5] (AGVC)
/// S[YYYYMMDDHH][Sequence * 5] (SHTC)
///
[Column(Name = "TASK_ID")] [Required, Key, StringLength(16), JsonPropertyName("TASK_ID"), JsonPropertyOrder(2)] public string TASK_ID { get; set; } /// /// 命令編號 /// /// /// Controller System Command ID
/// [Sequence * 5] (AGVC)
/// [Sequence * 4] (PLCC)
/// [Sequence * 4] (SHTC)
///
[Column(Name = "CMD_ID"), Required, JsonPropertyName("CMD_ID"), JsonPropertyOrder(3)] public string CMD_ID { get; set; } /// /// 任務完成狀態 /// /// /// 0 = 初始化
/// 1 = 待執行
/// 2 = 已傳送
/// 3 = 暫停
/// 4 = 執行中
/// 5 = 完成
/// 6 = 強制完成
/// 7 = 失敗
/// 8 = 取消
/// 9 = 強制取消
/// 10 = 中止
///
[Column(Name = "TASK_STATUS")] [Required, JsonPropertyName("TASK_STATUS"), JsonPropertyOrder(4)] public int TASK_STATUS { get; set; } = 0; /// /// 任務模式 /// /// /// 1 = 入庫
/// 2 = 出庫
/// 3 = 撿料/盤點
/// 4 = 站對站
/// 5 = 庫對庫
/// 6 = 盤點作業
/// 7 = 盤點調帳
/// 8 = 儲位維護
///
[Column(Name = "TASK_MODE")] [Required, JsonPropertyName("TASK_MODE"), JsonPropertyOrder(5)] public int TASK_MODE { get; set; } /// /// 任務流水號 /// /// 1 - 999 /// 最大 999 [Column(Name = "TASK_SEQ")] [Required, JsonPropertyName("TASK_SEQ"), JsonPropertyOrder(6)] public int TASK_SEQ { get; set; } = 1; /// /// 命令優先權 /// /// 0 - 9 /// 0 最優先 [Column(Name = "PRIORITY")] [Required, JsonPropertyName("PRIORITY"), JsonPropertyOrder(7)] public int PRIORITY { get; set; } = 9; /// /// 起始位置 /// [Column(Name = "SOURCE_POSITION")] [Required, StringLength(9), JsonPropertyName("SOURCE_POSITION"), JsonPropertyOrder(8)] public string SOURCE_POSITION { get; set; } /// /// 目的位置 /// [Column(Name = "DEST_POSITION")] [Required, StringLength(9), JsonPropertyName("DEST_POSITION"), JsonPropertyOrder(9)] public string DEST_POSITION { get; set; } /// /// 載具編號 /// [Column(Name = "CARRIER_ID")] [Required, StringLength(64), JsonPropertyName("CARRIER_ID"), JsonPropertyOrder(10)] public string CARRIER_ID { get; set; } /// /// 軟體編號 /// [Column(Name = "SOFTWARE_ID")] [Required, StringLength(7), JsonPropertyName("SOFTWARE_ID"), JsonPropertyOrder(11)] public string SOFTWARE_ID { get; set; } /// /// 設備編號 /// [Column(Name = "VEHICLE_ID")] [Required, StringLength(16), JsonPropertyName("VEHICLE_ID"), JsonPropertyOrder(12)] public string VEHICLE_ID { get; set; } /// /// 建立時間 /// [Column(Name = "CREATE_TIME")] [Required, JsonPropertyName("CREATE_TIME"), JsonPropertyOrder(13)] public DateTime CREATE_TIME { get; set; } = DateTime.Now; /// /// 傳送時間 /// [Column(Name = "SEND_TIME")] [JsonPropertyName("SEND_TIME"), JsonPropertyOrder(14)] public DateTime? SEND_TIME { get; set; } /// /// 起始時間 /// [Column(Name = "START_TIME")] [JsonPropertyName("START_TIME"), JsonPropertyOrder(15)] public DateTime? START_TIME { get; set; } /// /// 結束時間 /// [Column(Name = "END_TIME")] [JsonPropertyName("END_TIME"), JsonPropertyOrder(16)] public DateTime? END_TIME { get; set; } /// /// 失敗原因 /// [Column(Name = "FAILED_REASON")] [StringLength(255), JsonPropertyName("FAILED_REASON"), JsonPropertyOrder(17)] public string FAILED_REASON { get; set; } /// /// 程式名稱 /// [Column(Name = "PROGRAM_NAME")] [Required, StringLength(30), JsonPropertyName("PROGRAM_NAME"), JsonPropertyOrder(18)] public string PROGRAM_NAME { get; set; } } }