From 2fd658134344c18e9f2a2eb2c2099d0b0edf205a Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 25 三月 2026 16:08:10 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs |   46 ++++++++++++++++++++++++----------------------
 1 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs
index 9e86f3a..3b424e0 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")]
@@ -351,30 +352,11 @@
                 if (hmainid <= 0)
                     return new { code = "0", count = 0, Message = "鍗曟嵁ID涓嶈兘涓虹┖锛�" };
 
-                if (newPallet <= 0)
-                    return new { code = "0", count = 0, Message = "鎵樻暟蹇呴』澶т簬0锛�" };
+                if (newPallet < 0)
+                    return new { code = "0", count = 0, Message = "鎵樻暟涓嶈兘涓鸿礋鏁帮紒" };
 
 
-                string checkAuditSql = $@"
-                    SELECT HBillStatus 
-                    FROM Sc_MouldStockBillMain
-                    WHERE HInterID = {hmainid}";
 
-                DataSet dsAudit = oCn.RunProcReturn(checkAuditSql, "CheckAudit");
-
-                if (dsAudit != null && dsAudit.Tables[0].Rows.Count > 0)
-                {
-                    int hBillStatus = Convert.ToInt32(dsAudit.Tables[0].Rows[0]["HBillStatus"]);
-              
-                    if (hBillStatus == 2)
-                    {
-                        return new { code = "0", count = 0, Message = "鍗曟嵁宸插鏍革紝涓嶈兘淇敼鎵樻暟锛�" };
-                    }
-                }
-                else
-                {
-                    return new { code = "0", count = 0, Message = "鍗曟嵁涓嶅瓨鍦紒" };
-                }
 
                 // 鐩存帴鏇存柊鎵樻暟
                 string updateSql = $@"
@@ -832,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