From 7e7317ada7c9ec536a475f22c4d3aa548e6bb3fb Mon Sep 17 00:00:00 2001 From: 杨乐 <yang.le.192@qq.com> Date: 星期五, 28 一月 2022 10:22:59 +0800 Subject: [PATCH] 2658,2659 权限编辑 --- WebAPI/Controllers/LMESController.cs | 90 +++++++++++++++++++++++++++++++++----------- 1 files changed, 67 insertions(+), 23 deletions(-) diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index 9cd5ba5..3759f2b 100644 --- a/WebAPI/Controllers/LMESController.cs +++ b/WebAPI/Controllers/LMESController.cs @@ -60,17 +60,23 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - if (sWhere == null || sWhere.Equals("")) + 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) { - ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery", "h_v_Sc_ProcessExchangeBillQuery"); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; } else { - string sql1 = "select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 "; - string sql = sql1 + sWhere; - ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillQuery"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; } - } catch (Exception e) { @@ -80,7 +86,6 @@ objJsonResult.data = null; return objJsonResult; } - return GetObjectJson(ds); } /// <summary> @@ -175,6 +180,9 @@ return GetObjectJson(ds); } + #region 宸ヨ壓璺嚎 + + #region 宸ヨ壓璺嚎鍒楄〃 /// <summary> /// 杩斿洖宸ヨ壓璺嚎鍒楄〃 ///鍙傛暟锛歴tring sql銆� @@ -182,11 +190,21 @@ /// </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("")) { @@ -209,27 +227,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, true, 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) @@ -241,7 +263,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"; @@ -250,12 +272,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; //} @@ -278,6 +309,9 @@ return objJsonResult; } } + #endregion + + #endregion /// <summary> /// 杩斿洖鐢熶骇浠诲姟鍗曞垪琛� @@ -286,11 +320,21 @@ /// </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 { + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + 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 hmainid desc", "h_v_IF_ICMOBillList"); } catch (Exception e) -- Gitblit v1.9.1