From fef5abcd1181cff38715599beceb5e46a32c014f Mon Sep 17 00:00:00 2001 From: zzr99 <1940172413@qq.com> Date: 星期一, 11 十月 2021 17:59:57 +0800 Subject: [PATCH] 器具档案和器具分类的查看删除权限 --- WebAPI/Controllers/Pay_SingleBalBillController.cs | 155 ++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 114 insertions(+), 41 deletions(-) diff --git a/WebAPI/Controllers/Pay_SingleBalBillController.cs b/WebAPI/Controllers/Pay_SingleBalBillController.cs index a51a0aa..9a209c8 100644 --- a/WebAPI/Controllers/Pay_SingleBalBillController.cs +++ b/WebAPI/Controllers/Pay_SingleBalBillController.cs @@ -16,8 +16,10 @@ public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + public WebServer webserver = new WebServer(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - DataSet ds; + //DataSet ds; /// <summary> @@ -25,49 +27,92 @@ ///鍙傛暟锛歴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] + public ApiResult<DataSet> Pay_SingleBalBillListCheckDetail(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Pay_SingleBalBillList where hmainid= " + HID + " ", "h_v_Pay_SingleBalBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ粨绠楀崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] + [Route("Pay_SingleBalBill/Pay_SingleBalBillListProjectDetai")] + [HttpGet] + public object Pay_SingleBalBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + 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) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion /// <summary> /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 ///鍙傛暟锛歴tring sql銆� @@ -129,15 +174,14 @@ int HPRDORGID = mainList[0].HPRDORGID; //缁勭粐 //涓昏〃 - oCN.RunProc("Insert Into Pay_SingleBalBillMain " + - "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + - ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + - ",HGroupID,HDeptID,HEmpID,HPayType,HExplanation,HInnerBillNo" + - ") " + - " values('" + HBillType + "'," + HBillSubType + ",'" + HInterID + "','" + HBillNo + "','" + HDate + "'" + - "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()," + HGroupID + "," + HDeptID + "," + HEmpID + ","+ - "," + HPayType + "," + HExplanation + ",'" + HInnerBillNo + "'," + - ") "); + oCN.RunProc(" Insert Into Pay_SingleBalBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker" + + ",HGroupID,HDeptID,HEmpID,HPayType,HExplanation,HInnerBillNo" + ")" + + "values('" + HBillType + "'" + HBillSubType + "," + HInterID + ",'" + HBillNo + "','" + HDate + + "',"+ HDeptID + "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "'," + HGroupID + + "," + HEmpID + ","+ HPayType +",'" + HInnerBillNo + "'" + HExplanation + + ") "); //淇濆瓨瀛愯〃 objJsonResult = AddBillSub(msg3, HInterID); @@ -250,7 +294,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