fleetmap-reports 1.0.840 → 1.0.842
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
CHANGED
|
@@ -2,8 +2,10 @@ const automaticReports = require('../automaticReports')
|
|
|
2
2
|
const traccarHelper = require('../util/traccar')
|
|
3
3
|
const distance = require('@turf/distance')
|
|
4
4
|
|
|
5
|
+
const minDistance = 5000
|
|
6
|
+
|
|
5
7
|
async function createGPSJumpReport (from, to, userData, traccar) {
|
|
6
|
-
|
|
8
|
+
let reportData = []
|
|
7
9
|
|
|
8
10
|
const devices = userData.devices
|
|
9
11
|
|
|
@@ -14,7 +16,7 @@ async function createGPSJumpReport (from, to, userData, traccar) {
|
|
|
14
16
|
|
|
15
17
|
slice.forEach(d => {
|
|
16
18
|
const deviceData = getDeviceData(allInOne, d)
|
|
17
|
-
reportData.
|
|
19
|
+
reportData = reportData.concat(deviceData)
|
|
18
20
|
})
|
|
19
21
|
|
|
20
22
|
deviceCount = deviceCount + slice.length
|
|
@@ -41,7 +43,7 @@ function getDeviceData (allInOne, d) {
|
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
return undefined
|
|
44
|
-
})
|
|
46
|
+
}).filter(a => a && minDistance < a.distance)
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
exports.createGPSJumpReport = createGPSJumpReport
|