杨前锦
2025-07-01 a93b0e99036c24b9bd58c79bf5e7364b1ba28bae
HH.WCS.Mobox3/HH.WCS.Mobox3.TSSG/process/DeviceProcess.cs
@@ -27,19 +27,17 @@
        internal static void Analysis(string data, string ip) {
            if (!lastReceiptTime.TryGetValue(ip, out DateTime lastTime)) // 安全获取值
           // 检查是否需要跳过处理
            if (lastReceiptTime.TryGetValue(ip, out DateTime lastTime) &&
                DateTime.Now < lastTime.AddMinutes(1))
            {
                lastReceiptTime[ip] = DateTime.Now; // 使用索引器自动添加或更新
            }
            else if (lastTime < DateTime.Now.AddMinutes(-1))
            {
                lastReceiptTime[ip] = DateTime.Now;
            }
            else
            {
                return;
                return; // 1分钟内重复请求,跳过
            }
            // 更新接收时间并执行业务逻辑
            lastReceiptTime[ip] = DateTime.Now;
            LogHelper.Info($"下发入库请求,IP:{ip}", "TSSG");
            if (data.Length >= 6) {
               //去掉消息头3F 00
               data = data.Substring(4);