aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports/Stops.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-01 16:14:15 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-08-01 16:14:15 +1200
commitbf8a7aac4921d17c086e6d35e44a1bc2e37888b8 (patch)
tree166787aa64665c8699c16b17382ae1ec68035bea /src/org/traccar/reports/Stops.java
parentb65dd20c5e8c7fc9b26cb27154394d2afdbd5316 (diff)
downloadtrackermap-server-bf8a7aac4921d17c086e6d35e44a1bc2e37888b8.tar.gz
trackermap-server-bf8a7aac4921d17c086e6d35e44a1bc2e37888b8.tar.bz2
trackermap-server-bf8a7aac4921d17c086e6d35e44a1bc2e37888b8.zip
Option to limit report period
Diffstat (limited to 'src/org/traccar/reports/Stops.java')
-rw-r--r--src/org/traccar/reports/Stops.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/reports/Stops.java b/src/org/traccar/reports/Stops.java
index 886fd7915..ee6746e4e 100644
--- a/src/org/traccar/reports/Stops.java
+++ b/src/org/traccar/reports/Stops.java
@@ -55,8 +55,10 @@ public final class Stops {
return (Collection<StopReport>) result;
}
- public static Collection<StopReport> getObjects(long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
+ public static Collection<StopReport> getObjects(
+ long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
Date from, Date to) throws SQLException {
+ ReportUtils.checkPeriodLimit(from, to);
ArrayList<StopReport> result = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
Context.getPermissionsManager().checkDevice(userId, deviceId);
@@ -65,9 +67,10 @@ public final class Stops {
return result;
}
- public static void getExcel(OutputStream outputStream,
- long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
+ public static void getExcel(
+ OutputStream outputStream, long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
Date from, Date to) throws SQLException, IOException {
+ ReportUtils.checkPeriodLimit(from, to);
ArrayList<DeviceReport> devicesStops = new ArrayList<>();
ArrayList<String> sheetNames = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {