From 2d1dd7ea14fdf01d08ea52889037681dfb1a19cc Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期日, 03 三月 2024 16:50:03 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/工资管理/Pay_OverApplyBillController.cs | 1037 ++++++++++++++++++++++++++++++++------------------------ 1 files changed, 590 insertions(+), 447 deletions(-) diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OverApplyBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OverApplyBillController.cs" index 602e540..0c5e960 100644 --- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OverApplyBillController.cs" +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_OverApplyBillController.cs" @@ -15,13 +15,585 @@ { public class Pay_OverApplyBillController : ApiController { - public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛� - private json objJsonResult = new json(); + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + public const string ModName = "2209"; //鍗曟嵁绫诲瀷 + public const string ModCaption = "鍔犵彮鐢宠鍗�"; //鍗曟嵁鍚嶇О + public const string ModRightName = "Pay_OverApplyBill"; + 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 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + private json objJsonResult = new json(); + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + public DAL.ClsPay_OverApplyBill oBill = new DAL.ClsPay_OverApplyBill(); public DAL.ClsPay_OverApplyBill BillOld = new DAL.ClsPay_OverApplyBill(); - string user_LongShan = ""; - string HName_LongShan = ""; + + + #region 鍔犵彮鐢宠鍗曞垪琛� + /// <summary> + /// 鑾峰彇鍔犵彮鐢宠鍗曞垪琛ㄤ俊鎭� + /// </summary> + /// <returns></returns> + [Route("Pay_OverApplyBillController/GetPay_OverApplyBillList_Json")] + [HttpGet] + public object GetPay_OverApplyBillList_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 = oCn.RunProcReturn("select * from h_v_Pay_OverApplyBillList where 1=1 " + sWhere + " order by hmainid desc", "h_v_Pay_OverApplyBillList"); + 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.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鍔犵彮鐢宠鍗曞垹闄� + /// <summary> + /// 鍒犻櫎鍔犵彮鐢宠鍗� + /// </summary> + /// <returns></returns> + [Route("Pay_OverApplyBillController/GetPay_OverApplyBill_Delete_Json")] + [HttpGet] + public object GetPay_OverApplyBill_Delete_Json(Int64 HInterID, string HMaker) + { + try + { + //鍒ゆ柇鏉冮檺 + 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_OverApplyBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Pay_OverApplyBill_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_OverApplyBill_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_OverApplyBillController/GetPay_OverApplyBill_Check_Json")] + [HttpGet] + public object GetPay_OverApplyBill_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_OverApplyBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Pay_OverApplyBill_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_OverApplyBill_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_OverApplyBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Pay_OverApplyBill_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_OverApplyBill_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_OverApplyBillController/GetPay_OverApplyBill_Close_Json")] + [HttpGet] + public object GetPay_OverApplyBill_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_OverApplyBillController/GetPay_OverApplyBill_Cancelltion_Json")] + [HttpGet] + public object GetPay_OverApplyBill_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 鍔犵彮鐢宠鍗� 鏂板/缂栬緫 #region 鍔犵彮鐢宠鍗� 琛ㄥご鏁版嵁 @@ -85,19 +657,19 @@ var _value = sMainSub["sMainSub"].ToString(); string msg1 = _value.ToString(); //寮�濮嬩簨鍔� - oCN.BeginTran(); + oCn.BeginTran(); //淇濆瓨涓昏〃 objJsonResult = AddBillMain_Pay_OverApplyBill(msg1); if (objJsonResult.code == "0") { - oCN.RollBack(); + oCn.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } - oCN.Commit(); + oCn.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; @@ -184,7 +756,7 @@ //if (OperationType == 2) //{ - // ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); + // ds = oCn.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); // if (ds.Tables[0].Rows.Count > 0) // { // objJsonResult.code = "0"; @@ -195,7 +767,7 @@ // } //} - ds = oCN.RunProcReturn("select * from Pay_OverApplyBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_PayMentBillMain"); + ds = oCn.RunProcReturn("select * from Pay_OverApplyBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_PayMentBillMain"); if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板 { @@ -221,9 +793,9 @@ "')"; //涓昏〃 - oCN.RunProc(sql); + oCn.RunProc(sql); LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板鍔犵彮鐢宠鍗�:" + HBillNo); - oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板鍔犵彮鐢宠鍗曪細" + HBillNo + "','LMES-鍔犵彮鐢宠鍗曟ā鍧�','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板鍔犵彮鐢宠鍗曪細" + HBillNo + "','LMES-鍔犵彮鐢宠鍗曟ā鍧�','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) //缂栬緫 { @@ -242,13 +814,13 @@ "', HUpdateDate = '" + HUpdaterDate + "' where HInterID = " + HInterID; - oCN.RunProc(sql); + oCn.RunProc(sql); //鍒犻櫎瀛愯〃 - oCN.RunProc("delete from Pay_OverApplyBillSub where HInterID= " + HInterID); + oCn.RunProc("delete from Pay_OverApplyBillSub where HInterID= " + HInterID); //璁板綍鏃ュ織 LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼鍔犵彮鐢宠鍗�:" + HBillNo); - oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼鍔犵彮鐢宠鍗曪細" + HBillNo + "','LMES-鍔犵彮鐢宠鍗曟ā鍧�','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼鍔犵彮鐢宠鍗曪細" + HBillNo + "','LMES-鍔犵彮鐢宠鍗曟ā鍧�','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } //淇濆瓨瀛愯〃 objJsonResult = AddBillSub1_Pay_OverApplyBill(msg3, HInterID, HBillNo, OperationType); @@ -314,7 +886,7 @@ "," + HRelTimes + ",'" + HRemark + "')"; - oCN.RunProc(sql); + oCn.RunProc(sql); } objJsonResult.code = "1"; @@ -357,7 +929,7 @@ return objJsonResult; } - ds = oCN.RunProcReturn("select * from Pay_OverApplyBillMain where HInterID = " + HInterID, "Pay_PayMentBillMain"); + ds = oCn.RunProcReturn("select * from Pay_OverApplyBillMain where HInterID = " + HInterID, "Pay_PayMentBillMain"); string[] HBillStatusList = { "", "鏈", "瀹℃牳閫氳繃", "鍏抽棴", "浣滃簾", "瀹℃牳閫�鍥�", "瀹℃牳涓�", "宸查槄", "宸插洖澶�", "缁撴", "楠岃瘉", "涓嬭揪", "寮�宸�", "鐢宠瀹℃壒", "", "鐢宠妫�楠�", "鍒ゅ畾鍚堟牸", "鍒ゅ畾涓嶅悎鏍�" }; if (ds.Tables[0].Rows.Count > 0 && int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString())>1) { @@ -370,7 +942,7 @@ } - ds = oCN.RunProcReturn("exec h_p_Pay_OverApplyBill_EditInit " + HInterID, "h_p_Pay_OverApplyBill_EditInit"); + ds = oCn.RunProcReturn("exec h_p_Pay_OverApplyBill_EditInit " + HInterID, "h_p_Pay_OverApplyBill_EditInit"); tableList.Add(ds.Tables[0]); tableList.Add(ds.Tables[1]); @@ -391,435 +963,6 @@ } #endregion - #region 鍔犵彮鐢宠鍗� 鏌ヨ - [Route("Pay_OverApplyBill/list")] - [HttpGet] - public object getOverApplyBillList(string sWhere, string user) - { - try - { - List<object> columnNameList = new List<object>(); - if (!DBUtility.ClsPub.Security_Log("Pay_OverApplyBillList", 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_Pay_OverApplyBillList order by hmainid desc", "h_v_Pay_OverApplyBillList"); - } - else - { - string sql1 = "select * from h_v_Pay_OverApplyBillList where 1 = 1 "; - string sql = sql1 + sWhere + " order by hmainid desc"; - ds = oCN.RunProcReturn(sql, "h_v_Pay_OverApplyBillList"); - } - - //娣诲姞鍒楀悕 - 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 = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; - objJsonResult.data = ds.Tables[0]; - objJsonResult.list = columnNameList; - return objJsonResult; - } - catch (Exception e) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "Exception锛�" + e.ToString(); - objJsonResult.data = null; - return objJsonResult; - } - } - #endregion - #region 鍔犵彮鐢宠鍗� 鍒犻櫎 - /// <summary> - ///鍙傛暟锛歴tring HInterID銆� - ///杩斿洖鍊硷細object銆� - /// </summary> - [Route("Pay_OverApplyBill/delete")] - [HttpGet] - public object deleteOverApplyBill(string HInterID, string user) - { - try - { - //鏌ョ湅鏉冮檺 - if (!DBUtility.ClsPub.Security_Log("Pay_OverApplyBill_Drop", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; - objJsonResult.data = null; - return objJsonResult; - } - - if (HInterID == null || HInterID.Equals("")) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "HInterID涓嶈兘涓虹┖锛�"; - objJsonResult.data = null; - return objJsonResult; - } - - oCN.BeginTran(); - - oCN.RunProc("delete from Pay_OverApplyBillMain where HInterID = " + HInterID); - oCN.RunProc("delete from Pay_OverApplyBillSub where HInterID= " + HInterID); - - oCN.Commit(); - - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; - objJsonResult.data = null; - return objJsonResult; - } - catch (Exception e) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "Exception锛�" + e.ToString(); - objJsonResult.data = null; - return objJsonResult; - } - } - #endregion - - #region 鍔犵彮鐢宠鍗� 瀹℃牳/鍙嶅鏍� - /// <summary> - /// - /// </summary> - /// <param name="HInterID">鍗曟嵁ID</param> - /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param> - /// <param name="CurUserName">瀹℃牳浜�</param> - /// <returns></returns> - [Route("Pay_OverApplyBill/AuditPay_OverApplyBill")] - [HttpGet] - public object AuditPay_OverApplyBill(string HInterID, int Type, string user) - { - try - { - //鍒ゆ柇鏄惁鏈夊鏍告潈闄� - if (!DBUtility.ClsPub.Security_Log("Pay_OverApplyBill_Check", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犳潈闄愬鏍�!"; - objJsonResult.data = null; - return objJsonResult; - } - - if (string.IsNullOrWhiteSpace(HInterID)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "HInterID涓虹┖锛�"; - objJsonResult.data = null; - return objJsonResult; - } - - - ClsPub.CurUserName = user; - BillOld.MvarItemKey = "Pay_OverApplyBillMain"; - oCN.BeginTran();//寮�濮嬩簨鍔� - - //Type 1 瀹℃牳 2 鍙嶅鏍� - if (Type == 1) - { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳 - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) - { - if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶉渶瑕佸啀瀹℃牳!"; - objJsonResult.data = null; - return objJsonResult; - } - } - //瀹℃牳鍗曟嵁 - if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - } - else - { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍� - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) - { - if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插弽瀹℃牳!涓嶉渶瑕佸啀鍙嶅鏍�!"; - objJsonResult.data = null; - return objJsonResult; - } - } - //鍙嶅鏍稿崟鎹� - if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - } - - oCN.Commit();//鎻愪氦浜嬪姟 - - objJsonResult.code = "0"; - objJsonResult.count = 1; - 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_OverApplyBill/ClosePay_OverApplyBill")] - [HttpGet] - public object ClosePay_OverApplyBill(string HInterID, int Type, string user) - { - try - { - //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� - if (!DBUtility.ClsPub.Security_Log("Pay_OverApplyBill_Close", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犳潈闄愬叧闂�!"; - objJsonResult.data = null; - return objJsonResult; - } - - if (string.IsNullOrWhiteSpace(HInterID)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "HInterID涓虹┖锛�"; - objJsonResult.data = null; - return objJsonResult; - } - - ClsPub.CurUserName = user; - BillOld.MvarItemKey = "Pay_OverApplyBillMain"; - oCN.BeginTran();//寮�濮嬩簨鍔� - - //Type 1 鍏抽棴 2 鍙嶅叧闂� - if (Type == 1) - { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍏抽棴 - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) - { - if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶉渶瑕佸啀鍏抽棴!"; - objJsonResult.data = null; - return objJsonResult; - } - } - //鍏抽棴鍗曟嵁 - if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - } - else - { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅叧闂� - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) - { - if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插弽鍏抽棴!涓嶉渶瑕佸啀鍙嶅叧闂�!"; - objJsonResult.data = null; - return objJsonResult; - } - } - //鍙嶅叧闂崟鎹� - if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - } - - oCN.Commit();//鎻愪氦浜嬪姟 - - objJsonResult.code = "0"; - objJsonResult.count = 1; - 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_OverApplyBill/DropPay_OverApplyBill")] - [HttpGet] - public object DropPay_OverApplyBill(string HInterID, int Type, string user) - { - try - { - //鍒ゆ柇鏄惁鏈変綔搴熸潈闄� - if (!DBUtility.ClsPub.Security_Log("Pay_OverApplyBill_Delete", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犳潈闄愪綔搴�!"; - objJsonResult.data = null; - return objJsonResult; - } - - if (string.IsNullOrWhiteSpace(HInterID)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "HInterID涓虹┖锛�"; - objJsonResult.data = null; - return objJsonResult; - } - - ClsPub.CurUserName = user; - BillOld.MvarItemKey = "Pay_OverApplyBillMain"; - oCN.BeginTran();//寮�濮嬩簨鍔� - - //Type 1 浣滃簾 2 鍙嶄綔搴� - if (Type == 1) - { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡浣滃簾 - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) - { - if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶉渶瑕佸啀浣滃簾!"; - objJsonResult.data = null; - return objJsonResult; - } - } - //浣滃簾鍗曟嵁 - if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - } - else - { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶄綔搴� - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) - { - if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插弽浣滃簾!涓嶉渶瑕佸啀鍙嶄綔搴�!"; - objJsonResult.data = null; - return objJsonResult; - } - } - //鍙嶄綔搴熷崟鎹� - if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - } - - oCN.Commit();//鎻愪氦浜嬪姟 - - objJsonResult.code = "0"; - objJsonResult.count = 1; - 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 } } \ No newline at end of file -- Gitblit v1.9.1