|
|
@ -255,20 +255,25 @@ namespace Win.Sfs.SettleAccount.Entities.Prices |
|
|
|
where itm1.Price != itm2.Price |
|
|
|
select new PriceList(itm2.Id, itm2.BeginDate, itm2.EndDate, itm1.Price, itm2.MaterialCode, itm2.Type, itm2.ParentId, itm2.Version, itm1.CustomerCode); |
|
|
|
|
|
|
|
if (update.Count() > 0) |
|
|
|
{ |
|
|
|
await _repository.GetDbContext().BulkUpdateAsync(update.ToList()); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var add = from itm1 in entities |
|
|
|
join itm2 in pricelist |
|
|
|
on new { itm1.Type, itm1.MaterialCode } |
|
|
|
equals new { itm2.Type, itm2.MaterialCode } |
|
|
|
on new { itm1.Type, itm1.MaterialCode,itm1.CustomerCode } |
|
|
|
equals new { itm2.Type, itm2.MaterialCode,itm2.CustomerCode } |
|
|
|
into temp |
|
|
|
from itm3 in temp.DefaultIfEmpty() |
|
|
|
where itm3 == null |
|
|
|
select itm1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (update!=null&& update.Count() > 0) |
|
|
|
{ |
|
|
|
await _repository.GetDbContext().BulkUpdateAsync(update.ToList()); |
|
|
|
} |
|
|
|
if(add!=null && add.Count()>0) |
|
|
|
{ |
|
|
|
|
|
|
|
await _repository.GetDbContext().BulkInsertAsync<PriceListBJ>(add.ToList()); |
|
|
|
|
|
|
|
} |
|
|
|