From 7cc4be28036bef1aa1f2fbc0f0e6aea6fc5a77c0 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期五, 10 一月 2025 16:05:59 +0800 Subject: [PATCH] 优化库存视图前端,优化获取旧WMS辅料库存 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" index 2219ed3..b42dee9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" @@ -53,7 +53,7 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�"); } - if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus!=StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt()) + if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt()) { return WebResponseContent.Instance.Error($"璇ユ墭鐩樼姸鎬佷笉姝g‘,涓嶅彲鐢宠鍏ュ簱"); } @@ -173,7 +173,7 @@ return WebResponseContent.Instance.Error(ex.Message); } } - public WebResponseContent OutEmpty(int qty, string address, int WarehouseId) + public WebResponseContent OutEmpty(int qty, string address, int WarehouseId, string barcode) { try { @@ -182,8 +182,17 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒板簱鍖�"); } - var stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(), qty, nameof(Dt_StockInfo.CreateDate)); - if (stockInfos == null) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}鏈壘鍒扮┖绠卞簱瀛�"); + List<Dt_StockInfo> stockInfos = null; + if (string.IsNullOrEmpty(barcode)) + { + stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(), qty, nameof(Dt_StockInfo.CreateDate)); + } + else + { + stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt() && x.PalletCode == barcode); + if (stockInfos.Count == 0) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}鏈壘鍒扮┖绠便�恵barcode}銆�"); + } + if (stockInfos.Count < qty) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}绌虹搴撳瓨涓嶈冻,搴撳瓨鏁般�恵stockInfos.Count}銆�"); List<Dt_Task> tasks = GetTasks(stockInfos, TaskTypeEnum.OutEmpty); stockInfos.ForEach(x => -- Gitblit v1.9.3