From acbbf62b31ced06b27a5e34976b500e3ab688c68 Mon Sep 17 00:00:00 2001 From: fangdawei <44673626@qq.com> Date: Mon, 10 Jul 2023 11:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AEEF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4=EF=BC=8C=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E3=80=81=E5=A4=87=E4=BB=B6=E4=BB=B7=E6=A0=BC=E3=80=81?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=B8=BB=E6=95=B0=E6=8D=AE=E3=80=81=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=85=B3=E7=B3=BB=E3=80=81BOM=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...AccountDbContextModelCreatingExtensions.cs | 187 +++++++++++++++++- code/src/SmartFactorySuite.sln | 26 --- 2 files changed, 186 insertions(+), 27 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 0e99c015..8b057a0d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -64,12 +64,32 @@ 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 派格结算 - builder.ConfigureBBAC_CAN_SA(options); + builder.ConfigureBBAC_CAN_SA(options); builder.ConfigureBBAC_CAN_SA_DETAIL(options); builder.ConfigureBBAC_NOT_SA_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(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(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(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(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(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(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(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(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(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平台、一汽轿车 diff --git a/code/src/SmartFactorySuite.sln b/code/src/SmartFactorySuite.sln index 13867d31..49395228 100644 --- a/code/src/SmartFactorySuite.sln +++ b/code/src/SmartFactorySuite.sln @@ -1,10 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -<<<<<<< HEAD -VisualStudioVersion = 17.5.33516.290 -======= VisualStudioVersion = 17.6.33815.320 ->>>>>>> 1c2946500765850db29fa7d216f5e55e2e4de888 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gateways", "Gateways", "{593B8559-1521-4E54-A7DF-7F58E5F6EA86}" EndProject @@ -68,12 +64,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.HttpApi", "Modu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.HttpApi.Client", "Modules\BaseService\BaseService.HttpApi.Client\BaseService.HttpApi.Client.csproj", "{1913786D-E64D-48E4-98A7-42C3BCA9C282}" 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution 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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -205,11 +184,6 @@ Global {56B50817-0F64-4CD8-814D-CA3827F40FFB} = {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} -<<<<<<< HEAD - {C94F578D-C331-4A9D-B001-93DAECB51447} = {BD0465F1-50F8-4913-8B01-7C2E44CEED27} -======= - {4C7A0E8B-2DBC-4E76-8F68-0DD200CE88E7} = {BD0465F1-50F8-4913-8B01-7C2E44CEED27} ->>>>>>> 1c2946500765850db29fa7d216f5e55e2e4de888 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAAF5A4A-B83D-4CCD-BF50-58035AD87837}