Commit 40a20376 authored by duanruiming's avatar duanruiming

[add] 诱导屏定时任务异常问题优化

parent 0bde6e7f
......@@ -169,6 +169,10 @@ public class InducesMonitorTask {
List<StrategyGreenOptHistEntity> strategyGreenOptHistEntitiesList = strategyGreenOptHistMapper.selectByGreenId(String.valueOf(greenwaveInfoPO.getId())).stream().distinct().collect(Collectors.toList());
if (Objects.nonNull(strategyGreenOptHistEntitiesList)) {
for (StrategyGreenOptHistEntity greenOptHistEntity : strategyGreenOptHistEntitiesList) {
Integer controlMethod = greenOptHistEntity.getControlMethod();
if (Objects.equals(-1, controlMethod)) {
continue;
}
// LambdaQueryWrapper<GreenwaveInducesHist> greenwaveInducesHistQueryWrapper = new LambdaQueryWrapper<>();
// greenwaveInducesHistQueryWrapper.eq(GreenwaveInducesHist::getGreenId, greenwaveInfoPO.getId());
// greenwaveInducesHistQueryWrapper.eq(GreenwaveInducesHist::getDir, getDir(greenOptHistEntity.getDir()));
......@@ -319,7 +323,7 @@ public class InducesMonitorTask {
long current = System.currentTimeMillis();
// 结束时间小于服务器时间15分钟不在下屏
long time = parse.getTime();
if (time - current < 15 * 60 * 1000) {
if (time - current < 15 * 60 * 1000 || StringUtils.isBlank(equipCode)) {
continue;
}
messageParam.setFlg(2);
......
......@@ -14,11 +14,8 @@
<!-- 查询绿波优化记录表当天结束的绿波-->
<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
(select green_id, control_time from t_strategy_green_opt_hist t1 where control_time > CURDATE() and control_method = -1) t1
left join t_greenwave_induces t2 on t1.green_id = t2.green_id
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment