From 89a631eb2c7a97722e3ca04e8bc4c74c6bb71e49 Mon Sep 17 00:00:00 2001 From: mahao Date: Tue, 19 Sep 2023 09:19:16 +0800 Subject: [PATCH] up --- .../MaterialRelationshipAppService.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs index a55441e4..f0ada4a6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs @@ -79,13 +79,8 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase 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);