using iWareCommon.Utils; using iWareLog.ORM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using iWareCommon.Common.Entity; namespace iWareLog.LOG.Entity { public class InOutStorageDetailEntity : ICommonEntity { /// /// 1主键 /// public int Id { get; set; } /// /// 2库位类型id /// public int FormPlaceId { get; set; } /// /// 3库位代码 /// public string FromPlaceCode { get; set; } /// /// 4库位类型id /// public int ToPlaceId { get; set; } /// /// 5库位代码 /// public string ToPlaceCode { get; set; } /// /// 6出入库时间 /// public DateTime CreateTime { get; set; } /// /// 7修改时间 /// public DateTime UpdateTime { get; set; } /// /// 8操作类型,1为入库,2为出库 /// public int Type { get; set; } /// /// 9设备id /// public int EquipId { get; set; } /// /// 10设备名称 /// public string EquipName { get; set; } /// /// 11物料id /// public int MaterialId { get; set; } /// /// 12物料号 /// public string MaterialCode { get; set; } /// /// 无参构造 /// public InOutStorageDetailEntity() { } /// /// 有参构造 /// /// orm印射的类 public InOutStorageDetailEntity(InOutStorageDetail alert) { EntityPropHelper.CopyProp(alert, this, GetColumnMap()); } /// /// 将对象转换成ORM中的类型 /// /// Orm中的BASEShift类型 public InOutStorageDetail ToOrm() { InOutStorageDetail alert = new InOutStorageDetail(); EntityPropHelper.CopyProp(this, alert, GetColumnMap()); return alert; } /// /// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id", "id"}, {"FormPlaceId", "formplaceid"}, {"FromPlaceCode", "fromplacecode"}, {"ToPlaceId", "toplaceid"}, {"ToPlaceCode", "toplacecode"}, {"CreateTime", "createtime"}, {"UpdateTime", "updatetime"}, {"EquipId","equipid"}, {"EquipName","equipname"}, {"MaterialId", "materialid"}, {"MaterialCode","materialcode"}, {"Type","type"} }; } /// /// 根据ShiftEntity的字段转BASEShift的字段 /// /// ShiftEntity的字段 /// BASEShift public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取ShiftEntity对应的表名 /// /// 表名 public static string GetTableName() { return "[dbo].[InOutStorageDetail]"; } } }