From e3f218a023f0625f415a1526b278636c3e39aa4f Mon Sep 17 00:00:00 2001 From: llj <132905093+newwwwwwtree@users.noreply.github.com> Date: 星期一, 18 八月 2025 12:59:32 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/WebAPIController.cs | 325 ++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 242 insertions(+), 83 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index ed70dd5..e2776a8 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json.Linq; using SQLHelper; using System; +using System.Text; using System.Collections.Generic; using System.Data; using System.IO; @@ -89,7 +90,7 @@ } - + /// <summary> /// 鏍规嵁鏃堕棿鑾峰彇浜ч噺姹囨姤鍗曢泦鍚� /// </summary> @@ -358,7 +359,7 @@ return objjson; } //鍒ゆ柇鐢ㄦ埛鏁版槸鍚﹀ぇ浜庡鎴疯处鍙锋暟 - DataSet ds1 = oCN.RunProcReturn("Exec h_p_Xt_BaseInfo ", "h_p_Xt_BaseInfo"); + DataSet ds1 = oCN.RunProcReturn("Exec h_p_Xt_BaseInfo ", "h_p_Xt_BaseInfo"); if (DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBack"]) != "0") { objjson.code = "0"; @@ -381,7 +382,7 @@ objjson.data = null; return objjson; } - } + } objjson.code = "0"; objjson.count = 1; @@ -496,15 +497,15 @@ /// <returns></returns> [Route("Web/GetXGPassword")] [HttpGet] - public object GetXGPassword(string UserName, string oldPassword, string PassWord, string Repassword,string HCloudUserName,string HCloudUserPsd) + public object GetXGPassword(string UserName, string oldPassword, string PassWord, string Repassword, string HCloudUserName, string HCloudUserPsd) { try { ClsCN oCn = new ClsCN(); DataSet oDs = new DataSet(); //========== - - if(PassWord!=null) + + if (PassWord != null) { oDs = oCn.RunProcReturn("select Czmm from Gy_Czygl where Czybm='" + UserName + "'", "Gy_Czygl"); if (PassWord.Trim() != Repassword.Trim()) @@ -524,12 +525,12 @@ objjson.data = null; return objjson; ; } - oCn.RunProc("update Gy_Czygl set Czmm='" + ClsPub.StrToPsd(PassWord.Trim()) + "',HCloudUserName = '" + HCloudUserName+ "',HCloudUserPsd = '" + HCloudUserPsd+ "' where Czybm='" + UserName.Trim() + "'"); + oCn.RunProc("update Gy_Czygl set Czmm='" + ClsPub.StrToPsd(PassWord.Trim()) + "',HCloudUserName = '" + HCloudUserName + "',HCloudUserPsd = '" + HCloudUserPsd + "' where Czybm='" + UserName.Trim() + "'"); objjson.code = "0"; objjson.count = 1; objjson.Message = "* 瀵嗙爜淇敼鎴愬姛锛�"; objjson.data = null; - return objjson; + return objjson; } else { @@ -1213,7 +1214,7 @@ return objjson; } } - + /// <summary> /// 鑾峰彇浠撲綅鍒楄〃 /// </summary> @@ -2235,7 +2236,7 @@ public object Gy_EnvironmentTestSchemeBillList_Json(string sWhere) { DataSet ds; - + if (sWhere != "") { sWhere = " and ( 鐢熶骇閮ㄩ棬 like '%" + sWhere + "%' or 宸ヤ綔涓績 like '%" + sWhere + "%' or 宸ュ簭鍚嶇О like '%" + sWhere + "%' or 妫�娴嬮」鐩� like '%" + sWhere + "%' ) "; @@ -2698,7 +2699,7 @@ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒"; objJsonResult.data = 1; return objJsonResult; - } + } //鏂板鏃跺垽鏂� if (oItem.HItemID == 0) { @@ -2812,7 +2813,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "淇濆瓨鎴愬姛锛�";; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; ; objJsonResult.data = 1; return objJsonResult; } @@ -2956,7 +2957,7 @@ } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -3266,7 +3267,7 @@ if (ds.Tables[0].Rows.Count == 0) { - oCN.RunProc("Insert into " + "Gy_BadReason " + + oCN.RunProc("Insert into " + "Gy_BadReason " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HDeptID,HProcID" + ",HLevel,HEndFlag,HStopflag,HRemark,HBadTypeID) " + @@ -3276,7 +3277,7 @@ } else { - oCN.RunProc("Update Gy_BadReason"+ " set " + + oCN.RunProc("Update Gy_BadReason" + " set " + "HName='" + HName + "'" + ",HShortNumber='" + sShortNumber + "'" + ",HHelpCode='" + HHelpCode + "'" + @@ -3395,7 +3396,7 @@ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒"; objJsonResult.data = 1; return objJsonResult; - } + } //鏂板鏃跺垽鏂� if (oItem.HItemID == 0) { @@ -3556,7 +3557,7 @@ [HttpGet] public object DeltetGy_BadType(string HItemID, string user) { - DataSet ds; + DataSet ds; try { //鍒犻櫎鏉冮檺 @@ -3656,7 +3657,7 @@ } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -3793,7 +3794,7 @@ { tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); } - if(HGroupNumber != "") + if (HGroupNumber != "") { //鏌ヨ鐝粍 ds = oCN.RunProcReturn("select * from Gy_Group where HNumber='" + HGroupNumber + "' and Hname='" + HGroupName + "'", "Gy_Group"); @@ -3935,13 +3936,13 @@ if (ds.Tables[0].Rows.Count == 0) { - oCN.RunProc("Insert into Gy_BadType" + " " + - " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + - ",HGroupID" + - ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HUseFlag,HMakeEmp,HMakeTime) " + - " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 + - "," + HGroupID.ToString() + - "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "'," + HOrgID + "," + HOrgID + ",'" + "鏈娴�" + "','" + user + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); + oCN.RunProc("Insert into Gy_BadType" + " " + + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HGroupID" + + ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HUseFlag,HMakeEmp,HMakeTime) " + + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 + + "," + HGroupID.ToString() + + "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "'," + HOrgID + "," + HOrgID + ",'" + "鏈娴�" + "','" + user + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); } else @@ -4825,7 +4826,7 @@ //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; if (oBill.oModel.HItemID == 0) - { + { bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo); } else @@ -4980,7 +4981,7 @@ return objJsonResult; } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -5226,7 +5227,7 @@ if (ds.Tables[0].Rows.Count == 0) { - oCN.RunProc("Insert into Gy_BadResult" + + oCN.RunProc("Insert into Gy_BadResult" + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HISsystemSet,HCREATEORGID,HERPItemID) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 + @@ -6296,7 +6297,7 @@ oItem.HMakeEmp = msg2; //鍒涘缓浜� oBill.oModel = oItem; - } + } //淇濆瓨 //淇濆瓨瀹屾瘯鍚庡鐞� @@ -7140,7 +7141,7 @@ bool bResult; if (oBill.oModel.HItemID == 0) { - + bResult = oBill.AddNew(); } else @@ -7499,7 +7500,7 @@ [HttpGet] public object DeltetGy_PostSkill(string HItemID, string user) { - DataSet ds; + DataSet ds; try { //鍒犻櫎鏉冮檺 @@ -7583,7 +7584,7 @@ return objJsonResult; } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -7725,7 +7726,7 @@ } string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString(); //鏌ヨ宀椾綅 - ds = oCN.RunProcReturn("select * from Gy_Post where HNumber='" + HPostNumber + "' and Hname='" + HPostName + "' and HUSEORGID = "+ HORGid, "Gy_Post"); + ds = oCN.RunProcReturn("select * from Gy_Post where HNumber='" + HPostNumber + "' and Hname='" + HPostName + "' and HUSEORGID = " + HORGid, "Gy_Post"); if (ds.Tables[0].Rows.Count == 0) { @@ -8226,7 +8227,7 @@ } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -10705,11 +10706,11 @@ if (ds.Tables[0].Rows.Count == 0) { - oCN.RunProc("Insert into " + "Gy_SupType " + - " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + - ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " + - " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 + - "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "','" + DateTime.Now + "','" + HOrgID + "','" + "鏈娴�" + "','" + user + "','" + HOrgID + "')", ref DBUtility.ClsPub.sExeReturnInfo); + oCN.RunProc("Insert into " + "Gy_SupType " + + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " + + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 + + "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "','" + DateTime.Now + "','" + HOrgID + "','" + "鏈娴�" + "','" + user + "','" + HOrgID + "')", ref DBUtility.ClsPub.sExeReturnInfo); } else { @@ -11047,7 +11048,7 @@ } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -12083,7 +12084,7 @@ //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; if (oBill.oModel.HItemID == 0) - { + { bResult = oBill.AddNew(); } else @@ -12242,7 +12243,7 @@ return objJsonResult; } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -13185,10 +13186,10 @@ if (ds.Tables[0].Rows.Count == 0) { - oCN.RunProc("Insert into " + "Gy_ErrMsgBackType " + + oCN.RunProc("Insert into " + "Gy_ErrMsgBackType " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " + - " Values('" + HProcessNum + "','" + HProcessName + "','" + "','" + sShortNumber + "'," + 0 + + " Values('" + HProcessNum + "','" + HProcessName + "','" + "','" + sShortNumber + "'," + 0 + "," + HLevel + "," + HEndFlag + "," + 0 + ",'" + HRemark + "','" + DateTime.Now + "','" + HOrgID + "','" + "鏈娴�" + "','" + user + "','" + HOrgID + "')"); } else @@ -13304,7 +13305,7 @@ objJsonResult.data = 1; return objJsonResult; } - + //鏂板鏃跺垽鏂� if (oItem.HItemID == 0) { @@ -13416,7 +13417,7 @@ } else { - bResult = oBill.ModifyByID(oBill.oModel.HItemID,ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { @@ -13571,7 +13572,7 @@ } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -15057,7 +15058,7 @@ return objJsonResult; } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -15300,7 +15301,7 @@ [Route("DeltetGy_MaintainLev")] [HttpGet] public object DeltetGy_MaintainLev(string HItemID, string user) - { + { try { //鍒犻櫎鏉冮檺 @@ -15493,7 +15494,7 @@ //鏂板鏃跺垽鏂� if (oItem.HItemID == 0) { - + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� string sParent; sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); @@ -15706,7 +15707,7 @@ return objJsonResult; } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -15954,7 +15955,7 @@ if (ds.Tables[0].Rows.Count == 0) { - oCN.RunProc("Insert into " + "Gy_CheckNoteItem" + + oCN.RunProc("Insert into " + "Gy_CheckNoteItem" + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID,HCheckPostID) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + 0 + @@ -15965,7 +15966,7 @@ else { oCN.RunProc("Update " + "Gy_CheckNoteItem" + " set " + - + "HName='" + HName + "'" + ",HShortNumber='" + HShortNumber + "'" + ",HHelpCode='" + HHelpCode + "'" + @@ -16092,7 +16093,7 @@ // 瀹氫箟鏄熸湡鍑犵殑涓枃鏄犲皠鍏崇郴 Dictionary<DayOfWeek, string> chineseDayOfWeek = new Dictionary<DayOfWeek, string> { - { DayOfWeek.Sunday, "鏄熸湡鏃�" }, + { DayOfWeek.Sunday, "鏄熸湡鏃�" }, { DayOfWeek.Saturday, "鏄熸湡鍏�" } }; @@ -16169,18 +16170,18 @@ JObject msgObj = JObject.Parse(msg1); string HYear = msgObj["HYear"].ToString(); - string HNumber1 = msgObj["HDeptNumber"].ToString()+'-' + msgObj["HOrgNumber"].ToString(); - string HName1 = msgObj["HDeptName"].ToString()+'-'+msgObj["HOrgName"].ToString(); + string HNumber1 = msgObj["HDeptNumber"].ToString() + '-' + msgObj["HOrgNumber"].ToString(); + string HName1 = msgObj["HDeptName"].ToString() + '-' + msgObj["HOrgName"].ToString(); string HOrgID = msgObj["HOrgID"].ToString(); - string HDeptID = msgObj["HDeptID"].ToString(); + string HDeptID = msgObj["HDeptID"].ToString(); bool HStopflag = bool.Parse(msgObj["HStopflag"].ToString()); - string HRemark= msgObj["HRemark"].ToString(); - string HUSEORGID= msgObj["HUSEORGID"].ToString(); - string HHelpCode= msgObj["HHelpCode"].ToString(); + string HRemark = msgObj["HRemark"].ToString(); + string HUSEORGID = msgObj["HUSEORGID"].ToString(); + string HHelpCode = msgObj["HHelpCode"].ToString(); string HMakeEmp = msg2; //鍒涘缓浜� bool Sunday = Convert.ToBoolean(msgObj["Sunday"]); bool Saturday = Convert.ToBoolean(msgObj["Saturday"]); - List<Tuple<DateTime, string>> sundaysInYear = GetSundaysInYear(Convert.ToInt32(HYear), Sunday, Saturday); + List<Tuple<DateTime, string>> sundaysInYear = GetSundaysInYear(Convert.ToInt32(HYear), Sunday, Saturday); foreach (var oItem in sundaysInYear) { @@ -16201,11 +16202,11 @@ string HNumber = ""; string HName = ""; HNumber = HNumber1 + '-' + HDate; - - HName = HName1 + '-' + HDate; + + HName = HName1 + '-' + HDate; //鍏堟煡鐪嬫暟鎹簱鏈夋病鏈� ds = oCN.RunProcReturn("select * from Gy_RestDay where HRestDay='" + HRestDay + "' and HOrgID='" + HOrgID + "' and HDeptID='" + HDeptID + "'", "Gy_RestDay"); - if (ds.Tables[0].Rows.Count<1) + if (ds.Tables[0].Rows.Count < 1) { oCN.RunProc("Insert into Gy_RestDay " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + @@ -16214,7 +16215,7 @@ " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "',''," + 0 + "," + 0 + "," + 0 + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + DateTime.Now + "','" + HUSEORGID + "',' 鏈娴�','" + HMakeEmp + "','" + HUSEORGID + "'" + ",'" + HOrgID.ToString() + "','" + HDeptID.ToString() + "','" + HRestDay.ToString() + "','" + HWeekDay.ToString() + "')"); - } + } } objJsonResult.code = "0"; objJsonResult.count = 1; @@ -16300,7 +16301,7 @@ } //鑾峰彇涓�骞翠腑鐨勫懆鍏�,鍛ㄦ棩鎴栬�呬袱涓悓鏃惰幏鍙� - public List<Tuple<DateTime, string>> GetSundaysInYear(int HYear, bool Sunday,bool Saturday) + public List<Tuple<DateTime, string>> GetSundaysInYear(int HYear, bool Sunday, bool Saturday) { List<Tuple<DateTime, string>> Days = new List<Tuple<DateTime, string>>(); DateTime startDate = new DateTime(HYear, 1, 1); @@ -16340,16 +16341,16 @@ { weekdayChinese = "鏄熸湡澶�"; Days.Add(Tuple.Create(startDate, weekdayChinese)); - } + } else if (startDate.DayOfWeek == DayOfWeek.Saturday) { weekdayChinese = "鏄熸湡鍏�"; Days.Add(Tuple.Create(startDate, weekdayChinese)); - } + } } startDate = startDate.AddDays(1); } - } + } return Days; } @@ -17421,7 +17422,7 @@ return objJsonResult; } //================================================================================== - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -18314,7 +18315,7 @@ oCN.RunProc("delete from EqiupMaterWorkTimes where HItemID=" + HItemID); - + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -18652,7 +18653,7 @@ objjson.data = ds.Tables[0]; return objjson; } - }catch(Exception e) + } catch (Exception e) { objjson.code = "0"; objjson.count = 0; @@ -19400,17 +19401,17 @@ [HttpGet] public object GetPatrolCheckItemList_Json(string CheckItem) { - DataSet ds; + DataSet ds; try { sWhere = " Where HStopFlag=0 and HEndFlag=1"; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - if(CheckItem != "" && CheckItem != null) + if (CheckItem != "" && CheckItem != null) { sWhere = sWhere + " and ( HNumber like '%" + CheckItem + "%' or HName like '%" + CheckItem + "%' ) "; } ds = oCN.RunProcReturn("Select HItemID,HNumber,HName from Gy_PatrolCheck " + sWhere + " Order by HItemID ", "Gy_DotCheck"); - if(ds == null ) + if (ds == null) { objjson.code = "0"; objjson.count = 0; @@ -19427,7 +19428,7 @@ return objjson; } } - catch(Exception ex) + catch (Exception ex) { objjson.code = "0"; objjson.count = 0; @@ -19649,15 +19650,15 @@ /// <returns></returns> [Route("Web/GetSc_ProcessExchangeBillListView")] [HttpGet] - public object GetSc_ProcessExchangeBillListView(string sWhere,int OrganizationID) - { + public object GetSc_ProcessExchangeBillListView(string sWhere, int OrganizationID) + { try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select top 300 * from h_v_Sc_ProcessExchangeBillList_PDA where 1=1 order by 鍗曟嵁鍙� desc,hsubid", "h_v_Sc_ProcessExchangeBillList_PDA"); - } + } else { string sql = "select * from h_v_Sc_ProcessExchangeBillList_PDA where 1=1 " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid "; @@ -19960,12 +19961,12 @@ /// <returns></returns> [Route("Web/GetCheckItemID")] [HttpGet] - public object GetCheckItemID(string HName,string HProName,string HSourceID) - { + public object GetCheckItemID(string HName, string HProName, string HSourceID) + { try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCCheckProjectList_Main where 鐗╂枡鍚嶇О='"+HName+ "' and 宸ュ簭鍚嶇О='" + HProName + "' and HSourceID='" + HSourceID + "' order by 鏃ユ湡 desc ", "h_v_Gy_QCCheckProjectList_Main"); + ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCCheckProjectList_Main where 鐗╂枡鍚嶇О='" + HName + "' and 宸ュ簭鍚嶇О='" + HProName + "' and HSourceID='" + HSourceID + "' order by 鏃ユ湡 desc ", "h_v_Gy_QCCheckProjectList_Main"); if (ds == null || ds.Tables[0].Rows.Count <= 0) { ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCCheckProjectList_Main where 鐗╂枡鍚嶇О='" + HName + "' and 宸ュ簭鍚嶇О ='" + HProName + "' order by 鏃ユ湡 desc ", "h_v_Gy_QCCheckProjectList_Main"); @@ -21066,6 +21067,50 @@ /// <summary> + /// 鑾峰彇閫夊崟鍙风殑婧愬崟绫诲瀷 閫氳繃閫夊崟鍙峰崟鎹被鍨� + /// </summary> + /// <returns></returns> + [Route("Web/GetHSourceBillTypeByBillType")] + [HttpGet] + public object GetHSourceBillTypeByBillType(string HBillType, int Num) + { + try + { + ClsCN oCn = new ClsCN(); + DataSet oDs = new DataSet(); + //鏈夌殑鍗曞瓙婧愬崟鍒嗕负绾㈣摑鍗� 0浠h〃钃濆崟 1浠h〃绾㈠崟 + if (Num == 0) + { //婧愬崟涓鸿摑鍗� + oDs = oCn.RunProcReturn("select * from Xt_BillSourceSet where HNumber='" + HBillType + "'and HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet"); + } + else if (Num == 1) + { //婧愬崟涓虹孩鍗� + oDs = oCn.RunProcReturn("select * from Xt_BillSourceSet where HNumber='" + HBillType + "' and HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet"); + } + else if (Num == 2) + { //涓嶅垎绾㈣摑鍗� + oDs = oCn.RunProcReturn("select * from Xt_BillSourceSet where HNumber='" + HBillType + "'", "Xt_BillSourceSet"); + } + + objjson.code = "1"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛锛�"; + objjson.data = oDs.Tables[0]; + return objjson; ; + } + catch (Exception e) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触锛佸紓甯�" + e.ToString(); + objjson.data = null; + return objjson; ; + } + } + + + /// <summary> /// 鑾峰彇閫夊崟鍙风殑婧愬崟绫诲瀷 /// </summary> /// <returns></returns> @@ -21095,6 +21140,120 @@ return objjson; ; } } + #region [浠庢暟鎹簱鍔犺浇鑿滃崟 APP] + + public class AppMenuLoad + { + public string HitemID { get; set; } // 涓婚敭 + public string HPartentID { get; set; } = "0"; // 鐖惰妭鐐笽D + public string HEntryID { get; set; } // 鑿滃崟鑺傜偣id + public string HIndex { get; set; } + public string HName { get; set; } + public string HMenuName { get; set; } + public string HPicNum { get; set; } + public string HShowMode { get; set; } + public string HTranslationText_English { get; set; } + public string HTranslationText_Spain { get; set; } + public string HMaker { get; set; } + public List<MenuLoad> childMenus { get; set; } + } + [Route("Web/MenuList_APP")] + [HttpGet] + public object MenuList_APP(string HMaker, string HType, string HMenuListName) + { + try + { + DataSet ds = oCN.RunProcReturn("exec [h_p_Gy_MenuDefineSet_APP_Get] " + + "@HMaker = N'" + HMaker + "'," + + "@HType = N'" + HType + "'," + + "@HMenuListName = N'" + HMenuListName + "'" + , "h_p_Gy_MenuDefineSet_APP_Get"); + + if ((bool)ds.Tables[0].Rows[0]["returnType"] == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString(); + objJsonResult.data = ds.Tables[1]; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString(); + return objJsonResult; + } + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + + } + + [Route("Web/SetMenuList_APP")] + [HttpPost] + public object SetMenuList_APP([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + try + { + string msg2 = sArray[0]; + string user = sArray[1].ToString(); + string MenuName = sArray[2].ToString(); + string type = sArray[3].ToString(); + + if (String.Equals(type, "APP", StringComparison.InvariantCultureIgnoreCase)) + { + oCN.BeginTran(); + List<AppMenuLoad> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AppMenuLoad>>(msg2); + string sql1 = "delete from Gy_MenuDefineSet_APP where HMenuName = '" + MenuName + "' and HMaker = '" + user + "'"; + oCN.RunProcReturn(sql1, "Gy_MenuDefineSet_APP"); + list.ForEach(one => + { + string sql2 = "insert into Gy_MenuDefineSet_APP( HEntryID, HIndex, HName, HMenuName, HPicNum, HShowMode, HMaker)" + + "Values('" + one.HEntryID + "','" + one.HIndex + "','" + one.HName + "','" + MenuName + "','" + + one.HPicNum + "','" + one.HShowMode + "','" + user + "')"; + oCN.RunProcReturn(sql2, "Gy_MenuDefineSet_APP"); + }); + + oCN.Commit(); + + objJsonResult.code = "1"; + 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 [浠庢暟鎹簱鍔犺浇鑿滃崟] public class MenuLoad -- Gitblit v1.9.1