From de11f71014cb91222dc2ec9888d4a38acb855ce5 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期四, 14 九月 2023 09:31:37 +0800 Subject: [PATCH] 工艺路线 工序流转卡 工序进出站 增加权限 子数据 报表 十张 --- WebAPI/Controllers/WebAPIController.cs | 338 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 315 insertions(+), 23 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index ec0dc9f..aab08d2 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -342,6 +342,122 @@ } + #region 鐢ㄦ埛璁剧疆 + #region 鑾峰彇鐢ㄦ埛淇℃伅 + [Route("Gy_USERSet_PDA/GetGy_Czygl_Info")] + [HttpGet] + public object GetGy_Czygl_Info(string Czybm, string user) + { + try + { + //鏌ョ湅鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + string sql = @"select Czybm, Czymc, HWhID, HWhName, HSecManagerID, HSecManager, HKeeperID, HKeeper, HDeptID, HDept, HCloudUserName, HCloudUserPsd from Gy_Czygl where Czybm = '" + Czybm + "'"; + ds = oCN.RunProcReturn(sql, "Gy_Czygl"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈壘鍒扮浉鍏虫暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 淇濆瓨鐢ㄦ埛淇℃伅 + [Route("Gy_USERSet_PDA/SaveGy_Czygl_Info")] + [HttpPost] + public object SaveGy_Czygl_Info([FromBody] JObject sMainSub) + { + try + { + //鑾峰彇鍙傛暟 + var _value = sMainSub["sMainSub"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + + Int64 HWhID = Int64.Parse(sArray[0].ToString()); + string HWhName = sArray[1].ToString(); + Int64 HSecManagerID = Int64.Parse(sArray[2].ToString()); + string HSecManager = sArray[3].ToString(); + Int64 HKeeperID = Int64.Parse(sArray[4].ToString()); + string HKeeper = sArray[5].ToString(); + Int64 HDeptID = Int64.Parse(sArray[6].ToString()); + string HDept = sArray[7].ToString(); + string HCloudUserName = sArray[8].ToString().Trim(); + string HCloudUserPsd = sArray[9].ToString().Trim(); + + string Czybm = sArray[10].ToString(); + string user = sArray[11].ToString(); //鎿嶄綔鐢ㄦ埛鐨勭敤鎴峰悕 + + ////鍒ゆ柇鏄惁鏈夋柊澧炴潈闄� + //if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBillQualityStatus_Tmp_Edit", 1, false, user)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犳柊澧炴潈闄�!"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + string sql = "update Gy_Czygl set " + + "HWhID = " + HWhID + + ", HWhName = '" + HWhName + + "', HSecManagerID = " + HSecManagerID + + ", HSecManager = '" + HSecManager + + "', HKeeperID = " + HKeeperID + + ", HKeeper = '" + HKeeper + + "', HDeptID = " + HDeptID + + ", HDept = '" + HDept + + "', HCloudUserName = '" + HCloudUserName + + "', HCloudUserPsd = '" + HCloudUserPsd + + "' where Czybm = '" + Czybm + "'"; + + oCN.RunProc(sql); + + 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 + #endregion + + //鎾ら攢缂撳瓨鍒楄〃璁板綍 [Route("Web/Rescind_Json")] @@ -2663,7 +2779,7 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - string sql = "Select a.HItemID ,HNumber 鏍哥畻鏂瑰紡缁勪唬鐮�,HName 鏍哥畻鏂瑰紡缁勫悕绉�,HDeptID,b.閮ㄩ棬鍚嶇О 閮ㄩ棬 from Gy_ClassTimePrjGroup a left join h_v_Gy_Department b on a.HDeptID=b.HItemID"; + string sql = "Select a.HItemID ,HNumber 鏍哥畻鏂瑰紡缁勪唬鐮�,HName 鏍哥畻鏂瑰紡缁勫悕绉�,HDeptID,b.閮ㄩ棬浠g爜,b.閮ㄩ棬鍚嶇О 閮ㄩ棬 from Gy_ClassTimePrjGroup a left join h_v_Gy_Department b on a.HDeptID=b.HItemID"; if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrjGroup"); @@ -3410,7 +3526,7 @@ { objjson.code = "0"; objjson.count = 0; - objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo; + objjson.Message = "鑾峰彇澶辫触" + ",娌℃湁鏌ヨ鍒版暟鎹�"; objjson.data = null; return objjson; } @@ -3466,7 +3582,63 @@ { objjson.code = "0"; objjson.count = 0; - objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo; + objjson.Message = "鑾峰彇澶辫触" + ",娌℃湁鏌ヨ鍒版暟鎹�"; + objjson.data = null; + return objjson; + } + else + { + objjson.code = "1"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛!"; + objjson.data = ds.Tables[0]; + objjson.list = columnNameList; + return objjson; + } + } + catch (Exception ex) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + ex.ToString(); + objjson.data = null; + return objjson; + } + } + + /// <summary> + /// 鑾峰彇妫�浠櫒鍒楄〃 + /// </summary> + /// <returns></returns> + [Route("Web/GetGy_InspectInstruMent")] + [HttpGet] + public object GetGy_InspectInstruMent(string InspectInstruMent, int OrganizationID) + { + if (InspectInstruMent != "") + { + sWhere = " and ( 妫�楠屼华鍣ㄤ唬鐮� like '%" + InspectInstruMent + "%' or 妫�楠屼华鍣ㄥ悕绉� like '%" + InspectInstruMent + "%' ) "; + } + try + { + List<object> columnNameList = new List<object>(); + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql = "Select * from h_v_Gy_InspectInstruMent where 1 = 1 " + sWhere + "Order by HItemID "; + ds = oCN.RunProcReturn(sql, "h_v_Gy_InspectInstruMent"); + + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + ",娌℃湁鏌ヨ鍒版暟鎹�"; objjson.data = null; return objjson; } @@ -3496,7 +3668,7 @@ /// <returns></returns> [Route("Web/GetCheckItemByCheckProjectID")] [HttpGet] - public object GetCheckItemByCheckProjectID(int CheckProjectID) + public object GetCheckItemByCheckProjectID(int CheckProjectID,int HBatchQty) { if (CheckProjectID <= 0) { @@ -3509,8 +3681,8 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - string sql = "select c.HItemID HQCCheckItemID,c.HName 妫�楠岄」鐩�,b.HQCStd,b.HQCUnit HUnit,b.HAnalysisMethod,b.HStatus HResult from Gy_QCCheckProjectMain a left join Gy_QCCheckProjectSub b on a.HInterID = b.HInterID left join Gy_QCCheckItem c on b.HQCCheckItemID = c.HItemID where a.HInterID = " + CheckProjectID; - ds = oCN.RunProcReturn(sql, "Gy_QCCheckProjectMain"); + string sql = "exec h_p_Gy_GetQCCheckItemByProject " + CheckProjectID + "," + HBatchQty; + ds = oCN.RunProcReturn(sql, "h_p_Gy_GetQCCheckItemByProject"); if (ds == null || ds.Tables[0].Rows.Count <= 0) { objjson.code = "0"; @@ -4023,19 +4195,33 @@ #region [浠庢暟鎹簱鍔犺浇鑿滃崟] + public class MenuLoad + { + //public int HitemID { get; set; } + public string HitemID { get; set; } + //public int? HPartentID { get; set; } + public string HPartentID { get; set; } + public string HNumber { get; set; } + public string HName { get; set; } + public int HLevel { get; set; } + public string Hurl { get; set; } + public string HPicNum { get; set; } + public List<MenuLoad> childMenus { get; set; } + } + [Route("Web/MenuList")] [HttpGet] - public object MenuList(string HMakeName) + public object MenuList(string HMakeName, string HType) { try { - List<Menu> mu = new List<Menu>(); //浠ョ埗瀛愮骇缁撴瀯瀛樻斁鑿滃崟娓呭崟淇℃伅 + List<MenuLoad> mu = new List<MenuLoad>(); //浠ョ埗瀛愮骇缁撴瀯瀛樻斁鑿滃崟娓呭崟淇℃伅 SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //鏁版嵁搴撴搷浣滃伐鍏� - string sql = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' order by HItemID"; + string sql = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' and HType = '" + HType + "' order by HPosition"; ds = oCn.RunProcReturn(sql, "Gy_MenuDefineSet"); //鏌ヨ褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鑿滃崟鏁版嵁 if (ds.Tables[0]==null || ds.Tables[0].Rows.Count == 0) //鍒ゆ柇褰撳墠鐢ㄦ埛鏄惁鏈夎缃繃鑷畾涔変俊鎭紝鑻ヨ褰曟暟涓�0锛屽垯娌℃湁璁剧疆杩囷紝鍔犺浇鎵�鏈夌殑鑿滃崟淇℃伅 { - sql = "Select * from Gy_Menu_1 Order by HItemID "; + sql = "Select * from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition "; ds = oCn.RunProcReturn(sql, "Gy_Menu"); } @@ -4043,17 +4229,21 @@ { if (ds.Tables[0].Rows[i]["HPartentID"].ToString() == "0" || ds.Tables[0].Rows[i]["HitemID"].ToString() == ds.Tables[0].Rows[i]["HPartentID"].ToString()) //鍒ゆ柇鏄惁鏈�澶栧眰鏍硅妭鐐� { - Menu tbj = new Menu(); + MenuLoad tbj = new MenuLoad(); tbj.HitemID = ds.Tables[0].Rows[i]["HitemID"].ToString(); tbj.HNumber = ds.Tables[0].Rows[i]["HNumber"].ToString(); tbj.HName = ds.Tables[0].Rows[i]["HName"].ToString(); tbj.HPartentID = ds.Tables[0].Rows[i]["HPartentID"].ToString(); tbj.HLevel = int.Parse(ds.Tables[0].Rows[i]["HLevel"].ToString()); tbj.Hurl = ds.Tables[0].Rows[i]["Hurl"].ToString(); + if (ds.Tables[0].Rows[i]["HPicNum"] != null) + { + tbj.HPicNum = ds.Tables[0].Rows[i]["HPicNum"].ToString(); + } mu.Add(tbj); } } - ToHierarchy.digui(ds.Tables[0], mu); //浣跨敤閫掑綊锛屽皢闇�瑕佸姞杞界殑鏁版嵁浠ョ埗瀛愮骇鐨勭粨鏋勫瓨鏀惧湪mu涓� + diguiLoad(ds.Tables[0], mu); //浣跨敤閫掑綊锛屽皢闇�瑕佸姞杞界殑鏁版嵁浠ョ埗瀛愮骇鐨勭粨鏋勫瓨鏀惧湪mu涓� objJsonResult.code = "1"; @@ -4071,6 +4261,38 @@ return objJsonResult; } } + + public void diguiLoad(DataTable dt, List<MenuLoad> tree) + { + for (int m = 0; m < tree.Count; m++) + { + tree[m].childMenus = new List<MenuLoad>(); + for (int i = 0; i < dt.Rows.Count; i++)//绗竴娆″惊鐜紝寰楀埌鎵�鏈夋牴鑺傜偣鐨勫瓙闆� + { + if (tree[m].HitemID.ToString() == dt.Rows[i]["HPartentID"].ToString() && dt.Rows[i]["HitemID"].ToString() != dt.Rows[i]["HPartentID"].ToString()) + { + MenuLoad tbjson = new MenuLoad(); + tbjson.HitemID = dt.Rows[i]["HitemID"].ToString(); + tbjson.HPartentID = dt.Rows[i]["HPartentID"].ToString(); + tbjson.HNumber = dt.Rows[i]["HNumber"].ToString(); + tbjson.HName = dt.Rows[i]["HName"].ToString(); + tbjson.HLevel = tree[m].HLevel; + tbjson.Hurl = dt.Rows[i]["Hurl"].ToString(); + if (dt.Rows[i]["HPicNum"] != null) + { + tbjson.HPicNum = dt.Rows[i]["HPicNum"].ToString(); + } + tree[m].childMenus.Add(tbjson); + } + } + for (int i = 0; i < tree[m].childMenus.Count; i++) + { + diguiLoad(dt, tree[m].childMenus);//鍐嶆鐢ㄥ瓙闆嗗幓寰幆锛屾嬁鍑哄瓙闆嗙殑瀛愰泦 + } + } + + } + #endregion @@ -4114,7 +4336,7 @@ //鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹� [Route("Web/MenuDefineSet")] [HttpGet] - public object MenuDefineSet(string HMakeName) + public object MenuDefineSet(string HMakeName, string HType) { try { @@ -4122,7 +4344,7 @@ List<MenuInit> menuInitList = new List<MenuInit>(); //鐢ㄤ互鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝浠ュ強瀵瑰簲鑺傜偣鏄惁琚�変腑闇�瑕佸姞杞芥樉绀� SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - ds = oCn.RunProcReturn("Select * from Gy_Menu_1 Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁 + ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where HType = '" +HType + "' Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁 DataSet ds1 = new DataSet(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //灏咷y_Menu_1涓殑鑿滃崟淇℃伅鍙婇�変腑鎯呭喌淇濆瓨鍒癿enuInitList鍒楄〃涓紝 @@ -4211,6 +4433,7 @@ string[] sArray = msg.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string HMakeName = sArray[1].ToString(); string saveData = sArray[0].ToString(); + string HTypes = sArray[2].ToString(); List<SaveDefineMenu> saveDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SaveDefineMenu>>(saveData); //澹版槑鏁版嵁搴撴搷浣滃伐鍏� @@ -4220,7 +4443,7 @@ oCN.BeginTran(); //鍒犻櫎褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鏁版嵁 - string sql = "delete from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "'"; + string sql = "delete from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' and HType = '" + HTypes + "'"; oCN.RunProc(sql); //鎻掑叆褰撳墠鐢ㄦ埛鏈�鏂扮殑鑷畾涔夋暟鎹� @@ -4235,9 +4458,20 @@ int HLevel = int.Parse(ds.Tables[0].Rows[0]["HLevel"].ToString()); string Hurl = ds.Tables[0].Rows[0]["Hurl"].ToString(); string HType = ds.Tables[0].Rows[0]["HType"].ToString(); + string HPicNum = ds.Tables[0].Rows[0]["HPicNum"].ToString(); - sql = "insert into Gy_MenuDefineSet values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "')"; - oCN.RunProc(sql); + if(HPartentID == "0" || HPartentID == ds.Tables[0].Rows[0]["HItemID"].ToString()) + { + string HPosition = ds.Tables[0].Rows[0]["HPosition"].ToString(); + sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "')"; + oCN.RunProc(sql); + } + else + { + sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','z')"; + oCN.RunProc(sql); + } + } } //鎻愪氦鏁版嵁搴撴搷浣� @@ -4273,7 +4507,7 @@ //蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹� [Route("Web/Xt_UserFastMenu_Display")] [HttpGet] - public object Xt_UserFastMenu_Display(string HMakeName) + public object Xt_UserFastMenu_Display(string HMakeName, string HType) { try { @@ -4281,7 +4515,7 @@ List<MenuInit> menuInitList = new List<MenuInit>(); //鐢ㄤ互鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝浠ュ強瀵瑰簲鑺傜偣鏄惁琚�変腑闇�瑕佸姞杞芥樉绀� SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - ds = oCn.RunProcReturn("Select * from Gy_Menu_1 Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁 + ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where HType = '" + HType + "' Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁 DataSet ds1 = new DataSet(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //灏咷y_Menu_1涓殑鑿滃崟淇℃伅鍙婇�変腑鎯呭喌淇濆瓨鍒癿enuInitList鍒楄〃涓紝 @@ -4365,6 +4599,7 @@ string[] sArray = msg.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string HMakeName = sArray[1].ToString(); string saveData = sArray[0].ToString(); + string HTypes = sArray[2].ToString(); List<SaveDefineMenu> saveDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SaveDefineMenu>>(saveData); //澹版槑鏁版嵁搴撴搷浣滃伐鍏� @@ -4374,7 +4609,7 @@ oCN.BeginTran(); //鍒犻櫎褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鏁版嵁 - string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "'"; + string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "' and HType = '" + HTypes + "'"; oCN.RunProc(sql); //鎻掑叆褰撳墠鐢ㄦ埛鏈�鏂扮殑鑷畾涔夋暟鎹� @@ -4391,8 +4626,9 @@ string HUserID = HMakeName; string HSubFuncID = ds.Tables[0].Rows[0]["HItemID"].ToString(); string HCaption = ds.Tables[0].Rows[0]["HName"].ToString(); + string HType = ds.Tables[0].Rows[0]["HType"].ToString(); - sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "')"; + sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "')"; oCN.RunProc(sql); } } @@ -4422,12 +4658,68 @@ //蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹� [Route("Web/Xt_UserFastMenu_Init")] [HttpGet] - public object Xt_UserFastMenu_Init(string HMakeName) + public object Xt_UserFastMenu_Init(string HMakeName, string HType) { try { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = '" + HMakeName + "' Order by a.HItemID"; + string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = '" + HMakeName + "' and b.HType = '" + HType + "' Order by a.HItemID"; + ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu"); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇 + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ澶辫触锛�"; + objJsonResult.data = e.ToString(); + return objJsonResult; + } + } + #endregion + + #region 淇濆瓨蹇嵎鏂瑰紡鐨勫浘鏍� + [Route("Web/Xt_UserFastMenu_IconSave")] + [HttpGet] + public object Xt_UserFastMenu_IconSave(string Icon, string HItemID, string HMakeName) + { + try + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + string sql = "update Xt_UserFastMenu set HPicNum = '" + Icon + "' where HSubFuncID='" + HItemID + "' and HUserID = '" + HMakeName + "'"; + oCN.RunProc(sql); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇 + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ澶辫触锛�"; + objJsonResult.data = e.ToString(); + return objJsonResult; + } + } + #endregion + + #region 鑾峰彇蹇嵎鏂瑰紡鐨勫浘鏍� + [Route("Web/Xt_UserFastMenu_IconGet")] + [HttpGet] + public object Xt_UserFastMenu_IconGet(string HItemID, string HMakeName) + { + try + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + string sql = "select HPicNum from Xt_UserFastMenu where HSubFuncID='" + HItemID + "' and HUserID = '" + HMakeName + "'"; ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu"); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇 objJsonResult.code = "1"; -- Gitblit v1.9.1