diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj index a3fa5f85..fa4ebe42 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj @@ -20,6 +20,7 @@ + diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs index 3f07a301..5902cf83 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs @@ -1,4 +1,8 @@ -using Microsoft.AspNetCore.Builder; +using System; +using System.Linq; +using System.Text.RegularExpressions; +using Coravel; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.Routing; @@ -6,47 +10,91 @@ using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using System.Text.RegularExpressions; +using Volo.Abp.Domain.Repositories; +using Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +namespace Win.Sfs.SettleAccount; -namespace Win.Sfs.SettleAccount +public class Startup { - public class Startup + public void ConfigureServices(IServiceCollection services) { - public void ConfigureServices(IServiceCollection services) + services.AddScheduler(); + services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); + services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); + services.AddApplication(); + services.Configure(options => { - services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); - services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); - services.AddApplication(); - services.Configure(options => - { - // Set the limit to 256 MB - options.Limits.MaxRequestBodySize = 268435456; - }); - //上传文件大小限制IIS设置 - services.Configure(options => - { - options.MaxRequestBodySize = 268435456; - options.AllowSynchronousIO = true; - }); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + // Set the limit to 256 MB + options.Limits.MaxRequestBodySize = 268435456; + }); + //上传文件大小限制IIS设置 + services.Configure(options => { - var contentTypeProvider = new FileExtensionContentTypeProvider(); - contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); - app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider }); - app.InitializeApplication(); - } + options.MaxRequestBodySize = 268435456; + options.AllowSynchronousIO = true; + }); + } - public class SlugifyParameterTransformer : IOutboundParameterTransformer + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + app.ApplicationServices.UseScheduler(scheduler => { - public string TransformOutbound(object value) + using var scope = app.ApplicationServices.CreateScope(); + var jobs = scope.ServiceProvider.GetService>()?.ToList(); + jobs?.ForEach(job => { - if (value == null) { return null; } - var str = value.ToString(); - if (string.IsNullOrEmpty(str)) { return null; } - return Regex.Replace(str?.ToString(), "([a-z])([A-Z])", "$1-$2").ToLowerInvariant(); - } + var jobId = job.Id; + using var scope = app.ApplicationServices.CreateScope(); + var serviceType = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).FirstOrDefault(o => o.FullName == job.Service); + if (serviceType != null) + { + if (scope.ServiceProvider.GetService(serviceType) is IJobService jobService) + { + scheduler.Schedule(() => { + using var scope = app.ApplicationServices.CreateScope(); + var jobItemRepository = scope.ServiceProvider.GetRequiredService>(); + var jobLogRepository = scope.ServiceProvider.GetRequiredService>(); + var jobItem = jobItemRepository.FirstOrDefault(o => o.Id == jobId); + jobItem.IsRunning = true; + jobItemRepository.UpdateAsync(jobItem).Wait(); + var jobLog = new JobLog { JobId = jobId, Start = DateTime.Now }; + try + { + jobService.Invoke(); + jobLog.Success = true; + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + jobLog.Exception = ex.ToString(); + } + finally + { + jobLog.End = DateTime.Now; + jobLogRepository.InsertAsync(jobLog).Wait(); + jobItem.IsRunning = false; + jobItemRepository.UpdateAsync(jobItem).Wait(); + } + }).Cron(job.Cron); + } + } + }); + }); + var contentTypeProvider = new FileExtensionContentTypeProvider(); + contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); + app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider }); + app.InitializeApplication(); + } + + public class SlugifyParameterTransformer : IOutboundParameterTransformer + { + public string TransformOutbound(object value) + { + if (value == null) { return null; } + var str = value.ToString(); + if (string.IsNullOrEmpty(str)) { return null; } + return Regex.Replace(str?.ToString(), "([a-z])([A-Z])", "$1-$2").ToLowerInvariant(); } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json index f10a45c0..209e9758 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json @@ -1,10 +1,12 @@ -{ +{ "App": { "CorsOrigins": "https://*.abc.com,http://localhost:9527,http://149.223.116.5:8088" }, "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True", - "SettleAccountService": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;" + //"Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True", + //"SettleAccountService": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;" + "SettleAccountService": "Server=localhost;Database=BQ_SA;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True", + "Default": "Server=localhost;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True" }, "Serilog": { "Using": [], diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiService.cs new file mode 100644 index 00000000..b56f27a2 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiService.cs @@ -0,0 +1,50 @@ +using System.Linq; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Application.Services; +using Volo.Abp.DependencyInjection; +using Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +namespace Win.Sfs.SettleAccount.Entities.BQ; + +public interface IVmiService : IApplicationService, ITransientDependency, IJobService +{ + string Test(); + + void In(); + + void Out(); + + IQueryable Query(); +} + +[AllowAnonymous] +[Route("api/settleaccount/[controller]/[action]")] +public class VmiService : IVmiService +{ + public void Invoke() + { + throw new System.NotImplementedException(); + } + + public void In() + { + throw new System.NotImplementedException(); + } + + public void Out() + { + throw new System.NotImplementedException(); + } + + public IQueryable Query() + { + throw new System.NotImplementedException(); + } + + [HttpGet] + public string Test() + { + return "Test"; + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/IJobService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/IJobService.cs new file mode 100644 index 00000000..4a2d165e --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/IJobService.cs @@ -0,0 +1,6 @@ +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +public interface IJobService +{ + void Invoke(); +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs new file mode 100644 index 00000000..62ea44cd --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +public class JobItem : Entity, IHasConcurrencyStamp +{ + public JobItem() + { + this.Id = Guid.NewGuid(); + } + + public string Name { get; set; } + public string Cron { get; set; } + public string Service { get; set; } + public bool IsRunning { get; set; } + public List Logs { get; set; } = new List(); + public string ConcurrencyStamp { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs new file mode 100644 index 00000000..a870d1cd --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs @@ -0,0 +1,14 @@ +using System; +using Volo.Abp.Domain.Entities; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +public class JobLog : Entity +{ + public JobItem Job { get; set; } + public Guid? JobId { get; set; } + public DateTime Start { get; set; } + public DateTime End { get; set; } + public bool Success { get; set; } + public string Exception { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs new file mode 100644 index 00000000..5a269215 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +public class VmiBalance : Entity +{ + /// + /// LU零件号:BBAC发运单BBAC_SE_DETAIL.LU + /// + public string LU { get; set; } + + /// + /// 生产码:BBAC发运单BBAC_SE_DETAIL.PN + /// + public string PN { get; set; } + + /// + /// 生产码类型(01前保、02后保、03门槛等) + /// + public int PNType { get; set; } + + /// + /// 发货类型??? + /// + public string Type { get; set; } + + /// + /// 数量 + /// + public decimal Qty { get; set; } + + public List Logs { get; set; } = new List(); +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs new file mode 100644 index 00000000..f2a74b63 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +/// +/// 寄售库存操作分类 +/// +public class VmiCategory : Entity +{ + public VmiType Type { get; set; } + public string Number { get; set; } + public string Name { get; set; } + public List Logs { get; set; } = new List(); +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs new file mode 100644 index 00000000..584afeb0 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs @@ -0,0 +1,22 @@ +using System; +using Volo.Abp.Domain.Entities; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +/// +/// 寄售库存操作记录 +/// +public class VmiLog : Entity +{ + public Guid CategoryId { get; set; } + public Guid BalanceId { get; set; } + + /// + /// 操作范围 + /// + public string SessionId { get; set; } + + public VmiOperatorType Type { get; set; } + public VmiCategory Category { get; set; } + public VmiBalance Balance { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiOperatorType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiOperatorType.cs new file mode 100644 index 00000000..ad75bf56 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiOperatorType.cs @@ -0,0 +1,8 @@ +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +public enum VmiOperatorType +{ + Do, + UnDo, + ReDo +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs new file mode 100644 index 00000000..ca9826a9 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs @@ -0,0 +1,17 @@ +using System; +using Volo.Abp.Domain.Entities; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +/// +/// 库存快照,每月26日8.00,取库存按照时间存储到sqlite文件中 +/// +public class VmiSnapshot : Entity +{ + /// + /// YYYY-MM-DD hh + /// + public string Name { get; set; } + + public string Path { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs new file mode 100644 index 00000000..bd249098 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs @@ -0,0 +1,10 @@ +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +/// +/// 寄售库存操作类型 +/// +public enum VmiType +{ + In, + Out +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs index 6b35065d..7a86ab2a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs @@ -1,10 +1,6 @@ -using Microsoft.EntityFrameworkCore; -using SettleAccount; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.EstimatedStockDiffReports; -using Win.Sfs.SettleAccount.SendUnsettledDiffReports; -using Win.Sfs.SettleAccount.StockUnsettledDiffReports; namespace Win.Sfs.SettleAccount { @@ -15,7 +11,7 @@ namespace Win.Sfs.SettleAccount * public DbSet Questions { get; set; } */ - public SettleAccountDbContext(DbContextOptions options) + public SettleAccountDbContext(DbContextOptions options) : base(options) { this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(30)); @@ -28,6 +24,4 @@ namespace Win.Sfs.SettleAccount builder.ConfigureSettleAccount(); } } - - -} \ No newline at end of file +} 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 6f2d3dae..cc22b56d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -1,51 +1,20 @@ using System; using Microsoft.EntityFrameworkCore; +using SettleAccount.Domain.BQ; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; using Win.Sfs.SettleAccount.Boms; -using Win.Sfs.SettleAccount.Customers; +using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities.Boms; +using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.Controls; -using Win.Sfs.SettleAccount.FISes; -using Win.Sfs.SettleAccount.Entities.Inventories; +using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.SettleAccount.Prebatches; +using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Entities.SettleAccounts; -using Win.Sfs.SettleAccount.Entities.StorageLocations; -using Win.Sfs.SettleAccount.EstimatedStockDiffReports; -using Win.Sfs.SettleAccount.Inventories; using Win.Sfs.SettleAccount.MaterialRelationships; -using Win.Sfs.SettleAccount.SendUnsettledDiffReports; -using Win.Sfs.SettleAccount.StockUnsettledDiffReports; using Win.Sfs.Shared.Constant; -using Win.Sfs.SettleAccount.Entities.Factories; - -using Win.Sfs.SettleAccount.StockFisDiffReports; -using Win.Sfs.SettleAccount.StockSettledDiffReports; -using Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports; -using Win.Sfs.SettleAccount.SecondaryActuralDiffReports; -using Win.Sfs.SettleAccount.SupplierItemSetUps; - - -using Win.Sfs.SettleAccount.BTSeqKBDiffReports; -using Win.Sfs.SettleAccount.BTNotConsignReports; - -using Win.Sfs.SettleAccount.Entities; -using Win.Sfs.SettleAccount.Entities.ImportMap; -using Win.Sfs.SettleAccount.Entities.Invoices; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.Entities.FISes; -using Win.Sfs.SettleAccount.Entities.MaterialRelationships; -using Win.Sfs.SettleAccount.Entities.SettlementParts; -using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices; -using Win.Sfs.SettleAccount.Entities.SecMatch; - -using Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts; -using Win.Sfs.SettleAccount.Errors; -using SettleAccount.Domain.BQ; -using System.DirectoryServices.ActiveDirectory; namespace Win.Sfs.SettleAccount { @@ -65,6 +34,7 @@ namespace Win.Sfs.SettleAccount ); #region 基础数据 + builder.ConfigureCodeSetting(options); //价格 builder.ConfigurePriceListVersion(options); @@ -85,9 +55,8 @@ namespace Win.Sfs.SettleAccount builder.ConfigurePURCHASE_PRICE(options); //客户替换件关系 builder.ConfigureTB_RePartsRelationship(options); - #endregion - + #endregion 基础数据 #region 北汽结算 builder.ConfigureTaskJob(options); @@ -124,12 +93,7 @@ namespace Win.Sfs.SettleAccount builder.ConfigurePUB_SA(options); builder.ConfigurePUB_SA_DETAIL(options); builder.ConfigurePUB_SE_DETAIL(options); - - - - - - + builder.ConfigureVmi(options); //大众发票导入 //builder.ConfigureInvoice(options); @@ -139,50 +103,40 @@ namespace Win.Sfs.SettleAccount //builder.ConfigureSettleAccount(options); //builder.ConfigureSettleAccountVersion(options); - - ////红旗主机场-未结明细-导入 //builder.ConfigureUnHQSettleAccount(options); //builder.ConfigureUnHQSettleAccountVersion(options); - - //builder.ConfigureWmsDetailReport(options); //builder.ConfigureWmsDetailDiffReport(options); //builder.ConfigureWmsDetailCancelReport(options); - //有条码 //builder.ConfigureWmsDetailWithCodeReport(options); //builder.ConfigureErrorBill(options); - #endregion - + #endregion 北汽结算 } #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(); @@ -190,13 +144,11 @@ namespace Win.Sfs.SettleAccount 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); @@ -207,10 +159,8 @@ namespace Win.Sfs.SettleAccount }); } - private static void ConfigureBomVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { b.ToTable($"{options.TablePrefix}_bom_version", options.Schema); @@ -222,12 +172,10 @@ namespace Win.Sfs.SettleAccount }); } - private static void ConfigureBom(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_bom", options.Schema); b.ConfigureByConvention(); @@ -259,19 +207,14 @@ namespace Win.Sfs.SettleAccount 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 => @@ -299,24 +242,20 @@ namespace Win.Sfs.SettleAccount 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(); @@ -324,7 +263,6 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.Period).HasMaxLength(50); b.Property(x => x.Version).HasMaxLength(50); b.Property(x => x.Factory).HasMaxLength(50); - }); } @@ -340,7 +278,6 @@ namespace Win.Sfs.SettleAccount }); } - /// /// 客户替换件关系 /// @@ -352,22 +289,11 @@ namespace Win.Sfs.SettleAccount b.ConfigureByConvention(); }); } - #endregion - - - - + #endregion 基础数据 #region 北汽 - - - - - - - /// /// 一汽轿车平台验收结算明细-导入 /// @@ -375,10 +301,8 @@ namespace Win.Sfs.SettleAccount /// //private static void ConfigureHQCar(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) //{ - // builder.Entity(b => // { - // b.ToTable($"{options.TablePrefix}_HQ_Car_Platform", options.Schema); // b.ConfigureByConvention(); @@ -402,7 +326,6 @@ namespace Win.Sfs.SettleAccount //private static void ConfigureHQCarVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) //{ - // builder.Entity(b => // { // b.ToTable($"{options.TablePrefix}_HQ_Car_PlatformVersion", options.Schema); @@ -422,10 +345,8 @@ namespace Win.Sfs.SettleAccount /// //private static void ConfigureUnHQSettleAccount(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) //{ - // builder.Entity(b => // { - // b.ToTable($"{options.TablePrefix}_UnHQSettleAccount", options.Schema); // b.ConfigureByConvention(); @@ -457,7 +378,6 @@ namespace Win.Sfs.SettleAccount /// //private static void ConfigureUnHQSettleAccountVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) //{ - // builder.Entity(b => // { // b.ToTable($"{options.TablePrefix}_UnHQSettleAccountVersion", options.Schema); @@ -478,10 +398,8 @@ namespace Win.Sfs.SettleAccount /// //private static void ConfigureInvoice(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) //{ - // builder.Entity(b => // { - // b.ToTable($"{options.TablePrefix}_Invoice", options.Schema); // b.ConfigureByConvention(); @@ -502,10 +420,8 @@ namespace Win.Sfs.SettleAccount /// private static void ConfigureInvoiceVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_InvoiceVersion", options.Schema); b.ConfigureByConvention(); @@ -514,7 +430,6 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.Version).HasMaxLength(50); b.Property(x => x.CustomerCode).HasMaxLength(50); // b.Property(x => x.Factory).HasMaxLength(50); - }); } @@ -555,7 +470,6 @@ namespace Win.Sfs.SettleAccount /// private static void ConfigureSettleAccountVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { b.ToTable($"{options.TablePrefix}_Settle_Version", options.Schema); @@ -566,7 +480,6 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter); }); - } private static void ConfigureTaskJob(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) @@ -580,10 +493,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigureBBAC_CAN_SA(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_CAN_SA", options.Schema); b.ConfigureByConvention(); @@ -593,15 +504,12 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.InvGroupNum).HasMaxLength(50); b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); - } private static void ConfigureBBAC_CAN_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_CAN_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -618,12 +526,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureBBAC_PD_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_PD_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -640,13 +547,10 @@ namespace Win.Sfs.SettleAccount }); } - private static void ConfigureBBAC_NOT_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_NOT_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -662,12 +566,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureBBAC_SA(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_SA", options.Schema); b.ConfigureByConvention(); @@ -677,12 +580,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureBBAC_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -697,12 +599,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureBBAC_SE_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_SE_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -719,10 +620,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigureBBAC_SE_EDI(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_SE_EDI", options.Schema); b.ConfigureByConvention(); @@ -737,16 +636,13 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.Extend2).HasMaxLength(50); b.Property(x => x.Extend3).HasMaxLength(50); b.Property(x => x.Extend4).HasMaxLength(50); - }); } private static void ConfigureBBAC_SE_REPORT(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_SE_REPORT", options.Schema); b.ConfigureByConvention(); @@ -760,12 +656,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureBBAC_SE_SA_REPORT(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BBAC_SE_SA_REPORT", options.Schema); b.ConfigureByConvention(); @@ -784,12 +679,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureHBPO_CAN_SA(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_CAN_SA", options.Schema); b.ConfigureByConvention(); @@ -803,10 +697,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigureHBPO_CAN_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_CAN_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -824,10 +716,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigureHBPO_NOT_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_NOT_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -841,12 +731,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureHBPO_PD_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_PD_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -862,12 +751,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureHBPO_SA(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_SA", options.Schema); b.ConfigureByConvention(); @@ -881,10 +769,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigureHBPO_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -898,12 +784,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureHBPO_SE_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_SE_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -917,12 +802,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureHBPO_SE_EDI(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_SE_EDI", options.Schema); b.ConfigureByConvention(); @@ -937,17 +821,13 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.Extend2).HasMaxLength(50); b.Property(x => x.Extend3).HasMaxLength(50); b.Property(x => x.Extend4).HasMaxLength(50); - - }); } private static void ConfigureHBPO_SE_REPORT(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_SE_REPORT", options.Schema); b.ConfigureByConvention(); @@ -962,13 +842,10 @@ namespace Win.Sfs.SettleAccount }); } - private static void ConfigureHBPO_SE_SA_REPORT(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_HBPO_SE_SA_REPORT", options.Schema); b.ConfigureByConvention(); @@ -988,13 +865,10 @@ namespace Win.Sfs.SettleAccount }); } - private static void ConfigureINVOICE_GRP(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_INVOICE_GRP", options.Schema); b.ConfigureByConvention(); @@ -1006,12 +880,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureINVOICE_MAP_GROUP(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_INVOICE_MAP_GROUP", options.Schema); b.ConfigureByConvention(); @@ -1023,12 +896,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigureINVOICE_NOT_SETTLE(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_INVOICE_NOT_SETTLE", options.Schema); b.ConfigureByConvention(); @@ -1044,10 +916,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigureINVOICE_WAIT_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_INVOICE_WAIT_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -1065,10 +935,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigureJIT_SE_SA_REPORT(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_JIT_SE_SA_REPORT", options.Schema); b.ConfigureByConvention(); @@ -1090,10 +958,8 @@ namespace Win.Sfs.SettleAccount private static void ConfigurePUB_CAN_SA(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_PUB_CAN_SA", options.Schema); b.ConfigureByConvention(); @@ -1105,13 +971,10 @@ namespace Win.Sfs.SettleAccount }); } - private static void ConfigurePUB_CAN_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_PUB_CAN_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -1128,13 +991,10 @@ namespace Win.Sfs.SettleAccount }); } - private static void ConfigurePUB_NOT_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_PUB_NOT_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -1152,12 +1012,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigurePUB_PD_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_PUB_PD_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -1174,12 +1033,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigurePUB_SA(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_PUB_SA", options.Schema); b.ConfigureByConvention(); @@ -1188,12 +1046,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigurePUB_SA_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_PUB_SA_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -1209,12 +1066,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } + private static void ConfigurePUB_SE_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_PUB_SE_DETAIL", options.Schema); b.ConfigureByConvention(); @@ -1230,85 +1086,52 @@ namespace Win.Sfs.SettleAccount }); } + private static void ConfigureVmi(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + builder.Entity().HasData(new JobItem { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiService" }); + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_JobItem", options.Schema); + b.ConfigureByConvention(); + b.Property(o => o.Name).HasMaxLength(50).IsRequired(); + b.HasIndex(o => o.Name).IsUnique(); + b.Property(o => o.Service).HasMaxLength(100).IsRequired(); + b.Property(o => o.Cron).HasMaxLength(50).IsRequired(); + b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); + }); + builder.Entity().HasOne(o => o.Job).WithMany(o => o.Logs).HasForeignKey(o => o.JobId).OnDelete(DeleteBehavior.SetNull); + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_VmiCategory", options.Schema); + b.ConfigureByConvention(); + b.Property(o => o.Number).HasMaxLength(50).IsRequired(); + b.HasIndex(o => o.Number).IsUnique(); + b.Property(o => o.Name).HasMaxLength(50).IsRequired(); + }); + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema); + b.ConfigureByConvention(); + b.HasAlternateKey(o => new { o.PN, o.LU }); + }); + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_VmiLog", options.Schema); + b.ConfigureByConvention(); + }); + builder.Entity().HasOne(o => o.Category).WithMany(o => o.Logs).HasForeignKey(o => o.CategoryId).OnDelete(DeleteBehavior.Cascade); + builder.Entity().HasOne(o => o.Balance).WithMany(o => o.Logs).HasForeignKey(o => o.BalanceId).OnDelete(DeleteBehavior.Cascade); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_VmiSnapshot", options.Schema); + b.ConfigureByConvention(); + }); + } } - - - - #endregion - - + #endregion 北汽 } - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccountDbContextFactory.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccountDbContextFactory.cs new file mode 100644 index 00000000..f2cac305 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccountDbContextFactory.cs @@ -0,0 +1,19 @@ +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace Win.Sfs.SettleAccount; + +public class SettleAccountDbContextFactory : IDesignTimeDbContextFactory +{ + public SettleAccountDbContext CreateDbContext(string[] args) + { + var config = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json").Build(); + var connectionString = config.GetConnectionString("SettleAccountService"); + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseSqlServer(connectionString); + + return new SettleAccountDbContext(optionsBuilder.Options); + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/appsettings.json b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/appsettings.json index f877db73..44454042 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/appsettings.json +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/appsettings.json @@ -9,8 +9,8 @@ "CorsOrigins": "http://localhost:9527,http://dev.ccwin-in.com:10588,http://localhost:44307" }, "ConnectionStrings": { - "SettleAccountService": "Server=localhost;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True", - "Default": "Server=localhost;Database=BQ_SA;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True" + "SettleAccountService": "Server=localhost;Database=BQ_SA;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True", + "Default": "Server=localhost;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True" }, "ElasticSearch": { "Url": "http://localhost:9200"