From 7fcf7cc09a728223220a757614d8421115e19895 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 26 三月 2024 17:11:50 +0800
Subject: [PATCH] 异常反馈接收单,异常反馈类型  查询,编辑,审核,关闭,作废

---
 WebAPI/Controllers/LMESController.cs |  241 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 240 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index a1fe776..86f8e5d 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -104,6 +104,8 @@
                 }
 
                 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");
 
 
@@ -131,6 +133,92 @@
                 return objJsonResult;
             }
         }
+
+        #region 宸ュ簭娴佽浆鍗$淮鎶�-鏌ヨ
+        /// <summary>
+        /// 杩斿洖宸ュ簭娴佽浆鍗$淮鎶ゅ垪琛ㄤ富琛�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/Sc_ProcessExchangeBillList_Query")]
+        [HttpGet]
+        public object Sc_ProcessExchangeBillList_Query(string sWhere, string user, 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();
+
+
+                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_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 = 1;
+                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>
@@ -572,6 +660,7 @@
 
                 //鑾峰彇绯荤粺鍙傛暟
                 string Ret = "";
+                string Count = "";
                 if (oSystemParameter.ShowBill(ref Ret))
                 {
                     //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
@@ -582,10 +671,16 @@
 
                         sWhere += sql_splice;                        
                     }
+                    //鍒ゆ柇瀹㈡埛涓虹憺涓庣ズ
+                    if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+                    {
+                        Count = "top 1000";
+                    }
                 }
 
+
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                ds = oCN.RunProcReturn("select * 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锛�";
@@ -1320,6 +1415,7 @@
                 List<object> columnNameList3 = new List<object>();
                 List<object> columnNameList4 = new List<object>();
                 List<object> columnNameList5 = new List<object>();
+                List<object> columnNameList6 = new List<object>();
 
                 string sql = "exec h_p_Sc_ICMOBillList_LookDown " + HInterID;
                 ds = oCN.RunProcReturn(sql, "h_p_Xs_SeOrderBill_lookdown");
@@ -1372,12 +1468,21 @@
                     columnNameList5.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                 }
 
+                //娣诲姞 鐢熶骇璁㈠崟鍙樻洿鍗� 鍒楀悕
+                foreach (DataColumn col in ds.Tables[6].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList6.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
                 columnNameListSum.Add(columnNameList0);
                 columnNameListSum.Add(columnNameList1);
                 columnNameListSum.Add(columnNameList2);
                 columnNameListSum.Add(columnNameList3);
                 columnNameListSum.Add(columnNameList4);
                 columnNameListSum.Add(columnNameList5);
+                columnNameListSum.Add(columnNameList6);
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -1417,6 +1522,102 @@
                 else
                 {
                       ds = oCN.RunProcReturn("exec [h_p_Sc_ProductionAnalysisReportList] '" + 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/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]");
                 }
 
                 //娣诲姞鍒楀悕
@@ -2755,6 +2956,44 @@
         #endregion
 
 
+        #region 鎶ヨ〃鏌ョ湅鏉冮檺鎺у埗
+        /// <summary>
+        ///鍙傛暟锛歴tring HInterID銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LMES/getReportByModRightNameCheck")]
+        [HttpGet]
+        public object getReportByModRightNameCheck(string ModRightNameCheck, string user)
+        {
+            try
+            {
+                string s = "";
 
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                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;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1