From bf8a7aac4921d17c086e6d35e44a1bc2e37888b8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 1 Aug 2017 16:14:15 +1200 Subject: Option to limit report period --- src/org/traccar/reports/Stops.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/reports/Stops.java') 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) result; } - public static Collection getObjects(long userId, Collection deviceIds, Collection groupIds, + public static Collection getObjects( + long userId, Collection deviceIds, Collection groupIds, Date from, Date to) throws SQLException { + ReportUtils.checkPeriodLimit(from, to); ArrayList 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 deviceIds, Collection groupIds, + public static void getExcel( + OutputStream outputStream, long userId, Collection deviceIds, Collection groupIds, Date from, Date to) throws SQLException, IOException { + ReportUtils.checkPeriodLimit(from, to); ArrayList devicesStops = new ArrayList<>(); ArrayList sheetNames = new ArrayList<>(); for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) { -- cgit v1.2.3