From 434842b5f8efc116b1239cb97c79c8aeb74cd079 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 22 Oct 2024 13:48:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EPDA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inventories/BalanceController.cs | 31 +++++++++++++++++++ .../Balances/BalanceAppService.cs | 1 + 2 files changed, 32 insertions(+) diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs index 20ca5a718..2f2d8aa97 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs @@ -603,6 +603,37 @@ public class BalanceController : AbpController } } + /// + /// + /// + /// + /// + /// + /// + [HttpPost("get-recommend-balance-erplocation")] + public async Task> GetRecommendBalanceByErpLocation(string itemCode, bool isPackingCode,string erpLocationCode) + { + var codes=await _locationAppService.GetListByErpLocationCodes(new List{erpLocationCode}).ConfigureAwait(false); + + if(codes.Any()){ + + //获取可用库存 + var input = new RecommendBalanceRequestInput + { + ItemCode = itemCode, + Qty = decimal.MaxValue, + Statuses = new EditableList { EnumInventoryStatus.OK }, + Locations = codes.Select(p=>p.Code).ToList(), + IsPackingCode = isPackingCode + }; + + var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false); + return await SortByFifoAsync(usableList).ConfigureAwait(false); + } + + return new List(); + } + /// /// /// diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs index 751a5bb0c..9f4be59cf 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs @@ -687,6 +687,7 @@ public class BalanceAppService return dtos; } + /// /// 获取可用库存列表 ///