Browse Source

[fix]修复采购订单无法同步的BUG

master
贾荣国 2 years ago
parent
commit
0b59717d16
  1. 10
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs
  2. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbPoRepository.cs

10
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.Id).HasColumnName("UID").ValueGeneratedOnAdd();
b.Property(q => q.Site).HasMaxLength(50).IsRequired(); b.Property(q => q.Site).HasMaxLength(50).IsRequired();
b.Property(q => q.PoBillNum).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.VendId).HasMaxLength(50).IsRequired();
b.Property(q => q.ModType); b.Property(q => q.ModType);
b.Property(q => q.Contacter).HasMaxLength(50); 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.BuyerPhone).HasMaxLength(50);
b.Property(q => q.Remark).HasMaxLength(500); b.Property(q => q.Remark).HasMaxLength(500);
b.Property(q => q.BeginTime).IsRequired(); 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.Extend1);
b.Property(q => q.Extend2); b.Property(q => q.Extend2);
b.Property(q => q.Extend3); 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.Site).HasMaxLength(50).IsRequired();
b.Property(q => q.PoBillNum).HasMaxLength(50).IsRequired(); b.Property(q => q.PoBillNum).HasMaxLength(50).IsRequired();
b.Property(q => q.PoLine); b.Property(q => q.PoLine);
b.Property(q => q.BeginTime).IsRequired(); b.Property(q => q.BeginTime);
b.Property(q => q.EndTime).IsRequired(); b.Property(q => q.EndTime);
b.Property(q => q.PartCode).HasMaxLength(50).IsRequired(); b.Property(q => q.PartCode).HasMaxLength(50).IsRequired();
b.Property(q => q.ShippedQty).HasPrecision(18,6); b.Property(q => q.ShippedQty).HasPrecision(18,6);
b.Property(q => q.ReceivedQty).HasPrecision(18, 6); b.Property(q => q.ReceivedQty).HasPrecision(18, 6);
b.Property(q => q.RejectQty).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.LocUnit).HasMaxLength(50);
b.Property(q => q.Price).HasPrecision(18, 6); b.Property(q => q.Price).HasPrecision(18, 6);
b.Property(q => q.Currency).HasMaxLength(50); b.Property(q => q.Currency).HasMaxLength(50);

2
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; TB_PO ret;
var dbSet = await GetDbSetAsync(); var dbSet = await GetDbSetAsync();
var current = await dbSet.FirstOrDefaultAsync(p => p.Site == tbPo.Site var current = await dbSet.FirstOrDefaultAsync(p => p.Site == tbPo.Site
&& p.ErpBillNum == tbPo.ErpBillNum); && p.PoBillNum == tbPo.PoBillNum);
if (current == null) if (current == null)
{ {
ret = await InsertAsync(tbPo); ret = await InsertAsync(tbPo);

Loading…
Cancel
Save