From 8d72fd198f90c71eb547285a9aba2e35e644dceb Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 03 六月 2025 16:46:19 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/LMESController.cs |  131 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 126 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 6e09d75..1187096 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -192,7 +192,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
 
-                ds = oCN.RunProcReturn("select top 1000 * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc ", "h_v_Sc_ProcessExchangeBillList_Query");
+                ds = oCN.RunProcReturn("select top 3000 * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc ", "h_v_Sc_ProcessExchangeBillList_Query");
 
 
                 //娣诲姞鍒楀悕
@@ -285,6 +285,98 @@
                 else
                 {
                     ds = oCN.RunProcReturn("exec h_p_Sc_ProcessExchangeBillList_Query " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Sc_ProcessExchangeBillList_Query");
+                }
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮傚父锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ュ簭娴佽浆鍗$淮鎶�-鏌ヨ-鍒嗛〉
+        /// <summary>
+        /// 杩斿洖宸ュ簭娴佽浆鍗$淮鎶ゅ垪琛ㄤ富琛�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/Sc_ProcessExchangeBillList_QueryCheckRecord_byPage")]
+        [HttpGet]
+        public object Sc_ProcessExchangeBillList_QueryCheckRecord_byPage(string sWhere, string user, string Organization, int page, int size, string HBillSubType)
+        {
+            DataSet ds;
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                if (HBillSubType == "SUB")
+                {
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_SubQuery", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎸囧紩鍗℃棤鏌ヨ鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "娴佽浆鍗℃棤鏌ヨ鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                if (oSystemParameter.ShowBill(ref Ret))
+                {
+                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    {
+                        //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓�
+                        string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "宸ュ簭娲惧伐鍗曞垪琛�");
+
+                        sWhere += sql_splice;
+                    }
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                sWhere = sWhere.Replace("'", "''");
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_ProcessExchangeBillCheckRecordListPage " + page + "," + size + "," + "''", "h_p_Sc_ProcessExchangeBillList_Query");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_ProcessExchangeBillCheckRecordListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_ProcessExchangeBillList_Query");
                 }
 
                 //娣诲姞鍒楀悕
@@ -951,6 +1043,35 @@
                 string sql = "select * from h_v_Sc_ProcessExchangeBillQuerySub where hmainid = ";
                 string sql1 = sql + sWhere;
                 ds = oCN.RunProcReturn(sql1 + " order by cast(宸ュ簭鍙� as int)", "h_v_Sc_ProcessExchangeBillQuerySub");
+                return GetObjectJson(ds);
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "[0000-1-045]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 杩斿洖宸ュ簭娴佽浆鍗$淮鎶ゅ垪琛ㄤ粠琛�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/MES_Sc_ProcessExchangeBillQueryCheckRecordSub_Json")]
+        [HttpGet]
+        public object MES_Sc_ProcessExchangeBillQueryCheckRecordSub_Json(string sWhere, int selected)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = "exec h_p_ProcessExchangeBillCheckRecordList_GetSubBillList " +
+                    "@sWhere = N'" + sWhere + "'" + 
+                    ", @selected = N'" + selected + "'";
+                ds = oCN.RunProcReturn(sql, "h_p_ProcessExchangeBillCheckRecordList_GetSubBillList");
                 return GetObjectJson(ds);
             }
             catch (Exception e)
@@ -3601,7 +3722,7 @@
                 }
 
                 //鍒锋柊榛樿宸ヨ壓璺嚎
-                oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID+",'" + user + "'");
+                oCN.RunProc("exec h_p_Gy_RoutingBillSetDefault " + HInterID+",'" + user + "'");
 
                 oCN.Commit();//鎻愪氦浜嬪姟
 
@@ -3705,10 +3826,10 @@
                             return objJsonResult;
                         }
                     }
-
+                    string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
 
                     //瀹℃牳鍓嶆帶鍒�=========================================      
-                    string sql1 = "exec h_p_Gy_RoutingBill_BeforeCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
+                    string sql1 = "exec h_p_Gy_RoutingBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                     ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_BeforeCheckCtrl");
                     if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                     {
@@ -3736,7 +3857,7 @@
 
 
                     //瀹℃牳鍚庢帶鍒�=========================================      
-                    string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
+                    string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                     ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_AfterCheckCtrl");
                     if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                     {

--
Gitblit v1.9.1