aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-06 17:06:04 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-10-06 17:06:04 -0700
commitaa4248e73510c14eb64cfbb3c20cf65da805cd50 (patch)
treef15d4828125679ed5eac28feda132354e599ddeb /src/main/java/org/traccar/api
parent87e9932ff6eec10dec78300cd9fb2532d1bfa538 (diff)
downloadtraccar-server-aa4248e73510c14eb64cfbb3c20cf65da805cd50.tar.gz
traccar-server-aa4248e73510c14eb64cfbb3c20cf65da805cd50.tar.bz2
traccar-server-aa4248e73510c14eb64cfbb3c20cf65da805cd50.zip
Implement daily summary report
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/ReportResource.java10
1 files changed, 6 insertions, 4 deletions
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<SummaryReport> getSummary(
@QueryParam("deviceId") final List<Long> deviceIds, @QueryParam("groupId") final List<Long> 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<Long> deviceIds, @QueryParam("groupId") final List<Long> 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);
});
}