Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-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
traffic-signal-platform
Commits
9acb81ab
Commit
9acb81ab
authored
Apr 28, 2025
by
fengyasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
路口周报1.1空指针修正
parent
7fdf6bf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
CrossRidLaneServiceImpl.java
...ji/opt/servicev2/report/impl/CrossRidLaneServiceImpl.java
+8
-5
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/report/impl/CrossRidLaneServiceImpl.java
View file @
9acb81ab
...
...
@@ -60,7 +60,10 @@ public class CrossRidLaneServiceImpl implements CrossRidLaneService {
List
<
CrossRidLaneVO
>
crossRidLaneVOS
=
new
ArrayList
<>();
for
(
String
laneName
:
laneNameMap
.
keySet
())
{
List
<
CrossRidLaneDTO
>
laneDTOS
=
laneNameMap
.
get
(
laneName
).
stream
().
filter
(
x
->
x
.
getLaneType
()
==
2
).
collect
(
Collectors
.
toList
());
List
<
CrossRidLaneDTO
>
laneDTOS
=
laneNameMap
.
get
(
laneName
).
stream
().
filter
(
x
->
ObjectUtil
.
isNotEmpty
(
x
.
getLaneType
())
&&
x
.
getLaneType
()
==
2
).
collect
(
Collectors
.
toList
());
if
(
ObjectUtil
.
isEmpty
(
laneDTOS
)){
continue
;
}
CrossRidLaneVO
crossRidLaneVO
=
new
CrossRidLaneVO
();
crossRidLaneVO
.
setLaneName
(
laneName
);
if
(
ObjectUtil
.
isEmpty
(
laneDTOS
.
get
(
0
).
getInDir
())
||
ObjectUtil
.
isEmpty
(
laneDTOS
.
get
(
0
).
getOutDir
()))
{
...
...
@@ -68,14 +71,14 @@ public class CrossRidLaneServiceImpl implements CrossRidLaneService {
}
else
{
crossRidLaneVO
.
setLaneDir
(
CrossDirEnum
.
getDesc
(
laneDTOS
.
get
(
0
).
getInDir
())
+
CrossDirEnum
.
getDesc
(
laneDTOS
.
get
(
0
).
getOutDir
())
+
"走向"
);
}
Map
<
String
,
List
<
CrossRidLaneDTO
>>
endCrossRoadMap
=
laneNameMap
.
get
(
laneName
).
stream
().
filter
(
x
->
x
.
getLaneType
()
==
1
&&
x
.
getCrossId
().
equals
(
x
.
getStartCrossId
())).
collect
(
Collectors
.
groupingBy
(
CrossRidLaneDTO:
:
getEndCrossId
));
Map
<
String
,
List
<
CrossRidLaneDTO
>>
startCrossRoadMap
=
laneNameMap
.
get
(
laneName
).
stream
().
filter
(
x
->
x
.
getLaneType
()
==
1
&&
x
.
getCrossId
().
equals
(
x
.
getEndCrossId
())).
collect
(
Collectors
.
groupingBy
(
CrossRidLaneDTO:
:
getStartCrossId
));
Map
<
String
,
List
<
CrossRidLaneDTO
>>
endCrossRoadMap
=
laneNameMap
.
get
(
laneName
).
stream
().
filter
(
x
->
ObjectUtil
.
isNotEmpty
(
x
.
getLaneType
())
&&
x
.
getLaneType
()
==
1
&&
x
.
getCrossId
().
equals
(
x
.
getStartCrossId
())).
collect
(
Collectors
.
groupingBy
(
CrossRidLaneDTO:
:
getEndCrossId
));
Map
<
String
,
List
<
CrossRidLaneDTO
>>
startCrossRoadMap
=
laneNameMap
.
get
(
laneName
).
stream
().
filter
(
x
->
ObjectUtil
.
isNotEmpty
(
x
.
getLaneType
())
&&
x
.
getLaneType
()
==
1
&&
x
.
getCrossId
().
equals
(
x
.
getEndCrossId
())).
collect
(
Collectors
.
groupingBy
(
CrossRidLaneDTO:
:
getStartCrossId
));
int
maxCount
=
0
;
for
(
String
endCrossId
:
endCrossRoadMap
.
keySet
())
{
for
(
String
startCrossId
:
startCrossRoadMap
.
keySet
())
{
if
(
endCrossId
.
equals
(
startCrossId
))
{
if
(
endCrossId
.
equals
(
startCrossId
))
{
int
count
=
endCrossRoadMap
.
get
(
endCrossId
).
size
()
+
startCrossRoadMap
.
get
(
startCrossId
).
size
();
if
(
count
>
maxCount
)
{
if
(
count
>
maxCount
)
{
maxCount
=
count
;
}
}
...
...
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