From 5b3b3ffee315a99bd478e20dd92bae82de7c259e Mon Sep 17 00:00:00 2001 From: YL <YL@LAPTOP-SE03PLUR> Date: 星期一, 21 六月 2021 23:21:16 +0800 Subject: [PATCH] 生产汇报单审核、反审核案例 --- WebAPI/Controllers/PublicPageMethodController.cs | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 114 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs index 86bc81c..f0267b8 100644 --- a/WebAPI/Controllers/PublicPageMethodController.cs +++ b/WebAPI/Controllers/PublicPageMethodController.cs @@ -1271,5 +1271,119 @@ #endregion + #region 閫夋嫨璧勬簮鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ璧勬簮鍒楄〃 + [Route("PublicPageMethod/SourceList")] + [HttpGet] + public object SourceList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Source where HStopflag=0 Order by HItemID", "Gy_Source"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Source where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_Group"); + } + 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/SourceCX")] + [HttpGet] + public object SourceCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_Source WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_Source AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Source"); + 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/SourceLoadTree")] + [HttpGet] + public object SourceLoadTree(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_Source", "Gy_Source"); + 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