From 0b59717d16f5d659d02b36a78451b6f4520c3d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E8=8D=A3=E5=9B=BD?= Date: Fri, 1 Jul 2022 09:19:40 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=A0=E6=B3=95=E5=90=8C=E6=AD=A5=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DbContext/V1ScpDbContextModelCreatingExtensions.cs | 10 +++++----- .../Repositories/TbPoRepository.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) 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);