From ebfaee5cff4080a59ee294fced93bbdcf659348b Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期三, 20 十月 2021 22:12:01 +0800
Subject: [PATCH] 用户关联供应商基础资料

---
 WebAPI/Controllers/PublicPageMethodController.cs |  153 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 149 insertions(+), 4 deletions(-)

diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index 410fe8d..c9f1e67 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -122,9 +122,9 @@
 
         #endregion
 
-        #region 閫夋嫨鐢ㄦ埛鍩虹璧勬枡
+        #region 閫夋嫨鑱屽憳鍩虹璧勬枡
 
-        #region 鏉′欢鏌ヨ鐢ㄦ埛鍒楄〃
+        #region 鏉′欢鏌ヨ鑱屽憳鍒楄〃
         [Route("PublicPageMethod/UserList")]
         [HttpGet]
         public object UserList(string sWhere)
@@ -161,7 +161,7 @@
         }
         #endregion
 
-        #region  鏍规嵁鏍戝瀷id鏌ユ壘鐢ㄦ埛鍒楄〃   
+        #region  鏍规嵁鏍戝瀷id鏌ユ壘鑱屽憳鍒楄〃   
         [Route("Gy_MaintenanceMode/UserCX")]
         [HttpGet]
         public object UserCX(long HInterID)
@@ -198,7 +198,7 @@
         }
         #endregion
 
-        #region 鏍戝瀷鍒楄〃鐢ㄦ埛鍒楄〃鏁版嵁    
+        #region 鏍戝瀷鍒楄〃鑱屽憳鍒楄〃鏁版嵁    
         [Route("Gy_MaintenanceMode/UserLoadTree")]
         [HttpGet]
         public object UserLoadTree(string sWhere)
@@ -2992,6 +2992,151 @@
 
         #endregion
 
+        #region 閫夋嫨鐧诲綍缁勭粐鍩虹璧勬枡
 
+        #region 鏉′欢鏌ヨ缁勭粐鍒楄〃
+        [Route("PublicPageMethod/OrganizationsList")]
+        [HttpGet]
+        public object OrganizationsList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Xt_ORGANIZATIONS " + sWhere + " Order by HItemID ", "Xt_ORGANIZATIONS");
+                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/OrganizationsCX")]
+        [HttpGet]
+        public object OrganizationsCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_CusType Xt_ORGANIZATIONS HitemID=" + HInterID + " UNION ALL select s.* from Xt_ORGANIZATIONS AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Xt_ORGANIZATIONS");
+                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/OrganizationsLoadTree")]
+        [HttpGet]
+        public object OrganizationsLoadTree(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 Xt_ORGANIZATIONS " + sWhere + "", "Xt_ORGANIZATIONS");
+            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/PeopleList")]
+        [HttpGet]
+        public object PeopleList(string sWhere)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("Select czybm HNumber,czymc HName from h_v_Gy_UserList " + sWhere + " Order by czybm ", "h_v_Gy_UserList");
+                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
+
+        #endregion
     }
 }

--
Gitblit v1.9.1