diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/reports/RouteReportProvider.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/reports/RouteReportProvider.java b/src/main/java/org/traccar/reports/RouteReportProvider.java index a1d004dd1..5343652b7 100644 --- a/src/main/java/org/traccar/reports/RouteReportProvider.java +++ b/src/main/java/org/traccar/reports/RouteReportProvider.java @@ -50,6 +50,7 @@ public class RouteReportProvider { private final Config config; private final ReportUtils reportUtils; private final Storage storage; + private final Map<String, Integer> namesCount = new HashMap<>(); @Inject @@ -72,9 +73,10 @@ public class RouteReportProvider { private String getUniqueSheetName(String key) { - namesCount.compute(key, (k, value) -> (value == null) ? 1 : (value + 1)); - return (namesCount.get(key) > 1 ? key + "-" + namesCount.get(key) : key); + namesCount.compute(key, (k, value) -> value == null ? 1 : (value + 1)); + return namesCount.get(key) > 1 ? key + '-' + namesCount.get(key) : key; } + public void getExcel(OutputStream outputStream, long userId, Collection<Long> deviceIds, Collection<Long> groupIds, Date from, Date to) throws StorageException, IOException { |