Commit 01b3cdc5 by 杨林龙

1.9.0 仲利车辆列表增加最后定位时间字段-- 优化空指针判断逻辑

1 parent 3c9199e6
...@@ -1063,11 +1063,10 @@ public class VehicleService extends AbstractCommonService { ...@@ -1063,11 +1063,10 @@ public class VehicleService extends AbstractCommonService {
} }
// 查询设备最后定位点数据 // 查询设备最后定位点数据
List<String> snList = vehicleInfoList.stream().map(VehicleInfoPageDTO::getSn).filter(Objects::nonNull) List<String> snList = vehicleInfoList.stream().map(VehicleInfoPageDTO::getSn).filter(Objects::nonNull).collect(Collectors.toList());
.collect(Collectors.toList());
Map<String, DeviceLocation> deviceLocationMap = Maps.newHashMap(); Map<String, DeviceLocation> deviceLocationMap = Maps.newHashMap();
List<DeviceLocation> deviceLocationList = deviceLocationMapper.findLocationListBySnList(snList); if (CollectionUtils.isNotEmpty(snList)) {
if (CollectionUtils.isNotEmpty(deviceLocationList)) { List<DeviceLocation> deviceLocationList = deviceLocationMapper.findLocationListBySnList(snList);
deviceLocationMap = deviceLocationList.stream().collect(Collectors.toMap(DeviceLocation::getSn, Function.identity(), (k1, k2) -> k2)); deviceLocationMap = deviceLocationList.stream().collect(Collectors.toMap(DeviceLocation::getSn, Function.identity(), (k1, k2) -> k2));
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!