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
9b76d884
Commit
9b76d884
authored
Nov 17, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
路口级别拥堵划分拥堵等级
parent
ecbc6337
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
CarTrajectoryIndexMain.java
...ji/indicators/task/trajectory/CarTrajectoryIndexMain.java
+1
-1
MergeCongestionFunction.java
...icators/task/trajectory/func/MergeCongestionFunction.java
+18
-1
No files found.
wj-realtime-computing/src/main/java/com/wanji/indicators/task/trajectory/CarTrajectoryIndexMain.java
View file @
9b76d884
...
...
@@ -475,7 +475,7 @@ public class CarTrajectoryIndexMain {
new
JdbcStatementBuilder
<
CongestionResult
>()
{
@Override
public
void
accept
(
PreparedStatement
preparedStatement
,
CongestionResult
carRecordInfo
)
throws
SQLException
{
preparedStatement
.
setString
(
1
,
"505"
);
preparedStatement
.
setString
(
1
,
carRecordInfo
.
getCongestionType
()
);
preparedStatement
.
setString
(
2
,
carRecordInfo
.
getCrossId
());
preparedStatement
.
setString
(
3
,
"5"
);
preparedStatement
.
setTimestamp
(
4
,
new
Timestamp
(
carRecordInfo
.
getStartTime
()));
...
...
wj-realtime-computing/src/main/java/com/wanji/indicators/task/trajectory/func/MergeCongestionFunction.java
View file @
9b76d884
package
com
.
wanji
.
indicators
.
task
.
trajectory
.
func
;
import
com.wanji.indicators.constant.CongestEnum
;
import
com.wanji.indicators.task.trajectory.CarTrajectoryIndexMain
;
import
com.wanji.indicators.task.trajectory.pojo.CongestionResult
;
import
com.wanji.indicators.task.trajectory.pojo.StartDuration
;
...
...
@@ -91,6 +92,23 @@ public class MergeCongestionFunction extends ProcessFunction<CongestionResult, C
String
crossStateKey
=
crossId
;
if
(
isCrossCongestion
)
{
String
indexName
;
String
congestionType
;
if
(
crossIndex
<=
2.0
)
{
indexName
=
"轻度拥堵"
;
congestionType
=
CongestEnum
.
LIGHT_CONGEST
.
getType
();
}
else
if
(
crossIndex
<=
3.0
)
{
indexName
=
"中度拥堵"
;
congestionType
=
CongestEnum
.
MODERATE_CONGEST
.
getType
();
}
else
{
indexName
=
"重度拥堵"
;
congestionType
=
CongestEnum
.
HEAVY_CONGEST
.
getType
();
}
congestionResult
.
setIndexName
(
indexName
);
congestionResult
.
setCongestionType
(
congestionType
);
// 保存状态
try
{
if
(!
crossState
.
contains
(
crossStateKey
))
{
StartDuration
startDuration
=
new
StartDuration
();
...
...
@@ -116,7 +134,6 @@ public class MergeCongestionFunction extends ProcessFunction<CongestionResult, C
congestionResult
.
setDuration
(
durationInt
);
crossState
.
put
(
crossStateKey
,
startDuration
);
}
congestionResult
.
setIndexName
(
"拥堵"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
...
...
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