From 291fdb29daf239a13fcfb3f5e08a2f5bf9167534 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期六, 07 三月 2026 17:37:07 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs |   72 +++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs
index 9975a34..b1bec67 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs
@@ -29,7 +29,8 @@
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
         public DAL.ClsSc_MouldProdOutBill oBill = new DAL.ClsSc_MouldProdOutBill();
-
+        //鑾峰彇绯荤粺鍙傛暟
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
 
         #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗曞垎椤靛垪琛�
         [Route("Sc_MouldProdOutBillController/page")]
@@ -331,6 +332,55 @@
                 objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳鍣ㄥ叿棰嗙敤鍑哄簱鍗曞け璐ワ紒" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� - 鎵樻暟鍙樻洿鍔熻兘
+        [Route("Sc_MouldProdOutBill/UpdatePallet")]
+        [HttpPost]
+    
+        public object UpdatePallet([FromBody] JObject data)
+        {
+            try
+            {
+                long hmainid = data["hmainid"]?.ToObject<long>() ?? 0;
+                int newPallet = data["newPallet"]?.ToObject<int>() ?? 0;
+                string operatorName = data["operator"]?.ToString() ?? "";
+
+                if (hmainid <= 0)
+                    return new { code = "0", count = 0, Message = "鍗曟嵁ID涓嶈兘涓虹┖锛�" };
+
+                if (newPallet <= 0)
+                    return new { code = "0", count = 0, Message = "鎵樻暟蹇呴』澶т簬0锛�" };
+
+
+     
+
+                // 鐩存帴鏇存柊鎵樻暟
+                string updateSql = $@"
+                    UPDATE Sc_MouldStockBillMain 
+                    SET HPackQtys = {newPallet} 
+                    WHERE HInterID = {hmainid}";
+
+                oCn.RunProc(updateSql);
+
+                return new
+                {
+                    code = "1",
+                    count = 1,
+                    Message = "鎵樻暟淇敼鎴愬姛锛�"
+                };
+            }
+            catch (Exception e)
+            {
+                return new
+                {
+                    code = "0",
+                    count = 0,
+                    Message = "淇敼澶辫触锛�" + e.Message
+                };
             }
         }
         #endregion
@@ -764,6 +814,26 @@
 
                 if (bResult)
                 {
+                    string sReturn = "";
+                    // 鍗庤垷 淇濆瓨鎴愬姛鍚庝笅鎺ㄥ伐浣滆仈绯诲崟 
+                    if (oSystemParameter.ShowBill(ref sReturn) == true)
+                    {
+                        if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+                        {
+                            //鑷姩鐢熸垚宸ヤ綔鑱旂郴鍗�
+                            var ds2 = oCn.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + oBill.omodel.HInterID + "," + 3802, "h_p_OA_WorkLinkBill_Create");
+
+                            if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
+                            {
+                                int HInterID = int.Parse(ds2.Tables[0].Rows[0]["NewHInterID"].ToString());
+                                LogService.Write("鎵ц娑堟伅鎺ㄩ��..." + HInterID);
+
+                                // 瑙﹀彂娑堟伅鎺ㄩ��
+                                Service.GeTuiService.PubishSingle(HInterID);
+                            }
+                        }
+                    }
+
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;  //鎴愬姛锛�

--
Gitblit v1.9.1