From 09bef7222f28abfe5fbb308c610997dc52da5f18 Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期四, 26 二月 2026 08:11:40 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/LMESController.cs |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 288e6bd..3e4e02e 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -12,6 +12,8 @@
 using WebAPI.Models;
 using System.Web;
 using System.IO;
+using WebAPI.Controllers.SCGL;
+
 namespace WebAPI.Controllers
 {
     public class LMESController : ApiController
@@ -25,7 +27,6 @@
         //鑷畾涔�34杩涘埗鏁扮粍
         private static char[] lNCode = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
         string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"];
-
 
         #region 杩斿洖杩涚珯鎵弿鍒楄〃|宸ュ簭杩涚珯鎺ユ敹鍗曞垪琛� 
         [Route("LEMS/MES_StationInBillList_Json")]
@@ -856,11 +857,11 @@
                 // 鍙嶅簭鍒楀寲瀛愯〃鏁版嵁
                 var detailList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(msg3);
 
-                // 3. 寮�濮嬩簨鍔�
-                oCN.BeginTran();
-
                 foreach (var row in detailList)
                 {
+                    // 3. 寮�濮嬩簨鍔�
+                    oCN.BeginTran();
+                    DataSet ds2 = null;
                     // 鑾峰彇瀛愯〃瀛楁鍊�
                     string hSourceID = row.ContainsKey("HSourceID") ? row["HSourceID"] : "0";
                     string hMoldID = row.ContainsKey("HMoldID") ? row["HMoldID"] : "0";
@@ -874,13 +875,14 @@
                     string sReturn = "";
                     if (oSystemParameter.ShowBill(ref sReturn) == true)
                     {
-                        if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
-                        {
+                         if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+                         {
                             oCN.RunProc("update Sc_ProcessExchangeBillMain set HMakeDate = GETDATE(),HRemark3='宸叉淳宸�',HMaker='" + msg4 + "' where HInterID = " + hSourceInterID);
+                            LogService.Write("鑷姩鐢熸垚宸ヤ綔鑱旂郴鍗�...");
 
                             //鑷姩鐢熸垚宸ヤ綔鑱旂郴鍗�
-                            oCN.RunProc("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772);
-                        }
+                            ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772, "h_p_OA_WorkLinkBill_Create");
+                         }
                     }
                     oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=" + hSourceID + " where HInterID=" + hSourceInterID + " and HEntryID=" + hSourceEntryID);
                     // 鎻掑叆鐢熶骇鐘舵�佷复鏃惰〃
@@ -888,11 +890,21 @@
                     oCN.RunProc(SQL);
                     //鎻掑叆宸ュ簭娴佽浆鍗℃淳宸ュ崟
                     string SQL1 = $"exec h_p_Sc_ProcExchSendWorkBill_PG {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}";
-                    oCN.RunProc(SQL1);                    
+                    oCN.RunProc(SQL1);
+
+                    // 7. 鎻愪氦浜嬪姟
+                    oCN.Commit();
+                    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);
+                    }
                 }
 
-                // 7. 鎻愪氦浜嬪姟
-                oCN.Commit();
+
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;

--
Gitblit v1.9.1