|
|
@@ -45,11 +45,13 @@ public class TblCarInfoServiceImpl implements ITblCarInfoService {
|
|
|
@Override
|
|
|
public TblCarInfoVo queryById(Long id){
|
|
|
TblCarInfoVo carInfoVo = baseMapper.selectVoById(id);
|
|
|
- JSONUtil.parseArray(carInfoVo.getDeviceInfos()).toList(JSONObject.class).forEach(deviceInfo -> {
|
|
|
- if(deviceInfo.getStr("type").equals("gps")){
|
|
|
- carInfoVo.setLocation(RedisUtils.getCacheObject(StringUtils.format("gps_{}", deviceInfo.getStr("code"))));
|
|
|
- }
|
|
|
- });
|
|
|
+ try {
|
|
|
+ JSONUtil.parseArray(carInfoVo.getDeviceInfos()).toList(JSONObject.class).forEach(deviceInfo -> {
|
|
|
+ if(deviceInfo.getStr("type").equals("gps")){
|
|
|
+ carInfoVo.setLocation(RedisUtils.getCacheObject(StringUtils.format("gps_{}", deviceInfo.getStr("code"))));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }catch (Exception e){}
|
|
|
return carInfoVo;
|
|
|
}
|
|
|
|
|
|
@@ -60,14 +62,16 @@ public class TblCarInfoServiceImpl implements ITblCarInfoService {
|
|
|
public TableDataInfo<TblCarInfoVo> queryPageList(TblCarInfoBo bo, PageQuery pageQuery) {
|
|
|
LambdaQueryWrapper<TblCarInfo> lqw = buildQueryWrapper(bo);
|
|
|
Page<TblCarInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
- result.getRecords().forEach(carInfoVo -> {
|
|
|
- JSONUtil.parseArray(carInfoVo.getDeviceInfos()).toList(JSONObject.class).forEach(deviceInfo -> {
|
|
|
- if(deviceInfo.getStr("type").equals("gps")){
|
|
|
- carInfoVo.setLocation(RedisUtils.getCacheObject(StringUtils.format("gps_{}", deviceInfo.getStr("code"))));
|
|
|
- }
|
|
|
+ try {
|
|
|
+ result.getRecords().forEach(carInfoVo -> {
|
|
|
+ JSONUtil.parseArray(carInfoVo.getDeviceInfos()).toList(JSONObject.class).forEach(deviceInfo -> {
|
|
|
+ if(deviceInfo.getStr("type").equals("gps")){
|
|
|
+ carInfoVo.setLocation(RedisUtils.getCacheObject(StringUtils.format("gps_{}", deviceInfo.getStr("code"))));
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
+ }catch (Exception e){}
|
|
|
|
|
|
- });
|
|
|
return TableDataInfo.build(result);
|
|
|
}
|
|
|
|