From 2d1dd7ea14fdf01d08ea52889037681dfb1a19cc Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期日, 03 三月 2024 16:50:03 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/LMESController.cs |  122 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 120 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index bdbd9bf..1824817 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -104,7 +104,29 @@
                 }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery");
+
+                
+                //鍒ゆ柇鐢ㄦ埛鏄惁鎷ユ湁鏌ョ湅鎵�鏈夊鎴锋潈闄�
+                if (DBUtility.ClsPub.Security_Log_second("Gy_UserLookAllCus", 1, false, user))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery");
+                }
+                else
+                {
+                    //鑾峰彇鐢ㄦ埛缂栫爜
+                    string sql = "select * from Gy_Czygl where Czymc = '" + user + "'";
+                    ds = oCN.RunProcReturn(sql, "Gy_Czygl");
+                    string userID = ds.Tables[0].Rows[0]["Czybm"].ToString();
+
+                    string sql1 = " and HCusID in (select HCusID from Gy_UserCustomerRelation Where HUserID = '" + userID + "')";
+                    string sql2 = "select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + sql1 + " order by hmainid desc ";
+                    ds = oCN.RunProcReturn(sql2, "h_v_Sc_ProcessExchangeBillQuery");
+                }
+
+
+
+
+                
 
 
                 //娣诲姞鍒楀悕
@@ -592,7 +614,7 @@
 
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                ds = oCN.RunProcReturn("select " + Count + " * from h_v_Sc_ProcessExchangeIssueBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeIssueBillQuery");
+                ds = oCN.RunProcReturn("select " + Count + " * from h_v_Sc_ProcessExchangeIssueBillQuery where 1 = 1 " + sWhere + " order by hmainid desc,CONVERT(int,娴佹按鍙�) asc", "h_v_Sc_ProcessExchangeIssueBillQuery");
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "Sucess锛�";
@@ -1452,6 +1474,102 @@
         }
         #endregion
 
+        #region 閿�鍞粺璁℃姤琛�
+        [Route("LEMS/SeOutReportList")]
+        [HttpGet]
+        public object SeOutReportList(string DateYear, string HType, string user)
+        {
+            try
+            {
+                DataSet ds;
+                List<object> columnNameList = new List<object>();
+
+                if (DateYear == null || DateYear.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇烽�夋嫨鏈夋晥骞翠唤";
+                    return objJsonResult;
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec [h_p_Xe_SeOutReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]");
+                }
+
+                //娣诲姞鍒楀悕
+                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 閿�鍞彂璐х粺璁℃姤琛�
+        [Route("LEMS/SeOutStockReportList")]
+        [HttpGet]
+        public object SeOutStockReportList(string DateYear, string HType, string user)
+        {
+            try
+            {
+                DataSet ds;
+                List<object> columnNameList = new List<object>();
+
+                if (DateYear == null || DateYear.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇烽�夋嫨鏈夋晥骞翠唤";
+                    return objJsonResult;
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec [h_p_Xs_SeOutStockReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]");
+                }
+
+                //娣诲姞鍒楀悕
+                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 瀹㈡埛璁㈠崟  鐢熶骇璁㈠崟瀹屽伐
         [Route("LEMS/sc_ICOMReportClose")]
         [HttpPost]

--
Gitblit v1.9.1