fleetmap-reports 1.0.501 → 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 +11 -21
package/package.json
CHANGED
package/src/location-report.js
CHANGED
|
@@ -113,42 +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
|
-
positions.forEach(p => {
|
|
118
|
-
const driver = userData.drivers.find(d => d.uniqueId === p.attributes.driverUniqueId)
|
|
119
|
-
if (driver) {
|
|
120
|
-
p.driverName = driver.name
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const simplePosition = positions.map(p => {
|
|
116
|
+
const lighterPositions = positions.map(p => {
|
|
126
117
|
return {
|
|
127
118
|
id: p.id,
|
|
128
119
|
fixTime: p.fixTime,
|
|
129
120
|
address: p.address,
|
|
130
121
|
speed: p.speed,
|
|
131
|
-
driverName: p.driverName,
|
|
132
122
|
latitude: p.latitude,
|
|
133
123
|
longitude: p.longitude,
|
|
134
124
|
attributes: {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
|
142
133
|
}
|
|
143
134
|
}
|
|
144
135
|
})
|
|
145
|
-
|
|
146
|
-
if (positions.length > 0) {
|
|
136
|
+
if (lighterPositions.length > 0) {
|
|
147
137
|
devicesResult.push({
|
|
148
138
|
device: d,
|
|
149
139
|
from,
|
|
150
140
|
to,
|
|
151
|
-
|
|
141
|
+
positions: lighterPositions
|
|
152
142
|
})
|
|
153
143
|
}
|
|
154
144
|
}
|