fleetmap-reports 1.0.500 → 1.0.501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/location-report.js +22 -1
- package/src/util/traccar.js +1 -0
package/package.json
CHANGED
package/src/location-report.js
CHANGED
|
@@ -122,12 +122,33 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
122
122
|
})
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
const simplePosition = positions.map(p => {
|
|
126
|
+
return {
|
|
127
|
+
id: p.id,
|
|
128
|
+
fixTime: p.fixTime,
|
|
129
|
+
address: p.address,
|
|
130
|
+
speed: p.speed,
|
|
131
|
+
driverName: p.driverName,
|
|
132
|
+
latitude: p.latitude,
|
|
133
|
+
longitude: p.longitude,
|
|
134
|
+
attributes: {
|
|
135
|
+
temp1: p.attribute.temp1,
|
|
136
|
+
temp2: p.attribute.temp2,
|
|
137
|
+
door1: p.attribute.door1,
|
|
138
|
+
door2: p.attribute.door2,
|
|
139
|
+
sensor: p.attribute.sensor,
|
|
140
|
+
rain: p.attribute.rain,
|
|
141
|
+
ignition: p.attribute.ignition
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
|
|
125
146
|
if (positions.length > 0) {
|
|
126
147
|
devicesResult.push({
|
|
127
148
|
device: d,
|
|
128
149
|
from,
|
|
129
150
|
to,
|
|
130
|
-
|
|
151
|
+
simplePosition
|
|
131
152
|
})
|
|
132
153
|
}
|
|
133
154
|
}
|
package/src/util/traccar.js
CHANGED
|
@@ -91,6 +91,7 @@ async function getAllInOne (
|
|
|
91
91
|
const requests = []
|
|
92
92
|
for (const _chunk of automaticReports.sliceArray(chunk, devicesPerRequest)) {
|
|
93
93
|
const u = url + '&' + _chunk.map(d => `deviceId=${d.id}`).join('&')
|
|
94
|
+
console.log(u)
|
|
94
95
|
requests.push(
|
|
95
96
|
traccar.axios.get(u, {
|
|
96
97
|
jar: traccar.cookieJar,
|