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
0bde6e7f
Commit
0bde6e7f
authored
Mar 02, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 诱导屏下屏优化
parent
1a8c023b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
StrategyGreenOptHistMapper.java
.../net/wanji/opt/dao/mapper/StrategyGreenOptHistMapper.java
+3
-0
InducesMonitorTask.java
.../src/main/java/net/wanji/opt/task/InducesMonitorTask.java
+27
-0
StrategyGreenOptHistMapper.xml
.../src/main/resources/mapper/StrategyGreenOptHistMapper.xml
+10
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/dao/mapper/StrategyGreenOptHistMapper.java
View file @
0bde6e7f
package
net
.
wanji
.
opt
.
dao
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
net.wanji.opt.dto.induce.MessageParam
;
import
net.wanji.opt.po.StrategyGreenOptHistEntity
;
import
java.util.List
;
...
...
@@ -14,4 +15,6 @@ public interface StrategyGreenOptHistMapper extends BaseMapper<StrategyGreenOptH
List
<
StrategyGreenOptHistEntity
>
selectByGreenId
(
String
greenId
);
List
<
MessageParam
>
selectGreenOptEndTimeEquipCode
();
}
signal-optimize-service/src/main/java/net/wanji/opt/task/InducesMonitorTask.java
View file @
0bde6e7f
...
...
@@ -306,6 +306,33 @@ public class InducesMonitorTask {
});
}
}
// 下屏逻辑,如果绿波历史表结束优化control_method=-1, 在15分钟内,下屏
try
{
List
<
MessageParam
>
entities
=
strategyGreenOptHistMapper
.
selectGreenOptEndTimeEquipCode
();
if
(!
CollectionUtils
.
isEmpty
(
entities
))
{
for
(
MessageParam
messageParam
:
entities
)
{
String
endTime
=
messageParam
.
getEndTime
();
Integer
greenId
=
messageParam
.
getGreenId
();
String
equipCode
=
messageParam
.
getEquipCode
();
Date
parse
=
DateUtil
.
parse
(
endTime
,
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_SECOND
);
long
current
=
System
.
currentTimeMillis
();
// 结束时间小于服务器时间15分钟不在下屏
long
time
=
parse
.
getTime
();
if
(
time
-
current
<
15
*
60
*
1000
)
{
continue
;
}
messageParam
.
setFlg
(
2
);
messageParam
.
setType
(
"TFMH"
);
induceSendService
.
send
(
messageParam
);
log
.
info
(
"当前绿波:{}, 诱导屏编号:{}, 下屏成功"
,
greenId
,
equipCode
);
Thread
.
sleep
(
500
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"通过绿波优化结束时间下屏异常:{}"
,
e
);
}
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"每5分钟刷新绿波下发状态失败"
,
e
);
}
finally
{
...
...
signal-optimize-service/src/main/resources/mapper/StrategyGreenOptHistMapper.xml
View file @
0bde6e7f
...
...
@@ -12,4 +12,14 @@
) b on a.`green_id` = b.`green_id` and a.`control_time` = b.`control_time` and a.`green_id` = #{greenId} and a.`control_method` = 1 and TIMESTAMPDIFF(SECOND,a.`control_time`, now())
<
a.`control_duration`
</select>
<!-- 查询绿波优化记录表当天结束的绿波-->
<select
id=
"selectGreenOptEndTimeEquipCode"
resultType=
"net.wanji.opt.dto.induce.MessageParam"
>
<!-- select t1.green_id as greenId, t1.control_time as endTime, t2.equip_code as equipCode, t2.id as induceId, t2.source_id as sourceId from-->
<!-- (select green_id, control_time from t_strategy_green_opt_hist t1 where control_time > now() and control_method = -1) t1-->
<!-- left join t_greenwave_induces t2 on t1.green_id = t2.green_id-->
select t1.green_id as greenId, t1.control_time as endTime, t2.equip_code as equipCode, t2.id as induceId, t2.source_id as sourceId from
(select green_id, control_time from t_strategy_green_opt_hist t1 where control_time > STR_TO_DATE('2025-03-01', '%Y-%m-%d') and control_method = -1) t1
left join t_greenwave_induces t2 on t1.green_id = t2.green_id
</select>
</mapper>
\ No newline at end of file
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