diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs index fa36654..ae5eafc 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs @@ -112,7 +112,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore b.Property(q => q.Id).HasColumnName("UID").ValueGeneratedOnAdd(); b.Property(q => q.Site).HasMaxLength(50).IsRequired(); b.Property(q => q.PoBillNum).HasMaxLength(50).IsRequired(); - b.Property(q => q.ErpBillNum).HasMaxLength(50).IsRequired(); + b.Property(q => q.ErpBillNum).HasMaxLength(50); b.Property(q => q.VendId).HasMaxLength(50).IsRequired(); b.Property(q => q.ModType); b.Property(q => q.Contacter).HasMaxLength(50); @@ -120,7 +120,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore b.Property(q => q.BuyerPhone).HasMaxLength(50); b.Property(q => q.Remark).HasMaxLength(500); b.Property(q => q.BeginTime).IsRequired(); - b.Property(q => q.EndTime).IsRequired(); + b.Property(q => q.EndTime); b.Property(q => q.Extend1); b.Property(q => q.Extend2); b.Property(q => q.Extend3); @@ -151,13 +151,13 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore b.Property(q => q.Site).HasMaxLength(50).IsRequired(); b.Property(q => q.PoBillNum).HasMaxLength(50).IsRequired(); b.Property(q => q.PoLine); - b.Property(q => q.BeginTime).IsRequired(); - b.Property(q => q.EndTime).IsRequired(); + b.Property(q => q.BeginTime); + b.Property(q => q.EndTime); b.Property(q => q.PartCode).HasMaxLength(50).IsRequired(); b.Property(q => q.ShippedQty).HasPrecision(18,6); b.Property(q => q.ReceivedQty).HasPrecision(18, 6); b.Property(q => q.RejectQty).HasPrecision(18, 6); - b.Property(q => q.PoUnit).HasMaxLength(50).IsRequired(); + b.Property(q => q.PoUnit).HasMaxLength(50); b.Property(q => q.LocUnit).HasMaxLength(50); b.Property(q => q.Price).HasPrecision(18, 6); b.Property(q => q.Currency).HasMaxLength(50); diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbPoRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbPoRepository.cs index 65bf400..feac6b9 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbPoRepository.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbPoRepository.cs @@ -17,7 +17,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore TB_PO ret; var dbSet = await GetDbSetAsync(); var current = await dbSet.FirstOrDefaultAsync(p => p.Site == tbPo.Site - && p.ErpBillNum == tbPo.ErpBillNum); + && p.PoBillNum == tbPo.PoBillNum); if (current == null) { ret = await InsertAsync(tbPo);