类型映射、空列表允许

This commit is contained in:
attiya 2025-05-14 11:07:37 +08:00
parent ac2848d647
commit 3f5e3afc64
2 changed files with 7 additions and 5 deletions

View File

@ -86,7 +86,7 @@ public class RspBikeInfo {
*/ */
private String bikeNumber; private String bikeNumber;
private double longitude; private Double longitude;
private double latitude; private Double latitude;
} }

View File

@ -204,9 +204,11 @@ public class EbikeOperationRegionServiceImpl extends ServiceImpl<EbikeOperationR
}); });
bikeInfos.forEach(rspBikeInfo -> { bikeInfos.forEach(rspBikeInfo -> {
if (map.containsKey(rspBikeInfo.getEcuSn())) {
ResGPSDto gpsDto = map.get(rspBikeInfo.getEcuSn()); ResGPSDto gpsDto = map.get(rspBikeInfo.getEcuSn());
rspBikeInfo.setLongitude(gpsDto.getLongitude()); rspBikeInfo.setLongitude(gpsDto.getLongitude());
rspBikeInfo.setLatitude(gpsDto.getLatitude()); rspBikeInfo.setLatitude(gpsDto.getLatitude());
}
}); });
return bikeInfos; return bikeInfos;
} }