From 0addbbcc6ae0dfa387784c4bca6d7f5f19ceaef5 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 22 Aug 2023 09:59:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Transactions/TransactionAppService.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs index 1ff0c197d..e54d7b221 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs @@ -133,6 +133,17 @@ public class TransactionAppService public virtual async Task> GetItemSerialList(List itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime) { var itemSerialDtos = new List(); + if (!itemCodes.Any()) + { + var itemBasicDtos_i= await _itemBasicAppService.GetAllListByFilterAsync(new SfsBaseDataRequestInputBase()).ConfigureAwait(false); + var itemBasicDtos_t = await _repository.GetListAsync().ConfigureAwait(false); + + itemCodes.AddRange(itemBasicDtos_i.Select(p => p.Code)); + itemCodes.AddRange(itemBasicDtos_t.Select(p => p.ItemCode)); + + itemCodes=itemCodes.Distinct().ToList(); + } + foreach (var itemCode in itemCodes) { var itemSerialDto = new ReportItemSerialDto(); @@ -151,12 +162,16 @@ public class TransactionAppService //所有这个零件的事务 var transactions=await _repository.GetListAsync(p => p.ItemCode == itemCode).ConfigureAwait(false); - if (string.IsNullOrEmpty(erpLocationCode)) + if (!string.IsNullOrEmpty(erpLocationCode)) { transactions = transactions.Where(p => p.LocationErpCode == erpLocationCode).ToList(); } - var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false); + var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false); + if (!string.IsNullOrEmpty(erpLocationCode)) + { + locationDtos = locationDtos.Where(p => p.ErpLocationCode == erpLocationCode).ToList(); + } var groupKey= locationDtos.GroupBy(p => p.ErpLocationCode); foreach (var keyGroup in groupKey)