From aa4248e73510c14eb64cfbb3c20cf65da805cd50 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 6 Oct 2020 17:06:04 -0700 Subject: Implement daily summary report --- src/main/java/org/traccar/api/resource/ReportResource.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/org/traccar/api') diff --git a/src/main/java/org/traccar/api/resource/ReportResource.java b/src/main/java/org/traccar/api/resource/ReportResource.java index 7e9ce702e..7347bfd64 100644 --- a/src/main/java/org/traccar/api/resource/ReportResource.java +++ b/src/main/java/org/traccar/api/resource/ReportResource.java @@ -144,9 +144,10 @@ public class ReportResource extends BaseResource { @GET public Collection getSummary( @QueryParam("deviceId") final List deviceIds, @QueryParam("groupId") final List groupIds, - @QueryParam("from") Date from, @QueryParam("to") Date to) throws SQLException { + @QueryParam("from") Date from, @QueryParam("to") Date to, @QueryParam("daily") boolean daily) + throws SQLException { LogAction.logReport(getUserId(), "summary", from, to, deviceIds, groupIds); - return Summary.getObjects(getUserId(), deviceIds, groupIds, from, to); + return Summary.getObjects(getUserId(), deviceIds, groupIds, from, to, daily); } @Path("summary") @@ -154,11 +155,12 @@ public class ReportResource extends BaseResource { @Produces(XLSX) public Response getSummaryExcel( @QueryParam("deviceId") final List deviceIds, @QueryParam("groupId") final List groupIds, - @QueryParam("from") Date from, @QueryParam("to") Date to, @QueryParam("mail") boolean mail) + @QueryParam("from") Date from, @QueryParam("to") Date to, @QueryParam("daily") boolean daily, + @QueryParam("mail") boolean mail) throws SQLException, IOException { return executeReport(getUserId(), mail, stream -> { LogAction.logReport(getUserId(), "summary", from, to, deviceIds, groupIds); - Summary.getExcel(stream, getUserId(), deviceIds, groupIds, from, to); + Summary.getExcel(stream, getUserId(), deviceIds, groupIds, from, to, daily); }); } -- cgit v1.2.3