using System; using SqlSugar; using System.Linq; using System.ComponentModel; using System.Collections.Generic; namespace Tiger.Model { /// /// 实体:盘点单 /// [Description("Primary:ID")] [Serializable] [SugarTable("WMS_COUNT")] public class WMS_COUNT : DbEntityWithAuth { #region 构造函数 /// /// 实体:盘点单 /// public WMS_COUNT() {} #endregion #region 公共属性 /// /// 盘点单号 /// public string COUNT_NO { get; set; } /// /// 盘点模式(0Partial抽盘|2All全盘) /// public int COUNT_MODE { get; set; } /// /// 盘点类型(0Annual年盘|1Quarterly季盘|2Monthly月盘|3Weekly周盘|4Daily日盘) /// public int COUNT_TYPE { get; set; } /// /// 状态(0New新创建|1Counting盘点中|2Paused暂停中|3Closed已关闭|4Cancel作废) /// public int STATUS { get; set; } /// /// 盘点范围:组织代码,多个用","分割 /// public string ORG_CODE { get; set; } /// /// 盘点范围:仓库代码,多个用","分割 /// public string WH_IDS { get; set; } /// /// 盘点范围:储区代码,多个用","分割 /// public string REGION_IDS { get; set; } /// /// 盘点范围:货架编码,多个用","分割 /// public string SHELF_IDS { get; set; } /// /// 盘点范围:储位编码,多个用","分割 /// public string LOCATION_IDS { get; set; } /// /// 物料编码列表,多个用","分割 /// public string ITEM_CODE_LIST { get; set; } /// /// 物料编码关键字,多个用","分割 /// public string ITEM_CODE_LIKE { get; set; } /// /// 库存镜像创建时间 /// public DateTime MIRROR_DATE { get; set; } = DateTime.MinValue; /// /// 盘点开始时间 /// public DateTime BEGIN_DATE { get; set; } = DateTime.MinValue; /// /// 盘点结束时间 /// public DateTime END_DATE { get; set; } = DateTime.MinValue; /// /// 审核人 /// public string REVIEWER { get; set; } /// /// 审核日期 /// public DateTime REVIEW_DATE { get; set; } = DateTime.MinValue; /// /// 备注 /// public string REMARK { get; set; } #endregion #region 虚拟属性 /*例子 [SugarColumn(IsIgnore = true)] public string FieldName { get; set; } */ [SugarColumn(IsIgnore = true)] public List OrgCodeList => (ORG_CODE ?? "").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); [SugarColumn(IsIgnore = true)] public List WhIdList => (WH_IDS ?? "").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); [SugarColumn(IsIgnore = true)] public List RegionIdList => (REGION_IDS ?? "").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); [SugarColumn(IsIgnore = true)] public List ShelfIdList => (SHELF_IDS ?? "").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); [SugarColumn(IsIgnore = true)] public List LocationIdList => (LOCATION_IDS ?? "").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); [SugarColumn(IsIgnore = true)] public List ItemCodeList => (ITEM_CODE_LIST ?? "").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); [SugarColumn(IsIgnore = true)] public List ItemCodeLikeList => (ITEM_CODE_LIKE ?? "").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); #endregion #region 外键属性 /*例子 //一对一外键导航 [Navigate(NavigateType.OneToOne, nameof(ClassAId))]//一对一 ClassAId是WMS_COUNT类里面的外键ID字段 public ClassA ClassA { get; set; } //注意禁止手动赋值,只能是null //一对多外键导航 [Navigate(NavigateType.OneToMany, nameof(ClassA.WMS_COUNTId))]//ClassA表中的WMS_COUNTId public List ClassAList { get; set; }//注意禁止手动赋值,只能是null //多对多外键导航 [Navigate(typeof(MappingClass), nameof(MappingClass.WMS_COUNTId), nameof(MappingClass.ClassAId))]//注意顺序 public List ClassAList { get; set; } //注意禁止手动赋值,只能是null */ [Navigate(NavigateType.OneToMany, nameof(WMS_COUNT_LDTL.COUNT_NO), nameof(COUNT_NO))] public List LDtlsWithGhost { get; set; }//注意禁止手动赋值,只能是null [SugarColumn(IsIgnore = true)] public List LDtls => LDtlsWithGhost?.Where(q => !q.GHOST_ROW).ToList(); [Navigate(NavigateType.OneToMany, nameof(WMS_COUNT_MDTL.COUNT_NO), nameof(COUNT_NO))] public List MDtlsWithGhost { get; set; }//注意禁止手动赋值,只能是null [SugarColumn(IsIgnore = true)] public List MDtls => MDtlsWithGhost?.Where(q => !q.GHOST_ROW).ToList(); [Navigate(NavigateType.OneToMany, nameof(WMS_COUNT_SUM.COUNT_NO), nameof(COUNT_NO))] public List SumListWithGhost { get; set; }//注意禁止手动赋值,只能是null [SugarColumn(IsIgnore = true)] public List SumList => SumListWithGhost?.Where(q => !q.GHOST_ROW).ToList(); #endregion #region 枚举变量 /*例子 public enum FieldNames { [Description("枚举描述0")] Enum0, [Description("枚举描述1")] Enum1, } */ /// /// 盘点模式(0Partial抽盘|2All全盘) /// public enum COUNT_MODEs { [Description("抽盘")] Partial, [Description("全盘")] ALL, } /// /// 盘点类型(0Annual年盘|1Quarterly季盘|2Monthly月盘|3Weekly周盘|4Daily日盘) /// public enum COUNT_TYPEs { [Description("年盘")] Annual, [Description("季盘")] Quarterly, [Description("月盘")] Monthly, [Description("周盘")] Weekly, [Description("日盘")] Daily, } /// /// 状态(0New新创建|1Counting盘点中|2Paused暂停中|3Closed已关闭|4Cancel作废) /// public enum STATUSs { [Description("新创建")] New, [Description("盘点中")] Counting, [Description("暂停中")] Paused, [Description("已关闭")] Closed, [Description("作废")] Cancel, } #endregion #region 公共方法 #endregion }//endClass }