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
2e08fe83
Commit
2e08fe83
authored
May 30, 2024
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 微观大数据平台-信号评价曲线图跨天时间排序
parent
9dde2e74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
MainlineEvaluateServiceImpl.java
...t/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
+27
-2
MainlineEvaluateBottomCurveVO.java
.../java/net/wanji/opt/vo/MainlineEvaluateBottomCurveVO.java
+3
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
View file @
2e08fe83
...
...
@@ -652,16 +652,41 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
int
round
=
(
int
)
(
Math
.
round
(
v
));
vo
.
setValue
(
round
);
}
// 排序用
metricTimeStamp
(
vo
,
filteredList
);
res
.
add
(
vo
);
}
}
}
res
.
sort
(
Comparator
.
comparing
(
MainlineEvaluateBottomCurveVO:
:
getMetricTime
));
res
.
sort
(
Comparator
.
comparing
(
MainlineEvaluateBottomCurveVO:
:
getMetricTime
Stamp
));
return
res
;
}
private
void
metricTimeStamp
(
MainlineEvaluateBottomCurveVO
vo
,
List
<
CrossLaneDataHistPOExt
>
filteredList
)
{
CrossLaneDataHistPOExt
po
=
filteredList
.
get
(
0
);
if
(
po
!=
null
)
{
Integer
batchTime
=
po
.
getBatchTime
();
String
metricTime
=
vo
.
getMetricTime
();
long
batchTimeMillis
=
batchTime
*
1000L
;
Date
batchDate
=
new
Date
(
batchTimeMillis
);
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dateFormat
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
// Set timezone to UTC
String
datePart
=
dateFormat
.
format
(
batchDate
);
String
combinedDateTime
=
datePart
+
" "
+
metricTime
;
SimpleDateFormat
dateTimeFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
try
{
Date
finalDate
=
dateTimeFormat
.
parse
(
combinedDateTime
);
long
metricTimeStamp
=
finalDate
.
getTime
();
vo
.
setMetricTimeStamp
(
metricTimeStamp
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
/**
* Rounds the given date to the nearest previous 5-minute interval.
*
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/MainlineEvaluateBottomCurveVO.java
View file @
2e08fe83
...
...
@@ -21,4 +21,7 @@ public class MainlineEvaluateBottomCurveVO {
@ApiModelProperty
(
value
=
"数值"
)
private
Integer
value
;
@ApiModelProperty
(
value
=
"指标时间戳"
)
private
Long
metricTimeStamp
;
}
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