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.BASE.Entity { public class EmptyPlaceViewEntity : ICommonEntity { /// /// 库位ID /// public int Id { get; set; } /// /// 库位编码 /// public string Code { get; set; } /// /// 库位类型名字 /// public string PlaceTypeName { get; set; } /// /// 库位类型备注 /// public string PlaceTypeRemark { get; set; } /// /// 库位类型id /// public int? TypeId { get; set; } /// /// 库位行 /// public int? Row { get; set; } /// /// 库位列 /// public int? Col { get; set; } /// /// 层 /// public int? Layer { get; set; } /// /// 宽 /// public decimal? Width { get; set; } /// /// 长 /// public decimal? Length { get; set; } /// /// 高 /// public decimal? Height { get; set; } /// /// 最大承重 /// public decimal? MaxWeight { get; set; } /// /// 档位 /// public int? HeightLevel { get; set; } /// /// X坐标 /// public int? Posx { get; set; } /// /// Y坐标 /// public int? Posy { get; set; } /// /// Z坐标 /// public int? Posz { get; set; } /// /// 库位状态 /// public int Status { get; set; } /// /// 库位锁 /// public int IsLock { get; set; } /// /// 是否执行 /// public int IsExecute { get; set; } /// /// 库位锁定标记 /// public int? VoidLabel { get; set; } /// /// 库位中的物料 /// public List Materials { get; set; } /// /// 无参构造 /// public EmptyPlaceViewEntity() { Materials = new List(); } /// /// 有参构造 /// /// orm映射的类 public EmptyPlaceViewEntity(BASEEmptyPlaceView place) { EntityPropHelper.CopyProp(place, this, GetColumnMap()); Materials = new List(); } /// /// 将对象转换成ORM中的类型 /// /// Orm中的BASEEmptyPlaceView类型 public BASEEmptyPlaceView ToOrm() { BASEEmptyPlaceView place = new BASEEmptyPlaceView(); EntityPropHelper.CopyProp(this, place, GetColumnMap()); return place; } /// /// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id", "id"}, {"PlaceTypeName", "placetypename"}, {"PlaceTypeRemark", "placetyperemark"}, {"Code", "code"}, {"TypeId", "typeid"}, {"Row", "row"}, {"Col", "col"}, {"Layer", "layer"}, {"Width", "width"}, {"Length", "length"}, {"Height", "height"}, {"MaxWeight", "maxweight"}, {"HeightLevel", "heightlevel"}, {"Posx", "posx"}, {"Posy", "posy"}, {"Posz", "posz"}, {"Status", "status"}, {"IsLock", "islock"}, {"IsExecute", "isexecute"} }; } /// /// 根据WareHouseAreaTypeEntity的字段转BASEEmptyPlaceView的字段 /// /// WareHouseAreaTypeEntity的字段 /// BASEEmptyPlaceView public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取WareHouseAreaTypeEntity对应的表名 /// /// 表名 public static string GetTableName() { return "[dbo].[BASEEmptyPlaceView]"; } } }