diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-01 10:35:31 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-01 10:35:31 +0500 |
commit | 1ea8569eb87a714d6b2e2b817d05190dd3784384 (patch) | |
tree | 81c7a40ec551810fb97689fac65eeb57ae353eab /src/org/traccar/reports/Route.java | |
parent | 12ddac1b181692a1e32a1a26e9189ab3091dd4bc (diff) | |
download | trackermap-server-1ea8569eb87a714d6b2e2b817d05190dd3784384.tar.gz trackermap-server-1ea8569eb87a714d6b2e2b817d05190dd3784384.tar.bz2 trackermap-server-1ea8569eb87a714d6b2e2b817d05190dd3784384.zip |
Remove json conversion in reports
Diffstat (limited to 'src/org/traccar/reports/Route.java')
-rw-r--r-- | src/org/traccar/reports/Route.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/org/traccar/reports/Route.java b/src/org/traccar/reports/Route.java index 6992c89cc..4226d05ef 100644 --- a/src/org/traccar/reports/Route.java +++ b/src/org/traccar/reports/Route.java @@ -26,9 +26,6 @@ import java.util.Collection; import java.util.Date; import java.util.List; -import javax.json.Json; -import javax.json.JsonArrayBuilder; - import org.jxls.area.Area; import org.jxls.builder.xls.XlsCommentAreaBuilder; import org.jxls.common.CellRef; @@ -41,23 +38,20 @@ import org.traccar.model.Device; import org.traccar.model.Group; import org.traccar.model.Position; import org.traccar.reports.model.DeviceReport; -import org.traccar.web.JsonConverter; public final class Route { private Route() { } - public static String getJson(long userId, Collection<Long> deviceIds, Collection<Long> groupIds, + public static Collection<Position> getObjects(long userId, Collection<Long> deviceIds, Collection<Long> groupIds, Date from, Date to) throws SQLException { - JsonArrayBuilder json = Json.createArrayBuilder(); + ArrayList<Position> result = new ArrayList<>(); for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) { Context.getPermissionsManager().checkDevice(userId, deviceId); - for (Position position : Context.getDataManager().getPositions(deviceId, from, to)) { - json.add(JsonConverter.objectToJson(position)); - } + result.addAll(Context.getDataManager().getPositions(deviceId, from, to)); } - return json.build().toString(); + return result; } public static void getExcel(OutputStream outputStream, |