|  |  | 
 |  |  | using System; | 
 |  |  | using System.Collections.Generic; | 
 |  |  | using System.Data; | 
 |  |  | using System.Linq; | 
 |  |  | using System.Text; | 
 |  |  | using System.Threading.Tasks; | 
 |  |  | using Newtonsoft.Json; | 
 |  |  | using WebAPI.Utility; | 
 |  |  |  | 
 |  |  | namespace WebAPI | 
 |  |  | { | 
 |  |  |     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 = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "KDApiUrl");//K/3 Cloud 业务站点地址 | 
 |  |  |         /// <summary> | 
 |  |  |         /// 登陆 | 
 |  |  |         /// </summary> | 
 |  |  |         public static string Login() | 
 |  |  |         { | 
 |  |  |             //从C盘配置文件获取 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("61b14ea86f5c8a");//账套标示 | 
 |  |  |             Parameters.Add("Administrator");//用户名 | 
 |  |  |             Parameters.Add("888888");//密码 | 
 |  |  |             Parameters.Add(dbId);//账套标示 | 
 |  |  |             Parameters.Add(useName);//用户名 | 
 |  |  |             Parameters.Add(pwd);//密码 | 
 |  |  |             Parameters.Add(2052);//2052代表中文 | 
 |  |  |             httpClient.Content = JsonConvert.SerializeObject(Parameters); | 
 |  |  |  | 
 |  |  |             return httpClient.SyncRequest(); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public static string LoginUser(string user) | 
 |  |  |         { | 
 |  |  |             //从C盘配置文件获取 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"); | 
 |  |  |  | 
 |  |  |             List<object> Parameters = new List<object>(); | 
 |  |  |             Parameters.Add(dbId);//账套标示 | 
 |  |  |             Parameters.Add(useName);//用户名 | 
 |  |  |             Parameters.Add(pwd);//密码 | 
 |  |  |             Parameters.Add(2052);//2052代表中文 | 
 |  |  |             httpClient.Content = JsonConvert.SerializeObject(Parameters); | 
 |  |  |  | 
 |  |  | 
 |  |  |             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代表中文 | 
 |  |  |             httpClient.Content = JsonConvert.SerializeObject(Parameters); | 
 |  |  |  | 
 |  |  | 
 |  |  |             return httpClient.SyncRequest(); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// 单据查询 | 
 |  |  |         /// </summary> | 
 |  |  |         public static string Query(string formId, string content) | 
 |  |  |         { | 
 |  |  |             HttpClient httpClient = new HttpClient(); | 
 |  |  | 
 |  |  |         //生产订单 执行 | 
 |  |  |         public static string ExcuteOperation(string formId, string opNumber, string content) | 
 |  |  |         { | 
 |  |  |             LogService.Write("生产订单 执行,opNumber: " + opNumber + ",content:" + content); | 
 |  |  |             HttpClient httpClient = new HttpClient(); | 
 |  |  |             httpClient.Url = string.Concat(CloudUrl, "Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExcuteOperation.common.kdsvc"); | 
 |  |  |  |