fleetmap-reports 1.0.422 → 1.0.423
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/trip-report.js +4 -4
package/package.json
CHANGED
package/src/trip-report.js
CHANGED
|
@@ -10,7 +10,6 @@ const trips = require('./util/trips')
|
|
|
10
10
|
const { isInsideTimetable, addNearestPOIs, isPartialInsideTimetable, calculateTrip, getTripIdleTime } = require('./util/trips')
|
|
11
11
|
const { devicesToProcess } = require('./util/device')
|
|
12
12
|
const { getIdleEvents } = require('./util/route')
|
|
13
|
-
const axios = require('axios')
|
|
14
13
|
|
|
15
14
|
const fileName = 'TripReport'
|
|
16
15
|
|
|
@@ -60,7 +59,7 @@ async function createTripReportByDevice (from, to, userData, traccar) {
|
|
|
60
59
|
trips: tripsData,
|
|
61
60
|
stops: stopsData,
|
|
62
61
|
route: routeData
|
|
63
|
-
}, userData))
|
|
62
|
+
}, userData, traccar))
|
|
64
63
|
}
|
|
65
64
|
deviceCount = deviceCount + slice.length
|
|
66
65
|
}
|
|
@@ -122,7 +121,7 @@ async function createTripReportByDriver (from, to, userData, traccar) {
|
|
|
122
121
|
return { drivers: processDrivers(from, to, userData, { trips: tripsData, route: routeData }) }
|
|
123
122
|
}
|
|
124
123
|
|
|
125
|
-
function processDevices (from, to, devices, data, userData) {
|
|
124
|
+
function processDevices (from, to, devices, data, userData, traccar) {
|
|
126
125
|
const devicesResult = []
|
|
127
126
|
|
|
128
127
|
devices.forEach(d => {
|
|
@@ -159,7 +158,8 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
159
158
|
trip.stopEngineHours = 0
|
|
160
159
|
}
|
|
161
160
|
if (trip.endAddress === null) {
|
|
162
|
-
axios.get(
|
|
161
|
+
traccar.axios.get(`/server/geocode?latitude=${trip.latitude}&longitude=${trip.longitude}`)
|
|
162
|
+
.then(d => { trip.endAddress = d.data })
|
|
163
163
|
}
|
|
164
164
|
})
|
|
165
165
|
|