From 3e1ffddd0ec9d0df7c7c8e7b461bc5bfc4fd4eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E8=8D=A3=E5=9B=BD?= Date: Tue, 14 Jun 2022 15:42:55 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=BF=BD=E7=95=A5=E5=A4=9A=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Parts/PartAppService.cs | 14 +++-- .../PurchaseOrders/PurchaseOrderAppService.cs | 14 +++-- .../Receipts/ReceiptAppService.cs | 14 +++-- .../ScpV1AutoMapperProfile.cs | 53 +++++++++---------- .../Suppliers/SuppliersAppService.cs | 11 +++- .../UnplannedReceiptAppService.cs | 14 +++-- .../Repositories/TaPartRepository.cs | 3 +- .../Repositories/TaVenderRepository.cs | 2 +- 8 files changed, 82 insertions(+), 43 deletions(-) diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs index 51e02fb..9bffd73 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs @@ -16,6 +16,7 @@ using Volo.Abp.Uow; using Win_in.Sfs.Scp.v1.Domain; using Microsoft.Extensions.Configuration; using Volo.Abp.Clients; +using Volo.Abp.Data; using Volo.Abp.MultiTenancy; using Volo.Abp.Validation; using IConfiguration = Microsoft.Extensions.Configuration.IConfiguration; @@ -36,18 +37,21 @@ namespace Win_in.Sfs.Scp.WebApi private readonly ITaPartRepository _taPartRepository; private readonly ITenantStore _tenantStore; private readonly ITenantRepository _tenantRepository; - + private readonly IDataFilter _dataFilter; + public PartAppService( IPartRepository repository , ITaPartRepository taPartRepository , ITenantStore tenantStore , ITenantRepository tenantRepository + , IDataFilter dataFilter ) : base(repository) { _partRepository = repository; _taPartRepository = taPartRepository; _tenantStore = tenantStore; _tenantRepository = tenantRepository; + _dataFilter = dataFilter; } /// @@ -96,8 +100,12 @@ namespace Win_in.Sfs.Scp.WebApi var tenant = await _tenantStore.FindAsync(entity.Site); using (CurrentTenant.Change(tenant.Id, tenant.Name)) { - await UpsertTaPartAsync(entity, tenant.Id); - await CurrentUnitOfWork.SaveChangesAsync(); + using (_dataFilter.Disable()) + { + + await UpsertTaPartAsync(entity, tenant.Id); + await CurrentUnitOfWork.SaveChangesAsync(); + } } } catch (Exception ex) diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs index e46311e..28a236d 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs @@ -12,6 +12,7 @@ using Volo.Abp.TenantManagement; using Volo.Abp.Validation; using Win_in.Sfs.Scp.v1.Domain; using System.Security.Policy; +using Volo.Abp.Data; namespace Win_in.Sfs.Scp.WebApi { @@ -29,6 +30,7 @@ namespace Win_in.Sfs.Scp.WebApi private readonly ITaVenderRepository _taVenderRepository; private readonly ITenantStore _tenantStore; private readonly ITenantRepository _tenantRepository; + private readonly IDataFilter _dataFilter; public PurchaseOrderAppService( IPurchaseOrderRepository repository @@ -37,6 +39,7 @@ namespace Win_in.Sfs.Scp.WebApi , ITaVenderRepository taVenderRepository , ITenantStore tenantStore , ITenantRepository tenantRepository + , IDataFilter dataFilter ) : base(repository) { _purchaseOrderRepository = repository; @@ -45,6 +48,7 @@ namespace Win_in.Sfs.Scp.WebApi _taVenderRepository = taVenderRepository; _tenantStore = tenantStore; _tenantRepository = tenantRepository; + _dataFilter = dataFilter; } @@ -104,11 +108,15 @@ namespace Win_in.Sfs.Scp.WebApi var tenant = await _tenantStore.FindAsync(entity.Site); using (CurrentTenant.Change(tenant.Id, tenant.Name)) { - Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.SupplierCode); + using (_dataFilter.Disable()) + { + Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.SupplierCode); - await UpsertTbPoAndTbPoDetailAsync(entity, tenant.Id); - await CurrentUnitOfWork.SaveChangesAsync(); + + await UpsertTbPoAndTbPoDetailAsync(entity, tenant.Id); + await CurrentUnitOfWork.SaveChangesAsync(); + } } } catch (Exception ex) diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs index a740ea8..eef8062 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Data; using Volo.Abp.MultiTenancy; using Volo.Abp.Uow; using Volo.Abp.Validation; @@ -29,6 +30,7 @@ namespace Win_in.Sfs.Scp.WebApi private readonly ITaVenderRepository _taVenderRepository; private readonly ITenantStore _tenantStore; private readonly ITenantRepository _tenantRepository; + private readonly IDataFilter _dataFilter; public ReceiptAppService( IReceiptRepository repository @@ -37,6 +39,7 @@ namespace Win_in.Sfs.Scp.WebApi , ITaVenderRepository taVenderRepository , ITenantStore tenantStore , ITenantRepository tenantRepository + , IDataFilter dataFilter ) : base(repository) { _receiptRepository = repository; @@ -45,6 +48,7 @@ namespace Win_in.Sfs.Scp.WebApi _taVenderRepository = taVenderRepository; _tenantStore = tenantStore; _tenantRepository = tenantRepository; + _dataFilter = dataFilter; } @@ -95,10 +99,14 @@ namespace Win_in.Sfs.Scp.WebApi var tenant = await _tenantStore.FindAsync(entity.Site); using (CurrentTenant.Change(tenant.Id, tenant.Name)) { - Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.SupplierCode); + using (_dataFilter.Disable()) + { - await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id); - await CurrentUnitOfWork.SaveChangesAsync(); + Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.SupplierCode); + + await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id); + await CurrentUnitOfWork.SaveChangesAsync(); + } } } catch (Exception ex) diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs index 4f40f61..bb17509 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs @@ -31,8 +31,8 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.Site, p => p.MapFrom(q => q.Site)) .ForMember(p => p.PartCode, p => p.MapFrom(q => q.Code)) .ForMember(p => p.ErpPartCode, p => p.MapFrom(q => q.Code)) - .ForMember(p => p.PartDesc1, p => p.MapFrom(q =>string.IsNullOrEmpty(q.Desc2)?"":q.Desc2)) - .ForMember(p => p.PartDesc2, p => p.MapFrom(q =>string.IsNullOrEmpty(q.Desc1)?"":q.Desc1)) + // .ForMember(p => p.PartDesc1, p => p.MapFrom(q => ""))//中文描述不要覆盖 + .ForMember(p => p.PartDesc2, p => p.MapFrom(q => string.IsNullOrEmpty(q.Desc1) ? "" : q.Desc1)) .ForMember(p => p.ProjectId, p => p.MapFrom(q => q.ProductLine)) .ForMember(p => p.Unit, p => p.MapFrom(q => q.Uom)) .ForMember(p => p.PartGroup, p => p.MapFrom(q => q.Group)) @@ -40,7 +40,7 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.Configuration, p => p.MapFrom(q => q.Type))//TODO .ForMember(p => p.ValidityDays, p => p.MapFrom(q => 0))//默认值 .ForMember(p => p.ReceivePort, p => p.MapFrom(q => q.Desc2))//默认值 - .ForMember(p=>p.Qlevel,p=>p.MapFrom(q=>q.QLevel)) + .ForMember(p => p.Qlevel, p => p.MapFrom(q => q.QLevel)) // .ForMember(p => p.PalletSize, p => p.MapFrom(q => ""))//默认值 .ForMember(p => p.Remark, p => p.MapFrom(q => q.Version)) // .ForMember(p => p.Ischeck, p => p.MapFrom(q => false))//默认值 @@ -55,16 +55,15 @@ namespace Win_in.Sfs.Scp.WebApi { CreateMap() .Ignore(p => p.Id) - .ForMember(p => p.Site, p => p.MapFrom(q => q.Company))//TODO 接口没有传入Site + .ForMember(p => p.Site, p => p.MapFrom(q => q.Company))//接口没有传入Site .ForMember(p => p.VendId, p => p.MapFrom(q => q.Code)) - .ForMember(p => p.VendName, p => p.MapFrom(q => q.Desc)) - .ForMember(p => p.VendAbbCode, p => p.MapFrom(q=>"0"))//未使用 + .ForMember(p => p.ZipCode, p => p.MapFrom(q => q.Desc)) //英文描述放到ZipCode中 + .ForMember(p => p.VendAbbCode, p => p.MapFrom(q => "0"))//未使用 .ForMember(p => p.VendType, p => p.MapFrom(q => ""))//默认值未空 .ForMember(p => p.Country, p => p.MapFrom(q => q.Country)) .ForMember(p => p.City, p => p.MapFrom(q => q.City)) .ForMember(p => p.Currency, p => p.MapFrom(q => q.Currency)) .ForMember(p => p.Address, p => p.MapFrom(q => q.Address)) - .ForMember(p => p.ZipCode, p => p.MapFrom(q => q.PostId)) .ForMember(p => p.Contacter, p => p.MapFrom(q => q.ContactName)) .ForMember(p => p.Phone, p => p.MapFrom(q => q.Phone)) .ForMember(p => p.Fax, p => p.MapFrom(q => q.Fax)) @@ -72,8 +71,8 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.State, p => p.MapFrom(q => q.IsActive ? 1 : 0))//1:有效,2:无效 .ForMember(p => p.Remark, p => p.MapFrom(q => q.Remark)) .ForMember(p => p.Tax, p => p.MapFrom(q => 0))//默认值 - // .ForMember(p => p.ReceiveTimeScope, p => p.MapFrom(q =>0))//默认值 - // .ForMember(p => p.Quota, p => p.MapFrom(q =>0))//默认值 + // .ForMember(p => p.ReceiveTimeScope, p => p.MapFrom(q =>0))//默认值 + // .ForMember(p => p.Quota, p => p.MapFrom(q =>0))//默认值 ; } @@ -90,7 +89,7 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.ErpRecvBillNum, p => p.MapFrom(q => q.RcNumber)) .ForMember(p => p.RecvBillNum, p => p.MapFrom(q => q.RcNumber)) .ForMember(p => p.PoBillNum, p => p.MapFrom(q => q.PoNumber)) - .ForMember(p => p.AsnBillNum, p => p.MapFrom(q => string.IsNullOrEmpty(q.AsnNumber)?"":q.AsnNumber)) + .ForMember(p => p.AsnBillNum, p => p.MapFrom(q => string.IsNullOrEmpty(q.AsnNumber) ? "" : q.AsnNumber)) .ForMember(p => p.VendId, p => p.MapFrom(q => q.SupplierCode)) // .ForMember(p => p.ShipTime, p => p.MapFrom(q => DateTime.MinValue))//默认值 .ForMember(p => p.State, p => p.MapFrom(q => 0))//0:未处理 @@ -117,7 +116,7 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.PoBillNum, p => p.MapFrom(q => q.PoNumber)) .ForMember(p => p.PoLine, p => p.MapFrom(q => int.TryParse(q.PoLine, out poLine) ? poLine : 0)) .ForMember(p => p.PartCode, p => p.MapFrom(q => q.PartCode)) - .ForMember(p => p.Batch, p => p.MapFrom(q => string.IsNullOrEmpty(q.Lot)?"":q.Lot)) + .ForMember(p => p.Batch, p => p.MapFrom(q => string.IsNullOrEmpty(q.Lot) ? "" : q.Lot)) .ForMember(p => p.Qty, p => p.MapFrom(q => q.ReceiveQty)) .ForMember(p => p.DockCode, p => p.MapFrom(q => q.Dock)) .ForMember(p => p.State, p => p.MapFrom(q => 0))//0:未处理 @@ -128,7 +127,7 @@ namespace Win_in.Sfs.Scp.WebApi // .ForMember(p => p.IsDeleted, p => p.MapFrom(q => false))//默认值 .ForMember(p => p.GUID, p => p.MapFrom(q => Guid.NewGuid()))//默认值 .ForMember(p => p.BillType, p => p.MapFrom(q => string.IsNullOrWhiteSpace(q.RcType) ? 0 : 1))//0:收货 1:退货 - .ForMember(p => p.VendBatch, p => p.MapFrom(q => string.IsNullOrEmpty(q.SupplierLot)?"":q.SupplierLot)) + .ForMember(p => p.VendBatch, p => p.MapFrom(q => string.IsNullOrEmpty(q.SupplierLot) ? "" : q.SupplierLot)) .ForMember(p => p.PoUnit, p => p.MapFrom(q => q.Uom)) .ForMember(p => p.LocUnit, p => p.MapFrom(q => q.Uom)) .ForMember(p => p.PurCost, p => p.MapFrom(q => 0))//默认值 @@ -136,10 +135,10 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.Rate, p => p.MapFrom(q => q.SupplierPackConvertRate)) .ForMember(p => p.CurAmt, p => p.MapFrom(q => 0))//默认值 .ForMember(p => p.Tax, p => p.MapFrom(q => 0))//默认值 - // .ForMember(p => p.Extend1, p => p.MapFrom(q => ""))//默认值 - // .ForMember(p => p.Extend2, p => p.MapFrom(q => ""))//默认值 - // .ForMember(p => p.Extend3, p => p.MapFrom(q => ""))//默认值 - // .ForMember(p => p.SubSite, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.Extend1, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.Extend2, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.Extend3, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.SubSite, p => p.MapFrom(q => ""))//默认值 ; } @@ -164,8 +163,8 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.BuyerPhone, p => p.MapFrom(q => q.ContactPhone)) .ForMember(p => p.State, p => p.MapFrom(q => q.Status)) .ForMember(p => p.Remark, p => p.MapFrom(q => q.Remark)) - .ForMember(p => p.BeginTime, p => p.MapFrom(q =>q.OrderDate)) - .ForMember(p => p.EndTime, p => p.MapFrom(q =>q.DueDate)) + .ForMember(p => p.BeginTime, p => p.MapFrom(q => q.OrderDate)) + .ForMember(p => p.EndTime, p => p.MapFrom(q => q.DueDate)) // .ForMember(p => p.Extend1, p => p.MapFrom(q => ""))//默认值 // .ForMember(p => p.Extend2, p => p.MapFrom(q => ""))//默认值 // .ForMember(p => p.Extend3, p => p.MapFrom(q => ""))//默认值 @@ -231,7 +230,7 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.PoBillNum, p => p.MapFrom(q => "")) .ForMember(p => p.AsnBillNum, p => p.MapFrom(q => q.Order)) .ForMember(p => p.VendId, p => p.MapFrom(q => q.Address))//默认值 - // .ForMember(p => p.ShipTime, p => p.MapFrom(q => DateTime.MinValue))//默认值 + // .ForMember(p => p.ShipTime, p => p.MapFrom(q => DateTime.MinValue))//默认值 .ForMember(p => p.State, p => p.MapFrom(q => 0))//0:未处理 .ForMember(p => p.Remark, p => p.MapFrom(q => q.Remark)) .ForMember(p => p.CreateTime, p => p.MapFrom(q => q.EffectiveDate)) @@ -243,7 +242,7 @@ namespace Win_in.Sfs.Scp.WebApi // .ForMember(p => p.OperName, p => p.MapFrom(q => ""))//默认值 //.ForMember(p => p.BillType, p => p.MapFrom(q => string.IsNullOrWhiteSpace(q.TrType) ? 0 : 1))//0:收货 1:退货 - .ForMember(p => p.BillType, p => p.MapFrom(q=>0)) + .ForMember(p => p.BillType, p => p.MapFrom(q => 0)) // .ForMember(p => p.Tax, p => p.MapFrom(q => 0))//默认值 ; @@ -265,7 +264,7 @@ namespace Win_in.Sfs.Scp.WebApi // .ForMember(p => p.IsDeleted, p => p.MapFrom(q => false))//默认值 .ForMember(p => p.GUID, p => p.MapFrom(q => Guid.NewGuid()))//默认值 - + //.ForMember(p => p.BillType, p => p.MapFrom(q => string.IsNullOrWhiteSpace(q.TrType) ? 0 : 1))//0:收货 1:退货 .ForMember(p => p.BillType, p => p.MapFrom(q => 0)) @@ -275,13 +274,13 @@ namespace Win_in.Sfs.Scp.WebApi .ForMember(p => p.PurCost, p => p.MapFrom(q => 0))//默认值 .ForMember(p => p.StdCost, p => p.MapFrom(q => 0))//默认值 - // .ForMember(p => p.Rate, p => p.MapFrom(q => 0))//默认值 + // .ForMember(p => p.Rate, p => p.MapFrom(q => 0))//默认值 .ForMember(p => p.CurAmt, p => p.MapFrom(q => 0))//默认值 - // .ForMember(p => p.Tax, p => p.MapFrom(q => 0))//默认值 - // .ForMember(p => p.Extend1, p => p.MapFrom(q => ""))//默认值 - // .ForMember(p => p.Extend2, p => p.MapFrom(q => ""))//默认值 - // .ForMember(p => p.Extend3, p => p.MapFrom(q => ""))//默认值 - // .ForMember(p => p.SubSite, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.Tax, p => p.MapFrom(q => 0))//默认值 + // .ForMember(p => p.Extend1, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.Extend2, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.Extend3, p => p.MapFrom(q => ""))//默认值 + // .ForMember(p => p.SubSite, p => p.MapFrom(q => ""))//默认值 ; } } diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs index 78944af..44f4efc 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs @@ -13,6 +13,7 @@ using Volo.Abp.TenantManagement; using Volo.Abp.Uow; using Volo.Abp.Validation; using Win_in.Sfs.Scp.v1.Domain; +using Volo.Abp.Data; namespace Win_in.Sfs.Scp.WebApi @@ -29,18 +30,21 @@ namespace Win_in.Sfs.Scp.WebApi private readonly ITaVenderRepository _taVenderRepository; private readonly ITenantStore _tenantStore; private readonly ITenantRepository _tenantRepository; + private readonly IDataFilter _dataFilter; public SuppliersAppService( ISupplierRepository repository , ITaVenderRepository taVenderRepository , ITenantStore tenantStore , ITenantRepository tenantRepository + , IDataFilter dataFilter ) : base(repository) { _supplierRepository = repository; _taVenderRepository = taVenderRepository; _tenantStore = tenantStore; _tenantRepository = tenantRepository; + _dataFilter = dataFilter; } @@ -89,8 +93,11 @@ namespace Win_in.Sfs.Scp.WebApi var tenant = await _tenantStore.FindAsync(entity.Company); using (CurrentTenant.Change(tenant.Id, tenant.Name)) { - await UpsertTaVenderAsync(entity, tenant.Id); - await CurrentUnitOfWork.SaveChangesAsync(); + using (_dataFilter.Disable()) + { + await UpsertTaVenderAsync(entity, tenant.Id); + await CurrentUnitOfWork.SaveChangesAsync(); + } } } catch (Exception ex) diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs index ec0bf54..ca66e04 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs @@ -8,6 +8,7 @@ using FluentValidation; using Microsoft.Extensions.Configuration; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Data; using Volo.Abp.MultiTenancy; using Volo.Abp.Uow; using Volo.Abp.Validation; @@ -31,6 +32,7 @@ namespace Win_in.Sfs.Scp.WebApi private readonly ITaVenderRepository _taVenderRepository; private readonly ITenantStore _tenantStore; private readonly ITenantRepository _tenantRepository; + private readonly IDataFilter _dataFilter; public UnplannedReceiptAppService( IUnplannedReceiptRepository repository @@ -39,6 +41,7 @@ namespace Win_in.Sfs.Scp.WebApi , ITaVenderRepository taVenderRepository , ITenantStore tenantStore , ITenantRepository tenantRepository + , IDataFilter dataFilter ) : base(repository) { _unplannedReceiptRepository = repository; @@ -47,6 +50,7 @@ namespace Win_in.Sfs.Scp.WebApi _taVenderRepository = taVenderRepository; _tenantStore = tenantStore; _tenantRepository = tenantRepository; + _dataFilter = dataFilter; } @@ -97,10 +101,14 @@ namespace Win_in.Sfs.Scp.WebApi var tenant = await _tenantStore.FindAsync(entity.Site); using (CurrentTenant.Change(tenant.Id, tenant.Name)) { - Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.Address); + using (_dataFilter.Disable()) + { - await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id); - await CurrentUnitOfWork.SaveChangesAsync(); + Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.Address); + + await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id); + await CurrentUnitOfWork.SaveChangesAsync(); + } } } catch (Exception ex) diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs index f4e1f13..b574ceb 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs @@ -28,13 +28,14 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore { //使用直接赋值 - current.PartDesc1 = taPart.PartDesc1; + // current.PartDesc1 = taPart.PartDesc1;//中文描述不要覆盖 current.PartDesc2 = taPart.PartDesc2; current.ProjectId = taPart.ProjectId; current.Unit = taPart.Unit; current.PartGroup = taPart.PartGroup; current.State = taPart.State; current.Configuration = taPart.Configuration; + current.Qlevel = taPart.Qlevel; current.Remark = taPart.Remark; ret = await UpdateAsync(current); diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs index a22238c..d2e6cfc 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs @@ -29,7 +29,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore { //使用直接赋值 - current.VendName = taVender.VendName; + // current.VendName = taVender.VendName;//不要覆盖中文名称 current.VendAbbCode = taVender.VendAbbCode; current.Country = taVender.Country; current.City = taVender.City;