using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using WalkingTec.Mvvm.Core;
namespace HHWMS.Web.Models.Agv
{
///
/// AGV 任务日志归档镜像(超 6 个月日志备份于此,再由 AgvTaskArchiveJob 清理主表)
/// 对应《平库AGV方案流程(AGV自调度版).md》10.2 DDL 第 6 段
///
[Index(nameof(TaskNo), nameof(CreateTime))]
[Table("AgvTaskLogHistory")]
public class AgvTaskLogHistory : BasePoco
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public new int ID { get; set; }
[Display(Name = "AGV.TaskNo", Description = "WMS任务号")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string TaskNo { get; set; }
[Display(Name = "AGV.OrderId", Description = "AGV运单号")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string OrderId { get; set; }
[Display(Name = "AGV.FromStatus", Description = "变更前状态")]
public AgvTaskStatusEnum? FromStatus { get; set; }
[Display(Name = "AGV.ToStatus", Description = "变更后状态")]
public AgvTaskStatusEnum? ToStatus { get; set; }
[Display(Name = "AGV.Event", Description = "回调事件")]
[StringLength(30, ErrorMessage = "Validate.{0}stringmax{1}")]
public string Event { get; set; }
[Display(Name = "AGV.Direction", Description = "方向(down/up)")]
[StringLength(10, ErrorMessage = "Validate.{0}stringmax{1}")]
public string Direction { get; set; }
[Display(Name = "AGV.EventTime", Description = "事件发生时间")]
public DateTime? EventTime { get; set; }
[Display(Name = "AGV.SourceIp", Description = "来源IP")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string SourceIp { get; set; }
[Display(Name = "AGV.DurationMs", Description = "耗时(毫秒)")]
public int? DurationMs { get; set; }
[Display(Name = "AGV.RequestJson", Description = "请求报文")]
public string RequestJson { get; set; }
[Display(Name = "AGV.ResponseJson", Description = "响应报文")]
public string ResponseJson { get; set; }
[Display(Name = "AGV.Operator", Description = "操作人")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string Operator { get; set; }
[Display(Name = "AGV.Remark", Description = "备注")]
[StringLength(500, ErrorMessage = "Validate.{0}stringmax{1}")]
public string Remark { get; set; }
///
/// 归档时间
///
[Display(Name = "AGV.ArchivedAt", Description = "归档时间")]
public DateTime? ArchivedAt { get; set; }
}
}