From acdbefae8e00a3d32b17fd23c95ad31c73d9566f Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期二, 07 六月 2022 09:57:39 +0800
Subject: [PATCH] nothing

---
 WebAPI/Controllers/LMESController.cs |  146 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 98 insertions(+), 48 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index c57bd54..b597654 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -54,29 +54,40 @@
         /// </summary>
         [Route("LEMS/MES_Sc_ProcessExchangeBillQuery_Json")]
         [HttpGet]
-        public object MES_Sc_ProcessExchangeBillList_Json(string sWhere)
+        public object MES_Sc_ProcessExchangeBillList_Json(string sWhere,string user)
         {
             DataSet ds;
             try
             {
-                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere, "h_v_Sc_ProcessExchangeBillQuery");
-                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                else
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+
+                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 (ds.Tables[0].Rows.Count != 0 || ds != null)
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+                //}
+                //else
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
             }
             catch (Exception e)
             {
@@ -180,6 +191,9 @@
             return GetObjectJson(ds);
         }
 
+        #region 宸ヨ壓璺嚎
+
+        #region 宸ヨ壓璺嚎鍒楄〃
         /// <summary>
         /// 杩斿洖宸ヨ壓璺嚎鍒楄〃
         ///鍙傛暟锛歴tring sql銆�
@@ -187,20 +201,30 @@
         /// </summary>
         [Route("LEMS/MES_Gy_RoutingBillList_Json")]
         [HttpGet]
-        public object MES_Gy_RoutingBillList_Json(string sWhere)
+        public object MES_Gy_RoutingBillList_Json(string sWhere,string user)
         {
             DataSet ds;
             try
             {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                //if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList ", "h_v_Gy_RoutingBillList");
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList order by hmainid desc", "h_v_Gy_RoutingBillList");
                 }
                 else
                 {
                     string sql1 = "select * from h_v_Gy_RoutingBillList where 1 = 1 ";
-                    string sql = sql1 + sWhere;
+                    string sql = sql1 + sWhere+ " order by hmainid desc";
                     ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList");
                 }
             }
@@ -214,27 +238,31 @@
             }
             return GetObjectJson(ds);
         }
+
+        #endregion
+
+        #region 宸ヨ壓璺嚎  鍒犻櫎
         /// <summary>
         /// 宸ヨ壓璺嚎鍒犻櫎鍔熻兘
         /// </summary>
         /// <returns></returns>
         [Route("LEMS/DeltetGy_RoutingBillSub")]
         [HttpGet]
-        public object DeltetGy_RoutingBillSub(Int64 lngBillKey)
+        public object DeltetGy_RoutingBillSub(Int64 lngBillKey,string user)
         {
             DataSet ds;
-            //string ModRightNameCheck = "Sc_ProcessReport_check";
+            string ModRightNameCheck = "Gy_RoutingBill_Drop";
             try
             {
                 //鍒犻櫎鏉冮檺
-                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒犻櫎澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (lngBillKey == 0)
@@ -246,7 +274,7 @@
                     return objJsonResult;
                 }
                 oCN.BeginTran();//寮�濮嬩簨鍔�
-                ds = oCN.RunProcReturn("select * from Gy_RoutingBillSub where HInterID=" + lngBillKey, "Gy_RoutingBillSub");
+                ds = oCN.RunProcReturn("select * from Gy_RoutingBillmain where HInterID=" + lngBillKey, "Gy_RoutingBillmain");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -255,12 +283,21 @@
                     objJsonResult.data = null;
                     return objJsonResult; ;
                 }
-                //string HChecker = Convert.ToString(ds.Tables[0].Rows[0]["HChecker"]);
-                //if (HChecker != " ")
+                string HChecker = Convert.ToString(ds.Tables[0].Rows[0]["HChecker"]);
+                //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]);
+                if (HChecker != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //if (hdeleteman != "")
                 //{
                 //    objJsonResult.code = "0";
                 //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                //    objJsonResult.Message = "鍗曟嵁宸茬粡浣滃簾,涓嶈兘鍒犻櫎锛�";
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
@@ -283,6 +320,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
+
+        #endregion
 
         /// <summary>
         /// 杩斿洖鐢熶骇浠诲姟鍗曞垪琛�
@@ -291,12 +331,22 @@
         /// </summary>
         [Route("LEMS/MES_IF_ICMOBillList_Json")]
         [HttpGet]
-        public object MES_IF_ICMOBillList_Json(string sWhere)
+        public object MES_IF_ICMOBillList_Json(string sWhere,string user)
         {
             DataSet ds;
             try
             {
-                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1 " + sWhere + " order by hmainid desc", "h_v_IF_ICMOBillList");
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1 " + sWhere + " order by HEntryID", "h_v_IF_ICMOBillList");
             }
             catch (Exception e)
             {
@@ -350,22 +400,22 @@
         {
             try
             {
-                if (ds == null || ds.Tables[0].Rows.Count <= 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+                //}
+                //else
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
             }
             catch (Exception e)
             {

--
Gitblit v1.9.1