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
17ff6a00
Commit
17ff6a00
authored
Jan 15, 2025
by
zhoushiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
b3346a1e
2945f0f3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
4 deletions
+28
-4
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+1
-1
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+16
-2
CrossEventListPO.java
...vice/src/main/java/net/wanji/opt/vo/CrossEventListPO.java
+2
-0
HoloEventMapper.xml
...ize-service/src/main/resources/mapper/HoloEventMapper.xml
+3
-1
DateUtil.java
...n/src/main/java/net/wanji/common/utils/tool/DateUtil.java
+6
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
17ff6a00
...
...
@@ -55,7 +55,7 @@ public class StrategyControlController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"策略执行记录历史->路口/干线,时间粒度, 策略成功失败类型"
,
notes
=
""
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"strategyType"
,
value
=
"策略类型 0-路口 1-干线 空-查所有"
,
required
=
false
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"groupType"
,
value
=
"时间粒度类型 0-1小时 1-1天"
,
required
=
false
,
dataType
=
"Integer"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"groupType"
,
value
=
"时间粒度类型 0-1小时 1-1天
2-5秒
"
,
required
=
false
,
dataType
=
"Integer"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"resultType"
,
value
=
"时间粒度类型 0-失败 1-成功 空-查所有"
,
required
=
false
,
dataType
=
"Integer"
),
})
@ApiResponses
({
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
17ff6a00
...
...
@@ -6,7 +6,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.enums.DateStyle
;
import
net.wanji.common.framework.Constants
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.utils.tool.DateUtil
;
...
...
@@ -188,7 +187,22 @@ public class StrategyControlServiceImpl implements StrategyControlService {
if
(
Objects
.
isNull
(
groupType
))
{
groupType
=
1
;
}
LocalDateTime
localDateTime
=
Objects
.
equals
(
0
,
groupType
)
?
DateUtil
.
getPlusHour
(-
1
)
:
DateUtil
.
getMidNight
();
// LocalDateTime localDateTime = Objects.equals(0, groupType) ? DateUtil.getPlusHour(-1) : DateUtil.getMidNight();
LocalDateTime
localDateTime
=
null
;
switch
(
groupType
){
case
0
:
localDateTime
=
DateUtil
.
getPlusHour
(-
1
);
break
;
case
1
:
localDateTime
=
DateUtil
.
getMidNight
();
break
;
case
2
:
localDateTime
=
DateUtil
.
getPlusSecond
(-
5
);
break
;
default
:
localDateTime
=
DateUtil
.
getMidNight
();
}
// 查询干线和路口
if
(
Objects
.
isNull
(
strategyType
))
{
setGreenOptHist
(
results
,
localDateTime
,
resultType
);
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/CrossEventListPO.java
View file @
17ff6a00
...
...
@@ -15,4 +15,6 @@ public class CrossEventListPO {
private
Integer
duration
;
private
String
type
;
private
String
typeName
;
private
String
wkt
;
private
Double
trafficIndex
;
}
signal-optimize-service/src/main/resources/mapper/HoloEventMapper.xml
View file @
17ff6a00
...
...
@@ -100,7 +100,7 @@
<!-- 路口监测左下角路口事件列表 -->
<select
id =
"selectCrossEventList"
resultType=
"net.wanji.opt.vo.CrossEventListPO"
>
select t1.id crossId, t2.type, ifnull(t2.place_desc, "畅通") typeName,
ifnull(t2.count, 0) count, ifnull(t2.duration, 0) duration, t1.`name` name
ifnull(t2.count, 0) count, ifnull(t2.duration, 0) duration, t1.`name` name
,t1.location wkt, ROUND(t3.traffic_index,2) trafficIndex
from t_base_cross_info t1
left join
(select cross_id, type, place_desc,
...
...
@@ -111,6 +111,8 @@
group by cross_id, type
order by duration desc) t2
on t2.cross_id = t1.id
LEFT JOIN t_cross_data_realtime t3
ON t1.id = t3.cross_id
where t1.is_signal = 1
order by t2.duration desc
</select>
...
...
wj-common/src/main/java/net/wanji/common/utils/tool/DateUtil.java
View file @
17ff6a00
...
...
@@ -567,4 +567,10 @@ public class DateUtil {
return
localDateTime
;
}
public
static
LocalDateTime
getPlusSecond
(
Integer
offset
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
localDateTime
=
now
.
plusSeconds
(
offset
);
return
localDateTime
;
}
}
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