From 4ed78cf207b3a6222407c5fe0295cbfa38b44f55 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期二, 09 十一月 2021 22:05:12 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/PublicPageMethodController.cs | 89 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 87 insertions(+), 2 deletions(-)
diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index 6315e17..26339ef 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -1,10 +1,12 @@
-锘縰sing System;
+锘縰sing DBUtility;
+using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
+using System.Web.UI.WebControls;
using WebAPI.Models;
namespace WebAPI.Controllers
@@ -3351,5 +3353,88 @@
#endregion
#endregion
- }
+
+ #region 鐢ㄦ埛鍏宠仈鏉冮檺
+
+ #region 鏉′欢鏌ヨ鏉冮檺鍒楄〃
+ [Route("PublicPageMethod/PowerList")]
+ [HttpGet]
+ public object PowerList(string czybm,string sGnbm)
+ {
+ try
+ {
+ string sName = "";
+ if (sGnbm != "" && sGnbm != null)
+ {
+ sName = sGnbm.Substring(1, sGnbm.Length - 1);
+ if (sName == "鏉冮檺绠$悊-鐢ㄦ埛")
+ {
+ sName = "";
+ }
+ }
+
+ ds = oCN.RunProcReturn("select * from Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl");
+ string AuthorityID = ClsPub.isStrNull(ds.Tables[0].Rows[0]["AuthorityID"]);
+ ds = oCN.RunProcReturn("SELECT id hid,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end 鏄惁鏉冮檺,gnms 鍔熻兘璇存槑,gnbm hgnbm FROM xt_xtgnb where useflag=1 and sjgnbm='" + sName + "' and rightflag=1 order by gnbm", "xt_xtgnb");
+ 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 鏍戝瀷鍒楄〃鍔熻兘鍒楄〃鏁版嵁
+ [Route("Gy_MaintenanceMode/PowerLoadTree")]
+ [HttpGet]
+ public object PowerLoadTree()
+ {
+ SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
+ string sql = string.Format(@"select 'T鏉冮檺绠$悊-鐢ㄦ埛' id,'' HNumber,'鏉冮檺绠$悊--鐢ㄦ埛' title,'' ParentID, 'true' spread
+ union all
+ Select 'T'+gnbm id,gnsy HNumber,gnmc as title,case when sjgnbm<>null then sjgnbm else 'T鏉冮檺绠$悊-鐢ㄦ埛' end ParentID, 'true' spread
+ from Xt_Xtgnb where useflag=1 and rightflag=1 and (gnbm NOT LIKE '99%') and sjgnbm='' and mjbz=0 ");
+ ds = oCN.RunProcReturn(sql, "Xt_Xtgnb");
+ 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