谭斌 2 năm trước cách đây
mục cha
commit
70f4a39e80

+ 5 - 1
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -606,7 +606,11 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
                 //联网状态
                 //联网状态
                 Integer netState = deviceStatus == null ? DeviceNetSateType.DISCONNECT.getCode() : deviceStatus.getNetState();
                 Integer netState = deviceStatus == null ? DeviceNetSateType.DISCONNECT.getCode() : deviceStatus.getNetState();
                 device.setNetState(netState);
                 device.setNetState(netState);
-                device.setNetStateName(netState == null ? StrUtil.EMPTY : DeviceNetSateType.getEnumByCode(deviceStatus.getNetState()).getDescription());
+                if (netState == null) {
+                    device.setNetStateName(StrUtil.EMPTY);
+                } else {
+                    device.setNetStateName(DeviceNetSateType.getEnumByCode(deviceStatus.getNetState()).getDescription());
+                }
 
 
             });
             });
             vo.setDeviceInfos(deviceInfos);
             vo.setDeviceInfos(deviceInfos);