From d07f25c163706ac46a83bd2c63db1e3c52715222 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期四, 27 三月 2025 15:54:25 +0800
Subject: [PATCH] 解决问题

---
 Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs |   86 ++++++++++++++++++++++++------------------
 1 files changed, 49 insertions(+), 37 deletions(-)

diff --git a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
index 8597905..e8d8a3c 100644
--- a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -1073,6 +1073,7 @@
                     CustomerNo = model.Customer,
                     CustomerName = custname,
                     OrderCode = model.OrderCode,
+                    Status = "0",
                 };
 
                 // 鍏ュ簱鏄庣粏琛ㄤ俊鎭�
@@ -1115,10 +1116,17 @@
                         LotNo = asnDetailModel.LotNo,
                         LotText = "",
                         Qty = (decimal)asnDetailModel.Qty,
-                        PackagNo = asnDetailModel.PackagNo,
+                        FactQty = 0,
+                        CompleteQty = 0,
+                        Price = 0,
+                        Money = 0,
+                        IsBale = "",
+                        IsBelt = "",
+                        PackagNo = skuModel.PackagNo,
                         SupplierLot = asnDetailModel.SupplierLot,
                         Status = "0",
                         CreateUser = 0
+
                     };
 
                     detailModels.Add(detailModel);
@@ -1238,6 +1246,10 @@
                 {
                     throw new Exception("澶嶆牳澶辫触锛屽鏍镐汉鍛樺拰鍏抽棴璁㈠崟浜哄憳涓嶈兘鐩稿悓锛�");
                 }
+                if (date.Id == notice.CreateUser)
+                {
+                    throw new Exception("澶嶆牳澶辫触锛屽鏍镐汉鍛樺拰鍒涘缓璁㈠崟浜哄憳涓嶈兘鐩稿悓锛�");
+                }
                 //鍗曟嵁绫诲瀷鏄� 鎴愬搧鍏ュ簱鎴栭噰璐叆搴� 鍒ゆ柇鍏ュ簱鐗╂枡鏄惁鍚堟牸
                 if (notice.Type == "0" || notice.Type == "1")
                 {
@@ -1272,46 +1284,46 @@
 
                 #region 閫氳繃鎺ュ彛鍙戦�佽嚦erp 鎴� mes
                 ////绯荤粺瀵规帴鍚庢斁寮�
-                //var jsonData = JsonConvert.SerializeObject(asnInfo);
-                //var mesList = new List<string>() { "0", "4" };  //0 鎴愬搧鍏ュ簱 4浣欐枡閫�鍥炲叆搴�
-                //var erpList = new List<string>() { "1", "2", "3" }; //1 閲囪喘鍏ュ簱  2涓棿鍝佸叆搴�  3 閫�璐у叆搴�
+                var jsonData = JsonConvert.SerializeObject(asnInfo);
+                var mesList = new List<string>() { "0", "4" };  //0 鎴愬搧鍏ュ簱 4浣欐枡閫�鍥炲叆搴�
+                var erpList = new List<string>() { "1", "2", "3" }; //1 閲囪喘鍏ュ簱  2涓棿鍝佸叆搴�  3 閫�璐у叆搴�
 
-                //if (mesList.Contains(notice.Type)) // mes 
-                //{
-                //    //鑾峰彇浠ょ墝
-                //    //var token = new Token().GetMesToken(mesTokenUrl); //娴嬭瘯涓嶄娇鐢═OKEN锛屾寮忚繍琛屾椂鏀惧紑
-                //    var token = "";
-                //    Dictionary<string, string> mesDic = new Dictionary<string, string>()
-                //    {
-                //        {"Authorization",token }
-                //    };
-                //    var mesData = new FinishAsnModel()
-                //    {
-                //        no = asnInfo.OrderCode,
-                //        qty = asnInfo.AsnDetails.Sum(m=>m.Qty)
-                //    };
-                //    jsonData = JsonConvert.SerializeObject(mesData);
-                //    //璋冪敤鎺ュ彛
-                //    var response = HttpHelper.DoPost(mesUrl, jsonData, "鍏ュ簱鍗曞畬鎴愪笂浼�", "MES", mesDic);
+                if (mesList.Contains(notice.Type)) // mes 
+                {
+                    //鑾峰彇浠ょ墝
+                    //var token = new Token().GetMesToken(mesTokenUrl); //娴嬭瘯涓嶄娇鐢═OKEN锛屾寮忚繍琛屾椂鏀惧紑
+                    var token = "";
+                    Dictionary<string, string> mesDic = new Dictionary<string, string>()
+                    {
+                        {"Authorization",token }
+                    };
+                    var mesData = new FinishAsnModel()
+                    {
+                        no = asnInfo.OrderCode,
+                        qty = asnInfo.AsnDetails.Sum(m => m.Qty)
+                    };
+                    jsonData = JsonConvert.SerializeObject(mesData);
+                    //璋冪敤鎺ュ彛
+                    var response = HttpHelper.DoPost(mesUrl, jsonData, "鍏ュ簱鍗曞畬鎴愪笂浼�", "MES", mesDic);
 
-                //    var obj = JsonConvert.DeserializeObject<MesModel>(response);//瑙f瀽杩斿洖鏁版嵁
-                //    if (obj.status != "success")
-                //    {
-                //        throw new Exception("涓婁紶澶辫触" + obj.message);
-                //    }
-                //}
-                //else if (erpList.Contains(notice.Type)) //erp  
-                //{
-                //    var response = HttpHelper.DoPost(erpUrl, jsonData, "鍏ュ簱鍗曞畬鎴愪笂浼�", "ERP");
+                    var obj = JsonConvert.DeserializeObject<MesModel>(response);//瑙f瀽杩斿洖鏁版嵁
+                    if (obj.status != "success")
+                    {
+                        throw new Exception("涓婁紶澶辫触" + obj.message);
+                    }
+                }
+                else if (erpList.Contains(notice.Type)) //erp  
+                {
+                    var response = HttpHelper.DoPost(erpUrl, jsonData, "鍏ュ簱鍗曞畬鎴愪笂浼�", "ERP");
 
-                //    var obj = JsonConvert.DeserializeObject<ErpModel>(response);//瑙f瀽杩斿洖鏁版嵁
-                //    if (obj.Success != 0)
-                //    {
-                //        throw new Exception("涓婁紶澶辫触" + obj.Message);
-                //    }
-                //}
+                    var obj = JsonConvert.DeserializeObject<ErpModel>(response);//瑙f瀽杩斿洖鏁版嵁
+                    if (obj.Success != 0)
+                    {
+                        throw new Exception("涓婁紶澶辫触" + obj.Message);
+                    }
+                }
 
-                
+
                 #endregion
 
                 notice.Status = "4";

--
Gitblit v1.8.0