Browse Source

同步数据库

master
mahao 2 years ago
parent
commit
17bc23efde
  1. 13
      host/WmsWebApi.HttpApi.Host/appsettings.json
  2. 3
      src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiJsonDbContext.cs
  3. 445
      src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.Designer.cs
  4. 43
      src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.cs
  5. 58
      src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/WmsWebApiJsonDbContextModelSnapshot.cs
  6. 1
      src/WmsWebApi.EntityFrameworkCore/WmsWebApi.EntityFrameworkCore.csproj

13
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", //"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", //"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", "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", "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", "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", "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",
"AgvInLoc": "A01", "AgvInLoc": "A01",
"AgvOutLoc": "B01" "AgvOutLoc": "B01"

3
src/WmsWebApi.EntityFrameworkCore/EntityFrameworkCore/WmsWebApiJsonDbContext.cs

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
@ -37,6 +38,8 @@ namespace WmsWebApi.EntityFrameworkCore
{ {
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureBackgroundJobs();
var options = new WmsWebApiModelBuilderConfigurationOptions(WmsWebApiDbProperties.DbTablePrefix,WmsWebApiDbProperties.DbSchema); var options = new WmsWebApiModelBuilderConfigurationOptions(WmsWebApiDbProperties.DbTablePrefix,WmsWebApiDbProperties.DbSchema);
modelBuilder.Entity<WmsWebApiBOMDTO>(b => modelBuilder.Entity<WmsWebApiBOMDTO>(b =>

445
src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/20230309060032_202303091400.Designer.cs

@ -0,0 +1,445 @@
// <auto-generated />
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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsAbandoned")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("JobArgs")
.IsRequired()
.HasMaxLength(1048576)
.HasColumnType("nvarchar(max)");
b.Property<string>("JobName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<DateTime?>("LastTryTime")
.HasColumnType("datetime2");
b.Property<DateTime>("NextTryTime")
.HasColumnType("datetime2");
b.Property<byte>("Priority")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint")
.HasDefaultValue((byte)15);
b.Property<short>("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<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<decimal?>("BMENG")
.HasColumnType("decimal(18,2)");
b.Property<string>("DATUV")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("LOEKZ")
.HasColumnType("nvarchar(max)");
b.Property<string>("MAKTX")
.HasColumnType("nvarchar(max)");
b.Property<string>("MATNR")
.HasColumnType("nvarchar(max)");
b.Property<string>("STLAL")
.HasColumnType("nvarchar(max)");
b.Property<string>("STLAN")
.HasColumnType("nvarchar(max)");
b.Property<string>("STLST")
.HasColumnType("nvarchar(max)");
b.Property<string>("WERKS")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiBOMJsons");
});
modelBuilder.Entity("WmsWebApi.Domain.WmsWebApiProductRecieveDTO", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("AccountDate")
.HasColumnType("nvarchar(max)");
b.Property<string>("BillTime")
.HasColumnType("nvarchar(max)");
b.Property<string>("BillType")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<string>("GUID")
.HasColumnType("nvarchar(max)");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("OperName")
.HasColumnType("nvarchar(max)");
b.Property<string>("ReceiveDate")
.HasColumnType("nvarchar(max)");
b.Property<string>("SourceBillNum")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiProductRecieveJsons");
});
modelBuilder.Entity("WmsWebApi.Domain.WmsWebApiStockMoveDTO", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("AccountDate")
.HasColumnType("nvarchar(max)");
b.Property<string>("BillTime")
.HasColumnType("nvarchar(max)");
b.Property<string>("BillType")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<string>("GUID")
.HasColumnType("nvarchar(max)");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("OperName")
.HasColumnType("nvarchar(max)");
b.Property<string>("ReceiveDate")
.HasColumnType("nvarchar(max)");
b.Property<string>("SourceBillNum")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiStockMoveJsons");
});
modelBuilder.Entity("WmsWebApi.OtherZll.WmsWebApiOtherZLLDTO", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("MBLNR")
.HasColumnType("nvarchar(max)");
b.Property<string>("MJAHR")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZLLDJ")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZLLR")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiOtherZllJsons");
});
modelBuilder.Entity("WmsWebApi.PPlan.WmsWebApiPPLANDTO", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("DISPO")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<decimal>("GSMNG")
.HasColumnType("decimal(18,2)");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("KAPTPROG")
.HasColumnType("nvarchar(max)");
b.Property<string>("MAKTX")
.HasColumnType("nvarchar(max)");
b.Property<string>("MATNR")
.HasColumnType("nvarchar(max)");
b.Property<string>("PEDTR")
.HasColumnType("nvarchar(max)");
b.Property<string>("SCHGRUP")
.HasColumnType("nvarchar(max)");
b.Property<string>("VERID")
.HasColumnType("nvarchar(max)");
b.Property<string>("WERKS")
.HasColumnType("nvarchar(max)");
b.Property<string>("XUBNAME")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZBZSM")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZCDATE")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZCTIME")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZMACD")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZMATX")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZSCSX")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiPPlanJsons");
});
modelBuilder.Entity("WmsWebApi.Parts.WmsWebApiPARTDTO", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("DISGR")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<string>("GROES")
.HasColumnType("nvarchar(max)");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("MAKTX")
.HasColumnType("nvarchar(max)");
b.Property<string>("MAKTX1")
.HasColumnType("nvarchar(max)");
b.Property<string>("MATKL")
.HasColumnType("nvarchar(max)");
b.Property<string>("MATNR")
.HasColumnType("nvarchar(max)");
b.Property<string>("MBRSH")
.HasColumnType("nvarchar(max)");
b.Property<string>("MEINS")
.HasColumnType("nvarchar(max)");
b.Property<string>("MTART")
.HasColumnType("nvarchar(max)");
b.Property<string>("VTWEG")
.HasColumnType("nvarchar(max)");
b.Property<string>("WERKS")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZTEXT22")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiPartJsons");
});
modelBuilder.Entity("WmsWebApi.Purchase.WmsWebApiPURCHASEDTO", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("BUDAT")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("MBLNR")
.HasColumnType("nvarchar(max)");
b.Property<string>("MJAHR")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiPurchaseJsons");
});
modelBuilder.Entity("WmsWebApi.ZlldcjLogs.WmsWebApiZLLDCJDTO", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DYSJ")
.HasColumnType("datetime2");
b.Property<int>("EnumRetryStatus")
.HasColumnType("int");
b.Property<string>("ITYPE")
.HasColumnType("nvarchar(max)");
b.Property<string>("JSON")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZDJLX")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZLLDJ")
.HasColumnType("nvarchar(max)");
b.Property<string>("ZLTLX")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("WmsWebApiZlldcjLogJsons");
});
#pragma warning restore 612, 618
}
}
}

