Browse Source

增加退货是否有EDI数据判断,后更新数据

master
zhouhongjun 1 year ago
parent
commit
02ab3626ab
  1. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

@ -105,6 +105,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
await db.BulkUpdateAsync<BBAC_SE_EDI>(ediReturnEntities).ConfigureAwait(false); await db.BulkUpdateAsync<BBAC_SE_EDI>(ediReturnEntities).ConfigureAwait(false);
} }
var seReturnQuery = db.Set<BBAC_SE_DETAIL>().FromSqlRaw("select * from (SELECT a.* FROM [dbo].[Set_BBAC_SE_DETAIL] a right join (select PN,CustomerPartCodeNoSpace,COUNT(*) as hj,sum(Qty) as Qty,sum(CAST(IsHaveEdiData AS int)) as haveedi from Set_BBAC_SE_DETAIL where BusinessType=1 group by PN,CustomerPartCodeNoSpace having count(*)>sum(CAST(IsHaveEdiData AS int)) and count(*)>=3 and sum(CAST(IsHaveEdiData AS int))>=1) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace and a.IsHaveEdiData=0) c where c.id is not null ");
var seReturnEntities = seReturnQuery.ToList();
if (seReturnEntities.Count > 0)
{
seReturnEntities.ForEach(t => t.IsHaveEdiData = true);
await db.BulkUpdateAsync<BBAC_SE_DETAIL>(seReturnEntities).ConfigureAwait(false);
}
} }
/// <summary> /// <summary>

Loading…
Cancel
Save