From 399eb07af584e1e2f1f7dafcfbb3b2a386cfbf3c Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 02 九月 2025 16:58:38 +0800
Subject: [PATCH] 修改问题

---
 Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index 5395b9e..84724b2 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -337,11 +337,11 @@
                 {
                     //瀹㈡埛淇℃伅
                     var customer = Db.Queryable<SysCustomer>().First(m => m.IsDel == "0" && m.CustomerNo == model.customerNo);
-                    if (customer == null)
+                    if (customer != null)
                     {
-                        throw new Exception("瀹㈡埛淇℃伅涓嶅瓨鍦�!");
+                        //throw new Exception("瀹㈡埛淇℃伅涓嶅瓨鍦�!");
+                        CustomerName = customer.CustomerName;
                     }
-                    CustomerName = customer.CustomerName;
                 }
 
                 //鎵胯繍鍟嗕俊鎭�
@@ -612,19 +612,25 @@
                         
                         CreateUser = 0,
                     };
-                    if (houseNo == "1000" || houseNo == "1001" || houseNo == "2000")
-                    {
-                        notice.WareHouseNo = "W01";
-                    }
-                    else if (houseNo == "2001")
+                    if (houseNo == "1000" || houseNo == "1001" || houseNo == "2000" || houseNo == "2002" || houseNo == "2003" || houseNo == "2004")
                     {
                         notice.WareHouseNo = "W02";
                     }
+                    else if (houseNo == "4000")
+                    {
+                        notice.WareHouseNo = "W01";
+                    }
                     else
                     {
-                        throw new Exception("鍙戝嚭浠撳簱寮傚父");
+                        // houseNo鎶涘紓甯革紝閬垮厤鍑虹幇闈濿01锛學02鐨勫��
+                        throw new Exception($"涓嶆敮鎸佺殑鍙戝嚭浠撳簱缂栧彿锛歿houseNo}锛屼粎鏀寔鐢熸垚W01鍜學02浠撳簱鐨勫崟鎹�");
                     }
-                    
+                    //棰濆鏍¢獙锛堝彲閫夛紝鍙岄噸淇濋殰锛�
+                    if (notice.WareHouseNo != "W01" && notice.WareHouseNo != "W02")
+                    {
+                        throw new Exception($"浠撳簱缂栧彿寮傚父锛歿notice.WareHouseNo}锛屼粎鍏佽W01鍜學02");
+                    }
+
 
                     var n = Db.Insertable<BllExportNotice>(notice).ExecuteCommand();
                     var m = Db.Insertable<BllExportNoticeDetail>(list).ExecuteCommand();
@@ -744,7 +750,7 @@
                     };
                     #region 閫氳繃鎺ュ彛鍙戦�佽嚦erp
                     //绯荤粺瀵规帴鍚庢斁寮�
-                    /*var jsonData = JsonConvert.SerializeObject(soInfo);
+                    var jsonData = JsonConvert.SerializeObject(soInfo);
 
                     var response = HttpHelper.DoPost(url, jsonData, "鍑哄簱鍗曞畬鎴愪笂浼�", "ERP");
 
@@ -752,7 +758,7 @@
                     if (obj.Success != 0)
                     {
                         throw new Exception("涓婁紶澶辫触" + obj.Message);
-                    }*/
+                    }
                     #endregion
                 }
 
@@ -1949,10 +1955,10 @@
                         //    }
                         //}
 
-                        if (d.Qty != d.CompleteQty)
-                        {
-                            throw new Exception("褰撳墠鍗曟嵁鏄庣粏涓鍒掓暟閲忎笌鎷h揣鏁伴噺涓嶇锛岃鏍稿疄");
-                        }
+                        //if (d.Qty != d.CompleteQty)
+                        //{
+                        //    throw new Exception("褰撳墠鍗曟嵁鏄庣粏涓鍒掓暟閲忎笌鎷h揣鏁伴噺涓嶇锛岃鏍稿疄");
+                        //}
                         #region 搴撳瓨琛ㄥ噺鍘婚攣瀹氭暟閲忎笌鎬绘暟閲�(PDA鎷h揣鐨勬椂鍊欏凡缁忓噺鍘绘暟閲忎簡)
                         /*var sq = stocks.Where(s => s.SkuNo == d.SkuNo);
                         if (!string.IsNullOrWhiteSpace(d.LotNo))

--
Gitblit v1.8.0