From 0bbf8f554638cdc89d5dd618c500839554602dee Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 24 Nov 2016 10:45:44 +0500 Subject: - Use one parser - Reverted passing variables way --- src/org/traccar/api/resource/ReportResource.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/org/traccar/api/resource') diff --git a/src/org/traccar/api/resource/ReportResource.java b/src/org/traccar/api/resource/ReportResource.java index e8e80fa2f..e37d6f01d 100644 --- a/src/org/traccar/api/resource/ReportResource.java +++ b/src/org/traccar/api/resource/ReportResource.java @@ -50,7 +50,8 @@ public class ReportResource extends BaseResource { @QueryParam("deviceId") final List deviceIds, @QueryParam("groupId") final List groupIds, @QueryParam("from") String from, @QueryParam("to") String to) throws SQLException, IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); - Route.getExcel(stream, getUserId(), deviceIds, groupIds, from, to); + Route.getExcel(stream, getUserId(), deviceIds, groupIds, + DateUtil.parseDateTime(from), DateUtil.parseDateTime(to)); return Response.ok(stream.toByteArray()) .header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_XLSX).build(); @@ -75,7 +76,8 @@ public class ReportResource extends BaseResource { @QueryParam("type") final List types, @QueryParam("from") String from, @QueryParam("to") String to) throws SQLException, IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); - Events.getExcel(stream, getUserId(), deviceIds, groupIds, types, from, to); + Events.getExcel(stream, getUserId(), deviceIds, groupIds, types, + DateUtil.parseDateTime(from), DateUtil.parseDateTime(to)); return Response.ok(stream.toByteArray()) .header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_XLSX).build(); @@ -98,7 +100,8 @@ public class ReportResource extends BaseResource { @QueryParam("deviceId") final List deviceIds, @QueryParam("groupId") final List groupIds, @QueryParam("from") String from, @QueryParam("to") String to) throws SQLException, IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); - Summary.getExcel(stream, getUserId(), deviceIds, groupIds, from, to); + Summary.getExcel(stream, getUserId(), deviceIds, groupIds, + DateUtil.parseDateTime(from), DateUtil.parseDateTime(to)); return Response.ok(stream.toByteArray()) .header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_XLSX).build(); @@ -121,7 +124,8 @@ public class ReportResource extends BaseResource { @QueryParam("deviceId") final List deviceIds, @QueryParam("groupId") final List groupIds, @QueryParam("from") String from, @QueryParam("to") String to) throws SQLException, IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); - Trips.getExcel(stream, getUserId(), deviceIds, groupIds, from, to); + Trips.getExcel(stream, getUserId(), deviceIds, groupIds, + DateUtil.parseDateTime(from), DateUtil.parseDateTime(to)); return Response.ok(stream.toByteArray()) .header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_XLSX).build(); -- cgit v1.2.3