From 75fa0fb23f1e1a51df578c758feb0f4c2a5b4810 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期三, 30 八月 2023 14:34:11 +0800 Subject: [PATCH] 对色记录单,试样记录单pda新增 --- WebAPI/Controllers/WebAPIController.cs | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 254 insertions(+), 16 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index 98b0bd7..b732d40 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -2663,7 +2663,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"); @@ -3379,6 +3379,174 @@ } /// <summary> + /// 鑾峰彇鎶芥牱鏂规鍒楄〃 + /// </summary> + /// <returns></returns> + [Route("Web/GetGy_SampleScheme")] + [HttpGet] + public object GetSampleScheme(string SampleScheme, int OrganizationID) + { + if (SampleScheme != "") + { + sWhere = " and ( 鎶芥牱鏂规浠g爜 like '%" + SampleScheme + "%' or 鎶芥牱鏂规鍚嶇О like '%" + SampleScheme + "%' ) "; + } + try + { + List<object> columnNameList = new List<object>(); + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 " + sWhere + "Order by hmainid "; + ds = oCN.RunProcReturn(sql, "h_v_Gy_GetSampleSchemeListView"); + + //娣诲姞鍒楀悕 + 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; + } + 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_InspectValue")] + [HttpGet] + public object GetInspectValue(string InspectValue, int OrganizationID) + { + if (InspectValue != "") + { + sWhere = " and ( 妫�楠屽�间唬鐮� like '%" + InspectValue + "%' or 妫�楠屽�煎悕绉� like '%" + InspectValue + "%' ) "; + } + try + { + List<object> columnNameList = new List<object>(); + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql = "Select * from h_v_Gy_GetInspectValueList where 1 = 1 " + sWhere + "Order by hmainid "; + ds = oCN.RunProcReturn(sql, "h_v_Gy_GetInspectValueList"); + + //娣诲姞鍒楀悕 + 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; + } + 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; + } + 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> @@ -3397,7 +3565,7 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - string sql = "select c.HItemID HQCCheckItemID,c.HName 妫�楠岄」鐩�,b.HQCStd,b.HQCUnit HUnit 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; + 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"); if (ds == null || ds.Tables[0].Rows.Count <= 0) { @@ -3927,17 +4095,17 @@ [Route("Web/MenuList")] [HttpGet] - public object MenuList(string HMakeName) + public object MenuList(string HMakeName, string HType) { try { List<MenuLoad> mu = new List<MenuLoad>(); //浠ョ埗瀛愮骇缁撴瀯瀛樻斁鑿滃崟娓呭崟淇℃伅 SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //鏁版嵁搴撴搷浣滃伐鍏� - string sql = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum 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"); } @@ -4052,7 +4220,7 @@ //鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹� [Route("Web/MenuDefineSet")] [HttpGet] - public object MenuDefineSet(string HMakeName) + public object MenuDefineSet(string HMakeName, string HType) { try { @@ -4060,7 +4228,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鍒楄〃涓紝 @@ -4149,6 +4317,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); //澹版槑鏁版嵁搴撴搷浣滃伐鍏� @@ -4158,7 +4327,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); //鎻掑叆褰撳墠鐢ㄦ埛鏈�鏂扮殑鑷畾涔夋暟鎹� @@ -4173,9 +4342,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); + } + } } //鎻愪氦鏁版嵁搴撴搷浣� @@ -4211,7 +4391,7 @@ //蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹� [Route("Web/Xt_UserFastMenu_Display")] [HttpGet] - public object Xt_UserFastMenu_Display(string HMakeName) + public object Xt_UserFastMenu_Display(string HMakeName, string HType) { try { @@ -4219,7 +4399,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鍒楄〃涓紝 @@ -4303,6 +4483,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); //澹版槑鏁版嵁搴撴搷浣滃伐鍏� @@ -4312,7 +4493,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); //鎻掑叆褰撳墠鐢ㄦ埛鏈�鏂扮殑鑷畾涔夋暟鎹� @@ -4329,8 +4510,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); } } @@ -4360,12 +4542,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