1
0

代码优化2

This commit is contained in:
2025-07-31 19:03:04 +08:00
parent 370783b457
commit 74be5321ec
4 changed files with 50 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import com.fuyuanshen.app.domain.vo.AppPersonnelInfoVo;
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
import com.fuyuanshen.app.mapper.AppPersonnelInfoMapper;
import com.fuyuanshen.app.mapper.equipment.APPDeviceMapper;
import com.fuyuanshen.common.core.constant.GlobalConstants;
import com.fuyuanshen.common.core.exception.ServiceException;
import com.fuyuanshen.common.core.utils.ImageToCArrayConverter;
import com.fuyuanshen.common.core.utils.MapstructUtils;
@ -320,6 +321,16 @@ public class AppDeviceBizService {
}else{
vo.setBatteryPercentage("0");
}
// 获取经度纬度
String locationInfo = GlobalConstants.GLOBAL_REDIS_KEY+DeviceRedisKeyConstants.DEVICE_LOCATION_KEY_PREFIX + device.getDeviceImei();
if(StringUtils.isNotBlank(locationInfo)){
JSONObject jsonObject = JSONObject.parseObject(locationInfo);
vo.setLongitude((String)jsonObject.get("longitude"));
vo.setLatitude((String)jsonObject.get("latitude"));
vo.setAddress((String)jsonObject.get("address"));
}
return vo;
}