From ce58bfdb73054fa181e0731d60f4c2e74798cabb Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 13 十月 2025 09:23:38 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs |  111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 109 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs
index 9158cba..beb5a73 100644
--- a/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs
@@ -37,7 +37,7 @@
             try
             {
 
-                ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID, "h_v_IF_SeOutStockBillList");
+                ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillEdit where hmainid=" + HInterID, "h_v_IF_SeOutStockBillList");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -112,6 +112,74 @@
                 objJsonResult.data = ds.Tables[0];
                 objJsonResult.list = columnNameList;// 灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
                
+                return objJsonResult;
+                //}
+                //else
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 杩斿洖鍙戣揣閫氱煡鍗曞垪琛�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xs_SeOutStockBill/list_k3")]
+        [HttpGet]
+        public object list_k3(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();  //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList_k3 order by hmainid desc", "h_v_IF_SeOutStockBillList_k3");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_IF_SeOutStockBillList_k3 where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by hmainid desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_IF_SeOutStockBillList_k3");
+                }
+                foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+                {
+                    Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺�         // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;// 灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
+
                 return objJsonResult;
                 //}
                 //else
@@ -2232,7 +2300,7 @@
                 }
                 string sql = "select * from h_v_Xs_SeOutStockBillQuerySub where hmainid =  " + hmainid;
 
-                ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Xs_SeOutStockBillQuerySub");
+                ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Xs_SeOutStockBillQuerySub");
 
 
                 foreach (DataColumn col in ds.Tables[0].Columns)
@@ -2259,5 +2327,44 @@
             }
         }
         #endregion
+
+
+        #region 鍙戣揣閫氱煡鍗曟煡璇㈠嵆鏃跺簱瀛�
+        [Route("Xs_SeOutStockBill/GetICInventory")]
+        [HttpGet]
+        public object GetICInventory(int HMaterID, int HWHID, int HORGID)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+                //if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBillQuery", 1, false, user))
+                //{
+                //    objJsonResult.code = CodeConstant.FAIL;
+                //    objJsonResult.count = CountConstant.FAIL;
+                //    objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                string sql = "exec h_p_Xs_SeOutStockBillGetICInventory " + HMaterID + "," + HWHID + "," + HORGID;
+
+                ds = oCN.RunProcReturn(sql, "h_p_Xs_SeOutStockBillGetICInventory");
+
+                objJsonResult.code = CodeConstant.SUCCEED;
+                objJsonResult.count = CountConstant.SUCCEED;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0].Rows[0]["HBack"];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = CodeConstant.FAIL;
+                objJsonResult.count = CountConstant.FAIL;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1