1
0

app设备列表查询,新增纬度经度

This commit is contained in:
2025-08-01 11:11:36 +08:00
parent 74be5321ec
commit 51d9d7319a
6 changed files with 43 additions and 10 deletions

View File

@ -141,6 +141,15 @@ public class AppDeviceBizService {
item.setBattery("0");
}
String location = RedisUtils.getCacheObject(GLOBAL_REDIS_KEY+DeviceRedisKeyConstants.DEVICE_LOCATION_KEY_PREFIX + item.getDeviceImei());
// 获取电量
if(StringUtils.isNotBlank(location)){
JSONObject jsonObject = JSONObject.parseObject(location);
item.setLatitude(jsonObject.getString("latitude"));
item.setLongitude(jsonObject.getString("longitude"));
}else{
item.setBattery("0");
}
}
});
}
@ -323,7 +332,8 @@ public class AppDeviceBizService {
}
// 获取经度纬度
String locationInfo = GlobalConstants.GLOBAL_REDIS_KEY+DeviceRedisKeyConstants.DEVICE_LOCATION_KEY_PREFIX + device.getDeviceImei();
String locationKey = GlobalConstants.GLOBAL_REDIS_KEY+DeviceRedisKeyConstants.DEVICE_LOCATION_KEY_PREFIX + device.getDeviceImei();
String locationInfo = RedisUtils.getCacheObject(locationKey);
if(StringUtils.isNotBlank(locationInfo)){
JSONObject jsonObject = JSONObject.parseObject(locationInfo);
vo.setLongitude((String)jsonObject.get("longitude"));