From 5e690d9b586c191bc620260a2b7551d52f8d28a2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 3 Feb 2023 14:19:38 -0800 Subject: Filter no location events --- src/main/java/org/traccar/reports/CombinedReportProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/reports/CombinedReportProvider.java b/src/main/java/org/traccar/reports/CombinedReportProvider.java index d47a91bef..afe146e91 100644 --- a/src/main/java/org/traccar/reports/CombinedReportProvider.java +++ b/src/main/java/org/traccar/reports/CombinedReportProvider.java @@ -63,10 +63,11 @@ public class CombinedReportProvider { new Condition.Equals("deviceId", device.getId()), new Condition.Between("eventTime", "from", from, "to", to)), new Order("eventTime"))); - item.setEvents(events); + item.setEvents(events.stream() + .filter(p -> p.getPositionId() > 0) + .collect(Collectors.toList())); var eventPositions = events.stream() .map(Event::getPositionId) - .filter(positionId -> positionId > 0) .collect(Collectors.toSet()); item.setPositions(positions.stream() .filter(p -> eventPositions.contains(p.getId())) -- cgit v1.2.3