From 0acd18b6bebdcfc24a0d7c27edb0f8ef1fc7f9aa Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期一, 04 三月 2024 10:29:34 +0800
Subject: [PATCH] 出库单复核功能修改

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

diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index e09c0ca..81e5525 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -204,10 +204,18 @@
                 {
                     throw new Exception("鏈煡璇㈠埌鍗曟嵁淇℃伅");
                 }
+                if (notice.Status != "5")
+                {
+                    throw new Exception("澶嶆牳澶辫触锛屽崟鎹潪鍏抽棴鐘舵��");
+                }
                 var detail = Db.Queryable<BllExportNoticeDetail>().Where(m => m.SONo == notice.SONo && m.IsDel == "0").ToList();
                 if (detail.Count == 0)
                 {
                     throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏淇℃伅");
+                }
+                if (userId == notice.UpdateUser)
+                {
+                    throw new Exception("澶嶆牳澶辫触锛屽鏍镐汉鍛樺拰鍏抽棴璁㈠崟浜哄憳涓嶈兘鐩稿悓锛�");
                 }
                 var list = new List<SoDetail>();
                 foreach (var d in detail)
@@ -225,21 +233,25 @@
                     OrderCode = notice.OrderCode,
                     SoDetails = list
                 };
-                // 閫氳繃鎺ュ彛鍙戦�佽嚦erp
-                var jsonData = JsonConvert.SerializeObject(soInfo);
+                #region 閫氳繃鎺ュ彛鍙戦�佽嚦erp
+                //绯荤粺瀵规帴鍚庢斁寮�
+                /*var jsonData = JsonConvert.SerializeObject(soInfo);
 
                 var response = HttpHelper.DoPost(url, jsonData, "鍑哄簱鍗曞畬鎴愪笂浼�", "ERP");
-
-                //瑙f瀽杩斿洖鏁版嵁
-                var obj = JsonConvert.DeserializeObject<ErpModel>(response);
+                
+                var obj = JsonConvert.DeserializeObject<ErpModel>(response);//瑙f瀽杩斿洖鏁版嵁
                 if (obj.Success != 0)
                 {
                     throw new Exception("涓婁紶澶辫触" + obj.Message);
-                }
+                }*/
+                #endregion
+
                 notice.Status = "6";
                 notice.UpdateTime = DateTime.Now;
                 notice.UpdateUser = userId;
                 Db.Updateable(notice).ExecuteCommand();
+
+                new OperationSOServer().AddLogOperationSo("鍑哄簱浣滀笟", "鍑哄簱鍗曟嵁", notice.SONo, "澶嶆牳", $"澶嶆牳浜嗗崟鎹彿涓簕notice.SONo}鐨勫崟鎹俊鎭�", userId);
                 return true;
             }
             catch (Exception e)
@@ -1047,10 +1059,6 @@
                 {
                     throw new Exception("鍙傛暟寮傚父,璇锋鏌ョ姸鎬佹槸鍚︿负鎵ц瀹屾垚鎴栬鍗曞叧闂�/宸蹭笂浼�");
                 }
-                if (userId == notice.UpdateUser)
-                {
-                    throw new Exception("澶嶆牳澶辫触锛屽鏍镐汉鍛樺拰鍏抽棴璁㈠崟浜哄憳涓嶈兘鐩稿悓锛�");
-                }
                 //鍑哄簱鍗曟槑缁�
                 var comDetail = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.SONo == notice.SONo).Select(m => m.BoxNo3).ToList();
                 Db.BeginTran();//寮�鍚簨鍔�
@@ -1065,13 +1073,8 @@
                     //} 
 
                     var dom = HttpHelper.EncodeParsToFuMa(comDetail, "ceshi", "ExInfoXml");
-
-                    notice.Status = "6";//鐘舵�侊細宸蹭笂浼�
-                    notice.CheckTime = DateTime.Now;//澶嶆牳鏃堕棿
-                    notice.CheckUser = userId;//澶嶆牳浜�
-                    Db.Updateable(notice).ExecuteCommand();
                     ////娣诲姞鎿嶄綔鏃ュ織璁板綍
-                     var k = new OperationSOServer().AddLogOperationSo("鍑哄簱浣滀笟", "鍑哄簱鍗曟嵁", notice.SONo, "澶嶆牳", $"澶嶆牳浜嗗崟鎹彿涓簕notice.SONo}鐨勫崟鎹俊鎭�", userId);
+                    //var k = new OperationSOServer().AddLogOperationSo("鍑哄簱浣滀笟", "鍑哄簱鍗曟嵁", notice.SONo, "鍏冲崟", $"鍏抽棴浜嗗崟鎹彿涓簕notice.SONo}鐨勫崟鎹俊鎭�", userId);
 
                     Db.CommitTran();
                     return dom;

--
Gitblit v1.8.0