From d025fb7f76a203f3d29f7041611115a00f7a010c Mon Sep 17 00:00:00 2001 From: 杨乐 <yang.le.192@qq.com> Date: 星期一, 14 二月 2022 16:19:14 +0800 Subject: [PATCH] 无数据的情况下去掉提示,直接显示无数据的列表,且带出操作工具栏 --- WebAPI/Controllers/LMESController.cs | 127 ++++++++++++++++++++++++++++-------------- 1 files changed, 84 insertions(+), 43 deletions(-) diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index 828d0e7..27bb091 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) @@ -292,6 +320,9 @@ return objJsonResult; } } + #endregion + + #endregion /// <summary> /// 杩斿洖鐢熶骇浠诲姟鍗曞垪琛� @@ -300,11 +331,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) @@ -359,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