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 InOutListDetailEntity: ICommonEntity { /// /// 1出入库单明细id /// public int Id { get; set; } /// /// 2出入库单外键id /// public int InOutListId { get; set; } /// /// 3库位id /// public int PlaceId { get; set; } /// /// 4物料id /// public int MaterialId { get; set; } /// /// 5数量 /// public int IsFinish { get; set; } ///// ///// 6出入库单号 ///// //public string ListNo { get; set; } ///// ///// 7创建时间 ///// //public DateTime CreateTime { get; set; } ///// ///// 8类型名称 ///// //public string TypeName { get; set; } ///// ///// 9计划状态(0未生成,1已生成) ///// //public int Status { get; set; } ///// ///// 10单号备注 ///// //public string Remark { get; set; } ///// ///// 11库位号 ///// //public string PlaceCode { get; set; } ///// ///// 12库位状态(EPlaceStatus) ///// //public int PlaceStatus { get; set; } ///// ///// 13是否锁定 ///// //public int IsLock { get; set; } ///// ///// 14是否完成 ///// //public int IsExecute { get; set; } ///// ///// 15船级社 ///// //public string ClassificationSociety { get; set; } ///// ///// 16物料号 ///// //public string MaterialCode { get; set; } ///// ///// 17分段号 ///// //public string SerialNo { get; set; } ///// ///// 18厚 ///// //public string Thick { get; set; } ///// ///// 19宽 ///// //public string Wide { get; set; } ///// ///// 20长 ///// //public string Long { get; set; } /// /// 无参构造 /// public InOutListDetailEntity() { } /// /// 有参构造 /// /// orm映射的类 public InOutListDetailEntity(BASEInOutListDetail place) { EntityPropHelper.CopyProp(place, this, GetColumnMap()); } /// /// 将对象转换成ORM中的类型 /// /// Orm中的BASEInOutListDetail类型 public BASEInOutListDetail ToOrm() { var place = new BASEInOutListDetail(); EntityPropHelper.CopyProp(this, place, GetColumnMap()); return place; } /// /// 转换视图的方法 /// /// public InOutListDetailEntity(PlaceViewEntity place) { var keys = GetColumnMap().Keys.ToList(); var columnMap = new Dictionary(); keys.ForEach(x => columnMap.Add(x, x)); EntityPropHelper.CopyProp(place, this, columnMap); } /// /// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id", "id"}, {"InOutListId", "inoutlistid"}, {"PlaceId", "placeid"}, {"MaterialId", "materialid"}, {"IsFinish", "isfinish"} //{"ListNo", "listno"}, //{"CreateTime", "createtime"}, //{"TypeName", "typename"}, //{"Status", "status"}, //{"Remark", "remark"}, //{"PlaceCode", "placecode"}, //{"PlaceStatus", "placestatus"}, //{"IsLock", "islock"}, //{"IsExecute", "isexecute"}, //{"ClassificationSociety", "classificationsociety"}, //{"MaterialCode", "code"}, //{"SerialNo", "serialno"}, //{"Thick", "thick"}, //{"Wide", "wide"}, //{"Long", "long"} }; } /// /// 根据WareHouseAreaTypeEntity的字段转BASEInOutListDetail的字段 /// /// WareHouseAreaTypeEntity的字段 /// BASEInOutListDetail public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取WareHouseAreaTypeEntity对应的表名 /// /// 表名 public static string GetTableName() { return "[dbo].[BASEInOutListDetail]"; } } }