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
signal
traffic-signal-platform
Commits
fda6a763
Commit
fda6a763
authored
Feb 08, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 优化监测优化次数更新
parent
d3bbe9c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+7
-12
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
fda6a763
...
...
@@ -212,7 +212,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
log
.
error
(
"优化策略查询失败:"
,
e
);
JsonViewObject
.
newInstance
().
fail
(
"优化策略查询失败"
);
}
List
<
StrategyControlHistVO
>
sorted
=
results
.
stream
().
sorted
(
Comparator
.
comparing
(
StrategyControlHistVO:
:
getOptTime
).
reversed
()).
collect
(
Collectors
.
toList
());
List
<
StrategyControlHistVO
>
sorted
=
results
.
stream
().
sorted
(
Comparator
.
comparing
(
StrategyControlHistVO:
:
getOptTime
).
reversed
())
.
limit
(
3000
).
collect
(
Collectors
.
toList
());
return
JsonViewObject
.
newInstance
().
success
(
sorted
);
}
...
...
@@ -388,7 +389,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
@Override
public
JsonViewObject
strategyOptTimes
()
throws
Exception
{
public
JsonViewObject
strategyOptTimes
()
throws
Exception
{
String
timeUrl
=
"http://37.12.182.29:15020/decisionPage/MonitorStrategyOptimizationInfo/getData"
;
String
timeResult
=
OkHttpClientUtil
.
get
(
timeUrl
);
ObjectMapper
mapper
=
JacksonUtils
.
getInstance
();
...
...
@@ -398,21 +399,15 @@ public class StrategyControlServiceImpl implements StrategyControlService {
List
<
StrategyOptTimesDTO
.
Detail
>
content
=
dto
.
getContent
();
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Double
totalTime
=
0.0
;
int
count
=
0
;
for
(
StrategyOptTimesDTO
.
Detail
item
:
content
)
{
totalTime
+=
item
.
getOptimizeTime
();
count
+=
item
.
getExecuteNum
();
}
Double
temp
=
Math
.
floor
(
totalTime
/
3600
);
strategyOptTimesVO
.
set
Times
(
temp
.
intValue
()
);
strategyOptTimesVO
.
setTimes
(
totalTime
.
intValue
()
);
strategyOptTimesVO
.
set
Count
(
count
);
}
}
String
countUrl
=
"http://37.12.182.29:15020/decisionPage/MonitorRadarIndicatorsInfo/getRadarCountData"
;
String
countResult
=
OkHttpClientUtil
.
get
(
countUrl
);
if
(
StringUtils
.
isNotBlank
(
countResult
))
{
StrategyOptCountDTO
strategyOptCountDTO
=
mapper
.
readValue
(
countResult
,
StrategyOptCountDTO
.
class
);
StrategyOptCountDTO
.
Detail
content
=
strategyOptCountDTO
.
getContent
();
int
count
=
content
.
getCongestionNum
()
+
content
.
getEmptyPassNum
()
+
content
.
getSpilloverNum
()
+
content
.
getUnbalanceNum
();
strategyOptTimesVO
.
setCount
(
count
);
}
return
JsonViewObject
.
newInstance
().
success
(
strategyOptTimesVO
);
}
...
...
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