From d3075c71429e9531b08b68bd7c43fde3f836f2d0 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Tue, 25 Jun 2024 16:36:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EosAgentModule.cs | 4 ++-- .../OutgoingFromWmsWorker.cs | 7 ++++--- .../Orders/PurchaseOrders/PurchaseOrderAppService.cs | 7 +++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs index 3ebf12e92..8d4989e44 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs @@ -165,8 +165,8 @@ public class EosAgentModule : AbpModule ApplicationInitializationContext context) { - context.AddBackgroundWorkerAsync(); - // context.AddBackgroundWorkerAsync(); + //context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs index 6c156c33b..bafe08f81 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs @@ -1,6 +1,8 @@ +using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Volo.Abp.BackgroundWorkers; using Volo.Abp.Threading; @@ -54,10 +56,9 @@ public class OutgoingFromWmsWorker : AsyncPeriodicBackgroundWorkerBase await outgoingFromWmsManager.CreateManyAsync(outgoingFromWmsList).ConfigureAwait(false); await exchangeDataAppService.UpdateManyAsync(exchangeDataList).ConfigureAwait(false); } - catch (System.Exception ex) + catch (Exception ex) { - - throw ex; + Logger.LogInformation(ex.Message+ex?.InnerException.Message); } } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs index 547dbdb05..62efe2ac6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs @@ -66,6 +66,13 @@ ISupplierItemAppService supplierItemAppService) : base(repository) Dictionary dictionary) { var ImportData = dictionary.Select(p => p.Key); + #region 校验ERP库位是否存在 + var supplierCount= ImportData.Select(r => r.SupplierCode).Distinct().Count(); + if (supplierCount > 1) + { + throw new UserFriendlyException($"不允许导入多个供应商的采购订单!"); + } + #endregion #region 校验ERP库位是否存在 var allTempErpLocationCode = ImportData.Select(p => p.Details.Select(p => p.LocationErpCode).ToList()).ToList();