Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wj-datacenter-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jinan
wj-datacenter-platform
Commits
12f6403b
Commit
12f6403b
authored
Jul 15, 2024
by
zhoushiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
干线拥堵持续时间单位改为分钟
parent
82a29932
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
LineCongestionIndexMain.java
...i/indicators/task/trajectory/LineCongestionIndexMain.java
+9
-1
No files found.
wj-realtime-computing/src/main/java/com/wanji/indicators/task/trajectory/LineCongestionIndexMain.java
View file @
12f6403b
...
...
@@ -330,6 +330,7 @@ public class LineCongestionIndexMain {
}
Map
<
String
,
Double
>
ridTravelTime
=
new
HashMap
<>();
Map
<
String
,
Double
>
ridFreeTime
=
new
HashMap
<>();
groupByRid
.
forEach
((
k1
,
v1
)
->
{
double
avgTransitTime
=
v1
.
stream
().
mapToDouble
(
SingleCarInfo:
:
getTransitTime
).
average
().
orElse
(
0
)
/
1000
;
double
freeTime
=
v1
.
get
(
0
).
getFreeTime
();
...
...
@@ -343,6 +344,7 @@ public class LineCongestionIndexMain {
String
crossDir
=
v1
.
get
(
0
).
getCrossId
()
+
"_"
+
v1
.
get
(
0
).
getRidDir
()
+
"_"
+
v1
.
get
(
0
).
getRid
();
ridTravelTime
.
put
(
crossDir
,
avgTransitTime
);
ridFreeTime
.
put
(
crossDir
,
freeTime
);
//log.info("路段交通指数rid:{},index:{}", k1, ridIndex);
});
...
...
@@ -358,6 +360,7 @@ public class LineCongestionIndexMain {
lineCongestion
.
setEndTimeFormat
(
DateUtil
.
toDateTime
(
lineCongestion
.
getEndTime
(),
"yyyy-MM-dd HH:mm:ss.SSS"
));
lineCongestion
.
setDetectTime
(
list
.
get
(
0
).
getStartTime
());
lineCongestion
.
setRidTravelTime
(
ridTravelTime
);
lineCongestion
.
setRidFreeTime
(
ridFreeTime
);
lineCongestion
.
setIndex
(
index
);
lineCongestion
.
setTransitTime
(
atomicDoubleTime
.
get
());
...
...
@@ -377,7 +380,8 @@ public class LineCongestionIndexMain {
String
[]
sps
=
agoTime
.
split
(
"_"
);
String
congType
=
sps
[
0
];
if
(
Objects
.
equals
(
congType
,
congestionType
))
{
duration
=
(
System
.
currentTimeMillis
()
-
Long
.
valueOf
(
sps
[
1
]))
/
1000
;
//单位分钟
duration
=
(
System
.
currentTimeMillis
()
-
Long
.
valueOf
(
sps
[
1
]))
/
1000
/
60
;
}
else
{
greenWaveState
.
put
(
key
,
congestionType
+
"_"
+
System
.
currentTimeMillis
());
}
...
...
@@ -385,6 +389,10 @@ public class LineCongestionIndexMain {
greenWaveState
.
put
(
key
,
congestionType
+
"_"
+
System
.
currentTimeMillis
());
}
if
(
duration
<
1
)
{
//持续时间不足1分钟
congestionType
=
CongestEnum
.
NO_CONGEST
.
getCode
();
}
lineCongestion
.
setCongestionType
(
congestionType
);
lineCongestion
.
setGreenWaveId
(
waveId
);
lineCongestion
.
setGreenWaveDir
(
dir
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment