From 768405ab8a119d04f4d861f031b9ba38e84cf81c Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期三, 01 四月 2026 16:14:24 +0800
Subject: [PATCH] 1

---
 WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   33 +++++++++++++++++++++++++--------
 1 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
index ec175c1..64341d2 100644
--- a/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
+++ b/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -502,28 +502,20 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
-                // 鑾峰彇LED鏈嶅姟鍦板潃閰嶇疆
                 string ledApiAddress = AppSettings.Get("LEDApiAddress");
                 if (string.IsNullOrEmpty(ledApiAddress))
                 {
                     return WebResponseContent.Instance.Error("鏈壘鍒癓ED鏈嶅姟鍦板潃");
                 }
-
-                // 瑙f瀽IP鍦板潃锛堝鐞嗗彲鑳藉寘鍚殑http://鍓嶇紑锛�
                 string ipAddress = ledApiAddress;
                 int port = 8888; // 榛樿绔彛
-
-                // 鎷兼帴鎺ㄩ�佹牸寮�
                 string sendData = $"{stationCode}|{palletCode}|{taskType}";
 
-                // TCP杩炴帴WinForm
                 using (TcpClient tcpClient = new TcpClient())
                 {
-                    // 璁剧疆杩炴帴瓒呮椂
                     tcpClient.ReceiveTimeout = 5000;
                     tcpClient.SendTimeout = 5000;
 
-                    // 杩炴帴TCP鏈嶅姟
                     tcpClient.Connect(ipAddress, port);
 
                     NetworkStream stream = tcpClient.GetStream();
@@ -1027,5 +1019,30 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+
+        /// <summary>
+        /// 浠诲姟鎵嬪姩瀹屾垚
+        /// </summary>
+        /// <param name="taskNum"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public async Task<WebResponseContent> ManualTaskCompleted(int taskNum)
+        {
+            try
+            {
+                string url = "http://localhost:9290";
+                if (string.IsNullOrEmpty(url))
+                {
+                    return await Task.FromResult(WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃,璇锋鏌ラ厤缃枃浠�"));
+                }
+                string response = HttpHelper.Post($"{url}/api/Task/TaskCompleted?taskNum=" + taskNum,taskNum.ToString());
+
+                return await Task.FromResult(JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒"));
+            }
+            catch (Exception ex)
+            {
+                return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message));
+            }
+        }
     }
 }

--
Gitblit v1.9.3