From f29f358f589f5b1c2589c07b65845650be7aafef Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期一, 08 十二月 2025 21:21:08 +0800
Subject: [PATCH] 代码优化

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs |   24 ++++++++++++++++++++++++
 1 files changed, 24 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 4d20ff1..6b06a77 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"
@@ -2948,6 +2948,30 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+
+        public WebResponseContent GetPurchaseOrderByBarcode(string barcode)
+        {
+            try
+            {
+                Dt_InboundOrderDetail inboundOrderDetail = _stockInfoDetailService.Db.Queryable<Dt_InboundOrderDetail>().Where(x=>x.Barcode == barcode&& x.OrderDetailStatus !=OrderDetailStatusEnum.Over.ObjToInt()).First();
+                if(inboundOrderDetail == null)
+                {
+                    return WebResponseContent.Instance.Error($"鏈壘鍒拌鏉$爜{barcode}鐨勫叆搴撴槑缁嗘垨鑰呮槑缁嗙姸鎬佸凡鍏ユ櫤浠撳畬鎴�");
+                }
+                Dt_InboundOrder inboundOrder = _inboundOrderRepository.QueryFirst(x => x.Id == inboundOrderDetail.OrderId && x.OrderStatus != InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt());
+                if (inboundOrder == null)
+                {
+                    return WebResponseContent.Instance.Error($"璇ュ叆搴撳崟{inboundOrder}鐘舵�佸凡鍏ユ櫤浠撳畬鎴�");
+                }
+                var resultData = new { purchaseOrderNo = inboundOrder.UpperOrderNo };
+
+                return WebResponseContent.Instance.OK("鏌ヨ閲囪喘鍗曟垚鍔�", data: resultData);
+            }
+            catch(Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
         #endregion
 
         public WebResponseContent UnPalletQuantity(string orderNo)

--
Gitblit v1.9.3