From 7e11fa76dc55439cc02369eef9bb0b639e4c9223 Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期三, 09 六月 2021 08:53:32 +0800 Subject: [PATCH] nothing --- WebAPI/Controllers/PublicPageMethodController.cs | 229 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 229 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs index cf644c8..1904c5b 100644 --- a/WebAPI/Controllers/PublicPageMethodController.cs +++ b/WebAPI/Controllers/PublicPageMethodController.cs @@ -815,5 +815,234 @@ #endregion + #region 閫夋嫨鏁呴殰绫诲瀷鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ鏁呴殰绫诲瀷鍒楄〃 + [Route("PublicPageMethod/FaultTypeList")] + [HttpGet] + public object FaultTypeList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_ConkType where HStopflag=0 Order by HItemID", "Gy_ConkType"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_ConkType where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_ConkType"); + } + 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 鏍规嵁鏍戝瀷id鏌ユ壘鏁呴殰绫诲瀷鍒楄〃 + [Route("Gy_MaintenanceMode/FaultTypeCX")] + [HttpGet] + public object FaultTypeCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_ConkType WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_ConkType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_ConkType"); + 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 鏍戝瀷鍒楄〃鏁呴殰绫诲瀷鍒楄〃鏁版嵁 + [Route("Gy_MaintenanceMode/FaultTypeLoadTree")] + [HttpGet] + public object FaultTypeLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_ConkType", "Gy_ConkType"); + 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; + } + } + #endregion + + #endregion + + + #region 閫夋嫨璁惧鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ璁惧鍒楄〃 + [Route("PublicPageMethod/EqpList")] + [HttpGet] + public object EqpList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_EquipMent where HStopflag=0 Order by HItemID", "Gy_EquipMent"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_EquipMent where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_EquipMent"); + } + 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 鏍规嵁鏍戝瀷id鏌ユ壘璁惧鍒楄〃 + [Route("Gy_MaintenanceMode/EqpCX")] + [HttpGet] + public object EqpCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_EquipMent WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_EquipMent AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_EquipMent"); + 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 鏍戝瀷鍒楄〃璁惧鍒楄〃鏁版嵁 + [Route("Gy_MaintenanceMode/EqpLoadTree")] + [HttpGet] + public object EqpLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_EquipMent", "Gy_EquipMent"); + 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; + } + } + #endregion + + #endregion + } } -- Gitblit v1.9.1