From 8affd199e02bd37f0dcb16447d1fbcaa34bfa2f8 Mon Sep 17 00:00:00 2001 From: lan <lan@DESKTOP-MG88OFJ> Date: 星期四, 30 五月 2024 10:39:43 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/XSGL/Xs_CusRatingChangeBillController.cs | 138 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 103 insertions(+), 35 deletions(-) diff --git a/WebAPI/Controllers/XSGL/Xs_CusRatingChangeBillController.cs b/WebAPI/Controllers/XSGL/Xs_CusRatingChangeBillController.cs index d8ed3a9..55c89b0 100644 --- a/WebAPI/Controllers/XSGL/Xs_CusRatingChangeBillController.cs +++ b/WebAPI/Controllers/XSGL/Xs_CusRatingChangeBillController.cs @@ -37,23 +37,23 @@ { List<object> columnNameList = new List<object>(); //鏌ョ湅鏉冮檺 - //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user)) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; - // objJsonResult.data = null; - // return objJsonResult; - //} + if (!DBUtility.ClsPub.Security_Log("Xs_CusRatingChangeBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("select * from h_v_Xs_CusRatingChangeBillList_Query order by 鍗曟嵁鍙� ", "h_v_Xs_CusRatingChangeBillList_Query"); + ds = oCN.RunProcReturn("select * from h_v_Xs_CusRatingChangeBillList_Query order by 鍗曟嵁鍙� desc", "h_v_Xs_CusRatingChangeBillList_Query"); } else { string sql1 = "select * from h_v_Xs_CusRatingChangeBillList_Query where 1 = 1 "; - string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� "; + string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc"; ds = oCN.RunProcReturn(sql, "h_v_Xs_CusRatingChangeBillList_Query"); } @@ -217,7 +217,15 @@ } - + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + int sYear = 0; + int sPeriod = 0; + DateTime HDate = DateTime.Now; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.Message = s; + return objJsonResult; + } //淇濆瓨 //淇濆瓨瀹屾瘯鍚庡鐞� @@ -349,6 +357,15 @@ objJsonResult.data = 1; return objJsonResult; } + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + int sYear = 0; + int sPeriod = 0; + DateTime HDate = DateTime.Now; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.Message = s; + return objJsonResult; + } oCN.BeginTran(); @@ -359,7 +376,7 @@ objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; + objJsonResult.Message = "鎮ㄥ凡鍒犻櫎鍗曟嵁鍙蜂负" + BillOld.omodel.HBillNo + "鐨勪俊鐢ㄩ搴︾敵璇峰崟锛�"; objJsonResult.data = null; return objJsonResult; } @@ -468,34 +485,25 @@ //杩涜闇�瑕佽繘琛岀殑瀹℃牳/鍙嶅鏍告搷浣� if (IsAudit == 0) //瀹℃牳鎻愪氦 { - //鍙嶅啓瀹㈡埛淇$敤棰濆害 - oCN.BeginTran(); - string sql = "select * from Gy_Customer_Credit where HCusID = " + oBill.omodel.HCusID; - ds = oCN.RunProcReturn(sql, "Gy_Customer_Credit"); - if (ds.Tables[0].Rows.Count == 0) + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + string s = ""; + int sYear = 0; + int sPeriod = 0; + DateTime HDate = DateTime.Now; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) { - sql = "insert into Gy_Customer_Credit" + - "(HCusID,HCreditRating_Now,HUpdateTime,HUpdateMan)" + - " values(" + - "" + oBill.omodel.HCusID + - "," + oBill.omodel.HNewRating + - ",'" + DateTime.Now.ToString("yyyy-MM-dd") + "'" + - ",'" + CurUserName + "'" + - ")"; - oCN.RunProc(sql); + objJsonResult.Message = s; + return objJsonResult; } - else - { - sql = "update Gy_Customer_Credit set " + - "HCreditRating_Now = " + oBill.omodel.HNewRating + - ",HUpdateTime = '" + DateTime.Now.ToString("yyyy-MM-dd") + "'" + - ",HUpdateMan = '" + CurUserName + "'" + - " where HCusID = " + oBill.omodel.HCusID; - oCN.RunProc(sql); - } + //瀹℃牳鎻愪氦 if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { + + //鍙嶅啓瀹㈡埛淇$敤棰濆害 + oCN.BeginTran(); + string sql = "exec h_p_Xs_CusRatingChangeBill_ReWriteCustomerCredit " + oBill.omodel.HCusID + "," + oBill.omodel.HNewRating + ",'" + CurUserName + "'"; + oCN.RunProc(sql); oCN.Commit(); objJsonResult.code = "1"; @@ -515,6 +523,17 @@ } if (IsAudit == 1) //鍙嶅鏍告彁浜� { + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + string s = ""; + int sYear = 0; + int sPeriod = 0; + DateTime HDate = DateTime.Now; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.Message = s; + return objJsonResult; + } + //鍙嶅鏍告彁浜bandonCheck if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { @@ -827,5 +846,54 @@ } } #endregion + + #region 鏍规嵁瀹㈡埛鍐呯爜鑾峰彇瀹㈡埛浣欓涓庡鎴蜂俊鐢ㄩ搴� + /// <summary> + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xs_CusRatingChangeBill/getCustomerBalance")] + [HttpGet] + public object getCustomerBalance(Int64 HCusID, string CurUserName) + { + try + { + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_Customer_Balance", 1, false, CurUserName)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲鎴蜂綑棰濇煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + string sql = "exec h_p_Gy_Customer_CrediControl " + HCusID; + ds = oCN.RunProcReturn(sql, "h_p_Gy_Customer_CrediControl"); + if(ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛佹湭鑾峰彇鍒板搴斿鎴风殑淇℃伅锛侊紒"; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } \ No newline at end of file -- Gitblit v1.9.1