From 9ec043dadfc8c50b304685e1102e93ed7454189b Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 25 Apr 2023 09:28:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductReceiptNoteManager.cs | 2 +- .../PurchaseOrders/PurchaseOrderManager.cs | 1 - .../Transactions/BackFlushNoteEventHandler.cs | 1 + .../ProductReceiptNoteEventHandler.cs | 31 +++++++++++++++++-- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs index 5b6caa107..855f7519d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs @@ -42,7 +42,7 @@ public class ProductReceiptNoteManager : SfsStoreManagerBase CreateAsync(ProductReceiptNote productReceiptNote) { - if (string.IsNullOrEmpty(productReceiptNote.ProductionPlanNumber) == false) + if (string.IsNullOrEmpty(productReceiptNote.ProductionPlanNumber) == false) { //更新生产计划 var productionPlan = await _productionPlanRepository.FindAsync(c => c.Number == productReceiptNote.ProductionPlanNumber, true).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs index 721b1c17c..965a025b8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs @@ -54,7 +54,6 @@ public class PurchaseOrderManager : SfsStoreManagerBase eventData) @@ -30,7 +40,7 @@ public class ProductReceiptNoteEventHandler { var inboundTransactions = new List(); - inboundTransactions.AddRange(BuildTransactions(productReceiptNote)); + inboundTransactions.AddRange(await BuildTransactions(productReceiptNote)); await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); @@ -51,13 +61,13 @@ public class ProductReceiptNoteEventHandler //如果要做库存事务汇总,可以修改此处 foreach (var productReceiptNote in productReceiptNotes) { - inboundTransactions.AddRange(BuildTransactions(productReceiptNote)); + inboundTransactions.AddRange(await BuildTransactions(productReceiptNote)); } await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); } - private List BuildTransactions(ProductReceiptNote productReceiptNote) + private async Task> BuildTransactions(ProductReceiptNote productReceiptNote) { var transactionCreateInputs = new List(); //构造库存入库创建Input @@ -65,6 +75,21 @@ public class ProductReceiptNoteEventHandler { var transaction = ObjectMapper.Map(detail); + var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + ; + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2 = itemBasicDto.Desc2; + detail.ItemName=itemBasicDto.Name; + detail.StdPackQty=itemBasicDto.StdPackQty; + + var erpLocationDtos= await _locationAppService.GetListByTypesAndErpCodeAsync(new List { EnumLocationType.WIP }, + detail.LocationErpCode).ConfigureAwait(false); + var erpLocationDto = erpLocationDtos.First(); + detail.LocationArea = erpLocationDto.Code; + detail.LocationGroup = erpLocationDto.LocationGroupCode; + detail.LocationErpCode= erpLocationDto.Code; + detail.LocationCode= erpLocationDto.Code; + transaction.TransType = TransType; transaction.TransInOut = TransInOut; transaction.WarehouseCode = productReceiptNote.WarehouseCode;