From cf4622df137c26d238730316651f214fd29ca65f Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期五, 25 七月 2025 16:38:13 +0800
Subject: [PATCH] 修改最新websocket

---
 JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/mechanicalMonitor/controller/MechanicalMonitorController.java |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/mechanicalMonitor/controller/MechanicalMonitorController.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/mechanicalMonitor/controller/MechanicalMonitorController.java
index 5db0ed7..c3198e8 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/mechanicalMonitor/controller/MechanicalMonitorController.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/mechanicalMonitor/controller/MechanicalMonitorController.java
@@ -1,17 +1,17 @@
 package com.mes.mechanicalMonitor.controller;
 
+import cn.hutool.json.JSONObject;
 import com.mes.mechanicalMonitor.entity.MechanicalMonitor;
 import com.mes.mechanicalMonitor.service.MechanicalMonitorService;
-import com.mes.tools.WebSocketServer;
 import com.mes.utils.Result;
+import com.mes.websocket.WebSocketServer;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import cn.hutool.json.JSONObject;
-import java.util.ArrayList;
-import java.util.List;
+
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 @Api(tags = "璁惧鐘舵�佺洃鎺�")
@@ -42,10 +42,10 @@
     @ResponseBody
     public Result updateMechanicalStatus(@RequestBody JSONObject status) {
         try {
-            ArrayList<WebSocketServer> servers = WebSocketServer.sessionMap.get("mechanicalMonitor");
+            List<WebSocketServer> servers = WebSocketServer.SESSIONMAP.get("mechanicalMonitor");
             if (servers != null) {
                 for (WebSocketServer server : servers) {
-                    server.sendMessage(status.toString());
+                    server.sendToWeb("",status.toString());
                 }
             }
             return Result.build(200, "鐘舵�佹洿鏂版垚鍔�", null);

--
Gitblit v1.8.0