zs
2025-05-15 edba4ede85a3d82a7f0a0a7dccddbc8281862888
HIAWms/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WmsMaterial.cs
@@ -50,7 +50,7 @@
            b.HasKey(x => x.Id);
            // 字段配置
            b.Property(x => x.MaterialCode)
            b.Property(x => x.MaterialNo)
                .HasMaxLength(64)
                .IsRequired()
                .HasComment("物料编码(唯一标识)");
@@ -63,8 +63,13 @@
            b.Property(x => x.PurchaseType)
                .HasComment("采购类型(枚举值)");
            b.Property(x => x.MaterialType)
                .HasComment("物料类型(枚举值)");
            b.Property(x => x.MaterialTypeCode)
                .HasMaxLength(20)
                .HasComment("物料类型编码");
            b.Property(x => x.MaterialTypeDesc)
                .HasMaxLength(20)
                .HasComment("物料类型");
            b.Property(x => x.PrimaryUnit)
                .HasMaxLength(20)
@@ -101,6 +106,9 @@
            b.Property(x => x.Certification)
                .HasMaxLength(128)
                .HasComment("证书编号");
            b.Property(x => x.MaterialModel)
                .HasMaxLength(128)
                .HasComment("型号");
            // 冗余字段配置
            b.Property(x => x.RedundantField1)
@@ -134,10 +142,10 @@
                .HasComment("是否禁用");
            // 索引配置
            b.HasIndex(x => x.MaterialCode).IsUnique(); // 物料编码唯一索引
            b.HasIndex(x => x.MaterialNo).IsUnique(); // 物料编码唯一索引
            b.HasIndex(x => x.MaterialName);           // 物料名称普通索引
            b.HasIndex(x => x.PurchaseType);           // 采购类型索引(如需查询过滤)
            b.HasIndex(x => x.MaterialType);           // 物料类型索引(如需查询过滤)
            b.HasIndex(x => x.MaterialTypeCode);           // 物料类型索引(如需查询过滤)
            b.ApplyObjectExtensionMappings();
        });