|
|
@ -64,6 +64,26 @@ namespace Win.Sfs.SettleAccount |
|
|
|
SettleAccountDbProperties.DbSchema |
|
|
|
); |
|
|
|
|
|
|
|
#region 基础数据
|
|
|
|
//价格
|
|
|
|
builder.ConfigurePriceListVersion(options); |
|
|
|
builder.ConfigurePriceList(options); |
|
|
|
//BJ备件价格
|
|
|
|
builder.ConfigurePriceListVersionBJ(options); |
|
|
|
builder.ConfigurePriceListBJ(options); |
|
|
|
|
|
|
|
//物料、物料关系
|
|
|
|
builder.ConfigureMaterial(options); |
|
|
|
builder.ConfigureMaterialRelationship(options); |
|
|
|
//BOM
|
|
|
|
builder.ConfigureBom(options); |
|
|
|
builder.ConfigureBomVersion(options); |
|
|
|
//期间
|
|
|
|
builder.ConfigureCentralizedControl(options); |
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 派格结算
|
|
|
|
|
|
|
@ -139,6 +159,171 @@ namespace Win.Sfs.SettleAccount |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#region 基础数据
|
|
|
|
|
|
|
|
private static void ConfigurePriceListBJ(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
|
|
|
|
builder.Entity<PriceListBJ>(b => |
|
|
|
{ |
|
|
|
|
|
|
|
b.ToTable($"{options.TablePrefix}_PriceListBJ", options.Schema); |
|
|
|
|
|
|
|
b.ConfigureByConvention(); |
|
|
|
b.Property(x => x.MaterialCode).HasMaxLength(50); |
|
|
|
b.Property(x => x.CustomerCode).HasMaxLength(50); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
private static void ConfigurePriceListVersionBJ(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
|
|
|
|
builder.Entity<PriceListVersionBJ>(b => |
|
|
|
{ |
|
|
|
|
|
|
|
b.ToTable($"{options.TablePrefix}_PriceListVersionBJ", options.Schema); |
|
|
|
|
|
|
|
b.ConfigureByConvention(); |
|
|
|
b.Property(x => x.Year).HasMaxLength(50); |
|
|
|
b.Property(x => x.Period).HasMaxLength(50); |
|
|
|
b.Property(x => x.Version).HasMaxLength(50); |
|
|
|
b.Property(x => x.Factory).HasMaxLength(50); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private static void ConfigureCentralizedControl(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
|
|
|
|
builder.Entity<CentralizedControl>(b => |
|
|
|
{ |
|
|
|
b.ToTable($"{options.TablePrefix}_control", options.Schema); |
|
|
|
b.ConfigureByConvention(); |
|
|
|
b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.HasIndex(x => new { x.Year, x.Period }).IsUnique().HasFilter(IsDeletedFilter); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void ConfigureBomVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
|
|
|
|
builder.Entity<BomVersion>(b => |
|
|
|
{ |
|
|
|
b.ToTable($"{options.TablePrefix}_bom_version", options.Schema); |
|
|
|
b.ConfigureByConvention(); |
|
|
|
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Year).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Period).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void ConfigureBom(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
builder.Entity<Bom>(b => |
|
|
|
{ |
|
|
|
|
|
|
|
b.ToTable($"{options.TablePrefix}_bom", options.Schema); |
|
|
|
b.ConfigureByConvention(); |
|
|
|
|
|
|
|
b.Property(x => x.Year).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Period).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Factory).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Version).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.ParentItemCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.ChildItemCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Qty).IsRequired(); |
|
|
|
b.Property(x => x.OperateProcess); |
|
|
|
b.Property(x => x.ScrapPercent); |
|
|
|
b.Property(x => x.BomType).HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.EffectiveTime); |
|
|
|
b.Property(x => x.ExpireTime); |
|
|
|
b.Property(x => x.IssuePosition); |
|
|
|
b.Property(x => x.BomLevel); |
|
|
|
|
|
|
|
b.Property(x => x.Enabled); |
|
|
|
|
|
|
|
b.HasIndex(x => new { x.ParentItemCode, x.ChildItemCode, x.Version }).IsUnique().HasFilter(IsDeletedFilter); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private static void ConfigureMaterial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
builder.Entity<Material>(b => |
|
|
|
{ |
|
|
|
b.ToTable($"{options.TablePrefix}_material", options.Schema); |
|
|
|
b.ConfigureByConvention(); |
|
|
|
|
|
|
|
|
|
|
|
b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.EstimateType).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.Property(x => x.Unit).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.HasIndex(x => new { x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void ConfigureMaterialRelationship(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
builder.Entity<MaterialRelationship>(b => |
|
|
|
{ |
|
|
|
b.ToTable($"{options.TablePrefix}_relationship", options.Schema); |
|
|
|
b.ConfigureByConvention(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//b.Property(x => x.SettleMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
|
|
|
|
b.Property(x => x.MaterialProperty).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
//b.Property(x => x.ShipMaterailCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
|
|
|
|
b.Property(x => x.ErpMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); |
|
|
|
b.HasIndex(x => new { x.ErpMaterialCode }); |
|
|
|
|
|
|
|
b.HasIndex(x => new { x.ErpMaterialCode }).IsUnique().HasFilter(IsDeletedFilter); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private static void ConfigurePriceList(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
|
|
|
|
builder.Entity<PriceList>(b => |
|
|
|
{ |
|
|
|
|
|
|
|
b.ToTable($"{options.TablePrefix}_PriceList", options.Schema); |
|
|
|
|
|
|
|
b.ConfigureByConvention(); |
|
|
|
b.Property(x => x.MaterialCode).HasMaxLength(50); |
|
|
|
b.Property(x => x.CustomerCode).HasMaxLength(50); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
private static void ConfigurePriceListVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) |
|
|
|
{ |
|
|
|
|
|
|
|
builder.Entity<PriceListVersion>(b => |
|
|
|
{ |
|
|
|
|
|
|
|
b.ToTable($"{options.TablePrefix}_PriceListVersion", options.Schema); |
|
|
|
|
|
|
|
b.ConfigureByConvention(); |
|
|
|
b.Property(x => x.Year).HasMaxLength(50); |
|
|
|
b.Property(x => x.Period).HasMaxLength(50); |
|
|
|
b.Property(x => x.Version).HasMaxLength(50); |
|
|
|
b.Property(x => x.Factory).HasMaxLength(50); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 红旗M平台、一汽轿车
|
|
|
|