From aa163d95ef7e56aff066a11dad66083bcd373f95 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期四, 31 十月 2024 12:23:12 +0800 Subject: [PATCH] 到货确认审核人取当前登录用户绑定的金蝶账号 --- WebAPI/InvokeHelper.cs | 34 ++++++++++++++++++++++++++++++++++ WebAPI/Controllers/POStockInBillController.cs | 26 +++++++++++++------------- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs index c65a35e..f9cb83b 100644 --- a/WebAPI/Controllers/POStockInBillController.cs +++ b/WebAPI/Controllers/POStockInBillController.cs @@ -5318,21 +5318,21 @@ } [Route("POStockInBillList/AuditPOInStockBillPost_TianKang")] - [HttpPost] - public object AuditPOInStockBill_TianKang([FromBody] JObject msg) + [HttpGet] + public object AuditPOInStockBill_TianKang(long FID,string user) { try { - string _msg = msg["msg"].ToString(); - _msg = _msg.Replace("\\", ""); - _msg = _msg.Replace("\n", ""); - List<Models.ReciveBill_FastModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ReciveBill_FastModel>>(_msg); - DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill(); - var hinterID = list[0].HInterID; - var FID = list[0].FID; - string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);//瀹㈡埛鍚嶇О - var kdTbaleName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName"); - string sql = string.Empty; + //string _msg = msg["msg"].ToString(); + //_msg = _msg.Replace("\\", ""); + //_msg = _msg.Replace("\n", ""); + //List<Models.ReciveBill_FastModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ReciveBill_FastModel>>(_msg); + //DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill(); + //var hinterID = list[0].HInterID; + //var FID = list[0].FID; + //string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);//瀹㈡埛鍚嶇О + //var kdTbaleName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName"); + //string sql = string.Empty; var json = new { @@ -5340,7 +5340,7 @@ }; //LogService.Write(json); //鐧诲綍 - var loginRet = InvokeHelper.Login(); + var loginRet = InvokeHelper.LoginUser(user); var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); if (isSuccess <= 0) { diff --git a/WebAPI/InvokeHelper.cs b/WebAPI/InvokeHelper.cs index ae7824f..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; @@ -40,6 +41,39 @@ 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"); + + 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 async Task<string> LoginAsync() { HttpClient httpClient = new HttpClient(); -- Gitblit v1.9.1