Преглед изворни кода

1、日志打印修改为log.info

liweimin пре 1 дан
родитељ
комит
98f27b1c39
18 измењених фајлова са 55 додато и 55 уклоњено
  1. 2 2
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/client/EmqClient.java
  2. 2 2
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/DeviceOnlineManager.java
  3. 3 3
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/MessageHandler.java
  4. 6 6
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/JsonBodyDecoder.java
  5. 7 7
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/DeviceLoginService.java
  6. 5 5
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/DevicePtService.java
  7. 2 2
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/OpwMainDataUpService.java
  8. 2 2
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/OpwPassthroughDataUpService.java
  9. 2 2
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/OpwQueryDataUpService.java
  10. 2 2
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/TaxDataUpService.java
  11. 1 1
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/OpwMainDataDownService.java
  12. 1 1
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/OpwPassthroughDataDownService.java
  13. 1 1
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/OpwQueryDataDownService.java
  14. 1 1
      ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/TaxDataDownService.java
  15. 1 1
      ruoyi-device/src/main/java/com/ruoyi/device/websocket/TsbWebSocketServer.java
  16. 13 13
      ruoyi-device/src/main/java/com/ruoyi/device/websocket/TsbWebSocketService.java
  17. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/websocket/WebSocketUtils.java
  18. 3 3
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java

+ 2 - 2
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/client/EmqClient.java

