|
|
@ -79,13 +79,8 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater |
|
|
|
} |
|
|
|
foreach (var item in entitys) |
|
|
|
{ |
|
|
|
var entity = _repository.FirstOrDefault(p => p.ErpMaterialCode == item.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian); |
|
|
|
if (entity != null) |
|
|
|
{ |
|
|
|
entity.Update(item.MaterialDesc, item.SettleMaterialCode); |
|
|
|
await _repository.UpdateAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
else |
|
|
|
var entity = _repository.FirstOrDefault(p => p.ErpMaterialCode == item.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian && p.SettleMaterialCode == item.SettleMaterialCode); |
|
|
|
if (entity == null) |
|
|
|
{ |
|
|
|
item.BusinessType = EnumBusinessType.BeiJian; |
|
|
|
await _repository.InsertAsync(item).ConfigureAwait(false); |
|
|
|