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
407e5c2f
Commit
407e5c2f
authored
Mar 27, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 诊断优化-优化效果开始时间
parent
982f18e4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
4 deletions
+29
-4
CrossSchemeOptLogMapper.java
...ava/net/wanji/opt/dao/mapper/CrossSchemeOptLogMapper.java
+10
-0
DiagnoServiceImpl.java
...in/java/net/wanji/opt/service/impl/DiagnoServiceImpl.java
+8
-2
OptEffectVO.java
...e-service/src/main/java/net/wanji/opt/vo/OptEffectVO.java
+2
-2
CrossSchemeOptLogMapper.xml
...ice/src/main/resources/mapper/CrossSchemeOptLogMapper.xml
+9
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/dao/mapper/CrossSchemeOptLogMapper.java
View file @
407e5c2f
...
...
@@ -20,4 +20,14 @@ public interface CrossSchemeOptLogMapper {
int
insertBatch
(
@Param
(
"list"
)
List
<
CrossSchemeOptLogPO
>
list
);
List
<
CrossSchemeOptLogPO
>
selectMaxByCrossId
(
String
crossId
);
/**
* 查询历史表中两个小时内最早得优化记录
*
* @param crossId
* @param optReason
* @param optStartTime
* @return
*/
CrossSchemeOptLogPO
selectOptStartEntity
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"optReason"
)
String
optReason
,
@Param
(
"optStartTime"
)
long
optStartTime
);
}
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/DiagnoServiceImpl.java
View file @
407e5c2f
...
...
@@ -328,13 +328,13 @@ public class DiagnoServiceImpl implements DiagnoService {
public
OptEffectVO
optEffect
(
CrossIdAndDirDTO
crossIdAndDirDTO
)
{
String
crossId
=
crossIdAndDirDTO
.
getCrossId
();
OptEffectVO
optEffectVO
=
new
OptEffectVO
();
TBaseCrossInfo
crossInfoPO
=
crossInfoMapper
.
selectByPrimaryKey
(
crossId
);
optEffectVO
.
setCrossName
(
crossInfoPO
.
getName
());
List
<
CrossSchemeOptLogPO
>
maxList
=
crossSchemeOptLogMapper
.
selectMaxByCrossId
(
crossId
);
String
optReason
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
maxList
))
{
CrossSchemeOptLogPO
crossSchemeOptLogPO
=
maxList
.
get
(
0
);
opt
EffectVO
.
setOptStartTime
(
crossSchemeOptLogPO
.
getStartTime
()
);
opt
Reason
=
crossSchemeOptLogPO
.
getOptReason
(
);
Date
endTime
=
crossSchemeOptLogPO
.
getEndTime
();
if
(
ObjectUtil
.
isEmpty
(
endTime
))
{
optEffectVO
.
setStatus
(
2
);
...
...
@@ -347,6 +347,12 @@ public class DiagnoServiceImpl implements DiagnoService {
long
currentSeconds
=
DateUtil
.
currentSeconds
();
// todo 测试用 固定当前时间为1676082600
currentSeconds
=
1676082600
;
long
optStartTime
=
currentSeconds
-
2
*
60
*
60
;
// 优化开始时间,两个小时内最早时间
CrossSchemeOptLogPO
optStartEntity
=
crossSchemeOptLogMapper
.
selectOptStartEntity
(
crossId
,
optReason
,
optStartTime
);
if
(
Objects
.
nonNull
(
optStartEntity
))
{
optEffectVO
.
setOptStartTime
(
optStartEntity
.
getStartTime
());
}
long
preSeconds
=
currentSeconds
-
45
*
60
;
if
(
ObjectUtil
.
isEmpty
(
dir
)
||
dir
==
0
)
{
// 获取路口历史数据
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/OptEffectVO.java
View file @
407e5c2f
...
...
@@ -25,8 +25,8 @@ public class OptEffectVO {
String
strategyName
;
@ApiModelProperty
(
value
=
"优化方法"
)
String
ideaName
;
@ApiModelProperty
(
value
=
"优化开始时间
格式2023-03-02 10:10
"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"
yyyy-MM-dd
HH:mm"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"优化开始时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"HH:mm"
,
timezone
=
"GMT+8"
)
Date
optStartTime
;
@ApiModelProperty
(
value
=
"状态 1已完成 2持续优化"
)
Integer
status
;
...
...
signal-optimize-service/src/main/resources/mapper/CrossSchemeOptLogMapper.xml
View file @
407e5c2f
...
...
@@ -53,6 +53,15 @@
and data_batch_time=(SELECT MAX(ABS(data_batch_time)) FROM t_base_cross_scheme_opt_log WHERE cross_id = #{crossId});
</select>
<select
id=
"selectOptStartEntity"
resultType=
"net.wanji.opt.po.base.CrossSchemeOptLogPO"
>
select
<include
refid=
"Base_Column_List"
/>
from t_base_cross_scheme_opt_log
where cross_id = #{crossId} and opt_reason = #{optReason} and data_batch_time > #{optStartTime}
order by data_batch_time desc
limit 1
</select>
<insert
id=
"insertOne"
parameterType=
"net.wanji.opt.po.base.CrossSchemeOptLogPO"
>
insert into t_base_cross_scheme_opt_log (cross_id, scheme_id, dir_type, turn_type, offset, ring_no, phase_no,
phase_order_id, ori_green_time, opt_time, opt_type, opt_reason,
...
...
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