fleetmap-reports 1.0.289 → 1.0.290
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/.idea/aws.xml +17 -0
- package/.idea/codeStyles/Project.xml +7 -0
- package/{fleetmap-reports.iml → .idea/fleetmap-reports.iml} +2 -1
- package/.idea/jsLibraryMappings.xml +1 -1
- package/.idea/modules.xml +1 -1
- package/.idea/vcs.xml +1 -1
- package/package.json +1 -1
- package/src/speeding-report.js +5 -2
package/.idea/aws.xml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="accountSettings">
|
|
4
|
+
<option name="activeProfile" value="profile:default" />
|
|
5
|
+
<option name="activeRegion" value="us-east-1" />
|
|
6
|
+
<option name="recentlyUsedProfiles">
|
|
7
|
+
<list>
|
|
8
|
+
<option value="profile:default" />
|
|
9
|
+
</list>
|
|
10
|
+
</option>
|
|
11
|
+
<option name="recentlyUsedRegions">
|
|
12
|
+
<list>
|
|
13
|
+
<option value="us-east-1" />
|
|
14
|
+
</list>
|
|
15
|
+
</option>
|
|
16
|
+
</component>
|
|
17
|
+
</project>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
3
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
4
|
<exclude-output />
|
|
5
5
|
<content url="file://$MODULE_DIR$" />
|
|
6
|
+
<orderEntry type="inheritedJdk" />
|
|
6
7
|
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
8
|
</component>
|
|
8
9
|
</module>
|
package/.idea/modules.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ProjectModuleManager">
|
|
4
4
|
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/fleetmap-reports.iml" filepath="$PROJECT_DIR$/.idea/fleetmap-reports.iml" />
|
|
6
6
|
</modules>
|
|
7
7
|
</component>
|
|
8
8
|
</project>
|
package/.idea/vcs.xml
CHANGED
package/package.json
CHANGED
package/src/speeding-report.js
CHANGED
|
@@ -19,7 +19,6 @@ const fileName = 'SpeedingReport'
|
|
|
19
19
|
const eventTypes = ['deviceOverspeed']
|
|
20
20
|
|
|
21
21
|
async function createSpeedingReport(from, to, reportUserData, traccar) {
|
|
22
|
-
console.log('Create SpeedingReport')
|
|
23
22
|
traccarInstance = traccar
|
|
24
23
|
userData = reportUserData
|
|
25
24
|
const reportData = []
|
|
@@ -34,7 +33,7 @@ async function createSpeedingReport(from, to, reportUserData, traccar) {
|
|
|
34
33
|
const allData = await createSpeedingReportByGroup(from, to)
|
|
35
34
|
reportData.push(...allData)
|
|
36
35
|
} else {
|
|
37
|
-
console.log("
|
|
36
|
+
console.log("createSpeedingReportByDevice")
|
|
38
37
|
const allData = await createSpeedingReportByDevice(from, to, userData.devices)
|
|
39
38
|
reportData.push(allData)
|
|
40
39
|
}
|
|
@@ -239,6 +238,10 @@ async function getHereEvents(devices, routes, threshold){
|
|
|
239
238
|
const events = []
|
|
240
239
|
for (const d of devices) {
|
|
241
240
|
const positions = routes.filter(p => p.deviceId === d.id)
|
|
241
|
+
if (!positions.length) {
|
|
242
|
+
console.log('no positions on device', d.name)
|
|
243
|
+
continue
|
|
244
|
+
}
|
|
242
245
|
try {
|
|
243
246
|
const results = await here.routeMatch(positions)
|
|
244
247
|
const hereAlerts = results.filter(r => r.currentSpeedKmh > (parseInt(r.speedLimit) + threshold)).map(r => {
|