43
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<Guid>(type: "uniqueidentifier", nullable: false),
JobName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
JobArgs = table.Column<string>(type: "nvarchar(max)", maxLength: 1048576, nullable: false),
TryCount = table.Column<short>(type: "smallint", nullable: false, defaultValue: (short)0),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
NextTryTime = table.Column<DateTime>(type: "datetime2", nullable: false),
LastTryTime = table.Column<DateTime>(type: "datetime2", nullable: true),
IsAbandoned = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
Priority = table.Column<byte>(type: "tinyint", nullable: false, defaultValue: (byte)15),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(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");
}
}
}

58
src/WmsWebApi.EntityFrameworkCore/Migrations/WmsWebApiJsonDb/WmsWebApiJsonDbContextModelSnapshot.cs

@ -21,6 +21,64 @@ namespace WmsWebApi.Migrations.WmsWebApiJsonDb
.HasAnnotation("ProductVersion", "5.0.17") .HasAnnotation("ProductVersion", "5.0.17")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsAbandoned")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("JobArgs")
.IsRequired()
.HasMaxLength(1048576)
.HasColumnType("nvarchar(max)");
b.Property<string>("JobName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<DateTime?>("LastTryTime")
.HasColumnType("datetime2");
b.Property<DateTime>("NextTryTime")
.HasColumnType("datetime2");
b.Property<byte>("Priority")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint")
.HasDefaultValue((byte)15);
b.Property<short>("TryCount")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValue((short)0);
b.HasKey("Id");
b.HasIndex("IsAbandoned", "NextTryTime");
b.ToTable("AbpBackgroundJobs");
});
modelBuilder.Entity("WmsWebApi.Boms.WmsWebApiBOMDTO", b => modelBuilder.Entity("WmsWebApi.Boms.WmsWebApiBOMDTO", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")

1
src/WmsWebApi.EntityFrameworkCore/WmsWebApi.EntityFrameworkCore.csproj

@ -10,6 +10,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.14" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.14" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.14" />
<PackageReference Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="4.4.4" />
<PackageReference Include="Volo.Abp.Dapper" Version="4.4.4" /> <PackageReference Include="Volo.Abp.Dapper" Version="4.4.4" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="4.4.4" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="4.4.4" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="4.4.4" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="4.4.4" />

Loading…
Cancel
Save