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
89a25181
Commit
89a25181
authored
Jun 06, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 微观大数据平台-交通流量优化
parent
7e7199d1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
16 deletions
+43
-16
TrendController.java
...c/main/java/net/wanji/opt/controller/TrendController.java
+3
-4
TrendService.java
...ice/src/main/java/net/wanji/opt/service/TrendService.java
+1
-1
RunningEvaluateServiceImpl.java
...et/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
+1
-1
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+16
-10
Top5IndexVO.java
...e-service/src/main/java/net/wanji/opt/vo/Top5IndexVO.java
+22
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/TrendController.java
View file @
89a25181
...
@@ -259,12 +259,11 @@ public class TrendController {
...
@@ -259,12 +259,11 @@ public class TrendController {
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
}
}
@ApiOperation
(
value
=
"前五交通流量"
,
notes
=
"前五交通流量"
,
response
=
JsonViewObject
.
class
)
@ApiOperation
(
value
=
"前五交通流量"
,
notes
=
"前五交通流量"
,
response
=
Top5IndexVO
.
class
)
@GetMapping
(
value
=
"/top5Flow"
)
@GetMapping
(
value
=
"/top5Flow"
)
public
JsonViewObject
top5Flow
()
throws
Exception
{
public
JsonViewObject
top5Flow
()
throws
Exception
{
List
<
RunningEvaluateMetricsDetailVO
>
hotspotCrossVOS
=
trendService
.
top5Flow
();
List
<
Top5IndexVO
>
results
=
trendService
.
top5Flow
();
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
return
JsonViewObject
.
newInstance
().
success
(
results
);
}
}
@ApiOperation
(
value
=
"路口交通状态"
,
notes
=
"路口交通状态时长比例"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"路口交通状态"
,
notes
=
"路口交通状态时长比例"
,
response
=
JsonViewObject
.
class
,
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/TrendService.java
View file @
89a25181
...
@@ -56,7 +56,7 @@ public interface TrendService {
...
@@ -56,7 +56,7 @@ public interface TrendService {
List
<
HotspotCrossLaneVO
>
crossLaneData
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
;
List
<
HotspotCrossLaneVO
>
crossLaneData
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
;
List
<
RunningEvaluateMetricsDetailVO
>
top5Flow
()
throws
Exception
;
List
<
Top5IndexVO
>
top5Flow
()
throws
Exception
;
CrossStatusTimeRateVO
crossStatusTimeRate
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
;
CrossStatusTimeRateVO
crossStatusTimeRate
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
View file @
89a25181
...
@@ -431,7 +431,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
...
@@ -431,7 +431,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
}
}
p
rivate
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
buildMetricsList
(
p
ublic
static
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
buildMetricsList
(
List
<
MetricHistDTO
>
metricHistDTOList
,
Integer
minutes
)
{
List
<
MetricHistDTO
>
metricHistDTOList
,
Integer
minutes
)
{
// 按时间段分组
// 按时间段分组
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
89a25181
package
net
.
wanji
.
opt
.
service
.
impl
;
package
net
.
wanji
.
opt
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
...
@@ -15,6 +16,7 @@ import net.wanji.common.utils.tool.StringUtils;
...
@@ -15,6 +16,7 @@ import net.wanji.common.utils.tool.StringUtils;
import
net.wanji.databus.bo.CrossIdBO
;
import
net.wanji.databus.bo.CrossIdBO
;
import
net.wanji.databus.dao.entity.*
;
import
net.wanji.databus.dao.entity.*
;
import
net.wanji.databus.dao.mapper.*
;
import
net.wanji.databus.dao.mapper.*
;
import
net.wanji.databus.dto.MetricHistDTO
;
import
net.wanji.databus.po.*
;
import
net.wanji.databus.po.*
;
import
net.wanji.databus.vo.AbnormalCrossListVO
;
import
net.wanji.databus.vo.AbnormalCrossListVO
;
import
net.wanji.databus.vo.GreenwaveListVO
;
import
net.wanji.databus.vo.GreenwaveListVO
;
...
@@ -1822,8 +1824,8 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1822,8 +1824,8 @@ public class TrendServiceImpl implements TrendService {
}
}
@Override
@Override
public
List
<
RunningEvaluateMetricsDetail
VO
>
top5Flow
()
throws
Exception
{
public
List
<
Top5Index
VO
>
top5Flow
()
throws
Exception
{
List
<
RunningEvaluateMetricsDetailVO
>
hotspotCrossVOS
=
new
ArrayList
<>();
List
<
Top5IndexVO
>
hotspotCrossVOS
=
new
ArrayList
<>();
try
{
try
{
List
<
AbnormalCrossListVO
>
signalCrossRealTimeList
=
crossDataRealtimeMapper
.
selectAbnormalCross
(
null
,
null
,
null
);
List
<
AbnormalCrossListVO
>
signalCrossRealTimeList
=
crossDataRealtimeMapper
.
selectAbnormalCross
(
null
,
null
,
null
);
if
(!
CollectionUtils
.
isEmpty
(
signalCrossRealTimeList
))
{
if
(!
CollectionUtils
.
isEmpty
(
signalCrossRealTimeList
))
{
...
@@ -1835,15 +1837,19 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1835,15 +1837,19 @@ public class TrendServiceImpl implements TrendService {
if
(!
CollectionUtils
.
isEmpty
(
top5
))
{
if
(!
CollectionUtils
.
isEmpty
(
top5
))
{
for
(
AbnormalCrossListVO
abnormalCrossListVO
:
top5
)
{
for
(
AbnormalCrossListVO
abnormalCrossListVO
:
top5
)
{
String
crossId
=
abnormalCrossListVO
.
getId
();
String
crossId
=
abnormalCrossListVO
.
getId
();
MetricsDetailBO
metricsDetailBO
=
new
MetricsDetailB
O
();
Top5IndexVO
top5IndexVO
=
new
Top5IndexV
O
();
metricsDetailB
O
.
setCrossId
(
crossId
);
top5IndexV
O
.
setCrossId
(
crossId
);
//metricsDetailBO.setDate(DateUtil.offsetDay(new Date(1705456500000L), -1));
//metricsDetailBO.setDate(DateUtil.offsetDay(new Date(1705456500000L), -1));
Date
date
=
new
Date
();
Date
date
=
new
Date
();
metricsDetailBO
.
setDate
(
DateUtil
.
offsetDay
(
DateUtil
.
offsetHour
(
date
,
2
),
-
1
));
DateTime
start
=
DateUtil
.
offsetDay
(
DateUtil
.
offsetHour
(
date
,
2
),
-
1
);
metricsDetailBO
.
setMinutes
(
60
*
2
);
DateTime
end
=
DateUtil
.
offsetDay
(
DateUtil
.
offsetHour
(
date
,
2
),
0
);
RunningEvaluateMetricsDetailVO
result
=
runningEvaluateService
.
metricsDetail
(
metricsDetailBO
);
int
startStamp
=
(
int
)
(
start
.
getTime
()
/
1000
);
// 10位时间戳
result
.
setCrossId
(
crossId
);
int
endStamp
=
(
int
)
(
end
.
getTime
()
/
1000
);
hotspotCrossVOS
.
add
(
result
);
List
<
MetricHistDTO
>
metricHistDTOS
=
crossDataHistMapper
.
selectMetricHistDTO
(
crossId
,
startStamp
,
endStamp
);
// 使用全量数据按时间粒度聚合指标
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
crossMetrics
=
RunningEvaluateServiceImpl
.
buildMetricsList
(
metricHistDTOS
,
120
);
top5IndexVO
.
setMetricsList
(
crossMetrics
);
hotspotCrossVOS
.
add
(
top5IndexVO
);
}
}
}
}
}
}
...
@@ -1978,7 +1984,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1978,7 +1984,7 @@ public class TrendServiceImpl implements TrendService {
LocalDateTime
localDateTime2
=
LocalDateTime
.
ofInstant
(
end
.
toInstant
(),
ZoneId
.
of
(
"+8"
));
LocalDateTime
localDateTime2
=
LocalDateTime
.
ofInstant
(
end
.
toInstant
(),
ZoneId
.
of
(
"+8"
));
String
types
=
holoEventVO
.
getTypes
();
String
types
=
holoEventVO
.
getTypes
();
queryWrapper
.
eq
(
HoloEventInfoPO:
:
getCrossId
,
crossId
);
queryWrapper
.
eq
(
HoloEventInfoPO:
:
getCrossId
,
crossId
);
queryWrapper
.
between
(
HoloEventInfoPO:
:
get
Detec
tTime
,
localDateTime1
,
localDateTime2
);
queryWrapper
.
between
(
HoloEventInfoPO:
:
get
Star
tTime
,
localDateTime1
,
localDateTime2
);
List
<
HoloEventInfoPO
>
holoEventInfoPOS
=
holoEventMapper
.
selectList
(
queryWrapper
);
List
<
HoloEventInfoPO
>
holoEventInfoPOS
=
holoEventMapper
.
selectList
(
queryWrapper
);
List
<
HoloEventInfoPO
>
results
=
new
ArrayList
<>();
List
<
HoloEventInfoPO
>
results
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
holoEventInfoPOS
)
&&
StringUtils
.
isNotBlank
(
types
))
{
if
(!
CollectionUtils
.
isEmpty
(
holoEventInfoPOS
)
&&
StringUtils
.
isNotBlank
(
types
))
{
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/Top5IndexVO.java
0 → 100644
View file @
89a25181
package
net
.
wanji
.
opt
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2024/06/06 9:49
*/
@Data
@NoArgsConstructor
@ApiModel
(
value
=
"Top5IndexVO"
,
description
=
"前五交通指标实体"
)
public
class
Top5IndexVO
{
@ApiModelProperty
(
value
=
"路口编号"
)
private
String
crossId
;
@ApiModelProperty
(
value
=
"交通指标"
)
private
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
metricsList
;
}
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