Browse Source

up

master
mahao 1 year ago
parent
commit
89a631eb2c
  1. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

@ -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);

Loading…
Cancel
Save