From 17bc23efde6311e212ffd52bf536a703867ab2c9 Mon Sep 17 00:00:00 2001 From: mahao Date: Thu, 9 Mar 2023 14:09:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- host/WmsWebApi.HttpApi.Host/appsettings.json | 13 +- .../WmsWebApiJsonDbContext.cs | 3 + .../20230309060032_202303091400.Designer.cs | 445 ++++++++++++++++++ .../20230309060032_202303091400.cs | 43 ++ .../WmsWebApiJsonDbContextModelSnapshot.cs | 58 +++ .../WmsWebApi.EntityFrameworkCore.csproj | 1 + 6 files changed, 554 insertions(+), 9 deletions(-) create mode 100644 src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.Designer.cs create mode 100644 src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.cs diff --git a/host/WmsWebApi.HttpApi.Host/appsettings.json b/host/WmsWebApi.HttpApi.Host/appsettings.json index f27b84f..9d60b54 100644 --- a/host/WmsWebApi.HttpApi.Host/appsettings.json +++ b/host/WmsWebApi.HttpApi.Host/appsettings.json @@ -9,15 +9,10 @@ //"WmsWebApiJson": "Server=192.168.0.63;Database=CPAT_WMS_Json;User ID=sa;Password=Microsoft2008", //"AbpBackgroundJobs": "Server=192.168.0.63;Database=CPAT_WMS_Json;User ID=sa;Password=Microsoft2008", - //"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008", - //"WmsWebApi": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008", - //"WmsWebApiJson": "Server=192.168.0.140;Database=CPAT_WMS_Json_TEST;User ID=sa;Password=Microsoft2008", - //"AbpBackgroundJobs": "Server=192.168.0.140;Database=CPAT_WMS_Json_TEST;User ID=sa;Password=Microsoft2008", - - "Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", - "WmsWebApi": "Server=192.168.0.228,1433;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021", - "WmsWebApiJson": "Server=192.168.0.228,1433;Database=CPAT_WMS_Json;User ID=sa;Password=ChangkeTec@2021", - "AbpBackgroundJobs": "Server=192.168.0.228,1433;Database=CPAT_WMS_Json;User ID=sa;Password=ChangkeTec@2021", + "Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008", + "WmsWebApi": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008", + "WmsWebApiJson": "Server=192.168.0.140;Database=CPAT_WMS_Json_TEST;User ID=sa;Password=Microsoft2008", + "AbpBackgroundJobs": "Server=192.168.0.140;Database=CPAT_WMS_Json_TEST;User ID=sa;Password=Microsoft2008", "AgvInLoc": "A01", "AgvOutLoc": "B01" diff --git a/src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiJsonDbContext.cs b/src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiJsonDbContext.cs index 83cfe9d..c19627a 100644 --- a/src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiJsonDbContext.cs +++ b/src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiJsonDbContext.cs @@ -1,4 +1,5 @@ using Microsoft.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Modeling; @@ -37,6 +38,8 @@ namespace WmsWebApi.EntityFrameworkCore { base.OnModelCreating(modelBuilder); + modelBuilder.ConfigureBackgroundJobs(); + var options = new WmsWebApiModelBuilderConfigurationOptions(WmsWebApiDbProperties.DbTablePrefix,WmsWebApiDbProperties.DbSchema); modelBuilder.Entity(b => diff --git a/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.Designer.cs b/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.Designer.cs new file mode 100644 index 0000000..95637c5 --- /dev/null +++ b/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.Designer.cs @@ -0,0 +1,445 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using WmsWebApi.EntityFrameworkCore; + +namespace WmsWebApi.Migrations.WmsWebApiJsonDb +{ + [DbContext(typeof(WmsWebApiJsonDbContext))] + [Migration("20230309060032_202303091400")] + partial class _202303091400 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.17") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("WmsWebApi.Boms.WmsWebApiBOMDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BMENG") + .HasColumnType("decimal(18,2)"); + + b.Property("DATUV") + .HasColumnType("nvarchar(max)"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("LOEKZ") + .HasColumnType("nvarchar(max)"); + + b.Property("MAKTX") + .HasColumnType("nvarchar(max)"); + + b.Property("MATNR") + .HasColumnType("nvarchar(max)"); + + b.Property("STLAL") + .HasColumnType("nvarchar(max)"); + + b.Property("STLAN") + .HasColumnType("nvarchar(max)"); + + b.Property("STLST") + .HasColumnType("nvarchar(max)"); + + b.Property("WERKS") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiBOMJsons"); + }); + + modelBuilder.Entity("WmsWebApi.Domain.WmsWebApiProductRecieveDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountDate") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("nvarchar(max)"); + + b.Property("BillType") + .HasColumnType("nvarchar(max)"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("GUID") + .HasColumnType("nvarchar(max)"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("OperName") + .HasColumnType("nvarchar(max)"); + + b.Property("ReceiveDate") + .HasColumnType("nvarchar(max)"); + + b.Property("SourceBillNum") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiProductRecieveJsons"); + }); + + modelBuilder.Entity("WmsWebApi.Domain.WmsWebApiStockMoveDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountDate") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("nvarchar(max)"); + + b.Property("BillType") + .HasColumnType("nvarchar(max)"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("GUID") + .HasColumnType("nvarchar(max)"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("OperName") + .HasColumnType("nvarchar(max)"); + + b.Property("ReceiveDate") + .HasColumnType("nvarchar(max)"); + + b.Property("SourceBillNum") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiStockMoveJsons"); + }); + + modelBuilder.Entity("WmsWebApi.OtherZll.WmsWebApiOtherZLLDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("MBLNR") + .HasColumnType("nvarchar(max)"); + + b.Property("MJAHR") + .HasColumnType("nvarchar(max)"); + + b.Property("ZLLDJ") + .HasColumnType("nvarchar(max)"); + + b.Property("ZLLR") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiOtherZllJsons"); + }); + + modelBuilder.Entity("WmsWebApi.PPlan.WmsWebApiPPLANDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DISPO") + .HasColumnType("nvarchar(max)"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("GSMNG") + .HasColumnType("decimal(18,2)"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("KAPTPROG") + .HasColumnType("nvarchar(max)"); + + b.Property("MAKTX") + .HasColumnType("nvarchar(max)"); + + b.Property("MATNR") + .HasColumnType("nvarchar(max)"); + + b.Property("PEDTR") + .HasColumnType("nvarchar(max)"); + + b.Property("SCHGRUP") + .HasColumnType("nvarchar(max)"); + + b.Property("VERID") + .HasColumnType("nvarchar(max)"); + + b.Property("WERKS") + .HasColumnType("nvarchar(max)"); + + b.Property("XUBNAME") + .HasColumnType("nvarchar(max)"); + + b.Property("ZBZSM") + .HasColumnType("nvarchar(max)"); + + b.Property("ZCDATE") + .HasColumnType("nvarchar(max)"); + + b.Property("ZCTIME") + .HasColumnType("nvarchar(max)"); + + b.Property("ZMACD") + .HasColumnType("nvarchar(max)"); + + b.Property("ZMATX") + .HasColumnType("nvarchar(max)"); + + b.Property("ZSCSX") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiPPlanJsons"); + }); + + modelBuilder.Entity("WmsWebApi.Parts.WmsWebApiPARTDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DISGR") + .HasColumnType("nvarchar(max)"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("GROES") + .HasColumnType("nvarchar(max)"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("MAKTX") + .HasColumnType("nvarchar(max)"); + + b.Property("MAKTX1") + .HasColumnType("nvarchar(max)"); + + b.Property("MATKL") + .HasColumnType("nvarchar(max)"); + + b.Property("MATNR") + .HasColumnType("nvarchar(max)"); + + b.Property("MBRSH") + .HasColumnType("nvarchar(max)"); + + b.Property("MEINS") + .HasColumnType("nvarchar(max)"); + + b.Property("MTART") + .HasColumnType("nvarchar(max)"); + + b.Property("VTWEG") + .HasColumnType("nvarchar(max)"); + + b.Property("WERKS") + .HasColumnType("nvarchar(max)"); + + b.Property("ZTEXT22") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiPartJsons"); + }); + + modelBuilder.Entity("WmsWebApi.Purchase.WmsWebApiPURCHASEDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BUDAT") + .HasColumnType("nvarchar(max)"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("MBLNR") + .HasColumnType("nvarchar(max)"); + + b.Property("MJAHR") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiPurchaseJsons"); + }); + + modelBuilder.Entity("WmsWebApi.ZlldcjLogs.WmsWebApiZLLDCJDTO", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DYSJ") + .HasColumnType("datetime2"); + + b.Property("EnumRetryStatus") + .HasColumnType("int"); + + b.Property("ITYPE") + .HasColumnType("nvarchar(max)"); + + b.Property("JSON") + .HasColumnType("nvarchar(max)"); + + b.Property("ZDJLX") + .HasColumnType("nvarchar(max)"); + + b.Property("ZLLDJ") + .HasColumnType("nvarchar(max)"); + + b.Property("ZLTLX") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("WmsWebApiZlldcjLogJsons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.cs b/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.cs new file mode 100644 index 0000000..1579682 --- /dev/null +++ b/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.cs @@ -0,0 +1,43 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace WmsWebApi.Migrations.WmsWebApiJsonDb +{ + public partial class _202303091400 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpBackgroundJobs", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + JobName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + JobArgs = table.Column(type: "nvarchar(max)", maxLength: 1048576, nullable: false), + TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), + CreationTime = table.Column(type: "datetime2", nullable: false), + NextTryTime = table.Column(type: "datetime2", nullable: false), + LastTryTime = table.Column(type: "datetime2", nullable: true), + IsAbandoned = table.Column(type: "bit", nullable: false, defaultValue: false), + Priority = table.Column(type: "tinyint", nullable: false, defaultValue: (byte)15), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", + table: "AbpBackgroundJobs", + columns: new[] { "IsAbandoned", "NextTryTime" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpBackgroundJobs"); + } + } +} diff --git a/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/WmsWebApiJsonDbContextModelSnapshot.cs b/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/WmsWebApiJsonDbContextModelSnapshot.cs index 7591973..99fc346 100644 --- a/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/WmsWebApiJsonDbContextModelSnapshot.cs +++ b/src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/WmsWebApiJsonDbContextModelSnapshot.cs @@ -21,6 +21,64 @@ namespace WmsWebApi.Migrations.WmsWebApiJsonDb .HasAnnotation("ProductVersion", "5.0.17") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + modelBuilder.Entity("WmsWebApi.Boms.WmsWebApiBOMDTO", b => { b.Property("Id") diff --git a/src/WmsWebApi.EntityFrameworkCore/WmsWebApi.EntityFrameworkCore.csproj b/src/WmsWebApi.EntityFrameworkCore/WmsWebApi.EntityFrameworkCore.csproj index 02b4d6f..847080e 100644 --- a/src/WmsWebApi.EntityFrameworkCore/WmsWebApi.EntityFrameworkCore.csproj +++ b/src/WmsWebApi.EntityFrameworkCore/WmsWebApi.EntityFrameworkCore.csproj @@ -10,6 +10,7 @@ +