From 175b53e6f0adb40a0d861981f56f120615d55897 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 13 十一月 2024 14:52:31 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/XSGL/Xs_CusBalanceReportController.cs |  119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 119 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/XSGL/Xs_CusBalanceReportController.cs b/WebAPI/Controllers/XSGL/Xs_CusBalanceReportController.cs
index dd78a18..061d45f 100644
--- a/WebAPI/Controllers/XSGL/Xs_CusBalanceReportController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_CusBalanceReportController.cs
@@ -85,5 +85,124 @@
             }
         }
         #endregion
+
+        #region 瀹㈡埛浣欓鏌ヨ鎶ヨ〃 鍗犵敤棰濆害鏄庣粏
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xs_CusBalanceReport/getHIsUsingBalanceEntry")]
+        [HttpGet]
+        public object getHIsUsingBalanceEntry(string sWhere,Int64 HCusID, string user, string userid)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //////鏌ョ湅鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log("Xs_CusBalanceReport_Query", 1, false, user))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //鏌ヨ
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    string sql = "exec h_p_Xs_CusBalanceReport_HIsUsingBalanceEntry_Query '','" + userid + "'," + HCusID;
+                    ds = oCN.RunProcReturn(sql, "h_p_Xs_CusBalanceReport_Query");
+                }
+                else
+                {
+                    string sql = "exec h_p_Xs_CusBalanceReport_HIsUsingBalanceEntry_Query '" + sWhere +"','" + userid + "'," + HCusID;
+                    ds = oCN.RunProcReturn(sql, "h_p_Xs_CusBalanceReport_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 = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鍑哄簱鏉$爜鏄庣粏鎶ヨ〃 鏌ヨ
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xs_SellOutCompareToProductReport/list")]
+        [HttpGet]
+        public object getXs_SellOutCompareToProductReport(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Xs_SellOutCompareToProductReport", 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_Xs_SellOutCompareToProductReport order by 鐢熶骇鍗曞彿 desc", "h_v_Xs_SellOutCompareToProductReport");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Xs_SellOutCompareToProductReport where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by 鐢熶骇鍗曞彿 desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Xs_SellOutCompareToProductReport");
+                }
+
+                //娣诲姞鍒楀悕
+                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 = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1