From d586211dd69b25e73593576b1a36616a2ae294b7 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期一, 10 三月 2025 19:15:52 +0800 Subject: [PATCH] 仓库列表 增加 仓库类型字段 班次 ,,点检项目,维修项目,维修验收项目,设备档案,器具主档维护,检验项目分类,检验项目,检验值,检验仪器,异常反馈类型,工艺路线大类,维修验收项目分类,维修项目分类,保养项目分类 审核 反审核 禁用 反禁用 删除前 删除后 控制 增加页签 增加字段 增加点检项目分类字段 保养项目 维修项目 维修验收项目 增加树形图 --- WebAPI/InvokeHelper.cs | 66 +++++++++++++++++++++++++------- 1 files changed, 51 insertions(+), 15 deletions(-) diff --git a/WebAPI/InvokeHelper.cs b/WebAPI/InvokeHelper.cs index 92f048c..dcf04ee 100644 --- a/WebAPI/InvokeHelper.cs +++ b/WebAPI/InvokeHelper.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,24 +11,56 @@ { public static class InvokeHelper { - //private static string CloudUrl = "http://localhost/k3cloud/";//K/3 Cloud 涓氬姟绔欑偣鍦板潃 - //private static string CloudUrl = "http://60.190.4.42:9002/k3cloud/";//K/3 Cloud 涓氬姟绔欑偣鍦板潃 - private static string CloudUrl = "http://47.96.97.237/k3cloud/";//K/3 Cloud 涓氬姟绔欑偣鍦板潃 - //private static string CloudUrl = "http://60.190.4.42:9002/K3CLOUD/";//澶忓疂 - //private static string CloudUrl = "http://124.70.129.242/k3cloud/";//闆呯惇璇� - + private static string CloudUrl = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "KDApiUrl");//K/3 Cloud 涓氬姟绔欑偣鍦板潃 /// <summary> /// 鐧婚檰 /// </summary> public static string Login() { - var dbId = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DbId"); - var useName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "UserName"); - var pwd = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "PassWord"); - var CloudUrl = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "KDApiUrl"); - //var url = GetKey(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "/kdapi.config", "KDApiUrl"); - //var loginResult = ValidateLogin(dbId, useName, pwd, 2052); - //var resultType = JObject.Parse(loginResult)["LoginResultType"].Value<int>(); + //浠嶤鐩橀厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮� + Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo); + var useName = Pub_Class.ClsPub.sCLOUDUseName; + var pwd = Pub_Class.ClsPub.sCLOUDPsd; + var dbId = Pub_Class.ClsPub.sCLOUDAcc; + CloudUrl = Pub_Class.ClsPub.sCLOUDUrl; + + //鍘熶粠Config/kdapi.config妯″潡涓幏鍙� 20240712灞忚斀 + //var dbId = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DbId"); + //var useName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "UserName"); + //var pwd = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "PassWord"); + HttpClient httpClient = new HttpClient(); + httpClient.Url = string.Concat(CloudUrl, "Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc"); + + List<object> Parameters = new List<object>(); + Parameters.Add(dbId);//璐﹀鏍囩ず + Parameters.Add(useName);//鐢ㄦ埛鍚� + Parameters.Add(pwd);//瀵嗙爜 + Parameters.Add(2052);//2052浠h〃涓枃 + httpClient.Content = JsonConvert.SerializeObject(Parameters); + + return httpClient.SyncRequest(); + } + + public static string LoginUser(string user) + { + //浠嶤鐩橀厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮� + Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo); + var useName = Pub_Class.ClsPub.sCLOUDUseName; + var pwd = Pub_Class.ClsPub.sCLOUDPsd; + var dbId = Pub_Class.ClsPub.sCLOUDAcc; + CloudUrl = Pub_Class.ClsPub.sCLOUDUrl; + + //鑾峰彇鐢ㄦ埛缁戝畾閲戣澏璐﹀彿 + DataSet ds; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ds = oCN.RunProcReturn("exec h_p_API_GetCloudUserByLoginUser '" + user.ToString() + "'", "h_p_API_GetCloudUserByLoginUser"); + + if (ds != null && ds.Tables[0].Rows.Count != 0) + { + useName = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCloudUserName"]); + pwd = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCloudUserPsd"]); + } + HttpClient httpClient = new HttpClient(); httpClient.Url = string.Concat(CloudUrl, "Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc"); @@ -46,9 +79,9 @@ HttpClient httpClient = new HttpClient(); httpClient.Url = string.Concat(CloudUrl, "Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc"); List<object> Parameters = new List<object>(); - Parameters.Add("5f9258a311401c");//璐﹀鏍囩ず + Parameters.Add("622703e117d642");//璐﹀鏍囩ず Parameters.Add("Administrator");//鐢ㄦ埛鍚� - Parameters.Add("qaz!@#123");//瀵嗙爜 + Parameters.Add("sa@123456");//瀵嗙爜 Parameters.Add(2052);//2052浠h〃涓枃 httpClient.Content = JsonConvert.SerializeObject(Parameters); @@ -224,6 +257,9 @@ return httpClient.SyncRequest(); } + /// <summary> + /// 鍗曟嵁鏌ヨ + /// </summary> public static string Query(string formId, string content) { HttpClient httpClient = new HttpClient(); -- Gitblit v1.9.1