From 06e0e3b7d61e95902a6129de2490461cd0693e1d Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 15 十月 2025 15:06:40 +0800
Subject: [PATCH] 新增异步方法并优化服务调用逻辑在多个数据库文件中进行了二进制文件的修改、删除和新增操作,可能涉及数据库内容的更新或重建。在 HttpsClient.cs文件中新增了 PostNotLimitAsync方法,用于发送支持 JSON 格式的异步 HTTP POST 请求,并记录请求和响应参数。在 AgingInOrOutInputService.cs文件中,将 HttpsClient.PostAsync替换为PostNotLimitAsync,以利用新方法的功能特性。同时删除了不再需要的注释代码。
---
/dev/null | 0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs | 44 ++++++++++++++++++++++++++++++++++++++++++++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs | 4 +---
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm | 0
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal | 0
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal | 0
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db | 0
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db | 0
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm | 0
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db | 0
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db | 0
11 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db
index 5cb2164..04e1c06 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm
deleted file mode 100644
index c7ca75d..0000000
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm
+++ /dev/null
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal
deleted file mode 100644
index e3cdff7..0000000
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal
+++ /dev/null
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db
index 585e858..ca7ff39 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal
deleted file mode 100644
index 91c78e0..0000000
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal
+++ /dev/null
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db
new file mode 100644
index 0000000..27c9cd9
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm
similarity index 85%
copy from Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
copy to Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm
index d330c44..dcf78ba 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal
new file mode 100644
index 0000000..385b955
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db
new file mode 100644
index 0000000..addda57
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
similarity index 87%
rename from Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
rename to Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
index d330c44..3fc1d0f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal
new file mode 100644
index 0000000..632031f
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs
index 3055e53..d9bf3da 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs
@@ -113,6 +113,50 @@
}
}
+
+ public static async Task<string> PostNotLimitAsync(string url, Dictionary<string, object> parameters)
+ {
+ try
+ {
+ // 璁板綍璇锋眰鍙傛暟
+ LogRequestParameters(parameters, url);
+
+ // 鍒涘缓HttpClient瀹炰緥
+ using (HttpClient client = new HttpClient())
+ {
+ // 灏嗗弬鏁拌浆鎹负FormUrlEncodedContent
+ string content = JsonConvert.SerializeObject(parameters);
+
+ //client.Timeout = TimeSpan.from;
+
+ var request = new HttpRequestMessage(HttpMethod.Post, url);
+
+ request.Content = new StringContent(content, Encoding.UTF8, "application/json");
+ //var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters));
+ //// 鍙戦�丳OST璇锋眰骞惰幏鍙栧搷搴�
+ //HttpResponseMessage response = await client.PostAsync(url, content);
+ HttpResponseMessage response = await client.SendAsync(request);
+
+ // 纭繚鍝嶅簲鎴愬姛
+ response.EnsureSuccessStatusCode();
+
+ // 璇诲彇鍝嶅簲鍐呭
+ string responseBody = await response.Content.ReadAsStringAsync();
+
+ // 璁板綍鍝嶅簲鍙傛暟
+ LogResponseParameters(responseBody, url);
+
+ // 杩斿洖鍝嶅簲鍐呭
+ return responseBody;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogErrorParameters(ex.StackTrace, ex.Message, url);
+ return ex.Message;
+ }
+
+ }
private static void LogErrorParameters(string errordetail, string error, string url = "")
{
StringBuilder builder = new StringBuilder();
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs
index 95298d9..2741308 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs
@@ -142,10 +142,8 @@
}
var MOMIpAddress = MOMBase + ipAddress;
- var result = HttpsClient.PostAsync(MOMIpAddress, inputJson).Result;
+ var result = HttpsClient.PostNotLimitAsync(MOMIpAddress, inputJson).Result;
- //var respone = JsonConvert.DeserializeObject<EqptRunDTO>(result.ToString());
-
content.OK(data: result);
LogFactory.GetLog("鎹㈠瀷").Info(true, $"\r\r--------------------------------------");
LogFactory.GetLog("鎹㈠瀷").Info(true, input.EquipmentCode);
--
Gitblit v1.9.3