diff --git a/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo b/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo index e8279221..69a5d128 100644 Binary files a/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo and b/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo differ diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211221015126_init.Designer.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211221015126_init.Designer.cs new file mode 100644 index 00000000..7b1849f6 --- /dev/null +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211221015126_init.Designer.cs @@ -0,0 +1,10990 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Win.Sfs.SettleAccount; + +namespace Win.Sfs.SettleAccount.Migrations +{ + [DbContext(typeof(SettleAccountHttpApiHostMigrationsDbContext))] + [Migration("20211221015126_init")] + partial class init + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.8") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarConsigns.BTCarConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "KBCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarconsign"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarKBs.BTCarKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryDateTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("NeedQty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("OrderKBCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ReceiveAreaCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ReceiveAreaName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "OrderKBCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarSeqFirsts.BTCarSeqFirst", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BarCode") + .HasColumnType("nvarchar(450)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("VIN") + .HasColumnType("nvarchar(450)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "BarCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarseqfirst"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarSeqSeconds.BTCarSeqSecond", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BarCode") + .HasColumnType("nvarchar(450)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CMSerie") + .HasColumnType("nvarchar(max)"); + + b.Property("CMSerieRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CarModelShort") + .HasColumnType("nvarchar(max)"); + + b.Property("CarName") + .HasColumnType("nvarchar(max)"); + + b.Property("CarType") + .HasColumnType("nvarchar(max)"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("Color") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EngineCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InColor") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("OrderStateNum") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("PlanDate") + .HasColumnType("datetime2"); + + b.Property("PlanSeq") + .HasColumnType("int"); + + b.Property("PlanTypeRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SpecialCarTypeRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StateName") + .HasColumnType("nvarchar(max)"); + + b.Property("TopSeq") + .HasColumnType("nvarchar(max)"); + + b.Property("VIN") + .HasColumnType("nvarchar(450)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "BarCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarseqsecond"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarSeqs.BTCarSeq", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BarCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("VIN") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "BarCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarseq"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_not_kb_consign_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryDateTime") + .HasColumnType("datetime2"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasColumnType("nvarchar(450)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("NeedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("OrderKBCode") + .HasColumnType("nvarchar(450)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "CustomCode", "MaterialCode", "OrderKBCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_not_kb_consign_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_seq_kb_diff_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(450)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBQty") + .HasColumnType("decimal(18,2)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SeqQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "DT", "CustomCode", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_seq_kb_diff_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Boms.Bom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BomLevel") + .HasColumnType("int"); + + b.Property("BomType") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChildItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChildItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("ChildItemUom") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExpireTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssuePosition") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OperateProcess") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrapPercent") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ParentItemCode", "ChildItemCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bom"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Customers.Customer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Contact") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactEmail") + .HasColumnType("nvarchar(max)"); + + b.Property("ContactFax") + .HasColumnType("nvarchar(max)"); + + b.Property("ContactPhone") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrencyId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerType") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "Code") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_customer"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Customers.CustomerBom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChildItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FailureTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "CustomerCode", "ParentItemCode", "ChildItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_customer_bom"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarConsigns.BTCarConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarconsign_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarKBs.BTCarKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarSeqFirsts.BTCarSeqFirstVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarseqfirst_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarSeqSeconds.BTCarSeqSecondVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarseqsecond_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarSeqs.BTCarSeqVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarseq_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BT_Car.BT_Car_Platform", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptanceDate") + .HasColumnType("datetime2"); + + b.Property("BTCarKanBan") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalKanbanNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KanbanNumber") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialVoucherNo") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("StorageLocationDesc") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Supplier") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "KanbanNumber", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_BT_Car_Platform"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_bom_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CarMaterialConfigs.CarMaterialConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CarCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CarCode", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_carmaterialconfig"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CodeSettings.CodeSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Project") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Project", "Value") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_code"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Controls.CentralizedControl", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Year", "Period") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_control"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.EstimatedInventories.EstimatedInventoryVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_estinventory_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.EstimatedSums.EstimatedSum", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Postingperiod") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseDocument") + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseLine") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_estsum"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.EstimatedSums.EstimatedSumVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_estsum_verion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.FISes.FIS_TH", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("CP7Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChassisNumber2") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ErpMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Model") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChassisNumber2", "Version", "Model", "MaterialCode") + .IsUnique() + .HasFilter("[ChassisNumber2] IS NOT NULL AND [Model] IS NOT NULL"); + + b.ToTable("Set_fis_th"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Factories.Factory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Desc") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_factory"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("VIN") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_hqcon"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqcon_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQSpecConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("KBCodeExtend") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "KBCode", "KBCodeExtend", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_hqspcon"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQSpecConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqspcon_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("NeedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("VIN") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_hqkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQSpecKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("NeedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "KBCode", "Version") + .IsUnique() + .HasFilter("[MaterialCode] IS NOT NULL"); + + b.ToTable("Set_hqspkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQSpecKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqspkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_Platform", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptanceDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalKanbanNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HQHKanBan") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KanbanNumber") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialVoucherNo") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("StorageLocationDesc") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Supplier") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "HQHKanBan", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_HQ_H_Platform"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_PlatformVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_HQ_H_PlatformVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQ_M.HQ_M_Platform", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptanceDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalKanbanNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HQMKanBan") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KanbanNumber") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialVoucherNo") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("StorageLocationDesc") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Supplier") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "HQMKanBan", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_HQ_M_Platform"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQ_M.HQ_M_PlatformVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_HQ_M_PlatformVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.ImportMap.ImportColumnMap", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsCheck") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NewColumnName") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OldColumnName") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectName") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_importmap"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Inventories.InventoryDetailVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "Factory") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_inventory_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Invoices.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_Invoice"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Invoices.InvoiceVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_InvoiceVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.ItemInvoicePrices.ItemInvoicePrice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Backorder") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CC") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtendedMargin") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtendedPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Sales") + .HasColumnType("nvarchar(max)"); + + b.Property("SubAcct") + .HasColumnType("nvarchar(max)"); + + b.Property("UM") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Period", "Version", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_item_invoice_price"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.ItemInvoicePrices.ItemInvoicePriceVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_item_invoice_price_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.JFCarConsigns.JFCarConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_jfcarconsign_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.JFCarKBs.JFCarKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_jfcarkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.MaterialRelationships.MaterialRelationshipDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppraisalCategory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpMaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialProperty") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleMaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShipMaterailCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_MaterialRelationshipDetail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.MaterialRelationships.MaterialRelationshipVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_MaterialRelationshipVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Materials.Material", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimateType") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("EstimateTypeDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Unit") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_material"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceList"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecMatch.SecMatchBase", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("DiffPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Index") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsDiffNumber") + .HasColumnType("bit"); + + b.Property("IsSettle") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialPartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Model") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("RealSettlementNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("RealSettlementPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleMentPartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettlementNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("SettlementPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplyProportion") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("TheoreticalSettlementNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("UsedNumber") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SecMatchBase"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryAdjustment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerComponentCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("CustomerMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HasChanged") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("Total") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "CustomerComponentCode", "CustomerMaterialCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_adj"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryAdjustmentVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_adj_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryDiscount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HasChanged") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Total") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_dis"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryDiscountVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_dis_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryPriceRatio", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("CustomItemPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("CustomSubItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomSubItemPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplyProportion") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplyProportionPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_ratio"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryPriceRatioVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_ratio_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5A") + .HasColumnType("datetime2"); + + b.Property("CP7") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Model") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleYear") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementID") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SettlementSupplier") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("state") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("state"); + + b.HasIndex("Version", "ChassisNumber", "MaterialCode", "KENNCode"); + + b.ToTable("Set_Settle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccountVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_Settle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.UnSettleAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5A") + .HasColumnType("datetime2"); + + b.Property("CP7") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Model") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleYear") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementID") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SettlementSupplier") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("UnsettledReason") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("state") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("state"); + + b.HasIndex("Version", "ChassisNumber", "MaterialCode", "KENNCode") + .IsUnique(); + + b.ToTable("Set_Unsettle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.UnSettleAccountVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_Unsettle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementCrossReference.SettlementCrossReferenceVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SettlementCrossReference_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementCrossReferences.SettlementCrossReference", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BomMaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Model") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementMaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierDesc") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "SettlementMaterialCode", "BomMaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_SettlementCrossReference"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartsRef.SettlementPakAndSpareParts", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicableFunction") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpSparePartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ErpSparePartName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PerCarNum") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("ProductLine") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("QADCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("QuantityPrice") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementPartCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettlementPartDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplyProportion") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SettlementPakAndSpareParts"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartsRef.SettlementPakAndSparePartsVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SettlementPakAndSpareParts_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementParts.SettlementPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementPartCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SettlementPartDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Period", "CustomerCode", "Version", "SettlementPartCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_settlement_part"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementParts.SettlementPartVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_settlement_part_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.StorageLocations.CustomerStorageLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("CustomerDesc") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Storagelocation") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Storagelocation", "CustomerCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_customerlocation"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.TaskJob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DownFileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Email") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Error") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RealDownFileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("RealFileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceName") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("TaskId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TaskJob"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWKanBan.KanBanSettle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Batch") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Flag") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Kanban") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Relation") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("SettleInputDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "Kanban", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_KanBanSettle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWKanBan.KanBanVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_KanBanSettle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWScrapClaims.ScrapClaims", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_ScrapClaims"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWScrapClaims.ScrapClaimsVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_ScrapClaims_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWSparePart.SparePart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AmountNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("BatchNo") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryLineNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeliveryOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FactoryName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("GermanInvoiceNo") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("InvoicedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoItem") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoText") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchasePriceNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("PurchaseType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReceiptQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SpareDate") + .HasColumnType("datetime2"); + + b.Property("TaxCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Unit") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_SparePart"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_BT_Car_PlatformVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPutDetial", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChassisNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InPut") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KennCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialGroup") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("OutPut") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentMaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_WmsJitOutPutDetial"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanSettle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Batch") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryOrderNo") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Flag") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Kanban") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Relation") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("SettleInputDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("WMSActualGoodsDate") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliverGoodsState") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryNote") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WMSKanBanState") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "Kanban", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSKanBanSettle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSKanBanSettle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_SparePart.WMSSparePart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AmountNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("BatchNo") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryLineNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeliveryOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FactoryName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("GermanInvoiceNo") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("InvoicedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoItem") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoText") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchasePriceNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("PurchaseType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReceiptQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SpareDate") + .HasColumnType("datetime2"); + + b.Property("TaxCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Unit") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WMSDeliverGoodsState") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryNote") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSSparePartState") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSSparePart"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("InvoiceQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("MaterialDocument") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDocumentLine") + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PostingDate") + .HasColumnType("datetime2"); + + b.Property("PurchaseDocument") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseLine") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Source") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialDocument", "MaterialDocumentLine", "MaterialCode", "Version") + .IsUnique() + .HasFilter("[MaterialDocumentLine] IS NOT NULL"); + + b.ToTable("Set_estdetail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_estimate_stock_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationQty") + .HasColumnType("decimal(18,2)"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("EstimationTypeDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("FgQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("UnSettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_estimate_stock_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.FISes.FIS", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountDate") + .HasColumnType("datetime2"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("CP7Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChassisNumber2") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ErpMaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FISYear") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("KENNCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OrderBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleState") + .HasColumnType("int"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("UnSettleVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WMSBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSState") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChassisNumber2", "KENNCode"); + + b.HasIndex("ChassisNumber2", "Version", "KENNCode", "ItemCode"); + + b.ToTable("Set_fis"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.FISes.FISExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("CP7Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChassisNumber2") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ErpMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FISYear") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("KENNCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OrderBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleState") + .HasColumnType("int"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChassisNumber2", "Version", "Model", "ItemCode") + .IsUnique() + .HasFilter("[Model] IS NOT NULL"); + + b.ToTable("Set_fis_extend"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.FISes.FISVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_fis_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Inventories.InventoryDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppraisalCategory") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("AppraisalDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndingInventoryQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("InputQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("OpeningInventoryQty") + .HasColumnType("decimal(18,2)"); + + b.Property("OutputQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("StorageLocationDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Unit") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "MaterialCode", "StorageLocation") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_inventory"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFCarConsigns.JFCarConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PABillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "PABillNum", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jfcarconsign"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFCarKBs.JFCarKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InStockQty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "BillNum", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jfcarkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jf_not_kb_consign_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasColumnType("nvarchar(450)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("InStockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasColumnType("nvarchar(450)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId", "Version", "CustomCode", "MaterialCode", "BillNum") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jf_not_kb_consign_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.MaterialRelationships.MaterialRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppraisalCategory") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("MaterialProperty") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ShipMaterailCode") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ErpMaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_relationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Prebatches.Prebatch", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CarCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("YearKennCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_prebatch"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs.InvoiceSettledDiff", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP7ScrapQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ClaimQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("InvoiceAmt") + .HasColumnType("decimal(18,2)"); + + b.Property("InvoicePrice") + .HasColumnType("decimal(18,2)"); + + b.Property("InvoiceQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SalePrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SapMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SapMaterialGroup") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_InvoiceSettledDiff"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs.InvoiceSettledDiffVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CustomCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CustomName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ProjectName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_InvoiceSettledDiffVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_adjustment_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomSubItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomSubItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomSubItemPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("CustomSubItemSumQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpSubItemActualQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ErpSubItemCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErpSubItemQty") + .HasColumnType("decimal(18,2)"); + + b.Property("HasChanged") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OfflineQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SumPriceNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("SumPriceWithTax") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplyProportion") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_adjustment_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_diff_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActNoTaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ActPaymentPartyQty") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomSubItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomSubItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpSubItemCode") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StaPaymentPartyQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdNoTaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_diff_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BeginVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("EndVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_send_unsettled_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("ChassisNumber2") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FISYear") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("KENNCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentId", "Version", "ChassisNumber", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_send_unsettled_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_fis_diff_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("FisQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_fis_diff_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_settled_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("R3SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_settled_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_unsettled_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("FisUnSettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_unsettled_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SupplierItemSetUps.SupplierItemSetUp", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomerSupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ErpSupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ErpSupplierCode", "ErpItemCode", "CustomerSupplierCode", "CustomerCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_supplier_item_setup"); + }); + + modelBuilder.Entity("Win.Sfs.Shared.DomainBase.UpstreamDocument", b => + { + b.Property("UpstreamDocumentId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BTNotConsignReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("BTSeqKBDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("EstimatedStockDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("JFNotConsignReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("SecondaryActuralAdjustmentReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("SecondaryActuralDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("SendUnsettledDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("Seq") + .HasColumnType("int"); + + b.Property("StockFisDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("StockSettledDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("StockUnsettledDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("UpstreamDocumentNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("UpstreamDocumentType") + .HasColumnType("int"); + + b.HasKey("UpstreamDocumentId"); + + b.HasIndex("BTNotConsignReportId"); + + b.HasIndex("BTSeqKBDiffReportId"); + + b.HasIndex("EstimatedStockDiffReportId"); + + b.HasIndex("JFNotConsignReportId"); + + b.HasIndex("SecondaryActuralAdjustmentReportId"); + + b.HasIndex("SecondaryActuralDiffReportId"); + + b.HasIndex("SendUnsettledDiffReportId"); + + b.HasIndex("StockFisDiffReportId"); + + b.HasIndex("StockSettledDiffReportId"); + + b.HasIndex("StockUnsettledDiffReportId"); + + b.ToTable("UpstreamDocument"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", null) + .WithMany("BTNotConsignReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", null) + .WithMany("BTSeqKBDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", null) + .WithMany("EstimatedStockDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", null) + .WithMany("JFNotConsignReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", null) + .WithMany("SecondaryActuralAdjustmentReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", null) + .WithMany("SecondaryActuralDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", null) + .WithMany("StockFisDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", null) + .WithMany("StockSettledDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", null) + .WithMany("StockUnsettledDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.Shared.DomainBase.UpstreamDocument", b => + { + b.HasOne("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("BTNotConsignReportId"); + + b.HasOne("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("BTSeqKBDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("EstimatedStockDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("JFNotConsignReportId"); + + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("SecondaryActuralAdjustmentReportId"); + + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("SecondaryActuralDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("SendUnsettledDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("StockFisDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("StockSettledDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("StockUnsettledDiffReportId"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", b => + { + b.Navigation("BTNotConsignReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", b => + { + b.Navigation("BTSeqKBDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", b => + { + b.Navigation("EstimatedStockDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", b => + { + b.Navigation("JFNotConsignReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", b => + { + b.Navigation("SecondaryActuralAdjustmentReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", b => + { + b.Navigation("SecondaryActuralDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReport", b => + { + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", b => + { + b.Navigation("StockFisDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", b => + { + b.Navigation("StockSettledDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", b => + { + b.Navigation("StockUnsettledDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211221015126_init.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211221015126_init.cs new file mode 100644 index 00000000..ab64563f --- /dev/null +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211221015126_init.cs @@ -0,0 +1,4640 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Win.Sfs.SettleAccount.Migrations +{ + public partial class init : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Set_bom", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ParentItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ParentItemDesc = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ChildItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChildItemDesc = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ChildItemUom = table.Column(type: "nvarchar(max)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + OperateProcess = table.Column(type: "int", nullable: false), + ScrapPercent = table.Column(type: "decimal(18,2)", nullable: false), + BomType = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + EffectiveTime = table.Column(type: "datetime2", nullable: false), + ExpireTime = table.Column(type: "datetime2", nullable: false), + IssuePosition = table.Column(type: "nvarchar(max)", nullable: true), + BomLevel = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bom", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bom_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bom_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_BT_Car_Platform", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExternalKanbanNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + KanbanNumber = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + MaterialVoucherNo = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + BTCarKanBan = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + AcceptanceDate = table.Column(type: "datetime2", nullable: false), + Supplier = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + StorageLocation = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + StorageLocationDesc = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_BT_Car_Platform", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_BT_Car_PlatformVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_BT_Car_PlatformVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_not_kb_consign_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_not_kb_consign_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_seq_kb_diff_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_seq_kb_diff_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarconsign", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + KBCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarconsign", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarconsign_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarconsign_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + DateTime = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + OrderKBCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ReceiveAreaCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ReceiveAreaName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + DeliveryDateTime = table.Column(type: "datetime2", nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DateTime = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseq", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + DT = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + VIN = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + BarCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseq", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseq_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DT = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseq_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqfirst", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + DT = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + BarCode = table.Column(type: "nvarchar(450)", nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + VIN = table.Column(type: "nvarchar(450)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqfirst", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqfirst_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DT = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqfirst_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqsecond", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + DateTime = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + PlanTypeRemark = table.Column(type: "nvarchar(max)", nullable: true), + Code = table.Column(type: "nvarchar(max)", nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + VIN = table.Column(type: "nvarchar(450)", nullable: true), + EngineCode = table.Column(type: "nvarchar(max)", nullable: true), + BarCode = table.Column(type: "nvarchar(450)", nullable: true), + CarName = table.Column(type: "nvarchar(max)", nullable: true), + CMSerie = table.Column(type: "nvarchar(max)", nullable: true), + CMSerieRemark = table.Column(type: "nvarchar(max)", nullable: true), + CarType = table.Column(type: "nvarchar(max)", nullable: true), + Color = table.Column(type: "nvarchar(max)", nullable: true), + TopSeq = table.Column(type: "nvarchar(max)", nullable: true), + InColor = table.Column(type: "nvarchar(max)", nullable: true), + CarModelShort = table.Column(type: "nvarchar(max)", nullable: true), + OrderStateNum = table.Column(type: "nvarchar(max)", nullable: true), + StateName = table.Column(type: "nvarchar(max)", nullable: true), + SpecialCarTypeRemark = table.Column(type: "nvarchar(max)", nullable: true), + PlanDate = table.Column(type: "datetime2", nullable: false), + PlanSeq = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqsecond", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqsecond_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DateTime = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqsecond_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_carmaterialconfig", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CarCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_carmaterialconfig", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_code", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Project = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Value = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_code", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_control", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(max)", nullable: true), + State = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_control", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_customer", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Code = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Description = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + Address = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + Contact = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ContactPhone = table.Column(type: "nvarchar(max)", nullable: true), + ContactEmail = table.Column(type: "nvarchar(max)", nullable: true), + ContactFax = table.Column(type: "nvarchar(max)", nullable: true), + TaxRate = table.Column(type: "decimal(18,2)", nullable: true), + CurrencyId = table.Column(type: "uniqueidentifier", nullable: false), + CustomerType = table.Column(type: "int", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_customer", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_customer_bom", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ParentItemCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ChildItemCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + EffectiveTime = table.Column(type: "datetime2", nullable: false), + FailureTime = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_customer_bom", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_customerlocation", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerDesc = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Storagelocation = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_customerlocation", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estdetail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + MaterialDocument = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDocumentLine = table.Column(type: "nvarchar(450)", nullable: true), + BillNumber = table.Column(type: "nvarchar(max)", nullable: true), + PostingDate = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + ReceiveQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoiceQty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + PurchaseDocument = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + PurchaseLine = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Source = table.Column(type: "nvarchar(max)", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + StorageLocation = table.Column(type: "nvarchar(max)", nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estdetail", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estimate_stock_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estimate_stock_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estinventory_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estinventory_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estsum", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Postingperiod = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(max)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + PurchaseDocument = table.Column(type: "nvarchar(max)", nullable: true), + PurchaseLine = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estsum", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estsum_verion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estsum_verion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_factory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Code = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Desc = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_factory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + FISYear = table.Column(type: "nvarchar(max)", nullable: true), + OrderBillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber2 = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + CP7Time = table.Column(type: "datetime2", nullable: false), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + SettleState = table.Column(type: "int", nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + WMSState = table.Column(type: "nvarchar(max)", nullable: true), + WMSBillNum = table.Column(type: "nvarchar(max)", nullable: true), + UnSettleVersion = table.Column(type: "nvarchar(max)", nullable: true), + AccountDate = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis_extend", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + FISYear = table.Column(type: "nvarchar(max)", nullable: true), + OrderBillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + KENNCode = table.Column(type: "nvarchar(max)", nullable: true), + ItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber2 = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CP7Time = table.Column(type: "datetime2", nullable: false), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + SettleState = table.Column(type: "int", nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis_extend", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis_th", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + OrderBillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(450)", nullable: true), + KENNCode = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChassisNumber2 = table.Column(type: "nvarchar(450)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + CP7Time = table.Column(type: "datetime2", nullable: false), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis_th", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + BeginDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_HQ_H_Platform", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExternalKanbanNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + KanbanNumber = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + MaterialVoucherNo = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + HQHKanBan = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + AcceptanceDate = table.Column(type: "datetime2", nullable: false), + Supplier = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + StorageLocation = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + StorageLocationDesc = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_HQ_H_Platform", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_HQ_H_PlatformVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_HQ_H_PlatformVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_HQ_M_Platform", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExternalKanbanNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + KanbanNumber = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + MaterialVoucherNo = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + HQMKanBan = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + AcceptanceDate = table.Column(type: "datetime2", nullable: false), + Supplier = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + StorageLocation = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + StorageLocationDesc = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_HQ_M_Platform", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_HQ_M_PlatformVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_HQ_M_PlatformVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqcon", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + VIN = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqcon", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqcon_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqcon_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", nullable: false), + KBCode = table.Column(type: "nvarchar(max)", nullable: true), + VIN = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + CreateTime = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspcon", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + KBCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + KBCodeExtend = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspcon", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspcon_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspcon_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", nullable: false), + KBCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + CreateTime = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_importmap", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ProjectName = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + OldColumnName = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + NewColumnName = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + IsCheck = table.Column(type: "bit", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_importmap", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_inventory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + AppraisalDesc = table.Column(type: "nvarchar(max)", nullable: true), + StorageLocationDesc = table.Column(type: "nvarchar(max)", nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + InputQty = table.Column(type: "decimal(18,2)", nullable: false), + OutputQty = table.Column(type: "decimal(18,2)", nullable: false), + OpeningInventoryQty = table.Column(type: "decimal(18,2)", nullable: false), + EndingInventoryQty = table.Column(type: "decimal(18,2)", nullable: false), + AppraisalCategory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + StorageLocation = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Unit = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_inventory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_inventory_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(450)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_inventory_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Invoice", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Invoice", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_InvoiceSettledDiff", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(max)", nullable: true), + SapMaterialGroup = table.Column(type: "nvarchar(max)", nullable: true), + SapMaterialCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + InvoiceQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoiceAmt = table.Column(type: "decimal(18,2)", nullable: false), + InvoicePrice = table.Column(type: "decimal(18,2)", nullable: false), + SettleQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CP7ScrapQty = table.Column(type: "decimal(18,2)", nullable: false), + ClaimQty = table.Column(type: "decimal(18,2)", nullable: false), + SalePrice = table.Column(type: "decimal(18,2)", nullable: false), + DiffPrice = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_InvoiceSettledDiff", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_InvoiceSettledDiffVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreatorName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ProjectName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_InvoiceSettledDiffVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_InvoiceVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_InvoiceVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_item_invoice_price", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + UM = table.Column(type: "nvarchar(max)", nullable: true), + Sales = table.Column(type: "nvarchar(max)", nullable: true), + SubAcct = table.Column(type: "nvarchar(max)", nullable: true), + CC = table.Column(type: "nvarchar(max)", nullable: true), + Backorder = table.Column(type: "nvarchar(max)", nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + ExtendedPrice = table.Column(type: "decimal(18,2)", nullable: false), + ExtendedMargin = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_item_invoice_price", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_item_invoice_price_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_item_invoice_price_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jf_not_kb_consign_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jf_not_kb_consign_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarconsign", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Qty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + PABillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarconsign", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarconsign_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarconsign_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + BillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + InStockQty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_KanBanSettle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + Kanban = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + Relation = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleInputDate = table.Column(type: "datetime2", nullable: false), + Batch = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Flag = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettleDate = table.Column(type: "datetime2", nullable: false), + State = table.Column(type: "nvarchar(max)", nullable: true), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_KanBanSettle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_KanBanSettle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_KanBanSettle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_material", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + Unit = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + EstimateType = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + EstimateTypeDesc = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_material", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_MaterialRelationshipDetail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ErpMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialProperty = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ShipMaterailCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + AppraisalCategory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_MaterialRelationshipDetail", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_MaterialRelationshipVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_MaterialRelationshipVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_prebatch", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", nullable: false), + CarCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + YearKennCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_prebatch", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_PriceList", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + BeginDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + Price = table.Column(type: "decimal(18,2)", nullable: false), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Type = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_PriceList", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_PriceListVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_PriceListVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_relationship", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + MaterialProperty = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettleMaterialCode = table.Column(type: "nvarchar(max)", nullable: true), + ShipMaterailCode = table.Column(type: "nvarchar(max)", nullable: true), + AppraisalCategory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_relationship", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_ScrapClaims", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_ScrapClaims", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_ScrapClaims_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_ScrapClaims_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_adjustment_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_adjustment_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_diff_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_diff_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_adj", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerComponentCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Total = table.Column(type: "decimal(18,2)", nullable: false), + HasChanged = table.Column(type: "nvarchar(max)", nullable: true), + Buyer = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_adj", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_adj_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_adj_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_dis", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + SupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Total = table.Column(type: "decimal(18,2)", nullable: false), + HasChanged = table.Column(type: "nvarchar(max)", nullable: true), + Buyer = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_dis", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_dis_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_dis_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_ratio", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomItemPrice = table.Column(type: "decimal(18,2)", nullable: false), + CustomSubItemCode = table.Column(type: "nvarchar(450)", nullable: true), + CustomSubItemPrice = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + SupplyProportion = table.Column(type: "nvarchar(max)", nullable: true), + SupplyProportionPrice = table.Column(type: "decimal(18,2)", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_ratio", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_ratio_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: false), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_ratio_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SecMatchBase", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Index = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + IsSettle = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Model = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleMentPartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialPartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + UsedNumber = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + SupplyProportion = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + Buyer = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + SettlementPrice = table.Column(type: "decimal(18,2)", nullable: false), + DiffPrice = table.Column(type: "decimal(18,2)", nullable: false), + SettlementNumber = table.Column(type: "decimal(18,2)", nullable: false), + TheoreticalSettlementNumber = table.Column(type: "decimal(18,2)", nullable: false), + RealSettlementNumber = table.Column(type: "decimal(18,2)", nullable: false), + RealSettlementPrice = table.Column(type: "decimal(18,2)", nullable: false), + IsDiffNumber = table.Column(type: "bit", nullable: false), + DiffAmount = table.Column(type: "decimal(18,2)", nullable: false), + Remark = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SecMatchBase", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_send_unsettled_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BeginVersion = table.Column(type: "nvarchar(max)", nullable: true), + EndVersion = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_send_unsettled_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_send_unsettled_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + OrderBillNum = table.Column(type: "nvarchar(max)", nullable: true), + KENNCode = table.Column(type: "nvarchar(max)", nullable: true), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + FISYear = table.Column(type: "nvarchar(max)", nullable: true), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(450)", nullable: true), + ChassisNumber2 = table.Column(type: "nvarchar(max)", nullable: true), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + Status = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_send_unsettled_report_detail", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Settle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SettleYear = table.Column(type: "nvarchar(max)", nullable: true), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CP5A = table.Column(type: "datetime2", nullable: false), + CP7 = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettlementID = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettlementSupplier = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + state = table.Column(type: "int", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Settle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Settle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Settle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_settlement_part", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SettlementPartCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettlementPartDesc = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + Uom = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_settlement_part", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_settlement_part_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_settlement_part_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementCrossReference", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Model = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettlementMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + BomMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierDesc = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Buyer = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementCrossReference", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementCrossReference_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementCrossReference_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementPakAndSpareParts", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ApplicableFunction = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettlementPartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + SettlementPartDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ErpSparePartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ErpSparePartName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + QADCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ProductLine = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PerCarNum = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + Price = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + SupplyProportion = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + QuantityPrice = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementPakAndSpareParts", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementPakAndSpareParts_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementPakAndSpareParts_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SparePart", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + LineNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + PurchaseOrderNoItem = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNoText = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ReceiptQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoicedQty = table.Column(type: "decimal(18,2)", nullable: false), + AmountNoTax = table.Column(type: "decimal(18,2)", nullable: false), + PurchasePriceNoTax = table.Column(type: "decimal(18,2)", nullable: false), + AccountNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SpareDate = table.Column(type: "datetime2", nullable: false), + DeliveryOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + DeliveryLineNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + BatchNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Unit = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + TaxRate = table.Column(type: "decimal(18,2)", nullable: false), + TaxCode = table.Column(type: "nvarchar(max)", nullable: true), + GermanInvoiceNo = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + FactoryName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Extend = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SparePart", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_fis_diff_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_fis_diff_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_settled_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_settled_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_unsettled_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_unsettled_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_supplier_item_setup", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ErpItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerSupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ErpSupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_supplier_item_setup", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_TaskJob", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Type = table.Column(type: "nvarchar(max)", nullable: true), + State = table.Column(type: "nvarchar(max)", nullable: true), + TaskId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ActionName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Error = table.Column(type: "nvarchar(max)", nullable: true), + Creator = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Email = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + FileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + RealFileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + RealDownFileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + DownFileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + ServiceName = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_TaskJob", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Unsettle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SettleYear = table.Column(type: "nvarchar(max)", nullable: true), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CP5A = table.Column(type: "datetime2", nullable: false), + CP7 = table.Column(type: "datetime2", nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettlementID = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettlementSupplier = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + state = table.Column(type: "int", nullable: false), + UnsettledReason = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Unsettle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Unsettle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Unsettle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WmsJitOutPutDetial", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ParentMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + WmsBillNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + KennCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ChassisNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialGroup = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + OutPut = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + InPut = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + State = table.Column(type: "int", nullable: false), + Extend1 = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Extend2 = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Extend3 = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WmsJitOutPutDetial", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WMSKanBanSettle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + Kanban = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + Relation = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleInputDate = table.Column(type: "datetime2", nullable: false), + Batch = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Flag = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettleDate = table.Column(type: "datetime2", nullable: false), + State = table.Column(type: "nvarchar(max)", nullable: true), + WMSDeliveryNote = table.Column(type: "nvarchar(max)", nullable: true), + WMSActualGoodsDate = table.Column(type: "nvarchar(max)", nullable: true), + WMSDeliveryQty = table.Column(type: "decimal(18,2)", nullable: false), + WMSDeliverGoodsState = table.Column(type: "nvarchar(max)", nullable: true), + WMSKanBanState = table.Column(type: "nvarchar(max)", nullable: true), + DeliveryOrderNo = table.Column(type: "nvarchar(max)", nullable: true), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WMSKanBanSettle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WMSKanBanSettle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WMSKanBanSettle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WMSSparePart", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + LineNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + PurchaseOrderNoItem = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNoText = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ReceiptQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoicedQty = table.Column(type: "decimal(18,2)", nullable: false), + AmountNoTax = table.Column(type: "decimal(18,2)", nullable: false), + PurchasePriceNoTax = table.Column(type: "decimal(18,2)", nullable: false), + AccountNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SpareDate = table.Column(type: "datetime2", nullable: false), + DeliveryOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + DeliveryLineNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + BatchNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Unit = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + TaxRate = table.Column(type: "decimal(18,2)", nullable: false), + TaxCode = table.Column(type: "nvarchar(max)", nullable: true), + GermanInvoiceNo = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + FactoryName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Extend = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), + WMSDeliveryNote = table.Column(type: "nvarchar(max)", nullable: true), + WMSDeliverGoodsState = table.Column(type: "nvarchar(max)", nullable: true), + WMSSparePartState = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WMSSparePart", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_not_kb_consign_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomCode = table.Column(type: "nvarchar(450)", nullable: true), + OrderKBCode = table.Column(type: "nvarchar(450)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(450)", nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + DeliveryDateTime = table.Column(type: "datetime2", nullable: false), + State = table.Column(type: "int", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_not_kb_consign_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_bt_not_kb_consign_report_detail_Set_bt_not_kb_consign_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_bt_not_kb_consign_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_seq_kb_diff_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomCode = table.Column(type: "nvarchar(450)", nullable: true), + DT = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SeqQty = table.Column(type: "decimal(18,2)", nullable: false), + KBQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_seq_kb_diff_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_bt_seq_kb_diff_report_detail_Set_bt_seq_kb_diff_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_bt_seq_kb_diff_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_estimate_stock_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + EstimationTypeDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + FgQty = table.Column(type: "decimal(18,2)", nullable: false), + UnSettledQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estimate_stock_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_estimate_stock_report_detail_Set_estimate_stock_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_estimate_stock_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_jf_not_kb_consign_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomCode = table.Column(type: "nvarchar(450)", nullable: true), + BillNum = table.Column(type: "nvarchar(450)", nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(450)", nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + InStockQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jf_not_kb_consign_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_jf_not_kb_consign_report_detail_Set_jf_not_kb_consign_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_jf_not_kb_consign_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_adjustment_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + CustomItemCode = table.Column(type: "nvarchar(450)", nullable: true), + CustomItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + OfflineQty = table.Column(type: "decimal(18,2)", nullable: false), + CustomSubItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ErpSubItemCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + ErpSubItemQty = table.Column(type: "decimal(18,2)", nullable: false), + ErpSubItemActualQty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + SupplyProportion = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemPrice = table.Column(type: "decimal(18,2)", nullable: false), + CustomSubItemSumQty = table.Column(type: "decimal(18,2)", nullable: false), + SumPriceNoTax = table.Column(type: "decimal(18,2)", nullable: false), + SumPriceWithTax = table.Column(type: "decimal(18,2)", nullable: false), + HasChanged = table.Column(type: "nvarchar(max)", nullable: true), + Buyer = table.Column(type: "nvarchar(max)", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_adjustment_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_sec_act_adjustment_report_detail_Set_sec_act_adjustment_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_sec_act_adjustment_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_diff_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomItemCode = table.Column(type: "nvarchar(450)", nullable: true), + CustomItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ErpSubItemCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + StaPaymentPartyQty = table.Column(type: "decimal(18,2)", nullable: false), + ActPaymentPartyQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + StdNoTaxAmount = table.Column(type: "decimal(18,2)", nullable: false), + ActNoTaxAmount = table.Column(type: "decimal(18,2)", nullable: false), + DiffAmount = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_diff_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_sec_act_diff_report_detail_Set_sec_act_diff_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_sec_act_diff_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_fis_diff_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + FisQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_fis_diff_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_stock_fis_diff_report_detail_Set_stock_fis_diff_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_stock_fis_diff_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_settled_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + R3SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_settled_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_stock_settled_report_detail_Set_stock_settled_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_stock_settled_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_unsettled_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + FisUnSettledQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_unsettled_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_stock_unsettled_report_detail_Set_stock_unsettled_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_stock_unsettled_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "UpstreamDocument", + columns: table => new + { + UpstreamDocumentId = table.Column(type: "uniqueidentifier", nullable: false), + UpstreamDocumentNumber = table.Column(type: "nvarchar(max)", nullable: true), + UpstreamDocumentType = table.Column(type: "int", nullable: false), + Seq = table.Column(type: "int", nullable: false), + BTNotConsignReportId = table.Column(type: "uniqueidentifier", nullable: true), + BTSeqKBDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + EstimatedStockDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + JFNotConsignReportId = table.Column(type: "uniqueidentifier", nullable: true), + SecondaryActuralAdjustmentReportId = table.Column(type: "uniqueidentifier", nullable: true), + SecondaryActuralDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + SendUnsettledDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + StockFisDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + StockSettledDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + StockUnsettledDiffReportId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_UpstreamDocument", x => x.UpstreamDocumentId); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_bt_not_kb_consign_report_BTNotConsignReportId", + column: x => x.BTNotConsignReportId, + principalTable: "Set_bt_not_kb_consign_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_bt_seq_kb_diff_report_BTSeqKBDiffReportId", + column: x => x.BTSeqKBDiffReportId, + principalTable: "Set_bt_seq_kb_diff_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_estimate_stock_report_EstimatedStockDiffReportId", + column: x => x.EstimatedStockDiffReportId, + principalTable: "Set_estimate_stock_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_jf_not_kb_consign_report_JFNotConsignReportId", + column: x => x.JFNotConsignReportId, + principalTable: "Set_jf_not_kb_consign_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_sec_act_adjustment_report_SecondaryActuralAdjustmentReportId", + column: x => x.SecondaryActuralAdjustmentReportId, + principalTable: "Set_sec_act_adjustment_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_sec_act_diff_report_SecondaryActuralDiffReportId", + column: x => x.SecondaryActuralDiffReportId, + principalTable: "Set_sec_act_diff_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_send_unsettled_report_SendUnsettledDiffReportId", + column: x => x.SendUnsettledDiffReportId, + principalTable: "Set_send_unsettled_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_stock_fis_diff_report_StockFisDiffReportId", + column: x => x.StockFisDiffReportId, + principalTable: "Set_stock_fis_diff_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_stock_settled_report_StockSettledDiffReportId", + column: x => x.StockSettledDiffReportId, + principalTable: "Set_stock_settled_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_stock_unsettled_report_StockUnsettledDiffReportId", + column: x => x.StockUnsettledDiffReportId, + principalTable: "Set_stock_unsettled_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_Set_bom_ParentItemCode_ChildItemCode_Version", + table: "Set_bom", + columns: new[] { "ParentItemCode", "ChildItemCode", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_BT_Car_Platform_Version_KanbanNumber_MaterialCode", + table: "Set_BT_Car_Platform", + columns: new[] { "Version", "KanbanNumber", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_BT_Car_PlatformVersion_Version", + table: "Set_BT_Car_PlatformVersion", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_not_kb_consign_report_BranchId_DocumentNumber", + table: "Set_bt_not_kb_consign_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_not_kb_consign_report_detail_BranchId_DocumentId_Version_CustomCode_MaterialCode_OrderKBCode", + table: "Set_bt_not_kb_consign_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "CustomCode", "MaterialCode", "OrderKBCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_not_kb_consign_report_detail_DocumentId", + table: "Set_bt_not_kb_consign_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_seq_kb_diff_report_BranchId_DocumentNumber", + table: "Set_bt_seq_kb_diff_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_seq_kb_diff_report_detail_BranchId_DocumentId_Version_DT_CustomCode_MaterialCode", + table: "Set_bt_seq_kb_diff_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "DT", "CustomCode", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_seq_kb_diff_report_detail_DocumentId", + table: "Set_bt_seq_kb_diff_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarconsign_CustomerCode_MaterialCode_KBCode_Version", + table: "Set_btcarconsign", + columns: new[] { "CustomerCode", "MaterialCode", "KBCode", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarkb_CustomerCode_MaterialCode_OrderKBCode_Version", + table: "Set_btcarkb", + columns: new[] { "CustomerCode", "MaterialCode", "OrderKBCode", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarseq_CustomerCode_BarCode_VIN_Version", + table: "Set_btcarseq", + columns: new[] { "CustomerCode", "BarCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarseqfirst_CustomerCode_BarCode_VIN_Version", + table: "Set_btcarseqfirst", + columns: new[] { "CustomerCode", "BarCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarseqsecond_CustomerCode_BarCode_VIN_Version", + table: "Set_btcarseqsecond", + columns: new[] { "CustomerCode", "BarCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_carmaterialconfig_CarCode_MaterialCode", + table: "Set_carmaterialconfig", + columns: new[] { "CarCode", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_code_Project_Value", + table: "Set_code", + columns: new[] { "Project", "Value" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_control_Year_Period", + table: "Set_control", + columns: new[] { "Year", "Period" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_customer_BranchId_Code", + table: "Set_customer", + columns: new[] { "BranchId", "Code" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_customer_bom_BranchId_CustomerCode_ParentItemCode_ChildItemCode", + table: "Set_customer_bom", + columns: new[] { "BranchId", "CustomerCode", "ParentItemCode", "ChildItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_customerlocation_Storagelocation_CustomerCode", + table: "Set_customerlocation", + columns: new[] { "Storagelocation", "CustomerCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estdetail_MaterialDocument_MaterialDocumentLine_MaterialCode_Version", + table: "Set_estdetail", + columns: new[] { "MaterialDocument", "MaterialDocumentLine", "MaterialCode", "Version" }, + unique: true, + filter: "[MaterialDocumentLine] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estimate_stock_report_BranchId_DocumentNumber", + table: "Set_estimate_stock_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estimate_stock_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_estimate_stock_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estimate_stock_report_detail_DocumentId", + table: "Set_estimate_stock_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_factory_Code", + table: "Set_factory", + column: "Code", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_ChassisNumber2_KENNCode", + table: "Set_fis", + columns: new[] { "ChassisNumber2", "KENNCode" }); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_ChassisNumber2_Version_KENNCode_ItemCode", + table: "Set_fis", + columns: new[] { "ChassisNumber2", "Version", "KENNCode", "ItemCode" }); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_extend_ChassisNumber2_Version_Model_ItemCode", + table: "Set_fis_extend", + columns: new[] { "ChassisNumber2", "Version", "Model", "ItemCode" }, + unique: true, + filter: "[Model] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_th_ChassisNumber2_Version_Model_MaterialCode", + table: "Set_fis_th", + columns: new[] { "ChassisNumber2", "Version", "Model", "MaterialCode" }, + unique: true, + filter: "[ChassisNumber2] IS NOT NULL AND [Model] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_HQ_H_Platform_Version_HQHKanBan_MaterialCode", + table: "Set_HQ_H_Platform", + columns: new[] { "Version", "HQHKanBan", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_HQ_H_PlatformVersion_Version", + table: "Set_HQ_H_PlatformVersion", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_HQ_M_Platform_Version_HQMKanBan_MaterialCode", + table: "Set_HQ_M_Platform", + columns: new[] { "Version", "HQMKanBan", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_HQ_M_PlatformVersion_Version", + table: "Set_HQ_M_PlatformVersion", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqcon_CustomerCode_MaterialCode_VIN_Version", + table: "Set_hqcon", + columns: new[] { "CustomerCode", "MaterialCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqkb_CustomerCode_MaterialCode_VIN_Version", + table: "Set_hqkb", + columns: new[] { "CustomerCode", "MaterialCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqspcon_CustomerCode_MaterialCode_KBCode_KBCodeExtend_Version", + table: "Set_hqspcon", + columns: new[] { "CustomerCode", "MaterialCode", "KBCode", "KBCodeExtend", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqspkb_CustomerCode_MaterialCode_KBCode_Version", + table: "Set_hqspkb", + columns: new[] { "CustomerCode", "MaterialCode", "KBCode", "Version" }, + unique: true, + filter: "[MaterialCode] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_inventory_Version_MaterialCode_StorageLocation", + table: "Set_inventory", + columns: new[] { "Version", "MaterialCode", "StorageLocation" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_inventory_version_Version_Factory", + table: "Set_inventory_version", + columns: new[] { "Version", "Factory" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_item_invoice_price_Period_Version_MaterialCode", + table: "Set_item_invoice_price", + columns: new[] { "Period", "Version", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jf_not_kb_consign_report_BranchId_DocumentNumber", + table: "Set_jf_not_kb_consign_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jf_not_kb_consign_report_detail_DocumentId_Version_CustomCode_MaterialCode_BillNum", + table: "Set_jf_not_kb_consign_report_detail", + columns: new[] { "DocumentId", "Version", "CustomCode", "MaterialCode", "BillNum" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jfcarconsign_CustomerCode_MaterialCode_PABillNum_Version", + table: "Set_jfcarconsign", + columns: new[] { "CustomerCode", "MaterialCode", "PABillNum", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jfcarkb_CustomerCode_MaterialCode_BillNum_Version", + table: "Set_jfcarkb", + columns: new[] { "CustomerCode", "MaterialCode", "BillNum", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_KanBanSettle_Version_Kanban_MaterialCode", + table: "Set_KanBanSettle", + columns: new[] { "Version", "Kanban", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_KanBanSettle_Version_Version", + table: "Set_KanBanSettle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_material_MaterialCode", + table: "Set_material", + column: "MaterialCode", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_relationship_ErpMaterialCode", + table: "Set_relationship", + column: "ErpMaterialCode", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_ScrapClaims_Version_Version", + table: "Set_ScrapClaims_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_adjustment_report_BranchId_DocumentNumber", + table: "Set_sec_act_adjustment_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_adjustment_report_detail_BranchId_DocumentId_Version_CustomItemCode_CustomSubItemCode_SupplierCode", + table: "Set_sec_act_adjustment_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_adjustment_report_detail_DocumentId", + table: "Set_sec_act_adjustment_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_diff_report_BranchId_DocumentNumber", + table: "Set_sec_act_diff_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_diff_report_detail_BranchId_DocumentId_Version_CustomItemCode_CustomSubItemCode_SupplierCode", + table: "Set_sec_act_diff_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_diff_report_detail_DocumentId", + table: "Set_sec_act_diff_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_adj_Version_CustomerComponentCode_CustomerMaterialCode_SupplierCode", + table: "Set_sec_adj", + columns: new[] { "Version", "CustomerComponentCode", "CustomerMaterialCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_adj_version_Version", + table: "Set_sec_adj_version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_dis_SupplierCode", + table: "Set_sec_dis", + column: "SupplierCode", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_dis_version_Version", + table: "Set_sec_dis_version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_ratio_Version_CustomItemCode_CustomSubItemCode_SupplierCode", + table: "Set_sec_ratio", + columns: new[] { "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_ratio_version_Version", + table: "Set_sec_ratio_version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_send_unsettled_report_BranchId_DocumentNumber", + table: "Set_send_unsettled_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_send_unsettled_report_detail_BranchId_DocumentId_Version_ChassisNumber_ItemCode", + table: "Set_send_unsettled_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "ChassisNumber", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Settle_state", + table: "Set_Settle", + column: "state"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Settle_Version_ChassisNumber_MaterialCode_KENNCode", + table: "Set_Settle", + columns: new[] { "Version", "ChassisNumber", "MaterialCode", "KENNCode" }); + + migrationBuilder.CreateIndex( + name: "IX_Set_Settle_Version_Version", + table: "Set_Settle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_settlement_part_Period_CustomerCode_Version_SettlementPartCode", + table: "Set_settlement_part", + columns: new[] { "Period", "CustomerCode", "Version", "SettlementPartCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_SettlementCrossReference_Version_SettlementMaterialCode_BomMaterialCode", + table: "Set_SettlementCrossReference", + columns: new[] { "Version", "SettlementMaterialCode", "BomMaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_SparePart_Version_PurchaseOrderNo_MaterialCode", + table: "Set_SparePart", + columns: new[] { "Version", "PurchaseOrderNo", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_fis_diff_report_BranchId_DocumentNumber", + table: "Set_stock_fis_diff_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_fis_diff_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_stock_fis_diff_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_fis_diff_report_detail_DocumentId", + table: "Set_stock_fis_diff_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_settled_report_BranchId_DocumentNumber", + table: "Set_stock_settled_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_settled_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_stock_settled_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_settled_report_detail_DocumentId", + table: "Set_stock_settled_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_unsettled_report_BranchId_DocumentNumber", + table: "Set_stock_unsettled_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_unsettled_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_stock_unsettled_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_unsettled_report_detail_DocumentId", + table: "Set_stock_unsettled_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_supplier_item_setup_ErpSupplierCode_ErpItemCode_CustomerSupplierCode_CustomerCode", + table: "Set_supplier_item_setup", + columns: new[] { "ErpSupplierCode", "ErpItemCode", "CustomerSupplierCode", "CustomerCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Unsettle_state", + table: "Set_Unsettle", + column: "state"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Unsettle_Version_ChassisNumber_MaterialCode_KENNCode", + table: "Set_Unsettle", + columns: new[] { "Version", "ChassisNumber", "MaterialCode", "KENNCode" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Set_Unsettle_Version_Version", + table: "Set_Unsettle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_WMSKanBanSettle_Version_Kanban_MaterialCode", + table: "Set_WMSKanBanSettle", + columns: new[] { "Version", "Kanban", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_WMSKanBanSettle_Version_Version", + table: "Set_WMSKanBanSettle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_WMSSparePart_Version_PurchaseOrderNo_MaterialCode", + table: "Set_WMSSparePart", + columns: new[] { "Version", "PurchaseOrderNo", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_BTNotConsignReportId", + table: "UpstreamDocument", + column: "BTNotConsignReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_BTSeqKBDiffReportId", + table: "UpstreamDocument", + column: "BTSeqKBDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_EstimatedStockDiffReportId", + table: "UpstreamDocument", + column: "EstimatedStockDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_JFNotConsignReportId", + table: "UpstreamDocument", + column: "JFNotConsignReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_SecondaryActuralAdjustmentReportId", + table: "UpstreamDocument", + column: "SecondaryActuralAdjustmentReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_SecondaryActuralDiffReportId", + table: "UpstreamDocument", + column: "SecondaryActuralDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_SendUnsettledDiffReportId", + table: "UpstreamDocument", + column: "SendUnsettledDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_StockFisDiffReportId", + table: "UpstreamDocument", + column: "StockFisDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_StockSettledDiffReportId", + table: "UpstreamDocument", + column: "StockSettledDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_StockUnsettledDiffReportId", + table: "UpstreamDocument", + column: "StockUnsettledDiffReportId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Set_bom"); + + migrationBuilder.DropTable( + name: "Set_bom_version"); + + migrationBuilder.DropTable( + name: "Set_BT_Car_Platform"); + + migrationBuilder.DropTable( + name: "Set_BT_Car_PlatformVersion"); + + migrationBuilder.DropTable( + name: "Set_bt_not_kb_consign_report_detail"); + + migrationBuilder.DropTable( + name: "Set_bt_seq_kb_diff_report_detail"); + + migrationBuilder.DropTable( + name: "Set_btcarconsign"); + + migrationBuilder.DropTable( + name: "Set_btcarconsign_version"); + + migrationBuilder.DropTable( + name: "Set_btcarkb"); + + migrationBuilder.DropTable( + name: "Set_btcarkb_version"); + + migrationBuilder.DropTable( + name: "Set_btcarseq"); + + migrationBuilder.DropTable( + name: "Set_btcarseq_version"); + + migrationBuilder.DropTable( + name: "Set_btcarseqfirst"); + + migrationBuilder.DropTable( + name: "Set_btcarseqfirst_version"); + + migrationBuilder.DropTable( + name: "Set_btcarseqsecond"); + + migrationBuilder.DropTable( + name: "Set_btcarseqsecond_version"); + + migrationBuilder.DropTable( + name: "Set_carmaterialconfig"); + + migrationBuilder.DropTable( + name: "Set_code"); + + migrationBuilder.DropTable( + name: "Set_control"); + + migrationBuilder.DropTable( + name: "Set_customer"); + + migrationBuilder.DropTable( + name: "Set_customer_bom"); + + migrationBuilder.DropTable( + name: "Set_customerlocation"); + + migrationBuilder.DropTable( + name: "Set_estdetail"); + + migrationBuilder.DropTable( + name: "Set_estimate_stock_report_detail"); + + migrationBuilder.DropTable( + name: "Set_estinventory_version"); + + migrationBuilder.DropTable( + name: "Set_estsum"); + + migrationBuilder.DropTable( + name: "Set_estsum_verion"); + + migrationBuilder.DropTable( + name: "Set_factory"); + + migrationBuilder.DropTable( + name: "Set_fis"); + + migrationBuilder.DropTable( + name: "Set_fis_extend"); + + migrationBuilder.DropTable( + name: "Set_fis_th"); + + migrationBuilder.DropTable( + name: "Set_fis_version"); + + migrationBuilder.DropTable( + name: "Set_HQ_H_Platform"); + + migrationBuilder.DropTable( + name: "Set_HQ_H_PlatformVersion"); + + migrationBuilder.DropTable( + name: "Set_HQ_M_Platform"); + + migrationBuilder.DropTable( + name: "Set_HQ_M_PlatformVersion"); + + migrationBuilder.DropTable( + name: "Set_hqcon"); + + migrationBuilder.DropTable( + name: "Set_hqcon_version"); + + migrationBuilder.DropTable( + name: "Set_hqkb"); + + migrationBuilder.DropTable( + name: "Set_hqkb_version"); + + migrationBuilder.DropTable( + name: "Set_hqspcon"); + + migrationBuilder.DropTable( + name: "Set_hqspcon_version"); + + migrationBuilder.DropTable( + name: "Set_hqspkb"); + + migrationBuilder.DropTable( + name: "Set_hqspkb_version"); + + migrationBuilder.DropTable( + name: "Set_importmap"); + + migrationBuilder.DropTable( + name: "Set_inventory"); + + migrationBuilder.DropTable( + name: "Set_inventory_version"); + + migrationBuilder.DropTable( + name: "Set_Invoice"); + + migrationBuilder.DropTable( + name: "Set_InvoiceSettledDiff"); + + migrationBuilder.DropTable( + name: "Set_InvoiceSettledDiffVersion"); + + migrationBuilder.DropTable( + name: "Set_InvoiceVersion"); + + migrationBuilder.DropTable( + name: "Set_item_invoice_price"); + + migrationBuilder.DropTable( + name: "Set_item_invoice_price_version"); + + migrationBuilder.DropTable( + name: "Set_jf_not_kb_consign_report_detail"); + + migrationBuilder.DropTable( + name: "Set_jfcarconsign"); + + migrationBuilder.DropTable( + name: "Set_jfcarconsign_version"); + + migrationBuilder.DropTable( + name: "Set_jfcarkb"); + + migrationBuilder.DropTable( + name: "Set_jfcarkb_version"); + + migrationBuilder.DropTable( + name: "Set_KanBanSettle"); + + migrationBuilder.DropTable( + name: "Set_KanBanSettle_Version"); + + migrationBuilder.DropTable( + name: "Set_material"); + + migrationBuilder.DropTable( + name: "Set_MaterialRelationshipDetail"); + + migrationBuilder.DropTable( + name: "Set_MaterialRelationshipVersion"); + + migrationBuilder.DropTable( + name: "Set_prebatch"); + + migrationBuilder.DropTable( + name: "Set_PriceList"); + + migrationBuilder.DropTable( + name: "Set_PriceListVersion"); + + migrationBuilder.DropTable( + name: "Set_relationship"); + + migrationBuilder.DropTable( + name: "Set_ScrapClaims"); + + migrationBuilder.DropTable( + name: "Set_ScrapClaims_Version"); + + migrationBuilder.DropTable( + name: "Set_sec_act_adjustment_report_detail"); + + migrationBuilder.DropTable( + name: "Set_sec_act_diff_report_detail"); + + migrationBuilder.DropTable( + name: "Set_sec_adj"); + + migrationBuilder.DropTable( + name: "Set_sec_adj_version"); + + migrationBuilder.DropTable( + name: "Set_sec_dis"); + + migrationBuilder.DropTable( + name: "Set_sec_dis_version"); + + migrationBuilder.DropTable( + name: "Set_sec_ratio"); + + migrationBuilder.DropTable( + name: "Set_sec_ratio_version"); + + migrationBuilder.DropTable( + name: "Set_SecMatchBase"); + + migrationBuilder.DropTable( + name: "Set_send_unsettled_report_detail"); + + migrationBuilder.DropTable( + name: "Set_Settle"); + + migrationBuilder.DropTable( + name: "Set_Settle_Version"); + + migrationBuilder.DropTable( + name: "Set_settlement_part"); + + migrationBuilder.DropTable( + name: "Set_settlement_part_version"); + + migrationBuilder.DropTable( + name: "Set_SettlementCrossReference"); + + migrationBuilder.DropTable( + name: "Set_SettlementCrossReference_Version"); + + migrationBuilder.DropTable( + name: "Set_SettlementPakAndSpareParts"); + + migrationBuilder.DropTable( + name: "Set_SettlementPakAndSpareParts_Version"); + + migrationBuilder.DropTable( + name: "Set_SparePart"); + + migrationBuilder.DropTable( + name: "Set_stock_fis_diff_report_detail"); + + migrationBuilder.DropTable( + name: "Set_stock_settled_report_detail"); + + migrationBuilder.DropTable( + name: "Set_stock_unsettled_report_detail"); + + migrationBuilder.DropTable( + name: "Set_supplier_item_setup"); + + migrationBuilder.DropTable( + name: "Set_TaskJob"); + + migrationBuilder.DropTable( + name: "Set_Unsettle"); + + migrationBuilder.DropTable( + name: "Set_Unsettle_Version"); + + migrationBuilder.DropTable( + name: "Set_WmsJitOutPutDetial"); + + migrationBuilder.DropTable( + name: "Set_WMSKanBanSettle"); + + migrationBuilder.DropTable( + name: "Set_WMSKanBanSettle_Version"); + + migrationBuilder.DropTable( + name: "Set_WMSSparePart"); + + migrationBuilder.DropTable( + name: "UpstreamDocument"); + + migrationBuilder.DropTable( + name: "Set_bt_not_kb_consign_report"); + + migrationBuilder.DropTable( + name: "Set_bt_seq_kb_diff_report"); + + migrationBuilder.DropTable( + name: "Set_estimate_stock_report"); + + migrationBuilder.DropTable( + name: "Set_jf_not_kb_consign_report"); + + migrationBuilder.DropTable( + name: "Set_sec_act_adjustment_report"); + + migrationBuilder.DropTable( + name: "Set_sec_act_diff_report"); + + migrationBuilder.DropTable( + name: "Set_send_unsettled_report"); + + migrationBuilder.DropTable( + name: "Set_stock_fis_diff_report"); + + migrationBuilder.DropTable( + name: "Set_stock_settled_report"); + + migrationBuilder.DropTable( + name: "Set_stock_unsettled_report"); + } + } +} diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs index 85aec85f..1ca04217 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -7301,6 +7301,125 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_BT_Car_PlatformVersion"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPutDetial", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChassisNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InPut") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KennCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialGroup") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("OutPut") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentMaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_WmsJitOutPutDetial"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanSettle", b => { b.Property("Id") diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj index c09813b6..47366b8f 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj @@ -54,6 +54,7 @@ + diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json index 18125584..aa03b360 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json @@ -7,10 +7,10 @@ // "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;" //}, "ConnectionStrings": { - //"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", - //"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;" - "Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;", - "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;" + "Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", + "SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;" + //"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;", + //"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;" }, "Logging": { "LogLevel": { diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json index 7595b167..9492e153 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json @@ -7,10 +7,10 @@ // "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;" //}, "ConnectionStrings": { - //"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", - //"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;" - "Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;", - "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;", + "Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", + "SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;" + //"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;", + //"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;", //"WmsService": "Server=192.168.0.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;" }, diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs new file mode 100644 index 00000000..36a8d678 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs @@ -0,0 +1,46 @@ +using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Win.Sfs.SettleAccount.Entities.Wms +{ + public class WmsJitOutPutDetialDto + { + [ImporterHeader(Name = "交货单号")] + public string WmsBillNum { set; get; } + + [ImporterHeader(Name = "KENN号")] + //KENN号 + public string KennCode { set; get; } + [ImporterHeader(Name = "底盘号")] + //底盘号 + public string ChassisNumber { set; get; } + [ImporterHeader(Name = "物料号")] + //物料号 + public string MaterialCode { set; get; } + + [ImporterHeader(Name = "组件组物料")] + //物料号 + public string ParentMaterialCode { set; get; } + + [ImporterHeader(Name = "物料描述")] + //物料描述 + public string MaterialDesc { set; get; } + + [ImporterHeader(Name = "物料组(车型)")] + //物料组(车型) + public string MaterialGroup { set; get; } + + [ImporterHeader(Name = "结算数量")] + public decimal Qty { set; get; } + + + + } + + + +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs index 84fc50eb..eeda23b4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs @@ -43,6 +43,9 @@ using Magicodes.ExporterAndImporter.Core.Models; using TaskJob.Services; using TaskJob.EventArgs; +using Win.Sfs.SettleAccount.Entities.WMS; +using Win.Sfs.SettleAccount.Entities.Wms; +using Win.Sfs.SettleAccount.Repository; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { @@ -59,10 +62,14 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts private readonly IExcelImportAppService _excelImportService; private readonly ISettleAccountBranchEfCoreRepository _preBatchRepository; + private readonly ISettleAccountBranchEfCoreRepository _wmsRepository; + private readonly ISettleAccountBranchEfCoreRepository _wmsVersionRepository; private readonly ISettleAccountBranchEfCoreRepository _repository; private readonly ISettleAccountBranchEfCoreRepository _versionRepository; private readonly ISettleAccountBranchEfCoreRepository _fisRepository; private readonly ISettleAccountBranchEfCoreRepository _relrepository; + + private readonly WMSEfCoreRepository _wmsefRespository; private readonly TaskJobService _service; /// /// 构建方法 @@ -81,7 +88,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts TaskJobService service, ISettleAccountBranchEfCoreRepository fisRepository, ISettleAccountBranchEfCoreRepository preBatchRepository, - ISettleAccountBranchEfCoreRepository relrepository + ISettleAccountBranchEfCoreRepository relrepository, + ISettleAccountBranchEfCoreRepository wmsRepository, + ISettleAccountBranchEfCoreRepository wmsVersionRepository, + WMSEfCoreRepository wmsefRespository ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _service = service; @@ -92,10 +102,166 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts _repository = repository; _preBatchRepository = preBatchRepository; _relrepository = relrepository; + _wmsRepository = wmsRepository; + _wmsVersionRepository = wmsVersionRepository; + _wmsefRespository = wmsefRespository; + } + + /// + /// 汇总结算明细导记录 + /// + /// 上传的文件(前端已经限制只能上传一个附件) + /// + [HttpGet] + [Route("WmsJitOutPut")] + [DisableRequestSizeLimit] + + public async Task WmsJitOutPut(List fileList, string version) + { + + List _lst = new List(); + foreach (var filename in fileList) + { + string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; + IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter(); + var _list = await Importer.ImportSameSheets(fileSavePath); + foreach (var itm in _list) + { + var list = itm.Value.Data.ToList(); + _lst.AddRange(list.ToArray()); + } + } + var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); + + + var outPutDetail= await _wmsRepository.Where(p => p.Version == version).ToListAsync(); + + var query = from itm1 in _ls1 + join itm2 in outPutDetail on + new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber } + equals + new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1 + from tm1 in temp1.DefaultIfEmpty() where tm1==null + select itm1; + + await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0 }); + int _count= _wmsVersionRepository.Count(p => p.Version == version); + if (_count == 0) + { + var _version = new List(); + _version.Add(new WmsJitOutPut { Version = version, BillNum = "T" +DateTime.Now.ToString("yyyyMMddhhmmssdddd"), Creator = CurrentUser.Email }); + await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version); + } + //_wmsRepository.Where(p=>p) + return true; + + } + + [HttpGet] + [Route("WmsJitOutPut-Pass")] + + public async Task WmsJitOutPutPass( string version, List p_list=null) + { + if (p_list != null) + { + + var _ls = await _wmsRepository.Where(p => p_list.Contains(p.Id) && p.Version == version && p.State != 2).ToListAsync(); + if (_ls.Count() > 0) + { + var _first = _ls.FirstOrDefault(); + var _guid = GuidGenerator.Create(); + foreach (var itm in _ls) + { + itm.TaskId = _guid; + } + await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls); + var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0, _guid) + { + TaskId = _guid, + SourceBillNum = _first.BillNum, + TableName = "WmsJitOutPutDetail", + InterfaceType = "1", + Version = version, + State = 0, + + }; + var _l = new List(); + _l.Add(uniapi); + await _wmsefRespository.GetDbContext().BulkInsertAsync(_l); + + } + } + //_wmsDapper.GetListBySql("insert into WmsJitOutPutDetial", false); + //_wmsDapper.DbConnection.ConnectionTimeout = 1200; + //_wmsRepository.Where(p=>p) + return true; + + } + + + [HttpGet] + [Route("WmsJitOutPut-Cancel")] + + public async Task WmsJitOutPutCancel(List fileList, string version) + { + + List _lst = new List(); + foreach (var filename in fileList) + { + string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; + IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter(); + var _list = await Importer.ImportSameSheets(fileSavePath); + foreach (var itm in _list) + { + var list = itm.Value.Data.ToList(); + _lst.AddRange(list.ToArray()); + } + } + var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); + + await _wmsRepository.GetDbContext().BulkInsertAsync(_ls1, new BulkConfig() { BulkCopyTimeout = 0 }); + + int _count = _wmsVersionRepository.Count(p => p.Version == version); + if (_count == 0) + { + var _version = new List(); + _version.Add(new WmsJitOutPut { Version = version, BillNum = "T" + DateTime.Now.ToString("yyyyMMddhhmmssdddd"), Creator = CurrentUser.Email }); + await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version); + } + //_wmsRepository.Where(p=>p) + return true; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + [HttpPost] [Route("testImport")] [DisableRequestSizeLimit] diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/TaskList.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/TaskList.cs deleted file mode 100644 index 7205c1eb..00000000 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/TaskList.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.Shared.DomainBase; - -namespace Win.Sfs.SettleAccount.Entities.WMS -{ - public partial class TS_UNI_API: FullAuditedAggregateRootBase - { - - - - public TS_UNI_API(string interfaceType, string version, string tableName, int? billType, int? subBillType, string sourceBillNum) - { - InterfaceType = interfaceType; - Version = version; - TableName = tableName; - BillType = billType; - SubBillType = subBillType; - SourceBillNum = sourceBillNum; - } - /// - /// 接口类型 - /// - public string InterfaceType { get; set; } - /// - /// 版本号 - /// - public string Version { get; set; } - /// - /// 表明 - /// - public string TableName { get; set; } - - /// - /// 单据类型 - /// - public int? BillType { get; set; } - - /// - /// 子单据类型 - /// - public int? SubBillType { get; set; } - - /// - /// 原单据类型 - /// - public string SourceBillNum { get; set; } - - - /// - /// 状态 - /// - public int State { set; get; } - /// - /// 状态 - /// - //public int State { set; get; } - - - } - public class WmsOutPutDetial: FullAuditedAggregateRootBase - { - public WmsOutPutDetial(string wmsBillNum, string kennCode, string chassisNumber, string parentMaterialCode, string materialDesc, string materialGroup) - { - WmsBillNum = wmsBillNum; - KennCode = kennCode; - ChassisNumber = chassisNumber; - ParentMaterialCode = parentMaterialCode; - MaterialDesc = materialDesc; - MaterialGroup = materialGroup; - } - - //交货单号 - public string WmsBillNum{ set; get; } - //KENN号 - public string KennCode { set; get; } - //底盘号 - public string ChassisNumber { set; get; } - //物料号 - public string ParentMaterialCode { set; get; } - //物料描述 - public string MaterialDesc { set; get; } - //物料组(车型) - public string MaterialGroup { set; get; } - - - - } - - - -} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index 1120dece..15510def 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Authorization; +using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -24,6 +25,8 @@ using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.SettleAccounts; using Win.Sfs.SettleAccount.Entities.SettlementParts; using Win.Sfs.SettleAccount.Entities.TaskJobs; +using Win.Sfs.SettleAccount.Entities.Wms; +using Win.Sfs.SettleAccount.Entities.WMS; using Win.Sfs.SettleAccount.FISes; namespace Win.Sfs.SettleAccount.Reports.ReportServices @@ -605,6 +608,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices + + diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 933e8fe8..d2d3a39b 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -1410,6 +1410,13 @@ 仓储接口 缓存 + + + 结算总成和ERP总成价格对比 + + 上传的文件(前端已经限制只能上传一个附件) + + 导入功能 @@ -2154,24 +2161,29 @@ 表明 - + + + 原单据号 + + + - 单据类型 + 状态 - + - 子单据类型 + - + - 原单据类型 + 扩展字段2 - + - 状态 + 扩展字段3 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs index 09cf19f8..bd492e48 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs @@ -67,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities public virtual async Task> GetVersionListAsync() { - var entities = await _repository.Select(p => p.Type).Distinct().ToListAsync(); + var entities = await _repository.Where(p=> !string.IsNullOrEmpty(p.Type)).Select(p => p.Type ).Distinct().ToListAsync(); return entities; } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs new file mode 100644 index 00000000..ca24a765 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs @@ -0,0 +1,172 @@ +using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared.DomainBase; + +namespace Win.Sfs.SettleAccount.Entities.WMS +{ + public partial class TS_UNI_API: FullAuditedAggregateRootBase + { + public TS_UNI_API(Guid id,string interfaceType, string version, string tableName, string sourceBillNum,int state,Guid taskId) + { + Id = id; + InterfaceType = interfaceType; + Version = version; + TableName = tableName; + SourceBillNum = sourceBillNum; + State = state; + TaskId = taskId; + } + /// + /// 接口类型 + /// + public string InterfaceType { get; set; } + /// + /// 版本号 + /// + public string Version { get; set; } + /// + /// 表明 + /// + public string TableName { get; set; } + + /// + /// 原单据号 + /// + public string SourceBillNum { get; set; } + + /// + /// 状态 + /// + public int State { set; get; } + + + /// + /// 状态 + /// + public Guid TaskId { set; get; } + + + } + + + public class WmsJitOutPut : FullAuditedAggregateRootBase + { + public WmsJitOutPut() + { + } + + public WmsJitOutPut(Guid id,string version, string billNum, string creator):base(id) + { + Id = id; + Version = version; + BillNum = billNum; + Creator = creator; + } + + public string Version { set; get; } + + public string BillNum { set; get; } + + public string Creator { set; get; } + + + + } + + + /// + /// + /// + public class WmsJitOutPutDetial : FullAuditedAggregateRootBase + { + public WmsJitOutPutDetial() + { + } + + public WmsJitOutPutDetial(Guid id, string wmsBillNum, string kennCode, string chassisNumber, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode,string billNum,Guid taskId) + { + Id = id; + WmsBillNum = wmsBillNum; + KennCode = kennCode; + ChassisNumber = chassisNumber; + MaterialCode = materialCode; + MaterialDesc = materialDesc; + MaterialGroup = materialGroup; + OutPut = outPut; + InPut = inPut; + State = state; + Extend1 = extend1; + Extend2 = extend2; + Version = extend3; + ParentMaterialCode = parentMaterialCode; + BillNum = billNum; + TaskId = taskId; + } + + + // 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明 + + + //交货单号 + + [ImporterHeader(Name = "组件组物料")] + public string ParentMaterialCode { set; get; } + [ImporterHeader(Name = "交货单号")] + public string WmsBillNum { set; get; } + [ImporterHeader(Name = "KENN号")] + //KENN号 + public string KennCode { set; get; } + [ImporterHeader(Name = "底盘号")] + //底盘号 + public string ChassisNumber { set; get; } + [ImporterHeader(Name = "物料号")] + //物料号 + public string MaterialCode { set; get; } + [ImporterHeader(Name = "物料描述")] + //物料描述 + public string MaterialDesc { set; get; } + [ImporterHeader(Name = "物料组(车型)")] + //物料组(车型) + public string MaterialGroup { set; get; } + [ImporterHeader(Name = "出库库位")] + //出库库位 + public string OutPut { set; get; } + [ImporterHeader(Name = "入库库位")] + //入库库位 + public string InPut { set; get; } + [ImporterHeader(Name = "状态")] + public int State { get; set; } + [ImporterHeader(Name = "扩展字段1")] + /// + /// 扩展字段1 + /// + public string Extend1 { set; get; } + /// + /// 扩展字段2 + /// + [ImporterHeader(Name = "扩展字段2")] + public string Extend2 { set; get; } + /// + /// 扩展字段3 + /// + [ImporterHeader(Name = "版本号")] + public string Version { set; get; } + [ImporterHeader(Name = "数量")] + public string Qty { set; get; } + + [ImporterHeader(Name = "数量",IsIgnore =true)] + public string BillNum { set; get; } + + + public Guid TaskId { set; get; } + + + } + + + +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 9b0abcd3..bde6337e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -70,6 +70,7 @@ using Win.Sfs.SettleAccount.Entities.WMS_SparePart; using Win.Sfs.SettleAccount.Entities.HQ_H; using Win.Sfs.SettleAccount.Entities.HQ_M; using Win.Sfs.SettleAccount.Entities.BT_Car; +using Win.Sfs.SettleAccount.Entities.WMS; namespace Win.Sfs.SettleAccount { @@ -267,6 +268,7 @@ namespace Win.Sfs.SettleAccount builder.ConfigureSettlementPakAndSparePartsVersion(options); builder.ConfigureSecMatchBase(options); + builder.ConfigureWmsJitOutPutDetial(options); #endregion @@ -354,18 +356,47 @@ namespace Win.Sfs.SettleAccount }); } + /// + /// 准时化出库明细 + /// + /// + /// + private static void ConfigureWmsJitOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_WmsJitOutPutDetial", options.Schema); + b.ConfigureByConvention(); + b.Property(x => x.WmsBillNum).HasMaxLength(50).IsRequired(); + b.Property(x => x.Remark).HasMaxLength(200).IsRequired(); + b.Property(x => x.ParentMaterialCode).HasMaxLength(50).IsRequired(); + b.Property(x => x.MaterialCode).HasMaxLength(50).IsRequired(); + b.Property(x => x.MaterialGroup).HasMaxLength(200); + b.Property(x => x.OutPut).HasMaxLength(50); + b.Property(x => x.InPut).HasMaxLength(50); + b.Property(x => x.Extend1).HasMaxLength(50); + b.Property(x => x.Extend2).HasMaxLength(50); + b.Property(x => x.Extend3).HasMaxLength(50); + b.Property(x => x.ChassisNumber).HasMaxLength(50); + b.Property(x => x.KennCode).HasMaxLength(50); + b.Property(x => x.MaterialDesc).HasMaxLength(50); + }); + } + + + private static void ConfigureBTCarVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { builder.Entity(b => { - b.ToTable($"{options.TablePrefix}_BT_Car_PlatformVersion", options.Schema); - b.ConfigureByConvention(); - b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); - b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter); + //b.ToTable($"{options.TablePrefix}_BT_Car_PlatformVersion", options.Schema); + //b.ConfigureByConvention(); + //b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); + //b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); + //b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); + //b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); + //b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter); }); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs index 072bb292..7d0bbfa8 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs @@ -56,10 +56,10 @@ namespace Win.Sfs.SettleAccount }); - // context.Services.AddTransient(typeof(IInventoryDetailRepository), - //typeof(InventoryDetailRepository)); - + // context.Services.AddTransient(typeof(IInventoryDetailRepository), + //typeof(InventoryDetailRepository)); + context.Services.AddTransient(typeof(WMSEfCoreRepository<>)), context.Services.AddTransient(typeof(INormalEfCoreRepository<,>), typeof(SettleAccountNormalEfCoreRepository<,>)); context.Services.AddTransient(typeof(IBranchEfCoreRepository<,>), diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDapperRepository.cs new file mode 100644 index 00000000..2ecd966f --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDapperRepository.cs @@ -0,0 +1,126 @@ +using Dapper; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories.Dapper; +using Volo.Abp.EntityFrameworkCore; + + + +namespace Win.Sfs.SettleAccount +{ + public class WMSDapperRepository : DapperRepository, ITransientDependency + { + public WMSDapperRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } + + public virtual async Task> GetListBySqlAsync(string sql, bool isTrans = false) + { + if (isTrans) + { + IDbConnection conn = await GetDbConnectionAsync(); + IDbTransaction trans = await GetDbTransactionAsync(); + return (await conn.QueryAsync(sql, null, trans)) + .ToList(); + } + else + { + IDbConnection conn = await GetDbConnectionAsync(); + return (await conn.QueryAsync(sql)) + .ToList(); + } + } + + public virtual async Task GetSingleBySqlAsync(string sql, bool isTrans = false) + { + if (isTrans) + { + IDbConnection conn = await GetDbConnectionAsync(); + IDbTransaction trans = await GetDbTransactionAsync(); + return await conn.QuerySingleOrDefaultAsync(sql, null, trans); + } + else + { + IDbConnection conn = await GetDbConnectionAsync(); + return await conn.QuerySingleOrDefaultAsync(sql); + } + } + + + public virtual async Task ExecuteSqlAsync(string sql, object obj = null, bool isTrans = false) + { + if (isTrans) + { + //return await DbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name }, DbTransaction); + IDbConnection conn = await GetDbConnectionAsync(); + IDbTransaction trans = await GetDbTransactionAsync(); + return await conn.ExecuteAsync(sql, obj, trans); + } + else + { + //return await DbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name }, DbTransaction); + IDbConnection conn = await GetDbConnectionAsync(); + return await conn.ExecuteAsync(sql, obj); + } + } + + + #region 同步方法 + public virtual List GetListBySql(string sql, bool isTrans = false) + { + if (isTrans) + { + IDbConnection conn = GetDbConnectionAsync().GetAwaiter().GetResult(); + IDbTransaction trans = GetDbTransactionAsync().GetAwaiter().GetResult(); + return (conn.Query(sql, null, trans)) + .ToList(); + } + else + { + IDbConnection conn = (IDbConnection)GetDbConnectionAsync().GetAwaiter().GetResult(); + return (conn.Query(sql)) + .ToList(); + } + } + + public virtual T GetSingleBySql(string sql, bool isTrans = false) + { + if (isTrans) + { + IDbConnection conn = GetDbConnectionAsync().GetAwaiter().GetResult(); + IDbTransaction trans = GetDbTransactionAsync().GetAwaiter().GetResult(); + return conn.QuerySingleOrDefault(sql, null, trans); + } + else + { + IDbConnection conn = (IDbConnection)GetDbConnectionAsync().GetAwaiter().GetResult(); + return conn.QuerySingleOrDefault(sql); + } + } + + + public virtual int ExecuteSql(string sql, object obj = null, bool isTrans = false) + { + if (isTrans) + { + IDbConnection conn = GetDbConnectionAsync().GetAwaiter().GetResult(); + IDbTransaction trans = GetDbTransactionAsync().GetAwaiter().GetResult(); + return conn.Execute(sql, obj, trans); + } + else + { + IDbConnection conn = (IDbConnection)GetDbConnectionAsync().GetAwaiter().GetResult(); + return conn.Execute(sql, obj); + } + } + + #endregion + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDbContext.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDbContext.cs new file mode 100644 index 00000000..3ac5385f --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDbContext.cs @@ -0,0 +1,85 @@ + +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; +using Win.Sfs.SettleAccount.Entities.WMS; + +namespace Win.Sfs.SettleAccount +{ + + + + + [ConnectionStringName("WMS")] + public class WMSDbContext : AbpDbContext + { + #region DbSet + //public virtual DbSet TB_BILL { get; set; } + //public virtual DbSet TS_SORT_DETAIL { get; set; } + #endregion + + /* Add DbSet properties for your Aggregate Roots / Entities here. + * Also map them inside NewJitDbContextModelCreatingExtensions.ConfigureNewJit + */ + + public WMSDbContext(DbContextOptions options) + : base(options) + { + + } + + //protected override void OnModelCreating(ModelBuilder builder) + //{ + // base.OnModelCreating(builder); + // builder.Entity(b => + // { + // b.ToTable("WmsJitOutPutDetial"); + // b.HasKey(x => x.Id); + // b.Property(x => x.WmsBillNum).HasMaxLength(50).IsRequired(); + // b.Property(x => x.Remark).HasMaxLength(200).IsRequired(); + // b.Property(x => x.ParentMaterialCode).HasMaxLength(50).IsRequired(); + // b.Property(x => x.MaterialCode).HasMaxLength(50).IsRequired(); + // b.Property(x => x.MaterialGroup).HasMaxLength(200); + // b.Property(x => x.OutPut).HasMaxLength(50); + // b.Property(x => x.Extend1).HasMaxLength(50); + // b.Property(x => x.Extend2).HasMaxLength(50); + // b.Property(x => x.Extend3).HasMaxLength(50); + // b.Property(x => x.ChassisNumber).HasMaxLength(50); + // b.Property(x => x.KennCode).HasMaxLength(50); + // b.Property(x => x.MaterialDesc).HasMaxLength(50); + // }); + + // builder.Entity(b => + // { + // b.ToTable("TS_UNI_API"); + // b.HasKey(x => x.Id); + // b.Property(x => x.Remark).HasMaxLength(200).IsRequired(); + // b.Property(x => x.SourceBillNum).HasMaxLength(50).IsRequired(); + // b.Property(x => x.TableName).HasMaxLength(50).IsRequired(); + // b.Property(x => x.Version).HasMaxLength(50).IsRequired(); + // b.Property(x => x.TableName).HasMaxLength(50).IsRequired(); + // b.Property(x => x.TableName).HasMaxLength(50).IsRequired(); + // }); + + + + + + + // //在这里配置共享表 + + // //builder.Entity(b => + // //{ + // // b.HasIndex(x => new { x.BillNum, x.VinCode, x.PartCode }).IsUnique(); + + // //}); + //} + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/WMSEfCoreRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/WMSEfCoreRepository.cs new file mode 100644 index 00000000..bbec2721 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/WMSEfCoreRepository.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Common; +using System.Data.SqlClient; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win.Sfs.Shared; +using Win.Sfs.Shared.DomainBase; +using Win.Sfs.Shared.Filter; +using Win.Sfs.Shared.RepositoryBase; + +namespace Win.Sfs.SettleAccount.Repository +{ + public class WMSEfCoreRepository : + EfCoreRepository, + ITransientDependency + where TEntity : class,IEntity + { + + private readonly IDbContextProvider _dbContextProvider; + + + + public WMSEfCoreRepository(IDbContextProvider dbContextProvider) : + base(dbContextProvider) + { + + _dbContextProvider = dbContextProvider; + + } + public WMSEfCoreRepository() : base(null) + { + + } + + public DbCommand CreateCommand(string commandText, CommandType commandType, params DbParameter[] parameters) + { + var command = DbContext.Database.GetDbConnection().CreateCommand(); + + command.CommandText = commandText; + command.CommandType = commandType; + command.Transaction = DbContext.Database.CurrentTransaction?.GetDbTransaction(); + + foreach (var parameter in parameters) + { + command.Parameters.Add(parameter); + } + + return command; + } + + public async Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) + { + var connection = DbContext.Database.GetDbConnection(); + + if (connection.State != ConnectionState.Open) + { + await connection.OpenAsync(cancellationToken); + } + } + public virtual async Task> GetAllAsync( bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var query = includeDetails ? this.WithDetails() : this.GetQueryable(); + + //query = query.Where(p => p.BranchId.Equals(branchId)); + + return await query.ToListAsync(cancellationToken: cancellationToken); + } + + public virtual async Task GetCountAsync( CancellationToken cancellationToken = default) + { + return await this.GetQueryable() + //.Where(p => p.BranchId.Equals(branchId)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + + } + + public virtual async Task GetCountByFilterAsync( List filters, + CancellationToken cancellationToken = default) + { + return await this.GetQueryable() + //.Where(p => p.BranchId.Equals(branchId)) + .WhereIf(filters?.Count != 0, filters.ToLambda()) + .LongCountAsync(GetCancellationToken(cancellationToken)); + } + + public virtual async Task> GetListByFilterAsync(List filters, + string sorting = null, + int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var query = includeDetails ? this.WithDetails() : this.GetQueryable(); + // query = query.Where(p => p.BranchId.Equals(branchId)); + var entities = query.WhereIf(filters?.Count != 0, filters.ToLambda()); + //2021-07-02 设置sorting首字母大小,因设置了驼峰规则,不匹配“ var memberProp = typeof(T).GetProperty(propertyName);”反射 + if(!string.IsNullOrEmpty(sorting)) + { + sorting = sorting.Substring(0, 1).ToUpper() + sorting.Substring(1); + } + entities = GetSortingQueryable(entities, sorting); + return await entities.PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + + + } + + protected static IQueryable GetSortingQueryable(IQueryable entities, string sorting) + { + if (string.IsNullOrEmpty(sorting)) + { + entities = entities.OrderByDescending("Id"); + } + else + { + + + + + var sortParams = sorting?.Split(' '); + var sortName = sortParams[0]; + + + Type t = typeof(TEntity); + var _first = t.GetProperties().Where(p => p.Name.ToUpper() == sortName.ToUpper()).FirstOrDefault(); + if (_first != null) + { + sortName = _first.Name; + } + + + + + bool isDesc; + if (sortParams.Length > 1) + { + var sortDirection = sortParams[1]; + isDesc = sortDirection.ToUpper().Contains("DESC") ? true : false; + } + else + { + isDesc = true; + } + + entities = isDesc ? entities.OrderByDescending(sortName) : entities.OrderBy(sortName); + } + + return entities; + } + + } + + +} \ No newline at end of file