DAL/应付管理/ClsYF_PayMentBackBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DAL/应付管理/ClsYF_PayMentBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/应付管理/ClsYF_PayMentBackBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/应付管理/ClsYF_PayMentBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/WebAPIController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/XSGL/YF_PayMentBackBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/XSGL/YF_PayMentBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj.user | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/Ó¦¸¶¹ÜÀí/ClsYF_PayMentBackBill.cs
@@ -43,7 +43,7 @@ //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate YF_PayMentBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== ",HDate='" + omodel.HDate + "'" + ",HDate='" + omodel.HDate.ToShortDateString() + "'" + ",HYear='" + omodel.HYear.ToString() + "'" + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + ",HRemark='" + omodel.HRemark + "'" + @@ -58,6 +58,7 @@ ",HExRate=" + omodel.HExRate.ToString() + ",HDeptID=" + omodel.HDeptID.ToString() + ",HEmpID=" + omodel.HEmpID.ToString() + ",HOrgID=" + omodel.HOrgID + ",HSumMoney=" + omodel.HSumMoney.ToString() + ",HBankID=" + omodel.HBankID.ToString() + ",HBankNo='" + omodel.HBankNo + "'" + @@ -67,7 +68,7 @@ ",HCheckMoneyFor=" + omodel.HCheckMoneyFor.ToString() + ",HRemainMoney=" + omodel.HRemainMoney.ToString() + ",HCheckStatus=" + omodel.HCheckStatus.ToString() + ",HSSNum='" + omodel.HSSNum.ToString() + ",HSSNum='" + omodel.HSSNum + "'" + ",HRelSumMoney=" + omodel.HRelSumMoney.ToString() + ",HSumMoneyBB=" + omodel.HSumMoneyBB.ToString() + ",HRelSumMoneyBB=" + omodel.HRelSumMoneyBB.ToString() + @@ -82,6 +83,7 @@ omodel.HInterID = lngBillKey; foreach (Model.ClsYF_PayMentBackBillSub oSub in DetailColl) { oCn.RunProc("Insert into YF_PayMentBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + @@ -137,14 +139,14 @@ "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + ",HAccDate,HSupID,HAccSupID,HSSID,HCurID,HExRate" + ",HDeptID,HEmpID,HSumMoney,HBankID,HBankNo,HExplanation" + ",HDeptID,HEmpID,HOrgID,HSumMoney,HBankID,HBankNo,HExplanation" + ",HSSNum,HDiscountRate,HRelSumMoney,HSumMoneyBB,HRelSumMoneyBB" + ",HInnerBillNo,HCheckMoney,HCheckMoneyFor,HRemainMoney,HCheckStatus" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + ",'" + omodel.HAccDate + "'," + omodel.HSupID.ToString() + "," + omodel.HAccSupID.ToString() + "," + omodel.HSSID.ToString() + "," + omodel.HCurID.ToString() + "," + omodel.HExRate.ToString() + ", " + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HSumMoney.ToString() + "," + omodel.HBankID.ToString() + ",'" + omodel.HBankNo + "','" + omodel.HExplanation + "'" + ", " + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HOrgID + "," + omodel.HSumMoney.ToString() + "," + omodel.HBankID.ToString() + ",'" + omodel.HBankNo + "','" + omodel.HExplanation + "'" + ",'" + omodel.HSSNum + "'," + omodel.HDiscountRate.ToString() + "," + omodel.HRelSumMoney.ToString() + "," + omodel.HSumMoneyBB.ToString() + "," + omodel.HRelSumMoneyBB.ToString() + ",'" + omodel.HInnerBillNo + "'," + omodel.HCheckMoney.ToString() + "," + omodel.HCheckMoneyFor.ToString() + "," + omodel.HRemainMoney.ToString() + "," + omodel.HCheckStatus.ToString() + ") "); @@ -241,6 +243,7 @@ omodel.HExRate = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HExRate"]); omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]); omodel.HSumMoney = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HSumMoney"]); omodel.HBankID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBankID"]); omodel.HBankNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBankNo"]); DAL/Ó¦¸¶¹ÜÀí/ClsYF_PayMentBill.cs
@@ -58,6 +58,7 @@ ",HExRate=" + omodel.HExRate.ToString() + ",HDeptID=" + omodel.HDeptID.ToString() + ",HEmpID=" + omodel.HEmpID.ToString() + ",HOrgID=" + omodel.HOrgID + ",HSumMoney=" + omodel.HSumMoney.ToString() + ",HBankID=" + omodel.HBankID.ToString() + ",HBankNo='" + omodel.HBankNo + "'" + @@ -69,7 +70,7 @@ ",HCheckStatus=" + omodel.HCheckStatus.ToString() + ",HSSNum='" + omodel.HSSNum.ToString() + ",HSSNum='" + omodel.HSSNum + "'" + ",HRelSumMoney=" + omodel.HRelSumMoney.ToString() + ",HSumMoneyBB=" + omodel.HSumMoneyBB.ToString() + ",HRelSumMoneyBB=" + omodel.HRelSumMoneyBB.ToString() + @@ -139,14 +140,14 @@ "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + ",HAccDate,HSupID,HAccSupID,HSSID,HCurID,HExRate" + ",HDeptID,HEmpID,HSumMoney,HBankID,HBankNo,HExplanation" + ",HDeptID,HEmpID,HOrgID,HSumMoney,HBankID,HBankNo,HExplanation" + ",HSSNum,HDiscountRate,HRelSumMoney,HSumMoneyBB,HRelSumMoneyBB" + ",HInnerBillNo,HCheckMoney,HCheckMoneyFor,HRemainMoney,HCheckStatus" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + ",'" + omodel.HAccDate + "'," + omodel.HSupID.ToString() + "," + omodel.HAccSupID.ToString() + "," + omodel.HSSID.ToString() + "," + omodel.HCurID.ToString() + "," + omodel.HExRate.ToString() + ", " + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HSumMoney.ToString() + "," + omodel.HBankID.ToString() + ",'" + omodel.HBankNo + "','" + omodel.HExplanation +"'"+ ", " + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HOrgID + "," + omodel.HSumMoney.ToString() + "," + omodel.HBankID.ToString() + ",'" + omodel.HBankNo + "','" + omodel.HExplanation +"'"+ ",'" + omodel.HSSNum + "'," + omodel.HDiscountRate.ToString() + "," + omodel.HRelSumMoney.ToString() + "," + omodel.HSumMoneyBB.ToString() + "," + omodel.HRelSumMoneyBB.ToString() + ",'" + omodel.HInnerBillNo + "'," + omodel.HCheckMoney.ToString() + "," + omodel.HCheckMoneyFor.ToString() + "," + omodel.HRemainMoney.ToString() + "," + omodel.HCheckStatus.ToString() + ") "); @@ -243,6 +244,7 @@ omodel.HExRate = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HExRate"]); omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]); omodel.HSumMoney = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HSumMoney"]); omodel.HBankID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBankID"]); omodel.HBankNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBankNo"]); Model/Ó¦¸¶¹ÜÀí/ClsYF_PayMentBackBillMain.cs
@@ -15,6 +15,7 @@ public Single HExRate;// money //æ±çï¼éå¸å«å¸¦åºï¼ public Int64 HDeptID;// int //é¨é¨ public Int64 HEmpID;// int //ä¸å¡å public Int64 HOrgID; //int ç»ç» public double HSumMoney;// dec(18,8) //åæ®éé¢ public Int64 HBankID;// int //é¶è¡ID public string HBankNo;// varchar(100) //å¸å·ï¼éé¶è¡å¸¦åºï¼ Model/Ó¦¸¶¹ÜÀí/ClsYF_PayMentBillMain.cs
@@ -15,6 +15,7 @@ public Single HExRate;// money //æ±çï¼éå¸å«å¸¦åºï¼ public Int64 HDeptID;// int //é¨é¨ public Int64 HEmpID;// int //ä¸å¡å public Int64 HOrgID; //int ç»ç» public double HSumMoney;// dec(18,8) //åæ®éé¢ public Int64 HBankID;// int //é¶è¡ID public string HBankNo;// varchar(100) //å¸å·ï¼éé¶è¡å¸¦åºï¼ WebAPI/Controllers/WebAPIController.cs
@@ -1188,16 +1188,21 @@ [HttpGet] public object GetSupplierList_Json(string Supplier, Int64 HOrgID) { sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID =" + HOrgID + ""; sWhere = " Where HStopFlag=0 and HUSEORGID =" + HOrgID + ""; //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID =" + HOrgID + ""; //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); if (Supplier != "") if (Supplier != "" && Supplier != null) { sWhere = sWhere + " and ( HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%' or HUSEORGID like '%" + HOrgID + "%' ) "; //sWhere = sWhere + " and ( HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%' or HUSEORGID like '%" + HOrgID + "%' ) "; } try { WebS.WebService1 oWeb = new WebS.WebService1(); ds = oWeb.GetSupplierList(sWhere, ref DBUtility.ClsPub.sErrInfo); string sql = "select HItemID,HNumber,HName from Gy_Supplier " + sWhere; ds = oCN.RunProcReturn(sql, "Gy_Supplier"); //WebS.WebService1 oWeb = new WebS.WebService1(); //ds = oWeb.GetSupplierList(sWhere, ref DBUtility.ClsPub.sErrInfo); //ds = webserver.GetSupplierList(sWhere, ref DBUtility.ClsPub.sErrInfo); if (ds == null || ds.Tables[0].Rows.Count <= 0) { WebAPI/Controllers/XSGL/YF_PayMentBackBillController.cs
New file @@ -0,0 +1,669 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers { //åºä»é款åController public class YF_PayMentBackBillController : ApiController { //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; public DAL.ClsYF_PayMentBackBill BillOld = new DAL.ClsYF_PayMentBackBill(); public DAL.ClsYF_PayMentBackBill BillNew0 = new DAL.ClsYF_PayMentBackBill(); private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; #region åºä»é款åå表 æ¥è¯¢ /// <summary> /// è¿å项ç®é¶æ®µå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("YF_PayMentBackBill/list")] [HttpGet] public object getYF_PayMentBackBill(string sWhere, string user) { try { 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 (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBackBillList order by åæ®å· desc", "h_v_YF_PayMentBackBillList"); } else { string sql1 = "select * from h_v_YF_PayMentBackBillList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_YF_PayMentBackBillList"); } //æ·»å åå 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));//è·åå°DataColumnå对象çåå } 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 åºä»é款åä¿å æ°å¢/ç¼è¾ [Route("YF_PayMentBackBill/SaveYF_PayMentBackBill")] [HttpPost] public object SaveYF_PayMentBackBill([FromBody] JObject msg) { var _value = msg["msg"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); //è¡¨å¤´æ°æ® string msg3 = sArray[1].ToString(); //å表1æ°æ® string refSav = sArray[2].ToString(); //æä½æ¹å¼ string msg4 = sArray[3].ToString(); //ç¨æ· DBUtility.ClsPub.CurUserName = msg4; string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("YF_PayMentBackBill_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsYF_PayMentBackBill oBill = new DAL.ClsYF_PayMentBackBill(); List<Model.ClsYF_PayMentBackBillMain> lsmain = new List<Model.ClsYF_PayMentBackBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_YF_PayMentBackBillMain(msg2); foreach (Model.ClsYF_PayMentBackBillMain oItem in lsmain) { if (refSav == "Add") { //忮巿¯å¦éå¤ if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } } if (refSav == "Update") { if (BillOld.ShowBill(oItem.HInterID, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } //夿æ¯å¦å¯ç¼è¾ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (BillOld.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å 许修æ¹"; objJsonResult.data = 1; return objJsonResult; } } UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "2105"; oItem.HBillSubType = "2105"; oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } oBill.omodel = oItem; } //è¡¨ä½æ°æ® //æ },{æ¥æåæ°ç» //廿ãåã msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsYF_PayMentBackBillSub> ls = new List<Model.ClsYF_PayMentBackBillSub>(); ls = oListModels.getObjectByJson_YF_PayMentBackBillSub(msg3); int i = 0; foreach (Model.ClsYF_PayMentBackBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ //oItemSub.HSourceInterID = 0; // æºå主å ç //oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (refSav == "Add") { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else if (refSav == "Update") { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = false; } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region åºä»é款å ç¼è¾é¡µé¢åå§å [Route("YF_PayMentBackBill/cx")] [HttpGet] public object cx(long HInterID) { try { ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBackBillList where hmainid=" + HInterID, "h_v_YF_PayMentBackBillList"); 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; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region åºä»é款å å é¤ /// <summary> ///åæ°ï¼string HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("YF_PayMentBackBill/delete")] [HttpGet] public object deleteYF_PayMentBackBill(string HInterID, string user) { try { string s = ""; //æ¥çæé if (!DBUtility.ClsPub.Security_Log("YF_PayMentBackBill_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; } if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } //夿æ¯å¦å¯ç¼è¾ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许å é¤ï¼"; objJsonResult.data = 1; return objJsonResult; } oCN.BeginTran(); oCN.RunProc("delete from YF_PayMentBillMain where HInterID = " + HInterID); oCN.RunProc("delete from YF_PayMentBillSub 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("YF_PayMentBackBill/AuditYF_PayMentBackBill")] [HttpGet] public object AuditYF_PayMentBackBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "YF_PayMentBackBill_Check"; DBUtility.ClsPub.CurUserName = CurUserName; try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsYF_PayMentBackBill oBill = new DAL.ClsYF_PayMentBackBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { 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; } if (IsAudit == 0) //å®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ if (IsAudit == 0) //å®¡æ ¸æäº¤ { //å®¡æ ¸æäº¤ if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸æäº¤ { //åå®¡æ ¸æäº¤AbandonCheck if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } 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="IsAudit">å ³é(0),åå ³é(1)</param> /// <param name="CurUserName">å ³é人</param> /// <returns></returns> [Route("YF_PayMentBackBill/CloseYF_PayMentBackBill")] [HttpGet] public object CloseYF_PayMentBackBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "YF_PayMentBackBill_Close"; DBUtility.ClsPub.CurUserName = CurUserName; try { //æ£æ¥æé if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³éå¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsYF_PayMentBackBill oBill = new DAL.ClsYF_PayMentBackBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //å ³é夿 { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå ³é夿 { if (oBill.omodel.HCloseMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦åå ³éï¼"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } //è¿è¡éè¦è¿è¡çå ³é/åå ³éæä½ if (IsAudit == 0) //å ³éæäº¤ { //å ³éæäº¤ if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå ³éæäº¤ { //åå ³éæäº¤ if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败æè åå ³é失败ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/Controllers/XSGL/YF_PayMentBillController.cs
New file @@ -0,0 +1,672 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers { //仿¬¾åController public class YF_PayMentBillController : ApiController { //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; public DAL.ClsYF_PayMentBill BillOld = new DAL.ClsYF_PayMentBill(); public DAL.ClsYF_PayMentBill BillNew0 = new DAL.ClsYF_PayMentBill(); private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; #region 仿¬¾åå表 æ¥è¯¢ /// <summary> /// è¿å项ç®é¶æ®µå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("YF_PayMentBill/list")] [HttpGet] public object getYF_PayMentBill(string sWhere, string user) { try { 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 (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillList order by åæ®å· desc", "h_v_YF_PayMentBillList"); } else { string sql1 = "select * from h_v_YF_PayMentBillList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_YF_PayMentBillList"); } //æ·»å åå 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));//è·åå°DataColumnå对象çåå } 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 仿¬¾åä¿å æ°å¢/ç¼è¾ [Route("YF_PayMentBill/SaveYF_PayMentBill")] [HttpPost] public object SaveYF_PayMentBill([FromBody] JObject msg) { var _value = msg["msg"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); //è¡¨å¤´æ°æ® string msg3 = sArray[1].ToString(); //å表1æ°æ® string refSav = sArray[2].ToString(); //æä½æ¹å¼ string msg4 = sArray[3].ToString(); //ç¨æ· DBUtility.ClsPub.CurUserName = msg4; string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("YF_PayMentBill_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsYF_PayMentBill oBill = new DAL.ClsYF_PayMentBill(); List<Model.ClsYF_PayMentBillMain> lsmain = new List<Model.ClsYF_PayMentBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_YF_PayMentBillMain(msg2); foreach (Model.ClsYF_PayMentBillMain oItem in lsmain) { if (refSav == "Add") { //忮巿¯å¦éå¤ if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } } if (refSav == "Update") { if (BillOld.ShowBill(oItem.HInterID, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } //夿æ¯å¦å¯ç¼è¾ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (BillOld.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å 许修æ¹"; objJsonResult.data = 1; return objJsonResult; } } UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "2103"; oItem.HBillSubType = "2103"; oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } oBill.omodel = oItem; } //è¡¨ä½æ°æ® //æ },{æ¥æåæ°ç» //廿ãåã msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsYF_PayMentBillSub> ls = new List<Model.ClsYF_PayMentBillSub>(); ls = oListModels.getObjectByJson_YF_PayMentBillSub(msg3); int i = 0; foreach (Model.ClsYF_PayMentBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ //oItemSub.HSourceInterID = 0; // æºå主å ç //oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (refSav == "Add") { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else if (refSav == "Update") { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = false; } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region 仿¬¾å ç¼è¾é¡µé¢åå§å [Route("YF_PayMentBill/cx")] [HttpGet] public object cx(long HInterID) { try { ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillList where hmainid=" + HInterID, "h_v_YF_PayMentBillList"); 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; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region 仿¬¾å å é¤ /// <summary> ///åæ°ï¼string HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("YF_PayMentBill/delete")] [HttpGet] public object deleteYF_PayMentBill(string HInterID, string user) { try { string s = ""; //æ¥çæé if (!DBUtility.ClsPub.Security_Log("YF_PayMentBill_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; } if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } //夿æ¯å¦å¯ç¼è¾ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许å é¤ï¼"; objJsonResult.data = 1; return objJsonResult; } oCN.BeginTran(); oCN.RunProc("delete from YF_PayMentBillMain where HInterID = " + HInterID); oCN.RunProc("delete from YF_PayMentBillSub 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("YF_PayMentBill/AuditYF_PayMentBill")] [HttpGet] public object AuditYF_PayMentBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "YF_PayMentBill_Check"; DBUtility.ClsPub.CurUserName = CurUserName; try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsYF_PayMentBill oBill = new DAL.ClsYF_PayMentBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { 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; } if (IsAudit == 0) //å®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ if (IsAudit == 0) //å®¡æ ¸æäº¤ { //å®¡æ ¸æäº¤ if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸æäº¤ { //åå®¡æ ¸æäº¤AbandonCheck if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } 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="IsAudit">å ³é(0),åå ³é(1)</param> /// <param name="CurUserName">å ³é人</param> /// <returns></returns> [Route("YF_PayMentBill/CloseYF_PayMentBill")] [HttpGet] public object CloseYF_PayMentBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "YF_PayMentBill_Close"; DBUtility.ClsPub.CurUserName = CurUserName; try { //æ£æ¥æé if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³éå¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsYF_PayMentBill oBill = new DAL.ClsYF_PayMentBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //å ³é夿 { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå ³é夿 { if (oBill.omodel.HCloseMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦åå ³éï¼"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } //è¿è¡éè¦è¿è¡çå ³é/åå ³éæä½ if (IsAudit == 0) //å ³éæäº¤ { //å ³éæäº¤ if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå ³éæäº¤ { //åå ³éæäº¤ if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败æè åå ³é失败ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/ListModels.cs
@@ -6,6 +6,7 @@ using System.IO; using System.Text; using WebAPI.Code; using Model; namespace WebAPI { @@ -122,6 +123,8 @@ List<Model.ClsKf_MateOutBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_MateOutBillMain>>(jsonString); return list; } /// <summary> /// ç产补æååºåå /// </summary> @@ -202,6 +205,8 @@ List<Model.ClsXs_SeOutStockBackBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXs_SeOutStockBackBillSub>>(jsonString); return list; } /// <summary> /// éå®éåºååºåå @@ -2728,6 +2733,30 @@ } #endregion #region 仿¬¾å /// <summary> /// 仿¬¾å主表json /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsYF_PayMentBillMain> getObjectByJson_YF_PayMentBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsYF_PayMentBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsYF_PayMentBillMain>>(jsonString); return list; } /// <summary> /// 仿¬¾åå表json2 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsYF_PayMentBillSub> getObjectByJson_YF_PayMentBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsYF_PayMentBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsYF_PayMentBillSub>>(jsonString); return list; } #endregion #region ä¿¡ç¨é¢åº¦ç³è¯·å /// <summary> /// ä¿¡ç¨é¢åº¦ç³è¯·å主表json @@ -2851,6 +2880,31 @@ List<Model.ClsYS_ReceiveBackBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsYS_ReceiveBackBillSub>>(jsonString); return list; } #endregion #region åºä»é款å /// <summary> /// åºæ¶é款å主表json /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsYF_PayMentBackBillMain> getObjectByJson_YF_PayMentBackBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsYF_PayMentBackBillMain > list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsYF_PayMentBackBillMain>>(jsonString); return list; } /// <summary> /// åºæ¶é款åå表json2 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsYF_PayMentBackBillSub> getObjectByJson_YF_PayMentBackBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsYF_PayMentBackBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsYF_PayMentBackBillSub>>(jsonString); return list; } #endregion #region å·¥ä½å¨è®¡å WebAPI/WebAPI.csproj
@@ -468,6 +468,8 @@ <Compile Include="Controllers\XSGL\Xs_SeOrderChangeBillController.cs" /> <Compile Include="Controllers\XSGL\Xs_ExceptiveCheckRequestBillController.cs" /> <Compile Include="Controllers\XSGL\Xs_CusRatingChangeBillController.cs" /> <Compile Include="Controllers\XSGL\YF_PayMentBackBillController.cs" /> <Compile Include="Controllers\XSGL\YF_PayMentBillController.cs" /> <Compile Include="Controllers\XSGL\YS_ReceiveBackBillController.cs" /> <Compile Include="Controllers\XSGL\YS_ReceiveBillController.cs" /> <Compile Include="Controllers\XSGL\Kf_SellOutBillController.cs" /> WebAPI/WebAPI.csproj.user
@@ -9,7 +9,7 @@ <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected> <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\ç½ç«åå¸\å端代ç \MES-WEB-API\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\ä¹ä¸è®¡éåä½å表\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <UseIISExpress>false</UseIISExpress> <Use64BitIISExpress />