From 5f77b7e9021e7ee4e7c9e9e1769a4b286da4949d Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期五, 22 三月 2024 17:22:24 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/工资管理/Pay_OtherBalBillController.cs | 698 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 613 insertions(+), 85 deletions(-) diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OtherBalBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OtherBalBillController.cs" index e2fd0b2..b2b9920 100644 --- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OtherBalBillController.cs" +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OtherBalBillController.cs" @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json.Linq; +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; @@ -14,59 +15,585 @@ public class Pay_OtherBalBillController : ApiController { public DBUtility.ClsPub.Enum_BillStatus BillStatus; - - private json objJsonResult = new json(); + public const string ModName = "2206"; //鍗曟嵁绫诲瀷 + public const string ModCaption = "宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛�"; //鍗曟嵁鍚嶇О + public const string ModRightName = "Pay_OtherBalBill"; + public const string ModRightNameList = ModRightName + "List"; //鍒楄〃 + public const string ModRightNameEdit = ModRightName + "_Edit"; //缂栬緫 + public const string ModRightNameCheck = ModRightName + "_Check"; //瀹℃牳 + public const string ModRightNameClose = ModRightName + "_Close"; //鍏抽棴 + public const string ModRightNameDelete = ModRightName + "_Delete"; //浣滃簾 + public const string ModRightNameDrop = ModRightName + "_Drop"; //鍒犻櫎 + public const string ModRightNameMoney = ModRightName + "_Money"; //閲戦 + public const string ModRightNameQty = ModRightName + "_Qty"; //鏁伴噺 public DataSet ds = new DataSet(); - public WebServer webserver = new WebServer(); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - //DataSet ds; + private json objJsonResult = new json(); + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + public DAL.ClsPay_OtherBalBill oBill = new DAL.ClsPay_OtherBalBill(); public DLL.ClsPay_OtherBalBill BillNew0 = new DLL.ClsPay_OtherBalBill(); // public DLL.ClsPay_OtherBalBill BillOld0 = new DLL.ClsPay_OtherBalBill(); // + + #region 宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛夊垪琛� /// <summary> - /// 杩斿洖宸ヨ祫缁撶畻涓汉鍒楄〃 - ///鍙傛暟锛歴tring sql銆� - ///杩斿洖鍊硷細object銆� + /// 鑾峰彇宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛夊垪琛ㄤ俊鎭� /// </summary> - [Route("Pay_OtherBalBill/GetOtherBalBill")] + /// <returns></returns> + [Route("Pay_OtherBalBillController/GetPay_OtherBalBillList_Json")] [HttpGet] - public object GetOtherBalBill(string sWhere) + public object GetPay_OtherBalBillList_Json(string sWhere, string HMaker) { try { + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, HMaker)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } - ds = Sc_GetOtherBalBill(sWhere); - objJsonResult.code = "1"; + //杩斿洖鍒楄〃淇℃伅 + ds = oCn.RunProcReturn("select * from h_v_Pay_OtherBalBillList where 1=1 " + sWhere + " order by hmainid desc", "h_v_Pay_OtherBalBillList"); + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.Message = "鎴愬姛锛�"; objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; return objJsonResult; } - catch (Exception ex) + catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } + #endregion - public static DataSet Sc_GetOtherBalBill(string sWhere) + #region 宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛� 鍒犻櫎 + /// <summary> + /// 鍒犻櫎宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛� + /// </summary> + /// <returns></returns> + [Route("Pay_OtherBalBillController/GetPay_OtherBalBill_Delete_Json")] + [HttpGet] + public object GetPay_OtherBalBill_Delete_Json(Int64 HInterID, string HMaker) { - if (sWhere == null || sWhere.Equals("")) + try { - return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_OtherBalBillList order by 鏃ユ湡 desc", "h_v_Pay_OtherBalBillList"); - } - else - { - string sql1 = "select * from h_v_Pay_OtherBalBillList where 1 = 1 "; - string sql = sql1 + sWhere + "order by 鏃ユ湡 desc"; - return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_OtherBalBillList"); - } + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log(ModRightNameDrop, 3, false, HMaker)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍒犻櫎鍔熻兘鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒ゆ柇瀛樺湪鎬� + if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) + { + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod_Pay(oBill.omodel.HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶆帶鍒� + DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Pay_OtherBalBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Pay_OtherBalBill_BeforeDelCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } + //鍒犻櫎鍗曟嵁锛堝寘鍚垹闄ゅ悗鎺у埗銆佸啓鍏ユ棩蹇楋級 + if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Pay_OtherBalBill_AfterDelCtrl", HMaker, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛夋垚鍔燂紒"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈煡璇㈠埌璇ュ伐璧勭粨绠楀崟锛堝叾浠栵級锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛夊け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } } - + #endregion + + #region 宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛� 瀹℃牳/鍙嶅鏍� + /// <summary> + /// 瀹℃牳/鍙嶅鏍稿伐璧勭粨绠楀崟锛堝叾浠栵級 + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param> + /// <param name="HMaker">瀹℃牳浜�</param> + /// <returns></returns> + [Route("Pay_OtherBalBillController/GetPay_OtherBalBill_Check_Json")] + [HttpGet] + public object GetPay_OtherBalBill_Check_Json(Int64 HInterID, int Type, string HMaker) + { + try + { + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡瀹℃牳/鍙嶅鏍稿姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒ゆ柇瀛樺湪鎬� + if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) + { + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod_Pay(oBill.omodel.HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + + //Type 1 瀹℃牳 2 鍙嶅鏍� + if (Type == 1) + { + if (oBill.omodel.HChecker.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍革紝涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HCloseMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HDeleteMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //瀹℃牳鍓嶆帶鍒� + DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Pay_OtherBalBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Pay_OtherBalBill_BeforeCheckCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } + //瀹℃牳鍗曟嵁 + if (!oBill.CheckBill(HInterID, oBill.omodel.HBillNo, "h_p_Pay_OtherBalBill_AfterCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 瀹℃牳鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + else + { + if (oBill.omodel.HChecker.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈鏍革紝涓嶉渶瑕佸弽瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍稿墠鎺у埗 + DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Pay_OtherBalBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Pay_OtherBalBill_BeforeUnCheckCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅鏍稿墠鍒ゆ柇澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } + + //鍙嶅鏍稿崟鎹� + if (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_Pay_OtherBalBill_AfterUnCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅鏍告垚鍔燂紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈煡璇㈠埌璇ュ伐璧勭粨绠楀崟锛堝叾浠栵級锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛夊け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛� 鍏抽棴/鍙嶅叧闂� + /// <summary> + /// 鍏抽棴/鍙嶅叧闂伐璧勭粨绠楀崟锛堝叾浠栵級 + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="Type">鍏抽棴(1),鍙嶅叧闂�(2)</param> + /// <param name="HMaker">鍏抽棴浜�</param> + /// <returns></returns> + [Route("Pay_OtherBalBillController/GetPay_OtherBalBill_Close_Json")] + [HttpGet] + public object GetPay_OtherBalBill_Close_Json(Int64 HInterID, int Type, string HMaker) + { + try + { + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍏抽棴/鍙嶅叧闂姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒ゆ柇瀛樺湪鎬� + if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) + { + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod_Pay(oBill.omodel.HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + + //Type 1 鍏抽棴 2 鍙嶅叧闂� + if (Type == 1) + { + if (oBill.omodel.HCloseMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆鍏抽棴锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍏抽棴鍗曟嵁 + if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍏抽棴鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + else + { + if (oBill.omodel.HCloseMan.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈叧闂紝涓嶉渶瑕佸弽鍏抽棴锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅叧闂崟鎹� + if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅叧闂垚鍔燂紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈煡璇㈠埌璇ュ伐璧勭粨绠楀崟锛堝叾浠栵級锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍏抽棴鎴栧弽鍏抽棴宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛夊け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛� 浣滃簾/鍙嶄綔搴� + /// <summary> + /// 浣滃簾/鍙嶄綔搴熷伐璧勭粨绠楀崟锛堝叾浠栵級 + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="Type">浣滃簾(1),鍙嶄綔搴�(2)</param> + /// <param name="HMaker">浣滃簾浜�</param> + /// <returns></returns> + [Route("Pay_OtherBalBillController/GetPay_OtherBalBill_Cancelltion_Json")] + [HttpGet] + public object GetPay_OtherBalBill_Cancelltion_Json(Int64 HInterID, int Type, string HMaker) + { + try + { + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡浣滃簾/鍙嶄綔搴熷姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒ゆ柇瀛樺湪鎬� + if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) + { + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod_Pay(oBill.omodel.HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + + //Type 1 浣滃簾 2 鍙嶄綔搴� + if (Type == 1) + { + if (oBill.omodel.HDeleteMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆浣滃簾锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //浣滃簾鍗曟嵁 + if (!oBill.Cancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 浣滃簾鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + else + { + if (oBill.omodel.HDeleteMan.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈綔搴燂紝涓嶉渶瑕佸弽浣滃簾锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶄綔搴熷崟鎹� + if (!oBill.AbandonCancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶄綔搴熸垚鍔燂紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈煡璇㈠埌璇ュ伐璧勭粨绠楀崟锛堝叾浠栵級锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浣滃簾鎴栧弽浣滃簾宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛夊け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + + #region[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] [Route("Pay_OtherBalBill/Pay_OtherBalBillListCheckDetail")] [HttpGet] @@ -87,31 +614,61 @@ #region[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] [Route("Pay_OtherBalBill/Pay_OtherBalBillListProjectDetai")] [HttpGet] - public object Pay_OtherBalBillListProjectDetai(string sqlWhere) + public object Pay_OtherBalBillListProjectDetai(Int64 HInterID) { - DataSet ds; try { - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - string sql1 = "SELECT HMaterID,HMaterCode,HMaterName, HDeptID,閮ㄩ棬浠g爜,閮ㄩ棬" + - ",HGroupID,鐝粍浠g爜,鐝粍,宸ヨ祫绫诲瀷,鎽樿,鍐呴儴鍗曟嵁鍙�,琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡" + - ",瀹℃牳浜�,瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HProcID,HProcNumber,HProcName" + - ",HEmpID,HEmpNumber,HEmpName,宸ユ椂 HTimes ,鏁伴噺 HQty,宸ヤ环 HPrice,閲戦 HMoney ,琛ㄤ綋澶囨敞 as HRemark FROM h_v_Pay_OtherBalBillList where 1 = 1 "; - string sql = sql1 + sqlWhere; - ds = oCN.RunProcReturn(sql, "h_v_Pay_OtherBalBillList"); - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; + ds = oCn.RunProcReturn("exec h_p_Pay_OtherBalBill_EditInit " + HInterID, "h_p_Pay_OtherBalBill_EditInit"); + 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 = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.Message = "杩斿洖宸ヨ祫缁撶畻鍗曪紙鍏朵粬锛変俊鎭け璐ワ紒" + e.ToString(); objJsonResult.data = null; + return objJsonResult; } - return objJsonResult; + + + //DataSet ds; + //try + //{ + // SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + // string sql1 = "SELECT HMaterID,HMaterCode,HMaterName, HDeptID,閮ㄩ棬浠g爜,閮ㄩ棬" + + // ",HGroupID,鐝粍浠g爜,鐝粍,宸ヨ祫绫诲瀷,鎽樿,鍐呴儴鍗曟嵁鍙�,琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡" + + // ",瀹℃牳浜�,瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HProcID,HProcNumber,HProcName" + + // ",HEmpID,HEmpNumber,HEmpName,宸ユ椂 HTimes ,鏁伴噺 HQty,宸ヤ环 HPrice,閲戦 HMoney ,琛ㄤ綋澶囨敞 as HRemark FROM h_v_Pay_OtherBalBillList where 1 = 1 "; + // string sql = sql1 + sqlWhere; + // ds = oCN.RunProcReturn(sql, "h_v_Pay_OtherBalBillList"); + // 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 @@ -131,23 +688,24 @@ string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); string refSav = sArray[2].ToString(); - //string msg4 = sArray[3].ToString(); + string msg4 = sArray[3].ToString(); string UserName = ""; string s = ""; long mouldid; + DBUtility.ClsPub.CurUserName = msg4; //鎿嶄綔浜� ListModels oListModels = new ListModels(); try { - ////缂栬緫鏉冮檺 - //if (!DBUtility.ClsPub.Security_Log_second("Pay_SingleBalBill_Edit", 1, true, msg4)) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; - // objJsonResult.data = null; - // return objJsonResult; - //} + //缂栬緫鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("Pay_OtherBalBill_Edit", 1, false, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } DLL.ClsPay_OtherBalBill oBill = new DLL.ClsPay_OtherBalBill(); List<Models.ClsPay_OtherBalBillMain> lsmain = new List<Models.ClsPay_OtherBalBillMain>(); @@ -256,7 +814,7 @@ //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 //oItemSub.HManagerID = 0; //璐熻矗浜篒D //oItemSub.HCloseMan = ""; //琛屽叧闂� - oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(""); oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 //oItemSub.HRemark = ""; //澶囨敞 oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� @@ -312,43 +870,13 @@ } } - /// <summary> - ///宸ヨ祫缁撶畻鍏朵粬鍗曞垹闄ゅ姛鑳� - /// </summary> - /// <returns></returns> - [Route("Pay_OtherBalBill/DeltetOtherBalBill")] - [HttpGet] - public object Pay_OtherBalBill(string HInterID) - { - try - { - oCN.BeginTran(); - oCN.RunProc("Delete From Pay_OtherBalBillMain where HInterID = " + HInterID); - oCN.RunProc("Delete From Pay_OtherBalBillSub 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; - } - } [Route("Pay_OtherBalBill/getOtherBalBillPrice")] [HttpGet] public object getOtherBalBillPrice(string HMaterID, string HProcID) { try { - DataSet ds = oCN.RunProcReturn("select 鍗曚环 from h_v_Gy_ProcPriceList where HMaterID='" + HMaterID + "' and HProcID='" + HProcID + "'", "h_v_Gy_ProcPriceList"); + DataSet ds = oCn.RunProcReturn("select 鍗曚环 from h_v_Gy_ProcPriceList where HMaterID='" + HMaterID + "' and HProcID='" + HProcID + "'", "h_v_Gy_ProcPriceList"); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; @@ -364,6 +892,6 @@ return objJsonResult; } } - // + } } \ No newline at end of file -- Gitblit v1.9.1