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 PartTaskViewEntity : ICommonEntity { /// /// 1分任务主键 /// public int Id { get; set; } /// /// 2序列号 /// public int ExecutionSequence { get; set; } /// /// 3起始库位 /// public string SourcePlace { get; set; } /// /// 4目标库位 /// public string ToPlace { get; set; } /// /// 5分任务状态 /// public int Status { get; set; } /// /// 6更新时间 /// public DateTime UpdateTime { get; set; } /// /// 7创建时间 /// public DateTime CreateTime { get; set; } /// /// 8 /// public int IsCurrent { get; set; } /// /// 9起始位置排 /// public int Priority { get; set; } /// /// 10任务执行状态 0为未开始 1为执行中 2为已结束 /// public int IsMoveTask { get; set; } /// /// 11更新时间 /// public int IsHandled { get; set; } /// /// 12创建时间 /// public int IsReleased { get; set; } /// /// 13外键 执行任务id /// public int IsFinished { get; set; } /// /// 14设备节点 /// public string ProcessCardNumber { get; set; } /// /// 15是否是当前任务 0为否 1为是 /// public string MaterialCode { get; set; } /// /// 16任务类型 1是 正常任务 2是异常任务 /// public string PackageNo { get; set; } /// /// 17优先级 /// public string EquipName { get; set; } /// /// 18任务号 /// public string TaskNo { get; set; } /// /// 19是否已生成衔接任务 /// public string SysCode { get; set; } /// /// 20运行过程状态 /// public int MainTaskType { get; set; } /// /// 21是否已开始 /// public int FinishTimes { get; set; } /// /// 22是否已结束 /// public int HandleTimes { get; set; } /// /// 23下一阶段任务 /// public int NextNode { get; set; } /// /// 24流转卡号 /// public string PlaceTypeName { get; set; } /// /// 25包装号 /// public int IsLock { get; set; } /// /// 26物料号 /// public int PlaceStatus { get; set; } /// /// 27数量 /// public int IsExecute { get; set; } /// /// 28是否批次入库(0:否;1:是) /// public int IsLots { get; set; } /// /// 构造函数 /// public PartTaskViewEntity() { } /// /// 构造函数 /// /// orm中的模型 public PartTaskViewEntity(TASKPartTaskView task) { EntityPropHelper.CopyProp(task, this, GetColumnMap()); } /// /// 获取自定义类PartMainTaskViewEntity的字段名为键,ORM对象中字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id", "id"}, {"ExecutionSequence", "executionsequence"}, {"SourcePlace", "sourceplace"}, {"ToPlace","toplace"}, {"Status", "status"}, {"UpdateTime", "updatetime"}, {"CreateTime", "createtime"}, {"IsCurrent","iscurrent"}, {"Priority","priority"}, {"IsMoveTask","ismovetask"}, {"IsHandled","ishandled"}, {"IsReleased","isreleased"}, {"IsFinished", "isfinished"}, {"ProcessCardNumber","processcardnumber"}, {"MaterialCode","materialcode"}, {"PackageNo","packageno"}, {"EquipName","equipname"}, {"TaskNo","taskno"}, {"SysCode","syscode"}, {"MainTaskType", "maintasktype"}, {"FinishTimes","finishtimes"}, {"HandleTimes","handletimes"}, {"NextNode","nextnode"}, {"PlaceTypeName","placetypename"}, {"IsLock","islock"}, {"PlaceStatus","placestatus"}, {"IsExecute","isexecute"}, {"IsLots","islots"} }; } /// /// 将PartMainTaskViewEntity实体转化为orm里面的TASKPartTaskView模型 /// /// orm中的TASKPartTaskView模型 public TASKPartTaskView ToOrm() { var task = new TASKPartTaskView(); EntityPropHelper.CopyProp(this, task, GetColumnMap()); return task; } /// /// 根据PartMainTaskViewEntity的字段转TASKPartTaskView的字段 /// /// LogisticalTaskEntity的字段 /// TASKPartTaskView public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取PlaceContainerEntity对应的表名 /// /// SLPlace public static string GetTableName() { return "[dbo].[TASKPartTaskView]"; } } }