Răsfoiți Sursa

修复数据库GC错误,生成新的迁移点,完善新增数据面板

Administrator 2 ani în urmă
părinte
comite
d9f13ad0ff

+ 1 - 1
DBHelper/DB.cs

@@ -221,7 +221,7 @@ namespace DBHelper
                 ctx.Dispose();
             }
             Contexts.Clear();
-            Contexts = null;
+            //Contexts = null;
         }
     }
 

BIN
DLL/PLC.Siemens.dll


+ 14 - 0
Projects/永冠/WCS.Entity.Protocol/DeviceData.cs

@@ -35,6 +35,20 @@ namespace WCS.Entity.Protocol
         [DataMember(Order = 4)]
         public WCS_RGV523 D523 { get; set; } 
     }
+
+    /// <summary>
+    /// 双工位RGV
+    /// </summary>
+    [DataContract]
+    public class DRGVData : DeviceData
+    {
+        [DataMember(Order = 5)]
+        public WCS_DRGV520 D520 { get; set; }
+        [DataMember(Order = 3)]
+        public WCS_DRGV521 D521 { get; set; }
+        [DataMember(Order = 4)]
+        public WCS_DRGV523 D523 { get; set; }
+    }
     [DataContract]
     public class SCData : DeviceData
     {

+ 2097 - 0
Projects/永冠/WCS.Service/Migrations/20221003063033_双工位RGV.Designer.cs

@@ -0,0 +1,2097 @@
+// <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 WCS.Service;
+
+namespace WCS.Service.Migrations
+{
+    [DbContext(typeof(WCSDB))]
+    [Migration("20221003063033_双工位RGV")]
+    partial class 双工位RGV
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("Relational:MaxIdentifierLength", 128)
+                .HasAnnotation("ProductVersion", "5.0.5")
+                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_AGVTask", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("AGVID")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<int>("AGVStatus")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime?>("AGVUpdateTime")
+                        .HasColumnType("datetime2");
+
+                    b.Property<DateTime>("CreateTime")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("Position")
+                        .IsRequired()
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<string>("Station")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<int>("Status")
+                        .HasColumnType("int");
+
+                    b.Property<int>("TaskType")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime?>("UpdateTime")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("Workshop")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.ToTable("WCS_AGVTask");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_BCR80", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("CONTENT")
+                        .HasMaxLength(200)
+                        .HasColumnType("nvarchar(200)");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_BCR80");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV520", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("DestPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("DestPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("PRIORITY_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("PRIORITY_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES1_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES1_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("StartPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("StartPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID_1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("TaskID_2")
+                        .HasColumnType("int");
+
+                    b.Property<short>("TaskType_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("TaskType_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Trigger_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Trigger_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.Property<short>("res2_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("res2_2")
+                        .HasColumnType("smallint");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_DRGV520");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV521", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<short>("ACT_V_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("ACT_V_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("DestPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("DestPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("Finish_1")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("Finish_2")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<float>("Mileage")
+                        .HasColumnType("real");
+
+                    b.Property<bool>("PH_Status_1")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("PH_Status_2")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("PRIORITY_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("PRIORITY_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<float>("Position")
+                        .HasColumnType("real");
+
+                    b.Property<short>("RES")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES2_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES2_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<float>("Runtime")
+                        .HasColumnType("real");
+
+                    b.Property<short>("StartPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("StartPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SystemStatus")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID_1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("TaskID_2")
+                        .HasColumnType("int");
+
+                    b.Property<short>("TaskType_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("TaskType_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ToSition_1")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("ToSition_2")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.Property<short>("WorkMode")
+                        .HasColumnType("smallint");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_DRGV521");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV523", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("Fault")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Fault1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Fault2")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("Status")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Status1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Status2")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_DRGV523");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_MAPPINGENTRY", b =>
+                {
+                    b.Property<int>("MEP_ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<bool>("MEP_ISSTOP")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("MEP_MAPPINGCHNAME")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<int>("MEP_MAPPINGNO")
+                        .HasColumnType("int");
+
+                    b.Property<string>("MEP_MAPPINGTYPE")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.HasKey("MEP_ID");
+
+                    b.ToTable("WCS_MAPPINGENTRY");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RGV520", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("DestPosition")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<short>("FinishedACK")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("PRIORITY")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("StartPosition")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID")
+                        .HasColumnType("int");
+
+                    b.Property<short>("TaskType")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Trigger")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_RGV520");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RGV521", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<short>("ACT_V")
+                        .HasColumnType("smallint");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("DestPosition")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("Finish")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<float>("Mileage")
+                        .HasColumnType("real");
+
+                    b.Property<bool>("PH_Status")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("PRIORITY")
+                        .HasColumnType("smallint");
+
+                    b.Property<float>("Position")
+                        .HasColumnType("real");
+
+                    b.Property<short>("RES")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES2")
+                        .HasColumnType("smallint");
+
+                    b.Property<float>("Runtime")
+                        .HasColumnType("real");
+
+                    b.Property<short>("StartPosition")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SystemStatus")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID")
+                        .HasColumnType("int");
+
+                    b.Property<short>("TaskType")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ToSition")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.Property<short>("WorkMode")
+                        .HasColumnType("smallint");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_RGV521");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RGV523", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("Fault")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Fault1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Fault2")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("Status")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Status1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Status2")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_RGV523");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_Robot", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("FinishedTask")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("Mode")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Status")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Target")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID")
+                        .HasColumnType("int");
+
+                    b.Property<short>("Trigger")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_Robot");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RobotStation", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<int>("DocId")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("MaxQty")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("PalletType")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Qty")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_RobotStation");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_SC520", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("ECol")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("EDepth")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("ELayer")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("ELine")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("Endnumber2")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<short>("FinishedACK")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("GoodsType")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Handshake")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("SCol")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SDepth")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SLayer")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SLine")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SpeedMode")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Startnumber1")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID")
+                        .HasColumnType("int");
+
+                    b.Property<short>("Trigger")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_SC520");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_SC521", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<bool>("Alarm")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("Col")
+                        .HasColumnType("smallint");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("ECol")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("EDepth")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("ELayer")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("ELine")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("Endnumber2")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("FinishedTask")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ForkCenter")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("ForkPos")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("GetFinishi")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("GoodsType")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("Handshake")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("Layer")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("LiftPos")
+                        .HasColumnType("int");
+
+                    b.Property<short>("Line")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("Loaded")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("Mode")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("PutFinishi")
+                        .HasColumnType("bit");
+
+                    b.Property<byte>("RES")
+                        .HasColumnType("tinyint");
+
+                    b.Property<float>("Runtime")
+                        .HasColumnType("real");
+
+                    b.Property<short>("SCol")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SDepth")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SLayer")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SLine")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Status")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("TaskFinishi")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("TaskID")
+                        .HasColumnType("int");
+
+                    b.Property<float>("TotalKM")
+                        .HasColumnType("real");
+
+                    b.Property<int>("TravelPos")
+                        .HasColumnType("int");
+
+                    b.Property<short>("Trigger")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Tunnel")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_SC521");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_SC537", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<decimal>("SCAlarm")
+                        .HasColumnType("decimal(20,0)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_SC537");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_STATION520", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<bool>("CONFIRM")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("GOODSCODE")
+                        .HasColumnType("int");
+
+                    b.Property<short>("GOODSEND")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("GOODSSIZE")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("GOODSSTART")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("GOODSTYPE")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("HEIGHT")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("RES")
+                        .HasColumnType("bit");
+
+                    b.Property<byte>("RES2")
+                        .HasColumnType("tinyint");
+
+                    b.Property<int>("TASKNUM")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_STATION520");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_STATION521", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<bool>("BCR_NOREAD")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("B_OUTSIDE")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("F_OUTSIDE")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("GOODSCODE")
+                        .HasColumnType("int");
+
+                    b.Property<short>("GOODSEND")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("GOODSSIZE")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("GOODSSTART")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("GOODSTYPE")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("GOODS_ERR")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("HEIGHT")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("H_OUTSIDE")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("L_OUTSIDE")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("OVERLOAD")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("PH_STATUS")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("PH_STATUS2")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("REQUEST")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("RES")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("RES1")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("RES2")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("RES4")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("RES5")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("R_OUTSIDE")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("TASKNUM")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_STATION521");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_STATION523", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<long>("Fault")
+                        .HasColumnType("bigint");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<float>("RunTime")
+                        .HasColumnType("real");
+
+                    b.Property<short>("Status")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_STATION523");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_StatusLog", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("NewStatus")
+                        .HasColumnType("int");
+
+                    b.Property<string>("Node")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<int>("OldStatus")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCS_TASKID")
+                        .HasColumnType("int");
+
+                    b.Property<int>("upStatus")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.ToTable("WCS_StatusLog");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_SystemConfig", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("Code")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Describe")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Direction")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("TUNNEL")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("ID");
+
+                    b.ToTable("WCS_SystemConfig");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_Users", b =>
+                {
+                    b.Property<string>("USER_NO")
+                        .HasMaxLength(128)
+                        .HasColumnType("nvarchar(128)");
+
+                    b.Property<string>("USER_PWD")
+                        .IsRequired()
+                        .HasMaxLength(128)
+                        .HasColumnType("nvarchar(128)");
+
+                    b.Property<byte[]>("USER_TEXT")
+                        .HasColumnType("varbinary(max)");
+
+                    b.HasKey("USER_NO");
+
+                    b.ToTable("WCS_Users");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_CMD", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICE_CODE")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("PROPERTY")
+                        .HasMaxLength(32)
+                        .HasColumnType("nvarchar(32)");
+
+                    b.Property<string>("PROTOCOL")
+                        .HasMaxLength(256)
+                        .HasColumnType("nvarchar(256)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<string>("VALUE")
+                        .HasMaxLength(512)
+                        .HasColumnType("nvarchar(512)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.ToTable("WCS_CMD");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_DATABLOCK", b =>
+                {
+                    b.Property<string>("CODE")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<int>("DATALENGTH")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("LENGTH")
+                        .HasColumnType("int");
+
+                    b.Property<string>("NAME")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<int>("NO")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("NOUPDATE")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("PLCCODE")
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<string>("PROTOCOL")
+                        .IsRequired()
+                        .HasMaxLength(200)
+                        .HasColumnType("nvarchar(200)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("CODE");
+
+                    b.HasIndex("PLCCODE");
+
+                    b.ToTable("WCS_DATABLOCK");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_DEVICE", b =>
+                {
+                    b.Property<string>("CODE")
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("NAME")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("CODE");
+
+                    b.ToTable("WCS_DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_DEVICEPROTOCOL", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DBCODE")
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<string>("DEVICECODE")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("POSITION")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DBCODE");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_DEVICEPROTOCOL");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_EXCEPTION", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("MSG")
+                        .HasMaxLength(1000)
+                        .HasColumnType("nvarchar(1000)");
+
+                    b.Property<DateTime>("STARTTIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("TIMES")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("ID");
+
+                    b.ToTable("WCS_EXCEPTION");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_PATH", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("ENDCODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<string>("PATH")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("STARTCODE")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("ENDCODE");
+
+                    b.HasIndex("STARTCODE");
+
+                    b.ToTable("WCS_PATH");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_PATHPOINT", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("ENDCODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<string>("NEXTCODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<string>("PREVCODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<string>("STARTCODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.HasIndex("ENDCODE");
+
+                    b.HasIndex("NEXTCODE");
+
+                    b.HasIndex("PREVCODE");
+
+                    b.HasIndex("STARTCODE");
+
+                    b.ToTable("WCS_PATHPOINT");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_PLC", b =>
+                {
+                    b.Property<string>("CODE")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("IP")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<string>("MODEL")
+                        .HasMaxLength(10)
+                        .HasColumnType("nvarchar(10)");
+
+                    b.Property<string>("NAME")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<int>("PORT")
+                        .HasColumnType("int");
+
+                    b.Property<int>("RACK")
+                        .HasColumnType("int");
+
+                    b.Property<int>("SLOT")
+                        .HasColumnType("int");
+
+                    b.Property<int>("TYPE")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("CODE");
+
+                    b.ToTable("WCS_PLC");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_ROUTE", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("NEXTCODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.HasIndex("NEXTCODE");
+
+                    b.ToTable("WCS_ROUTE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_TASK", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("ADDRFROM")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<string>("ADDRNEXT")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<string>("ADDRTO")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<int>("AgvTask")
+                        .HasColumnType("int");
+
+                    b.Property<string>("BARCODE")
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<DateTime>("CREATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("DEVICE")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<int>("DOCID")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime?>("ENDTIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("FLOOR")
+                        .HasColumnType("int");
+
+                    b.Property<short>("FULLQTY")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("GROUPTASK")
+                        .HasColumnType("int");
+
+                    b.Property<short>("HEIGHT")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("PALLETTYPE")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("PRODLINE")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("Priority")
+                        .HasColumnType("int");
+
+                    b.Property<string>("SCSTATION")
+                        .HasMaxLength(20)
+                        .HasColumnType("nvarchar(20)");
+
+                    b.Property<DateTime?>("STARTTIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("STATUS")
+                        .HasColumnType("int");
+
+                    b.Property<string>("TUNNEL")
+                        .HasMaxLength(10)
+                        .HasColumnType("nvarchar(10)");
+
+                    b.Property<int>("TYPE")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<int>("UPLOADED")
+                        .HasColumnType("int");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WMSTASK")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.ToTable("WCS_TASK");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_BCR80", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV520", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV521", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV523", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RGV520", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RGV521", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RGV523", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_Robot", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_RobotStation", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_SC520", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_SC521", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_SC537", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_STATION520", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_STATION521", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_STATION523", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_DATABLOCK", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_PLC", "PLC")
+                        .WithMany()
+                        .HasForeignKey("PLCCODE");
+
+                    b.Navigation("PLC");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_DEVICEPROTOCOL", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DATABLOCK", "DB")
+                        .WithMany()
+                        .HasForeignKey("DBCODE");
+
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany("PROTOCOLS")
+                        .HasForeignKey("DEVICECODE")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("DB");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_PATH", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "END")
+                        .WithMany()
+                        .HasForeignKey("ENDCODE");
+
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "START")
+                        .WithMany("PATHS")
+                        .HasForeignKey("STARTCODE")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("END");
+
+                    b.Navigation("START");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_PATHPOINT", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "END")
+                        .WithMany()
+                        .HasForeignKey("ENDCODE");
+
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "NEXT")
+                        .WithMany()
+                        .HasForeignKey("NEXTCODE");
+
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "PREV")
+                        .WithMany()
+                        .HasForeignKey("PREVCODE");
+
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "START")
+                        .WithMany()
+                        .HasForeignKey("STARTCODE");
+
+                    b.Navigation("DEVICE");
+
+                    b.Navigation("END");
+
+                    b.Navigation("NEXT");
+
+                    b.Navigation("PREV");
+
+                    b.Navigation("START");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_ROUTE", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany("ROUTES")
+                        .HasForeignKey("DEVICECODE")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "NEXT")
+                        .WithMany()
+                        .HasForeignKey("NEXTCODE");
+
+                    b.Navigation("DEVICE");
+
+                    b.Navigation("NEXT");
+                });
+
+            modelBuilder.Entity("WCS.Entity.WCS_DEVICE", b =>
+                {
+                    b.Navigation("PATHS");
+
+                    b.Navigation("PROTOCOLS");
+
+                    b.Navigation("ROUTES");
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}

+ 164 - 0
Projects/永冠/WCS.Service/Migrations/20221003063033_双工位RGV.cs

@@ -0,0 +1,164 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace WCS.Service.Migrations
+{
+    public partial class 双工位RGV : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "WCS_DRGV520",
+                columns: table => new
+                {
+                    ID = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    TaskID_1 = table.Column<int>(type: "int", nullable: false),
+                    TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
+                    StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
+                    DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
+                    PRIORITY_1 = table.Column<short>(type: "smallint", nullable: false),
+                    RES1_1 = table.Column<short>(type: "smallint", nullable: false),
+                    res2_1 = table.Column<short>(type: "smallint", nullable: false),
+                    Trigger_1 = table.Column<short>(type: "smallint", nullable: false),
+                    TaskID_2 = table.Column<int>(type: "int", nullable: false),
+                    TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
+                    StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
+                    DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
+                    PRIORITY_2 = table.Column<short>(type: "smallint", nullable: false),
+                    RES1_2 = table.Column<short>(type: "smallint", nullable: false),
+                    res2_2 = table.Column<short>(type: "smallint", nullable: false),
+                    Trigger_2 = table.Column<short>(type: "smallint", nullable: false),
+                    ENABLED = table.Column<bool>(type: "bit", nullable: false),
+                    UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
+                    UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
+                    DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
+                    FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    ISLAST = table.Column<bool>(type: "bit", nullable: false),
+                    WCSVERSION = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_WCS_DRGV520", x => x.ID);
+                    table.ForeignKey(
+                        name: "FK_WCS_DRGV520_WCS_DEVICE_DEVICECODE",
+                        column: x => x.DEVICECODE,
+                        principalTable: "WCS_DEVICE",
+                        principalColumn: "CODE",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "WCS_DRGV521",
+                columns: table => new
+                {
+                    ID = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    TaskID_1 = table.Column<int>(type: "int", nullable: false),
+                    TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
+                    StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
+                    DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
+                    PRIORITY_1 = table.Column<short>(type: "smallint", nullable: false),
+                    ACT_V_1 = table.Column<short>(type: "smallint", nullable: false),
+                    RES2_1 = table.Column<short>(type: "smallint", nullable: false),
+                    PH_Status_1 = table.Column<bool>(type: "bit", nullable: false),
+                    ToSition_1 = table.Column<bool>(type: "bit", nullable: false),
+                    Finish_1 = table.Column<bool>(type: "bit", nullable: false),
+                    TaskID_2 = table.Column<int>(type: "int", nullable: false),
+                    TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
+                    StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
+                    DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
+                    PRIORITY_2 = table.Column<short>(type: "smallint", nullable: false),
+                    ACT_V_2 = table.Column<short>(type: "smallint", nullable: false),
+                    RES2_2 = table.Column<short>(type: "smallint", nullable: false),
+                    PH_Status_2 = table.Column<bool>(type: "bit", nullable: false),
+                    ToSition_2 = table.Column<bool>(type: "bit", nullable: false),
+                    Finish_2 = table.Column<bool>(type: "bit", nullable: false),
+                    SystemStatus = table.Column<short>(type: "smallint", nullable: false),
+                    WorkMode = table.Column<short>(type: "smallint", nullable: false),
+                    RES = table.Column<short>(type: "smallint", nullable: false),
+                    Position = table.Column<float>(type: "real", nullable: false),
+                    Mileage = table.Column<float>(type: "real", nullable: false),
+                    Runtime = table.Column<float>(type: "real", nullable: false),
+                    ENABLED = table.Column<bool>(type: "bit", nullable: false),
+                    UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
+                    UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
+                    DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
+                    FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    ISLAST = table.Column<bool>(type: "bit", nullable: false),
+                    WCSVERSION = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_WCS_DRGV521", x => x.ID);
+                    table.ForeignKey(
+                        name: "FK_WCS_DRGV521_WCS_DEVICE_DEVICECODE",
+                        column: x => x.DEVICECODE,
+                        principalTable: "WCS_DEVICE",
+                        principalColumn: "CODE",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "WCS_DRGV523",
+                columns: table => new
+                {
+                    ID = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Fault = table.Column<int>(type: "int", nullable: false),
+                    Fault1 = table.Column<int>(type: "int", nullable: false),
+                    Fault2 = table.Column<int>(type: "int", nullable: false),
+                    Status = table.Column<int>(type: "int", nullable: false),
+                    Status1 = table.Column<int>(type: "int", nullable: false),
+                    Status2 = table.Column<int>(type: "int", nullable: false),
+                    DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
+                    ENABLED = table.Column<bool>(type: "bit", nullable: false),
+                    UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
+                    UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
+                    FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    ISLAST = table.Column<bool>(type: "bit", nullable: false),
+                    WCSVERSION = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_WCS_DRGV523", x => x.ID);
+                    table.ForeignKey(
+                        name: "FK_WCS_DRGV523_WCS_DEVICE_DEVICECODE",
+                        column: x => x.DEVICECODE,
+                        principalTable: "WCS_DEVICE",
+                        principalColumn: "CODE",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_WCS_DRGV520_DEVICECODE",
+                table: "WCS_DRGV520",
+                column: "DEVICECODE");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_WCS_DRGV521_DEVICECODE",
+                table: "WCS_DRGV521",
+                column: "DEVICECODE");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_WCS_DRGV523_DEVICECODE",
+                table: "WCS_DRGV523",
+                column: "DEVICECODE");
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "WCS_DRGV520");
+
+            migrationBuilder.DropTable(
+                name: "WCS_DRGV521");
+
+            migrationBuilder.DropTable(
+                name: "WCS_DRGV523");
+        }
+    }
+}

+ 297 - 0
Projects/永冠/WCS.Service/Migrations/WCSDBModelSnapshot.cs

@@ -111,6 +111,276 @@ namespace WCS.Service.Migrations
                     b.ToTable("WCS_BCR80");
                 });
 
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV520", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("DestPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("DestPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("PRIORITY_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("PRIORITY_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES1_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES1_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("StartPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("StartPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID_1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("TaskID_2")
+                        .HasColumnType("int");
+
+                    b.Property<short>("TaskType_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("TaskType_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Trigger_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("Trigger_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.Property<short>("res2_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("res2_2")
+                        .HasColumnType("smallint");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_DRGV520");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV521", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<short>("ACT_V_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("ACT_V_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<short>("DestPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("DestPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("Finish_1")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("Finish_2")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<float>("Mileage")
+                        .HasColumnType("real");
+
+                    b.Property<bool>("PH_Status_1")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("PH_Status_2")
+                        .HasColumnType("bit");
+
+                    b.Property<short>("PRIORITY_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("PRIORITY_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<float>("Position")
+                        .HasColumnType("real");
+
+                    b.Property<short>("RES")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES2_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("RES2_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<float>("Runtime")
+                        .HasColumnType("real");
+
+                    b.Property<short>("StartPosition_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("StartPosition_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("SystemStatus")
+                        .HasColumnType("smallint");
+
+                    b.Property<int>("TaskID_1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("TaskID_2")
+                        .HasColumnType("int");
+
+                    b.Property<short>("TaskType_1")
+                        .HasColumnType("smallint");
+
+                    b.Property<short>("TaskType_2")
+                        .HasColumnType("smallint");
+
+                    b.Property<bool>("ToSition_1")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("ToSition_2")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.Property<short>("WorkMode")
+                        .HasColumnType("smallint");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_DRGV521");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV523", b =>
+                {
+                    b.Property<int>("ID")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("int")
+                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+                    b.Property<string>("DEVICECODE")
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<bool>("ENABLED")
+                        .HasColumnType("bit");
+
+                    b.Property<DateTime>("FRAME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("Fault")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Fault1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Fault2")
+                        .HasColumnType("int");
+
+                    b.Property<bool>("ISLAST")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("Status")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Status1")
+                        .HasColumnType("int");
+
+                    b.Property<int>("Status2")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("UPDATETIME")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("UPDATEUSER")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<byte[]>("VER")
+                        .IsConcurrencyToken()
+                        .ValueGeneratedOnAddOrUpdate()
+                        .HasColumnType("rowversion");
+
+                    b.Property<int>("WCSVERSION")
+                        .HasColumnType("int");
+
+                    b.HasKey("ID");
+
+                    b.HasIndex("DEVICECODE");
+
+                    b.ToTable("WCS_DRGV523");
+                });
+
             modelBuilder.Entity("WCS.Entity.Protocol.WCS_MAPPINGENTRY", b =>
                 {
                     b.Property<int>("MEP_ID")
@@ -1592,6 +1862,33 @@ namespace WCS.Service.Migrations
                     b.Navigation("DEVICE");
                 });
 
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV520", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV521", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
+            modelBuilder.Entity("WCS.Entity.Protocol.WCS_DRGV523", b =>
+                {
+                    b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")
+                        .WithMany()
+                        .HasForeignKey("DEVICECODE");
+
+                    b.Navigation("DEVICE");
+                });
+
             modelBuilder.Entity("WCS.Entity.Protocol.WCS_RGV520", b =>
                 {
                     b.HasOne("WCS.Entity.WCS_DEVICE", "DEVICE")

+ 21 - 13
Projects/永冠/WCS.Service/ProtocolProxy.cs

@@ -25,7 +25,7 @@ namespace WCS.Service
         MethodInfo SetMethod;
         public ProtocolProxy(string id, WCS_DATABLOCK db, ushort start, WCS_DEVICEPROTOCOL protocol) : base(id, db, start, protocol)
         {
-            SetMethod = typeof(DbContext).GetMethod("Set", new Type[] { }).MakeGenericMethod(this.ProtocolDataType); 
+            SetMethod = typeof(DbContext).GetMethod("Set", new Type[] { }).MakeGenericMethod(this.ProtocolDataType);
         }
 
         static ConcurrentDictionary<Type, object[]> LastDatas = new ConcurrentDictionary<Type, object[]>();
@@ -111,7 +111,7 @@ namespace WCS.Service
             Redis = new RedisClient("212.64.66.35,database=11");
             Redis.Serialize = obj =>
             {
-                var bytes = MessagePackSerializer.Serialize(obj); 
+                var bytes = MessagePackSerializer.Serialize(obj);
                 return bytes;
             };
             Redis.DeserializeRaw = (bytes, type) =>
@@ -133,21 +133,29 @@ namespace WCS.Service
         }
 
         //static ConcurrentDictionary<string, DeviceData> Datas = new ConcurrentDictionary<string, DeviceData>();
-        public override void Publish(string code,WCS_PROTOCOLDATA obj)
-        { 
+        public override void Publish(string code, WCS_PROTOCOLDATA obj)
+        {
             try
             {
                 var Datas = AllDatas;
                 if (code.StartsWith("SC"))
                 {
                     if (!Datas.ContainsKey(code))
-                        Datas[code] = new SCData { Code=code }; 
+                        Datas[code] = new SCData { Code = code };
                 }
                 else if (code.StartsWith("RGV"))
                 {
-                    if (!Datas.ContainsKey(code))
-                        Datas[code] = new RGVData { Code = code };
-                } 
+                    if (code is "RGV4" or "RGV6")
+                    {
+                        if (!Datas.ContainsKey(code))
+                            Datas[code] = new DRGVData { Code = code };
+                    }
+                    else
+                    {
+                        if (!Datas.ContainsKey(code))
+                            Datas[code] = new RGVData { Code = code };
+                    }
+                }
                 else if (code == "Robot")
                 {
                     if (!Datas.ContainsKey(code))
@@ -167,7 +175,7 @@ namespace WCS.Service
                     {
                         Console.WriteLine("类型" + data.GetType().Name + "不包含类型为" + obj.GetType().Name + "的属性");
                     }
-                    else 
+                    else
                     {
                         p.SetValue(data, obj);
                     }
@@ -218,9 +226,9 @@ namespace WCS.Service
                     var type = typeof(DeviceDataCollection<>).MakeGenericType(etype);
                     var coll = Activator.CreateInstance(type, LogicHandler.Frame, value);
                     var p = pack.GetType().GetProperties().Where(v => v.PropertyType == type).First();
-                    p.SetValue(pack, coll); 
+                    p.SetValue(pack, coll);
                 }
-                 
+
 
                 var sw = new Stopwatch();
                 sw.Start();
@@ -248,7 +256,7 @@ namespace WCS.Service
 
                 foreach (var data in AllDatas)
                 {
-                   // LastInfo[data.Key] = data.Value.Info;
+                    // LastInfo[data.Key] = data.Value.Info;
                     data.Value.Info = "";
                     if (data.Value is ProdLineData)
                     {
@@ -265,7 +273,7 @@ namespace WCS.Service
             }
             //Datas.Clear();
         }
-         
+
     }
 
     public class PackInfo