From 1f2c94e00af2c4c9ebe213acff5d9aa4f8a97a08 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期二, 09 十一月 2021 16:43:31 +0800
Subject: [PATCH] 器具采购订单打印、用户关联权限(权限树型列表)

---
 WebAPI/Controllers/PublicPageMethodController.cs |   84 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index 6315e17..7cceb0b 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,83 @@
         #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);
+                }
+                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