fleetmap-reports 1.0.500 → 1.0.502
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 +21 -10
- package/src/util/traccar.js +1 -0
package/package.json
CHANGED
package/src/location-report.js
CHANGED
|
@@ -113,21 +113,32 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
113
113
|
for (const d of devices) {
|
|
114
114
|
const positions = data.route.filter(t => t.deviceId === d.id)
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
const lighterPositions = positions.map(p => {
|
|
117
|
+
return {
|
|
118
|
+
id: p.id,
|
|
119
|
+
fixTime: p.fixTime,
|
|
120
|
+
address: p.address,
|
|
121
|
+
speed: p.speed,
|
|
122
|
+
latitude: p.latitude,
|
|
123
|
+
longitude: p.longitude,
|
|
124
|
+
attributes: {
|
|
125
|
+
driverUniqueId: p.attributes.driverUniqueId,
|
|
126
|
+
temp1: p.attributes.temp1,
|
|
127
|
+
temp2: p.attributes.temp2,
|
|
128
|
+
door1: p.attributes.door1,
|
|
129
|
+
door2: p.attributes.door2,
|
|
130
|
+
sensor: p.attributes.sensor,
|
|
131
|
+
rain: p.attributes.rain,
|
|
132
|
+
ignition: p.attributes.ignition
|
|
121
133
|
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (positions.length > 0) {
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
if (lighterPositions.length > 0) {
|
|
126
137
|
devicesResult.push({
|
|
127
138
|
device: d,
|
|
128
139
|
from,
|
|
129
140
|
to,
|
|
130
|
-
positions
|
|
141
|
+
positions: lighterPositions
|
|
131
142
|
})
|
|
132
143
|
}
|
|
133
144
|
}
|
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,
|