From 5a6e7582a7978341f3a2de9a81cb63252bca0bb7 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 5 Aug 2016 14:41:53 +0500 Subject: - Moved GeneralReport to separate file - Removed unnecessary getOut function - Added methods sorting --- src/org/traccar/api/resource/ReportResource.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 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 0885a3638..6c5772584 100644 --- a/src/org/traccar/api/resource/ReportResource.java +++ b/src/org/traccar/api/resource/ReportResource.java @@ -13,7 +13,6 @@ import javax.ws.rs.core.Response.ResponseBuilder; import org.traccar.api.BaseResource; import org.traccar.reports.Events; import org.traccar.reports.General; -import org.traccar.reports.ReportUtils; import org.traccar.reports.Route; import org.traccar.web.JsonConverter; @@ -26,8 +25,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 { if (getAcceptHeader().equals("application/ms-excel")) { - ResponseBuilder response = Response.ok(ReportUtils.getOut(Route.getCsv(getUserId(), deviceIds, groupIds, - JsonConverter.parseDate(from), JsonConverter.parseDate(to)))); + ResponseBuilder response = Response.ok(Route.getCsv(getUserId(), deviceIds, groupIds, + JsonConverter.parseDate(from), JsonConverter.parseDate(to))); response.type("application/ms-excel"); return response.build(); } @@ -44,8 +43,8 @@ public class ReportResource extends BaseResource { @QueryParam("type") final List types, @QueryParam("from") String from, @QueryParam("to") String to) throws SQLException { if (getAcceptHeader().equals("application/ms-excel")) { - ResponseBuilder response = Response.ok(ReportUtils.getOut(Events.getCsv(getUserId(), deviceIds, groupIds, - types, JsonConverter.parseDate(from), JsonConverter.parseDate(to)))); + ResponseBuilder response = Response.ok(Events.getCsv(getUserId(), deviceIds, groupIds, + types, JsonConverter.parseDate(from), JsonConverter.parseDate(to))); response.type("application/ms-excel"); return response.build(); } @@ -61,8 +60,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 { if (getAcceptHeader().equals("application/ms-excel")) { - ResponseBuilder response = Response.ok(ReportUtils.getOut(General.getCsv(getUserId(), deviceIds, groupIds, - JsonConverter.parseDate(from), JsonConverter.parseDate(to)))); + ResponseBuilder response = Response.ok(General.getCsv(getUserId(), deviceIds, groupIds, + JsonConverter.parseDate(from), JsonConverter.parseDate(to))); response.type("application/ms-excel"); return response.build(); } -- cgit v1.2.3