From c3c3ba8325acc965729de86b896f4dbeea80b8a2 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 22 四月 2026 13:26:46 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/WebAPIController.cs |   88 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 82 insertions(+), 6 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index e7dbf77..bbc9e01 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -21169,12 +21169,12 @@
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
-                ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl");
-                if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"])  //鏄惁绠$悊鍛�
-                {
-                    //涓嶆槸绠$悊鍛�
-                    sWhere += " and 鍒跺崟浜� = '" + user + "'";
-                }
+                //ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl");
+                //if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"])  //鏄惁绠$悊鍛�
+                //{
+                //    //涓嶆槸绠$悊鍛�
+                //    sWhere += " and 鍒跺崟浜� = '" + user + "'";
+                //}
 
 
                 string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 鏃ユ湡 desc, hmainid desc");
@@ -23993,5 +23993,81 @@
             }
         }
         #endregion
+
+        /// <summary>
+        /// APP鐧诲綍鏉冮檺楠岃瘉鎺ュ彛
+        /// </summary>
+        [Route("Auth/CheckAppLoginAuth")]
+        [HttpPost]
+        public object CheckAppLoginAuth()
+        {
+            try
+            {
+                // 鑾峰彇璇锋眰鍙傛暟
+                string orgID = HttpContext.Current.Request.Form["orgID"] ?? "";
+                string orgName = HttpContext.Current.Request.Form["orgName"] ?? "";
+                string serverUrl = HttpContext.Current.Request.Form["serverUrl"] ?? "";
+                string phoneType = HttpContext.Current.Request.Form["phoneType"] ?? "";
+                string userAccount = HttpContext.Current.Request.Form["userAccount"] ?? "";
+                string other = HttpContext.Current.Request.Form["other"] ?? "";
+                // 鍙傛暟楠岃瘉
+                if (string.IsNullOrEmpty(userAccount))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璐﹀彿涓嶈兘涓虹┖!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (string.IsNullOrEmpty(orgID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "缁勭粐ID涓嶈兘涓虹┖!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                // 鍙傛暟瀹夊叏澶勭悊锛堥槻姝㈡敞鍏ワ級
+                orgID = orgID.Replace("'", "''");
+                orgName = orgName.Replace("'", "''");
+                serverUrl = serverUrl.Replace("'", "''");
+                phoneType = phoneType.Replace("'", "''");
+                userAccount = userAccount.Replace("'", "''");
+
+                // 鎵ц鍥哄畾瀛樺偍杩囩▼
+                string sql = $"EXEC SP_CheckAppLoginAuth '{orgID}', '{orgName}', '{serverUrl}', '{phoneType}','{userAccount}','{other}'";
+                ds = oCN.RunProcReturn(sql, "SP_CheckAppLoginAuth");
+
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    int result = Convert.ToInt32(ds.Tables[0].Rows[0]["Result"]);
+                    string message = ds.Tables[0].Rows[0]["Message"].ToString();
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = message;
+                    objJsonResult.data = ds.Tables[0];
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "楠岃瘉鎺ュ彛杩斿洖寮傚父!";
+                    objJsonResult.data = null;
+                }
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
     }
 }

--
Gitblit v1.9.1