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.ConfirmMaterialReqProdReturn.cs |   82 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/Tiger.Business.WMS/ERP/WMS_U9C.ConfirmMaterialReqProdReturn.cs b/Tiger.Business.WMS/ERP/WMS_U9C.ConfirmMaterialReqProdReturn.cs
new file mode 100644
index 0000000..3ef8476
--- /dev/null
+++ b/Tiger.Business.WMS/ERP/WMS_U9C.ConfirmMaterialReqProdReturn.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 ConfirmReqReturnUrl
+        { get; set; } = "http://172.16.80.20/u9c/webapi/IssueDoc/Confirm"; // ApiConfig.IsTestServer ? Cache.SysParam["ConfirmReqReturnUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["ConfirmReqReturnUrl", "U9CUrl"].PARAM_VALUE; //http://172.16.80.20/u9c/webapi/IssueDoc/Confirm
+
+        /// <summary>
+        /// 棰嗘枡鍗�/閫�鏂欏崟鍙戞枡/閫�鏂欑‘璁�
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        public async Task<ApiAction<List<U9CReturnData>>> ConfirmReqReturn(ConfirmReqReturnInput 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={input.userId}{secret}");
+                    if (u9CLoginResult.Success)
+                    {
+                        input.token = u9CLoginResult.Data;
+                        Logger.Interface.Info($"U9C鐧诲綍token: {input.token}");
+                    }
+                }
+
+                var response = await HttpHelper.PostAsync(ConfirmReqReturnUrl, JsonConvert.SerializeObject(input.ConfirmReqReturnParams), 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($"棰嗘枡鍗�/閫�鏂欏崟鍙戞枡/閫�鏂欑‘璁ゆ帴鍙f彁浜son: {JsonConvert.SerializeObject(input.ConfirmReqReturnParams)}锛岃繑鍥濲son: {response.Message}");
+                    }
+                    else
+                    {
+                        action.IsSuccessed = false;
+                        action.LocaleMsg = new($"{action.Message}; {result.Data[0].m_errorMsg}");
+                        Logger.Interface.Info($"棰嗘枡鍗�/閫�鏂欏崟鍙戞枡/閫�鏂欑‘璁ゆ帴鍙eけ璐�:{result.Data[0].m_errorMsg}锛屾彁浜son: {JsonConvert.SerializeObject(input.ConfirmReqReturnParams)}");
+                    }
+                }
+            }
+            catch (System.Exception ex)
+            {
+                action.CatchExceptionWithLog(ex, "棰嗘枡鍗�/閫�鏂欏崟鍙戞枡/閫�鏂欑‘璁ゅ紓甯�");
+            }
+            Logger.Interface.Info($"/* 棰嗘枡鍗�/閫�鏂欏崟鍙戞枡/閫�鏂欑‘璁ゆ帴鍙g粨鏉� */\r\n"); //鍥哄畾鍐欐硶
+            return action;
+        }
+    }
+}

--
Gitblit v1.9.3