From ca4a0e7ffc11dc6f4c19b75f625444b06768ea15 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期三, 12 十一月 2025 08:51:30 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
index a47f4b8..5a87c34 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
@@ -46,6 +46,47 @@
             _splitPackageService = splitPackageService;
         }
 
+        public async Task<WebResponseContent> ValidateBarcode(string barcode)
+        {
+            try
+            {
+                if (string.IsNullOrEmpty(barcode))
+                {
+                    return WebResponseContent.Instance.Error("鏉$爜涓嶈兘涓虹┖");
+                }
+
+                // 鏍规嵁鏉$爜鏌ヨ搴撳瓨鏄庣粏
+                var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+                    .Includes(x => x.StockInfo)
+                    .Where(x => x.Barcode == barcode)
+                    .FirstAsync();
+
+                if (stockDetail == null)
+                {
+                    return WebResponseContent.Instance.Error("鏉$爜涓嶅瓨鍦�");
+                }
+
+                
+
+                var result = new
+                {
+                    Barcode = barcode,
+                    MaterielCode = stockDetail.MaterielCode,
+                 
+                    BatchNo = stockDetail.BatchNo,
+                    AvailableQuantity = stockDetail.StockQuantity - stockDetail.OutboundQuantity,
+                    LocationCode = stockDetail.StockInfo?.LocationCode,
+                    PalletCode = stockDetail.StockInfo?.PalletCode
+                };
+
+                return WebResponseContent.Instance.OK(null, result);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error($"鏉$爜楠岃瘉澶辫触: {ex.Message}");
+            }
+        }
+
         /// <summary>
         /// 鎵爜鎷i�夌‘璁� - 绠�鍖栫増鏈�
         /// 鍙鐞嗗疄闄呮嫞閫夌殑搴撳瓨鎵e噺

--
Gitblit v1.9.3