From a8fcfbb5e5ed9a07b1a30ef2d7ef9d407e9b04dd Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期三, 02 四月 2025 21:44:54 +0800 Subject: [PATCH] 更新ASN实体 --- Tiger.Business.WMS/ERP/WMS_U9C.ApproveMaterialReqProdReturn.cs | 82 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/Tiger.Business.WMS/ERP/WMS_U9C.ApproveMaterialReqProdReturn.cs b/Tiger.Business.WMS/ERP/WMS_U9C.ApproveMaterialReqProdReturn.cs new file mode 100644 index 0000000..8bef7b1 --- /dev/null +++ b/Tiger.Business.WMS/ERP/WMS_U9C.ApproveMaterialReqProdReturn.cs @@ -0,0 +1,82 @@ +锘縰sing Tiger.Model; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; +using Rhea.Common; +using System.Net; +using System.Linq; +using Newtonsoft.Json; +using Tiger.IBusiness; +using Microsoft.AspNetCore.Http; +using Tiger.Model.Minsun; +using Org.BouncyCastle.Asn1.Tsp; +using Tiger.Model.Entitys.MES.Position; +using Apache.NMS.ActiveMQ.Commands; +using System.Security.Cryptography; +using System.Diagnostics; +using Tiger.Model.Entitys.MES.U9C; +using Newtonsoft.Json.Linq; +using System.Security.Policy; +using NetTaste; + +namespace Tiger.Business.WMS +{ + public partial class WMS_U9C + { + /// <summary> + /// 棰嗘枡鍗曢��鏂欏崟瀹℃牳鎺ュ彛 + /// </summary> + public static string ApproveReqReturnUrl + { get; set; } = "http://172.16.80.20/u9c/webapi/IssueDoc/Approve"; // ApiConfig.IsTestServer ? Cache.SysParam["ApproveReqReturnUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["ApproveReqReturnUrl", "U9CUrl"].PARAM_VALUE; //http://172.16.80.20/u9c/webapi/IssueDoc/Approve + + /// <summary> + /// 棰嗘枡鍗曢��鏂欏崟瀹℃牳鎺ュ彛 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public async Task<ApiAction<List<U9CReturnData>>> ApproveReqReturn(ApproveReqReturnInput input) + { + Logger.Interface.Info($"/**\r\n *杩涘叆棰嗘枡鍗曢��鏂欏崟瀹℃牳鎺ュ彛....\r\n */\r\n"); //鍥哄畾鍐欐硶 + var action = new ApiAction<List<U9CReturnData>>(); + try + { + //濡傛灉宸茬粡鐧诲綍鍒欎笉闇�瑕佸啀娆$櫥褰曪紝鐩存帴浣跨敤浼犲叆鐨則oken + if (input.IsLogin) + { + var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={Reviewer}{secret}"); + if (u9CLoginResult.Success) + { + input.token = u9CLoginResult.Data; + Logger.Interface.Info($"U9C鐧诲綍token: {input.token}"); + } + } + + var response = await HttpHelper.PostAsync(ConfirmReqReturnUrl, JsonConvert.SerializeObject(input.ApproveReqReturnParams), new Dictionary<string, string>() { { "token", input.token } }); + var result = JsonConvert.DeserializeObject<U9CResult>(response.Message); + if (result != null) + { + if (result.Success && result.Data[0].m_isSucess) + { + action.Data = result.Data; + Logger.Interface.Info($"棰嗘枡鍗曢��鏂欏崟瀹℃牳鎺ュ彛鎻愪氦Json: {JsonConvert.SerializeObject(input.ApproveReqReturnParams)}锛岃繑鍥濲son: {response.Message}"); + } + else + { + action.IsSuccessed = false; + action.LocaleMsg = new($"{action.Message}; {result.Data[0].m_errorMsg}"); + Logger.Interface.Info($"棰嗘枡鍗曢��鏂欏崟瀹℃牳鎺ュ彛澶辫触:{result.Data[0].m_errorMsg}锛屾彁浜son: {JsonConvert.SerializeObject(input.ApproveReqReturnParams)}"); + } + } + } + catch (System.Exception ex) + { + action.CatchExceptionWithLog(ex, "棰嗘枡鍗�/閫�鏂欏崟鍙戞枡/閫�鏂欑‘璁ゅ紓甯�"); + } + Logger.Interface.Info($"/* 棰嗘枡鍗曢��鏂欏崟瀹℃牳鎺ュ彛缁撴潫 */\r\n"); //鍥哄畾鍐欐硶 + return action; + } + } +} -- Gitblit v1.9.3