From c37ac3c9349c10afb3938326ea8e17b338e68a92 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期五, 15 八月 2025 09:05:22 +0800
Subject: [PATCH] 修改SAP下发出库单接口

---
 Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
index e57b70b..a8f25c3 100644
--- a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -610,8 +610,18 @@
                 {
                     throw new Exception("鏈煡璇㈠埌鍗曟嵁淇℃伅");
                 }
-
-                var pack = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == asnList.PackagNo);
+                //鍖呰缂栫爜
+                var packagNo = asnList.PackagNo;
+                if (string.IsNullOrEmpty(packagNo))
+                {
+                    var skuInfo = Db.Queryable<SysMaterials>().First(w => w.IsDel == "0" && w.SkuNo == asnList.SkuNo);
+                    if (skuInfo == null)
+                    {
+                        throw new Exception("鏈煡璇㈠埌鐗╂枡淇℃伅");
+                    }
+                    packagNo = skuInfo.PackagNo;
+                }
+                var pack = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == packagNo);
                 if (pack == null)
                 {
                     throw new Exception("鏈煡璇㈠埌褰撳墠鍗曟嵁涓墿鏂欑殑鍖呰淇℃伅");

--
Gitblit v1.8.0