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
33442974
Commit
33442974
authored
May 20, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
cd69c1f7
e9d5422e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
43 deletions
+41
-43
GreenwaveHistProviderImpl.java
...net/wanji/opt/service/impl/GreenwaveHistProviderImpl.java
+6
-11
GreenwaveHistMapper.xml
...service/src/main/resources/mapper/GreenwaveHistMapper.xml
+35
-32
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/GreenwaveHistProviderImpl.java
View file @
33442974
...
...
@@ -2,27 +2,21 @@ package net.wanji.opt.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.enums.BaseEnum
;
import
net.wanji.common.enums.TurnConvertEnum
;
import
net.wanji.common.framework.Constants
;
import
net.wanji.common.framework.dubbointerface.impl.BaseDubboInterfaceImpl
;
import
net.wanji.common.framework.exception.DubboProviderException
;
import
net.wanji.common.framework.mapper.BaseInterfaceMapper
;
import
net.wanji.common.gts.Tools
;
import
net.wanji.common.utils.tool.DateUtil
;
import
net.wanji.databus.dao.mapper.BaseCrossInfoMapper
;
import
net.wanji.databus.po.BaseCrossInfoPO
;
import
net.wanji.databus.po.CrossDataHistPO
;
import
net.wanji.databus.po.CrossDirDataHistPO
;
import
net.wanji.databus.po.CrossTurnDataHistPO
;
import
net.wanji.databus.po.CrossTurnInfoPO
;
import
net.wanji.databus.po.TBaseCrossInfo
;
import
net.wanji.opt.bo.BottomMenuBO
;
import
net.wanji.opt.common.ArithOfBigDecmial
;
import
net.wanji.opt.common.EsDateIndexUtil
;
import
net.wanji.opt.common.enums.TimeGranularityEnum
;
import
net.wanji.opt.constant.ServiceLevelEnum
;
import
net.wanji.opt.dao.mapper.GreenwaveHistoryMapper
;
import
net.wanji.opt.dto.report.GreenHistIndexDTO
;
...
...
@@ -37,7 +31,6 @@ import org.apache.dubbo.config.annotation.DubboService;
import
org.joda.time.DateTime
;
import
org.joda.time.Seconds
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -54,7 +47,6 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Random
;
import
java.util.Set
;
import
java.util.TreeMap
;
import
java.util.TreeSet
;
...
...
@@ -810,7 +802,9 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
params
.
put
(
"groupType"
,
groupType
);
//存放时段
Set
<
String
>
sortedSet
=
EsDateIndexUtil
.
getTimeGranularityAxis
(
groupType
,
startTime
,
endTime
);
//Set<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxis(groupType, startTime, endTime);
//存放时段
List
<
String
>
sortedSet
=
EsDateIndexUtil
.
getTimeGranularityAxisAll
(
groupType
,
startTime
,
endTime
);
//======================================================================================================//
//存放所有数据
List
<
Map
<
String
,
Object
>>
allList
=
new
ArrayList
<>();
...
...
@@ -868,8 +862,9 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
params
.
put
(
"groupType"
,
groupType
);
//存放时段
Set
<
String
>
sortedSet
=
EsDateIndexUtil
.
getTimeGranularityAxis
(
groupType
,
startTime
,
endTime
);
// Set<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxis(groupType, startTime, endTime);
//存放时段
List
<
String
>
sortedSet
=
EsDateIndexUtil
.
getTimeGranularityAxisAll
(
groupType
,
startTime
,
endTime
);
//======================================================================================================//
//存放所有数据
List
<
Map
<
String
,
Object
>>
allList
=
new
ArrayList
<>();
...
...
signal-optimize-service/src/main/resources/mapper/GreenwaveHistMapper.xml
View file @
33442974
...
...
@@ -148,11 +148,12 @@
(
SELECT start_time,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time,
cross_id,
...
...
@@ -192,12 +193,12 @@
(
SELECT start_time,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time,
cross_id,
...
...
@@ -239,11 +240,11 @@
(
SELECT start_time,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
end
) unit_time,
cross_id,
...
...
@@ -502,14 +503,15 @@
) t1
left join (
SELECT cross_id,dir_type,start_time,flow,speed,queue_length,stop_times,delay_time,sturation ,traffic_index,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
end
) unit_time
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time
from t_cross_dir_data_hist
WHERE start_time >= #{startDate} and start_time
<
#{endDate}
) t2
...
...
@@ -550,14 +552,15 @@
) t1
left join (
SELECT id as lane_id,cross_id,start_time,flow,speed,queue_length,stop_times,delay_time,sturation ,
(case
when #{groupType}=0 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 5 ) * 5 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
end
) unit_time
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time
from t_lane_data_hist
WHERE start_time >= #{startDate} and start_time
<
#{endDate}
) t2
...
...
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