Browse Source

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

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

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

@ -104,7 +104,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
ediReturnEntities.ForEach(t => t.IsHaveSeData = 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>

Loading…
Cancel
Save