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
f280d8ac
Commit
f280d8ac
authored
May 30, 2024
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 微观大数据平台-信号评价曲线图跨天时间排序
parent
2e08fe83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
5 deletions
+79
-5
MainlineEvaluateServiceImpl.java
...t/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
+79
-5
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
View file @
f280d8ac
...
@@ -308,7 +308,8 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
...
@@ -308,7 +308,8 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
int
round
=
(
int
)
(
Math
.
round
(
v
));
int
round
=
(
int
)
(
Math
.
round
(
v
));
vo
.
setValue
(
round
);
vo
.
setValue
(
round
);
}
}
// 排序用
metricTimeStampCross
(
vo
,
filteredList
);
res
.
add
(
vo
);
res
.
add
(
vo
);
}
}
}
else
if
(
scope
==
1
)
{
// 进口道
}
else
if
(
scope
==
1
)
{
// 进口道
...
@@ -419,7 +420,8 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
...
@@ -419,7 +420,8 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
int
round
=
(
int
)
(
Math
.
round
(
v
));
int
round
=
(
int
)
(
Math
.
round
(
v
));
vo
.
setValue
(
round
);
vo
.
setValue
(
round
);
}
}
// 排序用
metricTimeStampDir
(
vo
,
filteredList
);
res
.
add
(
vo
);
res
.
add
(
vo
);
}
}
}
}
...
@@ -533,7 +535,8 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
...
@@ -533,7 +535,8 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
int
round
=
(
int
)
(
Math
.
round
(
v
));
int
round
=
(
int
)
(
Math
.
round
(
v
));
vo
.
setValue
(
round
);
vo
.
setValue
(
round
);
}
}
// 排序用
metricTimeStampTurn
(
vo
,
filteredList
);
res
.
add
(
vo
);
res
.
add
(
vo
);
}
}
}
}
...
@@ -653,7 +656,7 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
...
@@ -653,7 +656,7 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
vo
.
setValue
(
round
);
vo
.
setValue
(
round
);
}
}
// 排序用
// 排序用
metricTimeStamp
(
vo
,
filteredList
);
metricTimeStamp
Lane
(
vo
,
filteredList
);
res
.
add
(
vo
);
res
.
add
(
vo
);
}
}
}
}
...
@@ -663,7 +666,78 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
...
@@ -663,7 +666,78 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
return
res
;
return
res
;
}
}
private
void
metricTimeStamp
(
MainlineEvaluateBottomCurveVO
vo
,
List
<
CrossLaneDataHistPOExt
>
filteredList
)
{
private
void
metricTimeStampCross
(
MainlineEvaluateBottomCurveVO
vo
,
List
<
CrossDataHistPOExt
>
filteredList
)
{
CrossDataHistPOExt
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"
);
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
();
}
}
}
private
void
metricTimeStampDir
(
MainlineEvaluateBottomCurveVO
vo
,
List
<
CrossDirDataHistPO
>
filteredList
)
{
CrossDirDataHistPO
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
();
}
}
}
private
void
metricTimeStampTurn
(
MainlineEvaluateBottomCurveVO
vo
,
List
<
CrossTurnDataHistPO
>
filteredList
)
{
CrossTurnDataHistPO
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
();
}
}
}
private
void
metricTimeStampLane
(
MainlineEvaluateBottomCurveVO
vo
,
List
<
CrossLaneDataHistPOExt
>
filteredList
)
{
CrossLaneDataHistPOExt
po
=
filteredList
.
get
(
0
);
CrossLaneDataHistPOExt
po
=
filteredList
.
get
(
0
);
if
(
po
!=
null
)
{
if
(
po
!=
null
)
{
Integer
batchTime
=
po
.
getBatchTime
();
Integer
batchTime
=
po
.
getBatchTime
();
...
...
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