using iWareCommon.Common.Entity; using iWareCommon.Utils; using iWareDataCore.ORM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWareDataCore.TASK.Entity { public class MainTaskViewEntity : ICommonEntity { /// /// 1分任务主键 /// public int Id { get; set; } /// /// 2系统编号 /// public string SysCode { get; set; } /// /// 3任务编号 /// public string TaskNo { get; set; } /// /// 4发送时间 /// public DateTime SendTime { get; set; } /// /// 5起始位置 /// public string SourcePlace { get; set; } /// /// 6目标位置 /// public string ToPlace { get; set; } /// /// 7批次号 /// public string ProcessCardNumber { get; set; } /// /// 8物料号 /// public string MaterialCode { get; set; } /// /// 9数量 /// public int Quantity { get; set; } /// /// 10任务类型 /// public int TaskType { get; set; } /// /// 11状态 /// public int Status { get; set; } /// /// 12分解时间 /// public DateTime DecompositionTime { get; set; } /// /// 13反馈状态 /// public int WipStatus { get; set; } /// /// 14分解次数 /// public int DecompositionTimes { get; set; } /// /// 15工包 /// public string PackageNo { get; set; } /// /// 16是否批次入库(0:否;1:是) /// public int IsLots { get; set; } /// /// 17优先级 /// public int Priority { get; set; } /// /// 18物料名称 /// public string MaterialName { get; set; } /// /// 19物料类型名称 /// public string MaterialTypeName { get; set; } /// /// 20目标库位类型 /// public string ToPlaceTypeName { get; set; } /// /// 21起始库位类型 /// public string SourcePlaceTypeName { get; set; } /// /// 构造函数 /// public MainTaskViewEntity() { } /// /// 构造函数 /// /// orm中的模型 public MainTaskViewEntity(TASKMainTaskView task) { EntityPropHelper.CopyProp(task, this, GetColumnMap()); } /// /// 获取自定义类PartMainTaskViewEntity的字段名为键,ORM对象中字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id", "id"}, {"SysCode", "syscode"}, {"TaskNo", "taskno"}, {"SendTime", "sendtime"}, {"SourcePlace","sourceplace"}, {"ToPlace","toplace"}, {"ProcessCardNumber","processcardnumber"}, {"MaterialCode", "materialcode"}, {"Quantity","quantity"}, {"TaskType","tasktype"}, {"Status","status"}, {"DecompositionTime","decompositiontime"}, {"WipStatus","wipstatus"}, {"DecompositionTimes","decompositiontimes"}, {"IsLots","islots"}, {"Priority","priority"}, {"PackageNo","packageno"}, {"MaterialName", "materialname"}, {"MaterialTypeName", "materialtypename"}, {"ToPlaceTypeName", "toplacetypename"}, {"SourcePlaceTypeName","sourceplacetypename"} }; } /// /// 将PartMainTaskViewEntity实体转化为orm里面的TASKMainTaskView模型 /// /// orm中的TASKMainTaskView模型 public TASKMainTaskView ToOrm() { var task = new TASKMainTaskView(); EntityPropHelper.CopyProp(this, task, GetColumnMap()); return task; } /// /// 根据PartMainTaskViewEntity的字段转TASKMainTaskView的字段 /// /// LogisticalTaskEntity的字段 /// TASKMainTaskView public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取PlaceContainerEntity对应的表名 /// /// SLPlace public static string GetTableName() { return "[dbo].[TASKMainTaskView]"; } } }