using Furion.DatabaseAccessor; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using iWare.Wms.Core.Enum; namespace iWare.Wms.Core { /// /// 物料信息 /// [Table("wms_material")] [Comment("物料信息")] public class WmsMaterial:DEntityBase { /// /// 物料名称 /// [Comment("物料名称")] public string MaterialName { get; set; } /// /// 物料编号 /// [Comment("物料编号")] public string MaterialNo { get; set; } /// /// 物料批次 /// [Comment("物料批次")] public string MaterialBatch { get; set; } /// /// 描述 /// [Comment("描述")] [MaxLength(500)] public string Description { get; set; } /// /// 检验方式;数据字典 /// [Comment("检验方式")] public MaterialInspection InspectionMethod { get; set; } /// /// 物料类别;数据字典 /// [Comment("物料类别")] public MaterialType MaterialType { get; set; } /// /// 物料规格 /// [Comment("物料规格")] public string MaterialSpec { get; set; } /// /// 单位类别;数据字典 /// [Comment("单位类别")] public UnitType UnitType { get; set; } /// /// 单位编号;数据字典 /// [Comment("单位编号")] public UnitnoType UnitNo { get; set; } /// /// 安全存量 /// [Comment("安全存量")] public decimal? Safeqty { get; set; } /// /// 是否关键物料;数据字典 /// [Comment("是否关键物料")] public YesOrNot? Keymaterials { get; set; } /// /// Erp单号 /// [Comment("Erp单号")] [MaxLength(50)] public string ErpNo { get; set; } /// /// 图号 /// [Comment("图号")] [MaxLength(50)] public string GraphNo { get; set; } /// /// 品管类别 /// [Comment("品管类别")] [MaxLength(50)] public string Qccategory { get; set; } /// /// 保质期 /// [Comment("保质期")] public decimal? Warranty { get; set; } /// /// 最大存量 /// [Comment("最大存量")] public decimal? MaxImumqty { get; set; } /// /// 最小库龄 /// [Comment("最小库龄")] public decimal? MinstorageAge { get; set; } /// /// 最大库龄 /// [Comment("最大库龄")] public decimal? MaxstorageAge { get; set; } public ICollection WmsMaterialContainers { get; set; } /// /// 构建一对多的关系 /// /// /// /// public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator) { entityBuilder.HasMany(x => x.WmsMaterialContainers) .WithOne(x => x.WmsMaterial) .HasForeignKey(x => x.MaterialId).IsRequired(false); } /// /// 长(mm) /// [Comment("长(mm)")] public decimal? Length { get; set; } /// /// 宽(mm) /// [Comment("宽(mm)")] public decimal? Width { get; set; } /// /// 高(mm) /// [Comment("高(mm)")] public decimal? Height { get; set; } /// /// 备注 /// [Comment("备注")] public string Remark { get; set; } /// /// 车型 /// [Comment("车型")] public string WareContainerTypeCode { get; set; } } }