Sfoglia il codice sorgente

添加联网记录

李进 2 anni fa
parent
commit
1641e74b20

+ 2 - 2
device-api-service/src/main/java/com/xy/consumer/connected/ConnectedConsumer.java

@@ -45,10 +45,10 @@ public class ConnectedConsumer implements MqttConsumer {
         } catch (Exception e) {
             return true;
         }
-        String msg = netState == DictSonEnum.DEVICE_ONLINE_STATUS_1.getKeyInt() ? "上线" : "离线";
-        log.info("设备" + msg + "监听:{}", payload);
         ThreadPoolUtils.excPoll(DeviceThreadPoolConfig.DEVICE_NETWORK_POLL, 1)
                 .execute(() -> {
+                    String msg = netState == DictSonEnum.DEVICE_ONLINE_STATUS_1.getKeyInt() ? "上线" : "离线";
+                    log.info("设备" + msg + "监听:{}", payload);
                     //上报状态
                     DeviceStatusDto.Up up = new DeviceStatusDto.Up().setDeviceId(deviceId);
                     up.setNetState(netState);