Browse Source

基础数据EF配置代码提交,价格、备件价格、物料主数据、物料关系、BOM等

pull/1/head
fangdawei 1 year ago
parent
commit
acbbf62b31
  1. 187
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  2. 26
      code/src/SmartFactorySuite.sln

187
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -64,12 +64,32 @@ namespace Win.Sfs.SettleAccount
SettleAccountDbProperties.DbSchema 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 派格结算 #region 派格结算
builder.ConfigureBBAC_CAN_SA(options); builder.ConfigureBBAC_CAN_SA(options);
builder.ConfigureBBAC_CAN_SA_DETAIL(options); builder.ConfigureBBAC_CAN_SA_DETAIL(options);
builder.ConfigureBBAC_NOT_SA_DETAIL(options); builder.ConfigureBBAC_NOT_SA_DETAIL(options);
builder.ConfigureBBAC_PD_DETAIL(options); builder.ConfigureBBAC_PD_DETAIL(options);
@ -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平台、一汽轿车 #region 红旗M平台、一汽轿车

26
code/src/SmartFactorySuite.sln

@ -1,10 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
<<<<<<< HEAD
VisualStudioVersion = 17.5.33516.290
=======
VisualStudioVersion = 17.6.33815.320 VisualStudioVersion = 17.6.33815.320
>>>>>>> 1c2946500765850db29fa7d216f5e55e2e4de888
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gateways", "Gateways", "{593B8559-1521-4E54-A7DF-7F58E5F6EA86}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gateways", "Gateways", "{593B8559-1521-4E54-A7DF-7F58E5F6EA86}"
EndProject EndProject
@ -68,12 +64,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.HttpApi", "Modu
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.HttpApi.Client", "Modules\BaseService\BaseService.HttpApi.Client\BaseService.HttpApi.Client.csproj", "{1913786D-E64D-48E4-98A7-42C3BCA9C282}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.HttpApi.Client", "Modules\BaseService\BaseService.HttpApi.Client\BaseService.HttpApi.Client.csproj", "{1913786D-E64D-48E4-98A7-42C3BCA9C282}"
EndProject EndProject
<<<<<<< HEAD
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthServer.Host", "AuthServer\AuthServer.Host\AuthServer.Host.csproj", "{C94F578D-C331-4A9D-B001-93DAECB51447}"
=======
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthServer.Host", "AuthServer\AuthServer.Host\AuthServer.Host.csproj", "{4C7A0E8B-2DBC-4E76-8F68-0DD200CE88E7}"
>>>>>>> 1c2946500765850db29fa7d216f5e55e2e4de888
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -164,17 +154,6 @@ Global
{1913786D-E64D-48E4-98A7-42C3BCA9C282}.Debug|Any CPU.Build.0 = Debug|Any CPU {1913786D-E64D-48E4-98A7-42C3BCA9C282}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1913786D-E64D-48E4-98A7-42C3BCA9C282}.Release|Any CPU.ActiveCfg = Release|Any CPU {1913786D-E64D-48E4-98A7-42C3BCA9C282}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1913786D-E64D-48E4-98A7-42C3BCA9C282}.Release|Any CPU.Build.0 = Release|Any CPU {1913786D-E64D-48E4-98A7-42C3BCA9C282}.Release|Any CPU.Build.0 = Release|Any CPU
<<<<<<< HEAD
{C94F578D-C331-4A9D-B001-93DAECB51447}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C94F578D-C331-4A9D-B001-93DAECB51447}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C94F578D-C331-4A9D-B001-93DAECB51447}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C94F578D-C331-4A9D-B001-93DAECB51447}.Release|Any CPU.Build.0 = Release|Any CPU
=======
{4C7A0E8B-2DBC-4E76-8F68-0DD200CE88E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C7A0E8B-2DBC-4E76-8F68-0DD200CE88E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C7A0E8B-2DBC-4E76-8F68-0DD200CE88E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C7A0E8B-2DBC-4E76-8F68-0DD200CE88E7}.Release|Any CPU.Build.0 = Release|Any CPU
>>>>>>> 1c2946500765850db29fa7d216f5e55e2e4de888
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -205,11 +184,6 @@ Global
{56B50817-0F64-4CD8-814D-CA3827F40FFB} = {B55F5923-5FDE-4BEB-9E81-BE270D5909A1} {56B50817-0F64-4CD8-814D-CA3827F40FFB} = {B55F5923-5FDE-4BEB-9E81-BE270D5909A1}
{65DEB438-557B-4268-8EC6-25A9A2ED6FE1} = {B55F5923-5FDE-4BEB-9E81-BE270D5909A1} {65DEB438-557B-4268-8EC6-25A9A2ED6FE1} = {B55F5923-5FDE-4BEB-9E81-BE270D5909A1}
{1913786D-E64D-48E4-98A7-42C3BCA9C282} = {B55F5923-5FDE-4BEB-9E81-BE270D5909A1} {1913786D-E64D-48E4-98A7-42C3BCA9C282} = {B55F5923-5FDE-4BEB-9E81-BE270D5909A1}
<<<<<<< HEAD
{C94F578D-C331-4A9D-B001-93DAECB51447} = {BD0465F1-50F8-4913-8B01-7C2E44CEED27}
=======
{4C7A0E8B-2DBC-4E76-8F68-0DD200CE88E7} = {BD0465F1-50F8-4913-8B01-7C2E44CEED27}
>>>>>>> 1c2946500765850db29fa7d216f5e55e2e4de888
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CAAF5A4A-B83D-4CCD-BF50-58035AD87837} SolutionGuid = {CAAF5A4A-B83D-4CCD-BF50-58035AD87837}

Loading…
Cancel
Save