From 52c79d631103539455bbf2d0401514d2b8c1ecea Mon Sep 17 00:00:00 2001 From: 沈泽 <211959439@qq.com> Date: 星期六, 09 十月 2021 16:59:39 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/Pay_SingleBalBillController.cs | 126 ++++++++++++++++++++++------------------- 1 files changed, 67 insertions(+), 59 deletions(-) diff --git a/WebAPI/Controllers/Pay_SingleBalBillController.cs b/WebAPI/Controllers/Pay_SingleBalBillController.cs index 206cecf..77f7165 100644 --- a/WebAPI/Controllers/Pay_SingleBalBillController.cs +++ b/WebAPI/Controllers/Pay_SingleBalBillController.cs @@ -27,48 +27,45 @@ ///鍙傛暟锛歴tring sql銆� ///杩斿洖鍊硷細object銆� /// </summary> - [Route("Pay_SingleBalBill/list")] + [Route("Pay_SingleBalBill/GetSingleBalBill")] [HttpGet] - public object list(string sWhere) + public object GetSingleBalBill(string sWhere) { try { - if (sWhere == null || sWhere.Equals("")) - { - ds = oCN.RunProcReturn("select * from h_v_Pay_SingleBalBillList " + sWhere, "h_v_Pay_SingleBalBillList"); - } - else - { - string sql1 = "select * from h_v_Pay_SingleBalBillList where 1 = 1 "; - string sql = sql1 + sWhere; - ds = oCN.RunProcReturn(sql, "h_v_Pay_SingleBalBillList"); - } - if (ds == null || ds.Tables[0].Rows.Count == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "false锛�"; - objJsonResult.data = null; - return objJsonResult; - } - else - { - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; - objJsonResult.data = ds.Tables[0]; - return objJsonResult; - } + + ds = Sc_GetSingleBalBill(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; } - catch (Exception e) + catch (Exception ex) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } + + public static DataSet Sc_GetSingleBalBill(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_SingleBalBillList order by 鏃ユ湡 desc", "h_v_Pay_SingleBalBillList"); + } + else + { + string sql1 = "select * from h_v_Pay_SingleBalBillList where 1 = 1 "; + string sql = sql1 + sWhere + "order by 鏃ユ湡 desc"; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_SingleBalBillList"); + } + + } + #region[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] [Route("Pay_SingleBalBill/Pay_SingleBalBillListCheckDetail")] [HttpGet] @@ -95,34 +92,16 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - if (sqlWhere == null || sqlWhere.Equals("")) - { - ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID 鐗╂枡浠g爜,鐗╂枡鍚嶇О, HDeptID 閮ㄩ棬浠g爜,閮ㄩ棬,HGroupID 鐝粍浠g爜,鐝粍,宸ヨ祫绫诲瀷,鎽樿,鍐呴儴鍗曟嵁鍙�, - 琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡,瀹℃牳浜�,瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HProcID 宸ュ簭浠g爜,宸ュ簭鍚嶇О, - HEmpID 鑱屽憳浠g爜,鑱屽憳,宸ユ椂,鏁伴噺,宸ヤ环,閲戦 - FROM h_v_Pay_SingleBalBillList"), "h_v_Pay_SingleBalBillList"); - - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; - } - else - { - - //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; - string sql1 = string.Format(@"SELECT HMaterID 鐗╂枡浠g爜,鐗╂枡鍚嶇О, HDeptID 閮ㄩ棬浠g爜,閮ㄩ棬,HGroupID 鐝粍浠g爜,鐝粍,宸ヨ祫绫诲瀷,鎽樿,鍐呴儴鍗曟嵁鍙�, - 琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡,瀹℃牳浜�,瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HProcID 宸ュ簭浠g爜,宸ュ簭鍚嶇О, - HEmpID 鑱屽憳浠g爜,鑱屽憳,宸ユ椂,鏁伴噺,宸ヤ环,閲戦 - FROM h_v_Pay_SingleBalBillList where 1 = 1 "); - string sql = sql1 + sqlWhere; - ds = oCN.RunProcReturn(sql, "h_v_Pay_SingleBalBillList"); - - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; - } + string sql1 = "SELECT HMaterID,鐗╂枡浠g爜,鐗╂枡鍚嶇О, HDeptID,閮ㄩ棬浠g爜,閮ㄩ棬" + + ",HGroupID,鐝粍浠g爜,鐝粍,宸ヨ祫绫诲瀷,鎽樿,鍐呴儴鍗曟嵁鍙�,琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡" + + ",瀹℃牳浜�,瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HProcID,宸ュ簭浠g爜,宸ュ簭鍚嶇О" + + ",HEmpID,鑱屽憳浠g爜,鑱屽憳,宸ユ椂,鏁伴噺,宸ヤ环,閲戦 FROM h_v_Pay_SingleBalBillList where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Pay_SingleBalBillList"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; } catch (Exception e) { @@ -316,7 +295,36 @@ objJsonResult.data = null; return objJsonResult; } - + /// <summary> + ///宸ヨ祫缁撶畻涓汉鍗曞垹闄ゅ姛鑳� + /// </summary> + /// <returns></returns> + [Route("Pay_SingleBalBill/DeltetSingleBalBill")] + [HttpGet] + public object Pay_SingleBalBill(string HInterID) + { + try + { + oCN.BeginTran(); + oCN.RunProc("Delete From Pay_SingleBalBillMain where HInterID = " + HInterID); + oCN.RunProc("Delete From Pay_SingleBalBillSub where HInterID = " + HInterID); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } // } } \ No newline at end of file -- Gitblit v1.9.1