@@ -39,7 +39,7 @@ public class EmqClient
     {
         if (StringUtils.isEmpty(mqttConfig.getBroker()))
         {
-            log.warn("未配置 emqx.broker,跳过 MQTT 客户端初始化");
+            log.info("未配置 emqx.broker,跳过 MQTT 客户端初始化");
             return;
         }
         MqttClientPersistence persistence = new MemoryPersistence();
@@ -158,7 +158,7 @@ public class EmqClient
     {
         if (mqttClient == null || !mqttClient.isConnected())
         {
-            log.warn("发布消息失败,mqtt未连接,放弃发布 topic={}", topic);
+            log.info("发布消息失败,mqtt未连接,放弃发布 topic={}", topic);
             return;
         }
         try

+ 2 - 2
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/DeviceOnlineManager.java

@@ -81,13 +81,13 @@ public class DeviceOnlineManager
         DeviceOnlineInfo info = getDeviceLoginInfo(deviceSn);
         if (info == null)
         {
-            log.debug("设备心跳,登录信息不存在, deviceSn={}", deviceSn);
+            log.info("设备心跳,登录信息不存在, deviceSn={}", deviceSn);
             return;
         }
         info.setLineStatus(DeviceLineStatusEnum.ON_LINE.getStatus());
         info.setHeartbeatTime(new Date());
         saveDeviceLoginInfo(info);
-        log.debug("设备心跳在线, deviceSn={}", deviceSn);
+        log.info("设备心跳在线, deviceSn={}", deviceSn);
     }
 
     /**

+ 3 - 3
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/MessageHandler.java

@@ -74,7 +74,7 @@ public class MessageHandler
                 IDecoder decoder = handlerManager.getDecoder(key);
                 if (decoder == null)
                 {
-                    log.warn("未找到对应业务解析器,消息类型:{}-{}", firstType, secondType);
+                    log.info("未找到对应业务解析器,消息类型:{}-{}", firstType, secondType);
                     return;
                 }
                 // 6、处理消息
@@ -120,7 +120,7 @@ public class MessageHandler
     {
         if (payload == null || payload.length < 14)
         {
-            log.warn("CRC16 校验失败: 报文过短, len={}", payload == null ? 0 : payload.length);
+            log.info("CRC16 校验失败: 报文过短, len={}", payload == null ? 0 : payload.length);
             return false;
         }
         byte[] dataWithoutTailCrc = Arrays.copyOfRange(payload, 0, payload.length - 2);
@@ -129,7 +129,7 @@ public class MessageHandler
         byte high = payload[payload.length - 1];
         if (computed[0] != low || computed[1] != high)
         {
-            log.warn("CRC16 校验失败: expect [{}, {}], actual [{}, {}], hexLog={}",
+            log.info("CRC16 校验失败: expect [{}, {}], actual [{}, {}], hexLog={}",
                 computed[0] & 0xFF, computed[1] & 0xFF, low & 0xFF, high & 0xFF,
                 bytesToHexLog(payload));
             return false;

+ 6 - 6
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/JsonBodyDecoder.java

@@ -33,7 +33,7 @@ public class JsonBodyDecoder extends AbstractDecoder<BaseJsonBody>
         // 1、按照 msgLength-2 的长度读取报文体
         if (header.getMsgLength() <= 2)
         {
-            log.warn("报文体长度标识小于2,忽略解析");
+            log.info("报文体长度标识小于2,忽略解析");
             return BaseJsonBody.fail(commonTopic.getDeviceType(), commonTopic.getDeviceSn(), "报文体长度标识小于2,忽略解析");
         }
         byte[] bodyBytes = new byte[header.getMsgLength() - 2];
@@ -43,7 +43,7 @@ public class JsonBodyDecoder extends AbstractDecoder<BaseJsonBody>
         // 2、解析报文体json
         if (!JSON.isValidObject(bodyStr))
         {
-            log.warn("报文体json格式化出错");
+            log.info("报文体json格式化出错");
             return BaseJsonBody.fail(commonTopic.getDeviceType(), commonTopic.getDeviceSn(), "报文体json格式化出错");
         }
 
@@ -51,19 +51,19 @@ public class JsonBodyDecoder extends AbstractDecoder<BaseJsonBody>
         BaseJsonBody jsonBody = JSON.parseObject(bodyStr, BaseJsonBody.class);
         if (jsonBody == null || StringUtils.isEmpty(jsonBody.getCmdType()))
         {
-            log.warn("报文体缺少 cmdType");
+            log.info("报文体缺少 cmdType");
             return BaseJsonBody.fail(commonTopic.getDeviceType(), commonTopic.getDeviceSn(), "报文体缺少 cmdType");
         }
         String rawCmdType = jsonBody.getCmdType().trim();
         if (CmdTypeEnum.isDownlink(rawCmdType))
         {
-            log.warn("收到下行 cmdType 于上行通道, cmdType={}", rawCmdType);
+            log.info("收到下行 cmdType 于上行通道, cmdType={}", rawCmdType);
             return BaseJsonBody.fail(commonTopic.getDeviceType(), commonTopic.getDeviceSn(), "cmdType 不能为下行类型");
         }
         CmdTypeEnum cmd = CmdTypeEnum.resolveUplink(rawCmdType);
         if (cmd == null)
         {
-            log.warn("未知 cmdType={}", rawCmdType);
+            log.info("未知 cmdType={}", rawCmdType);
             return BaseJsonBody.fail(commonTopic.getDeviceType(), commonTopic.getDeviceSn(), "未知 cmdType: " + rawCmdType);
         }
         if (StringUtils.isEmpty(jsonBody.getDeviceType()) && StringUtils.isNotEmpty(commonTopic.getDeviceType()))
@@ -89,7 +89,7 @@ public class JsonBodyDecoder extends AbstractDecoder<BaseJsonBody>
         }
         if (handler == null)
         {
-            log.warn("未注册 JSON 命令处理器 cmd={}", cmd);
+            log.info("未注册 JSON 命令处理器 cmd={}", cmd);
             return BaseJsonBody.fail(jsonBody.getDeviceType(), jsonBody.getDeviceSn(), cmd.getCmdDownType(), "未实现的服务处理器");
         }
         return handler.handle(commonTopic, header, bodyStr, cmd);

+ 7 - 7
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/DeviceLoginService.java

@@ -54,7 +54,7 @@ public class DeviceLoginService implements IJsonCmdUpHandler
         DeviceLoginRequest request = JSON.parseObject(bodyJson, DeviceLoginRequest.class);
         if (request == null)
         {
-            log.warn("调试宝登录报文体解析失败");
+            log.info("调试宝登录报文体解析失败");
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "调试宝登录报文体解析失败");
         }
 
@@ -62,29 +62,29 @@ public class DeviceLoginService implements IJsonCmdUpHandler
         String userName = request.getUserName();
         if (StringUtils.isEmpty(userName))
         {
-            log.warn("用户名不能为空");
+            log.info("用户名不能为空");
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "用户名不能为空");
         }
         SysUser user = userService.selectUserByUserName(userName);
         if (StringUtils.isNull(user))
         {
-            log.warn("登录用户:{}不存在", userName);
+            log.info("登录用户:{}不存在", userName);
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "当前登录用户不存在");
         }
         if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
         {
-            log.warn("登录用户:{}已被删除", userName);
+            log.info("登录用户:{}已被删除", userName);
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "当前登录用户已被删除");
         }
         if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
         {
-            log.warn("登录用户:{}已被停用", userName);
+            log.info("登录用户:{}已被停用", userName);
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "当前登录用户已被停用");
         }
         if (StringUtils.isEmpty(request.getUserPassword())
             || !SecurityUtils.matchesPassword(request.getUserPassword(), user.getPassword()))
         {
-            log.warn("登录用户:{} 密码错误,请重新输入.", userName);
+            log.info("登录用户:{} 密码错误,请重新输入.", userName);
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "密码错误,请重新输入");
         }
 
@@ -95,7 +95,7 @@ public class DeviceLoginService implements IJsonCmdUpHandler
         TsbUserDeviceBind bindResult = tsbUserDeviceService.selectTsbUserDeviceBind(bindQuery);
         if (bindResult == null)
         {
-            log.warn("用户:{} 未绑定设备.", userName);
+            log.info("用户:{} 未绑定设备.", userName);
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "当前用户未绑定设备");
         }
 

+ 5 - 5
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/DevicePtService.java

@@ -38,30 +38,30 @@ public class DevicePtService implements IJsonCmdUpHandler
         DevicePtRequest request = JSON.parseObject(bodyJson, DevicePtRequest.class);
         if (request == null)
         {
-            log.warn("调试宝产测报文体解析失败");
+            log.info("调试宝产测报文体解析失败");
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "调试宝产测报文体解析失败");
         }
 
         // 1、设备查询
         if (StringUtils.isEmpty(request.getImei()))
         {
-            log.warn("IMEI 不能为空");
+            log.info("IMEI 不能为空");
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "IMEI 不能为空");
         }
         TsbDevice device = tsbDeviceMapper.selectTsbDeviceByImei(request.getImei());
         if (device == null)
         {
-            log.warn("未找到 IMEI:{} 对应设备", request.getImei());
+            log.info("未找到 IMEI:{} 对应设备", request.getImei());
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "未找到 IMEI 对应设备");
         }
         if (UserStatus.DELETED.getCode().equals(device.getDelFlag()))
         {
-            log.warn("设备 IMEI:{} 已被删除", request.getImei());
+            log.info("设备 IMEI:{} 已被删除", request.getImei());
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "设备 IMEI 对应设备已被删除");
         }
         if (UserStatus.DISABLE.getCode().equals(device.getStatus()))
         {
-            log.warn("设备 IMEI:{} 已被停用", request.getImei());
+            log.info("设备 IMEI:{} 已被停用", request.getImei());
             return BaseJsonBody.fail(request.getDeviceType(), request.getDeviceSn(), cmd.getCmdDownType(), "设备 IMEI 对应设备已被停用");
         }
 

+ 2 - 2
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/OpwMainDataUpService.java

@@ -37,13 +37,13 @@ public class OpwMainDataUpService implements IJsonCmdUpHandler
         JSONObject bodyObj = JSON.parseObject(bodyJson);
         if (bodyObj == null)
         {
-            log.warn("液位仪主页报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("液位仪主页报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "液位仪报文体解析失败");
         }
         OpwMainDataUp opwMainDataUp = bodyObj.to(OpwMainDataUp.class);
         if (opwMainDataUp == null)
         {
-            log.warn("液位仪主页报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("液位仪主页报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "液位仪报文体解析失败");
         }
 

+ 2 - 2
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/OpwPassthroughDataUpService.java

@@ -37,13 +37,13 @@ public class OpwPassthroughDataUpService implements IJsonCmdUpHandler
         JSONObject bodyObj = JSON.parseObject(bodyJson);
         if (bodyObj == null)
         {
-            log.warn("液位仪透传报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("液位仪透传报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "液位仪透传报文体解析失败");
         }
         OpwPassthroughDataUp opwPassthroughDataUp = bodyObj.to(OpwPassthroughDataUp.class);
         if (opwPassthroughDataUp == null)
         {
-            log.warn("液位仪透传报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("液位仪透传报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "液位仪透传报文体解析失败");
         }
 

+ 2 - 2
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/OpwQueryDataUpService.java

@@ -37,13 +37,13 @@ public class OpwQueryDataUpService implements IJsonCmdUpHandler
         JSONObject bodyObj = JSON.parseObject(bodyJson);
         if (bodyObj == null)
         {
-            log.warn("液位仪查询报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("液位仪查询报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "液位仪查询报文体解析失败");
         }
         OpwQueryDataUp opwQueryDataUp = bodyObj.to(OpwQueryDataUp.class);
         if (opwQueryDataUp == null)
         {
-            log.warn("液位仪查询报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("液位仪查询报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "液位仪查询报文体解析失败");
         }
 

+ 2 - 2
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/decoder/json/service/TaxDataUpService.java

@@ -37,13 +37,13 @@ public class TaxDataUpService implements IJsonCmdUpHandler
         JSONObject bodyObj = JSON.parseObject(bodyJson);
         if (bodyObj == null)
         {
-            log.warn("报税口报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("报税口报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "报税口报文体解析失败");
         }
         TaxDataUp taxDataUp = bodyObj.to(TaxDataUp.class);
         if (taxDataUp == null)
         {
-            log.warn("报税口报文体解析失败, deviceSn={}", topic.getDeviceSn());
+            log.info("报税口报文体解析失败, deviceSn={}", topic.getDeviceSn());
             return BaseJsonBody.fail(topic.getDeviceType(), topic.getDeviceSn(), cmd.getCmdDownType(), "报税口报文体解析失败");
         }
 

+ 1 - 1
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/OpwMainDataDownService.java

@@ -28,7 +28,7 @@ public class OpwMainDataDownService implements IJsonCmdDownHandler
         OpwMainDataDown opwMainDataDown = data.to(OpwMainDataDown.class);
         if (opwMainDataDown == null)
         {
-            log.warn("液位仪主页报文体解析失败, deviceSn={}", bind.getDeviceSn());
+            log.info("液位仪主页报文体解析失败, deviceSn={}", bind.getDeviceSn());
             return null;
         }
         opwMainDataDown.setDeviceType(bind.getDeviceType());

+ 1 - 1
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/OpwPassthroughDataDownService.java

@@ -28,7 +28,7 @@ public class OpwPassthroughDataDownService implements IJsonCmdDownHandler
         OpwPassthroughDataDown opwPassthroughDataDown = data.to(OpwPassthroughDataDown.class);
         if (opwPassthroughDataDown == null)
         {
-            log.warn("液位仪透传报文体解析失败, deviceSn={}", bind.getDeviceSn());
+            log.info("液位仪透传报文体解析失败, deviceSn={}", bind.getDeviceSn());
             return null;
         }
         opwPassthroughDataDown.setDeviceType(bind.getDeviceType());

+ 1 - 1
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/OpwQueryDataDownService.java

@@ -28,7 +28,7 @@ public class OpwQueryDataDownService implements IJsonCmdDownHandler
         OpwQueryDataDown opwQueryDataDown = data.to(OpwQueryDataDown.class);
         if (opwQueryDataDown == null)
         {
-            log.warn("液位仪查询报文体解析失败, deviceSn={}", bind.getDeviceSn());
+            log.info("液位仪查询报文体解析失败, deviceSn={}", bind.getDeviceSn());
             return null;
         }
         opwQueryDataDown.setDeviceType(bind.getDeviceType());

+ 1 - 1
ruoyi-device/src/main/java/com/ruoyi/device/mqtt/handler/encoder/json/service/TaxDataDownService.java

@@ -28,7 +28,7 @@ public class TaxDataDownService implements IJsonCmdDownHandler
         TaxDataDown taxDataDown = data.to(TaxDataDown.class);
         if (taxDataDown == null)
         {
-            log.warn("报税口报文体解析失败, deviceSn={}", bind.getDeviceSn());
+            log.info("报税口报文体解析失败, deviceSn={}", bind.getDeviceSn());
             return null;
         }
         taxDataDown.setDeviceType(bind.getDeviceType());

+ 1 - 1
ruoyi-device/src/main/java/com/ruoyi/device/websocket/TsbWebSocketServer.java

@@ -109,7 +109,7 @@ public class TsbWebSocketServer
     @OnError
     public void onError(Session session, Throwable error) throws Exception
     {
-        log.warn("WebSocket 异常, sessionId={}, err={}", session.getId(), error.getMessage());
+        log.info("WebSocket 异常, sessionId={}, err={}", session.getId(), error.getMessage());
         if (session.isOpen())
         {
             // 关闭连接

+ 13 - 13
ruoyi-device/src/main/java/com/ruoyi/device/websocket/TsbWebSocketService.java

@@ -120,7 +120,7 @@ public class TsbWebSocketService
         LoginUser loginUser = tokenService.getLoginUser(token);
         if (loginUser == null || loginUser.getUser() == null)
         {
-            log.warn("WebSocket 鉴权失败:无效 token");
+            log.info("WebSocket 鉴权失败:无效 token");
             if (failReason != null)
             {
                 failReason.append("登录状态无效,请重新登录");
@@ -138,7 +138,7 @@ public class TsbWebSocketService
             String precheckMsg = precheckConnect(userId, deviceSn, loginUser);
             if (precheckMsg != null)
             {
-                log.warn("WebSocket 预检失败:{}, userId={}, deviceSn={}", precheckMsg, userId, deviceSn);
+                log.info("WebSocket 预检失败:{}, userId={}, deviceSn={}", precheckMsg, userId, deviceSn);
                 if (failReason != null)
                 {
                     failReason.append(precheckMsg);
@@ -154,7 +154,7 @@ public class TsbWebSocketService
             // 创建信息map
             if (!TsbWebSocketUsers.tryPut(bind.getDeviceSn(), session))
             {
-                log.warn("WebSocket 注册失败:设备已被占用, deviceSn={}", bind.getDeviceSn());
+                log.info("WebSocket 注册失败:设备已被占用, deviceSn={}", bind.getDeviceSn());
                 if (failReason != null)
                 {
                     failReason.append("该设备已被占用连接,请稍后再试");
@@ -185,14 +185,14 @@ public class TsbWebSocketService
         TsbWebSocketMessage tsbWebSocketMessage = JSON.parseObject(message, TsbWebSocketMessage.class);
         if (tsbWebSocketMessage == null || StringUtils.isEmpty(tsbWebSocketMessage.getCmdType()))
         {
-            log.warn("WebSocket 消息格式无效, sessionId={}, message={}", session.getId(), message);
+            log.info("WebSocket 消息格式无效, sessionId={}, message={}", session.getId(), message);
             return;
         }
         // 2、组装下发所需的消息
         TsbUserDeviceBind bind = getBindFromSession(session);
         if (bind == null || bind.getDeviceSn() == null || StringUtils.isEmpty(bind.getDeviceType()))
         {
-            log.warn("WebSocket 获取用户设备信息失败, sessionId={}, bind={}", session.getId(), bind);
+            log.info("WebSocket 获取用户设备信息失败, sessionId={}, bind={}", session.getId(), bind);
             TsbWebSocketUsers.sendMessageToUserByText(session,
                     TsbWebSocketMessage.fail(tsbWebSocketMessage.getCmdType(), "会话缺少设备绑定信息,请重新连接"));
             return;
@@ -201,7 +201,7 @@ public class TsbWebSocketService
         Long userId = getUserIdFromSession(session);
         if (!hasPagePermission(userPermissions, tsbWebSocketMessage.getCmdType(), userId))
         {
-            log.warn("WebSocket 用户权限不足, sessionId={}, cmdType={}", session.getId(), tsbWebSocketMessage.getCmdType());
+            log.info("WebSocket 用户权限不足, sessionId={}, cmdType={}", session.getId(), tsbWebSocketMessage.getCmdType());
             TsbWebSocketUsers.sendMessageToUserByText(session,
                     TsbWebSocketMessage.fail(tsbWebSocketMessage.getCmdType(), "用户权限不足"));
             return;
@@ -209,14 +209,14 @@ public class TsbWebSocketService
         CmdTypeEnum cmdType = CmdTypeEnum.resolveDownlink(tsbWebSocketMessage.getCmdType());
         if (cmdType == null)
         {
-            log.warn("WebSocket 命令类型无效, sessionId={}, cmdType={}", session.getId(), tsbWebSocketMessage.getCmdType());
+            log.info("WebSocket 命令类型无效, sessionId={}, cmdType={}", session.getId(), tsbWebSocketMessage.getCmdType());
             TsbWebSocketUsers.sendMessageToUserByText(session,
                     TsbWebSocketMessage.fail(tsbWebSocketMessage.getCmdType(), "命令类型无效"));
             return;
         }
         if (!deviceOnlineManager.isOnline(bind.getDeviceSn()))
         {
-            log.warn("WebSocket 设备未在线, sessionId={}, deviceSn={}", session.getId(), bind.getDeviceSn());
+            log.info("WebSocket 设备未在线, sessionId={}, deviceSn={}", session.getId(), bind.getDeviceSn());
             TsbWebSocketUsers.sendMessageToUserByText(session,
                     TsbWebSocketMessage.fail(tsbWebSocketMessage.getCmdType(), "设备未在线"));
             return;
@@ -230,7 +230,7 @@ public class TsbWebSocketService
         }
         if (handler == null)
         {
-            log.warn("未注册 JSON 命令处理器 cmd={}", cmdType);
+            log.info("未注册 JSON 命令处理器 cmd={}", cmdType);
             TsbWebSocketUsers.sendMessageToUserByText(session,
                     TsbWebSocketMessage.fail(tsbWebSocketMessage.getCmdType(), "未实现的服务处理器"));
             return;
@@ -241,7 +241,7 @@ public class TsbWebSocketService
         IEncoder<BaseJsonBody> encoder = (IEncoder<BaseJsonBody>) handlerManager.getEncoder(key);
         if (encoder == null)
         {
-            log.warn("未找到 JSON Body 编码器, deviceSn={}", bind.getDeviceSn());
+            log.info("未找到 JSON Body 编码器, deviceSn={}", bind.getDeviceSn());
             return;
         }
         log.info("MQTT 下行发送, cmdType={}, deviceType={}, deviceSn={}",
@@ -313,19 +313,19 @@ public class TsbWebSocketService
         Long deviceSn = bodyObj.getLong("deviceSn");
         if (deviceSn == null)
         {
-            log.warn("MQTT上行设备SN码无效");
+            log.info("MQTT上行设备SN码无效");
             return;
         }
         if (!deviceOnlineManager.isOnline(deviceSn))
         {
-            log.warn("MQTT上行设备未在线, deviceSn={}", deviceSn);
+            log.info("MQTT上行设备未在线, deviceSn={}", deviceSn);
             return;
         }
         // 2、通过 deviceSn 判断WebSocket是否连接
         Map<Long, Session> sessionUsers = TsbWebSocketUsers.getSessionUsers();
         if (!sessionUsers.containsKey(deviceSn))
         {
-            log.warn("web端用户未操作设备, deviceSn={}", deviceSn);
+            log.info("web端用户未操作设备, deviceSn={}", deviceSn);
             return;
         }
         // 3、发送消息

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/websocket/WebSocketUtils.java

@@ -51,7 +51,7 @@ public final class WebSocketUtils
         }
         catch (IOException e)
         {
-            log.debug("关闭 WebSocket 失败: {}", e.getMessage());
+            log.info("关闭 WebSocket 失败: {}", e.getMessage());
         }
     }
 

+ 3 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java

@@ -403,17 +403,17 @@ public class SysMenuServiceImpl implements ISysMenuService
                 String dbRouteName = StringUtils.isEmpty(sysMenu.getRouteName()) ? dbPath : sysMenu.getRouteName();
                 if (StringUtils.equalsAnyIgnoreCase(path, dbPath) && parentId.longValue() == dbParentId.longValue())
                 {
-                    log.warn("[同级路由冲突] 同级下已存在相同路由路径 '{}',冲突菜单:{}", dbPath, sysMenu.getMenuName());
+                    log.info("[同级路由冲突] 同级下已存在相同路由路径 '{}',冲突菜单:{}", dbPath, sysMenu.getMenuName());
                     return UserConstants.NOT_UNIQUE;
                 }
                 else if (StringUtils.equalsAnyIgnoreCase(path, dbPath) && parentId.longValue() == MENU_ROOT_ID)
                 {
-                    log.warn("[根目录路由冲突] 根目录下路由 '{}' 必须唯一,已被菜单 '{}' 占用", path, sysMenu.getMenuName());
+                    log.info("[根目录路由冲突] 根目录下路由 '{}' 必须唯一,已被菜单 '{}' 占用", path, sysMenu.getMenuName());
                     return UserConstants.NOT_UNIQUE;
                 }
                 else if (StringUtils.equalsAnyIgnoreCase(routeName, dbRouteName))
                 {
-                    log.warn("[路由名称冲突] 路由名称 '{}' 需全局唯一,已被菜单 '{}' 使用", routeName, sysMenu.getMenuName());
+                    log.info("[路由名称冲突] 路由名称 '{}' 需全局唯一,已被菜单 '{}' 使用", routeName, sysMenu.getMenuName());
                     return UserConstants.NOT_UNIQUE;
                 }
             }