武汉8号线列车位置显示功能

This commit is contained in:
tiger_zhou 2022-09-07 18:12:32 +08:00
parent caf12a6cee
commit 5916cd765e

View File

@ -98,7 +98,7 @@ public class TrainPositionService {
List<Section> list = ROAD_TYPE_CACHE.getIfPresent(roadType); List<Section> list = ROAD_TYPE_CACHE.getIfPresent(roadType);
if(Objects.equals(true,CollectionUtils.isEmpty(list))){ if(Objects.equals(true,CollectionUtils.isEmpty(list))){
list = sim.getRepository().getSectionList(); list = sim.getRepository().getSectionList();
list = list.stream().filter(d->d.getRoadType() == roadType) list = list.stream().filter(d->d.getRoadType() == roadType && Objects.nonNull(d.getKmMin()))
.sorted(Comparator.comparing(Section::getKmMin)).collect(Collectors.toList()); .sorted(Comparator.comparing(Section::getKmMin)).collect(Collectors.toList());
ROAD_TYPE_CACHE.put(roadType,list); ROAD_TYPE_CACHE.put(roadType,list);
} }