From 51922d7093b9c8f52417bfdd0fe9aa087d1fb5be Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期五, 01 五月 2026 18:31:01 +0800
Subject: [PATCH] feat: 优化仓库仪表盘界面并添加电池和空托盘统计功能

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
index 6a5fca3..2c7f8f4 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
@@ -3,6 +3,7 @@
 using System.Text.Json;
 using System.IO;
 using WIDESEAWCS_Model.Models;
+using Serilog.Core;
 
 namespace WIDESEAWCS_Tasks.SocketServer
 {
@@ -23,8 +24,7 @@
         /// <param name="client">TCP 瀹㈡埛绔繛鎺�</param>
         /// <param name="clientId">瀹㈡埛绔敮涓�鏍囪瘑</param>
         /// <param name="cancellationToken">鍙栨秷浠ょ墝</param>
-        /// <param name="robotCrane">鏈哄櫒浜虹姸鎬�</param>
-        public async Task HandleClientAsync(TcpClient client, string clientId, CancellationToken cancellationToken, RobotSocketState robotCrane)
+        public async Task HandleClientAsync(TcpClient client, string clientId, CancellationToken cancellationToken)
         {
             using (client)
             using (NetworkStream networkStream = client.GetStream())
@@ -60,11 +60,16 @@
                             break;
                         }
 
-                        if(message == lastMessage)
-                        {
-                            // 閲嶅娑堟伅锛屽拷鐣�
-                            continue;
-                        }
+                        // 鎸夊鎴风鍘婚噸锛氭鏌ユ槸鍚︿笌璇ュ鎴风涓婃娑堟伅鐩稿悓
+                        //lock (_syncRoot)
+                        //{
+                        //    if (_clientLastMessage.TryGetValue(clientId, out var prev) && message == prev)
+                        //    {
+                        //        QuartzLogHelper.LogInfo(Logger.None, $"鏉ヨ嚜瀹㈡埛绔� {clientId} 鐨勯噸澶嶆秷鎭紝鍐呭: {message}", clientId);
+                        //        continue;
+                        //    }
+                        //    _clientLastMessage[clientId] = message;
+                        //}
 
                         // 鏇存柊瀹㈡埛绔姸鎬�
                         UpdateClientStatus(clientId, message);
@@ -84,7 +89,7 @@
                             {
                                 // 鍒ゆ柇鏄惁涓� JSON 鏍煎紡
                                 bool isJsonFormat = TryParseJsonSilent(message);
-                                _ = MessageReceived.Invoke(message, isJsonFormat, client, robotCrane);
+                                _ = MessageReceived.Invoke(message, isJsonFormat, client);
                             }
                             catch { }
                         }

--
Gitblit v1.9.3