From 7a9c63c6145b6592f89e3e89cf5b2e608d923cb8 Mon Sep 17 00:00:00 2001
From: 仲国强 <519541279@qq.com>
Date: 星期三, 25 八月 2021 21:58:12 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/PublicPageMethodController.cs | 315 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 314 insertions(+), 1 deletions(-)
diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index e5308b8..6c97202 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -1794,7 +1794,7 @@
}
else
{
- string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit where 1 = 1 ";
+ string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit ";
string sql = sql1 + sWhere;
ds = oCN.RunProcReturn(sql, "h_v_IF_Unit");
}
@@ -2007,7 +2007,320 @@
#endregion
+ #region 閫夋嫨淇濆吇椤圭洰鍩虹璧勬枡
+ #region 鏉′欢鏌ヨ淇濆吇椤圭洰鍒楄〃
+ [Route("PublicPageMethod/MaintainList")]
+ [HttpGet]
+ public object MaintainList(string sWhere)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Maintain " + sWhere + " Order by HItemID ", "Gy_Maintain");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+ 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/MaintainCX")]
+ [HttpGet]
+ public object MaintainCX(long HInterID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_Maintain WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_Maintain AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Maintain");
+ 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/MaintainLoadTree")]
+ [HttpGet]
+ public object MaintainLoadTree(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_Maintain " + sWhere + "", "Gy_Maintain");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+ 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/CheckItemList")]
+ [HttpGet]
+ public object CheckItemList(string sWhere)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_QCCheckItem " + sWhere + " Order by HItemID ", "Gy_QCCheckItem");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+ 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/CheckItemCX")]
+ [HttpGet]
+ public object CheckItemCX(long HInterID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_QCCheckItem WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_QCCheckItem AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckItem");
+ 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/CheckItemLoadTree")]
+ [HttpGet]
+ public object CheckItemLoadTree(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_QCCheckItem " + sWhere + "", "Gy_QCCheckItem");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犵偣妫�椤圭洰鏁版嵁锛�";
+ 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/MaterTypeList")]
+ [HttpGet]
+ public object MaterTypeList(string sWhere)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_MaterType " + sWhere + " Order by HItemID ", "Gy_MaterType");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+ 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/MaterTypeCX")]
+ [HttpGet]
+ public object MaterTypeCX(long HInterID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_MaterType WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_MaterType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckItem");
+ 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/MaterTypeLoadTree")]
+ [HttpGet]
+ public object MaterTypeLoadTree(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_MaterType " + sWhere + "", "Gy_MaterType");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犵偣妫�椤圭洰鏁版嵁锛�";
+ 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