更新老模块没有卫星信号,导致没有定位的问题
This commit is contained in:
parent
17eaba3846
commit
1753133e4f
|
@ -87,7 +87,7 @@ public class DeviceUtil {
|
|||
if (device == null || info == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 设置设备信息
|
||||
if (info.containsKey(DeviceCacheKey.VOLTAGE)) {
|
||||
device.setVoltage(JsonUtils.getBigDecimal(info.get(DeviceCacheKey.VOLTAGE)));
|
||||
|
@ -186,11 +186,13 @@ public class DeviceUtil {
|
|||
|
||||
/**
|
||||
* 卫星信号弱
|
||||
* 仅卫星信号不为空才判断,若为空,则不判断是否弱信号
|
||||
* 因为老模块没有卫星信号
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
public static boolean isLowSatelliteSignal(Integer s) {
|
||||
return s == null || s <= 5;
|
||||
return s != null && s <= 5;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -212,7 +214,7 @@ public class DeviceUtil {
|
|||
* @return
|
||||
*/
|
||||
public static boolean validMobileLocation(BigDecimal lon, BigDecimal lat) {
|
||||
return lon != null && lat != null
|
||||
return lon != null && lat != null
|
||||
&& !MathUtils.equals(lon, BigDecimal.ZERO) && !MathUtils.equals(lat, BigDecimal.ZERO)
|
||||
&& lon.scale() >= 6 && lat.scale() >= 6;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user