Commit 016742f7 authored by duanruiming's avatar duanruiming

[add] 诱导屏下屏逻辑优化

parent 5d11325c
......@@ -321,16 +321,19 @@ public class InducesMonitorTask {
String equipCode = messageParam.getEquipCode();
Date parse = DateUtil.parse(endTime, Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND);
long current = System.currentTimeMillis();
// 结束时间小于服务器时间15分钟不在下屏
// 当前时间大于绿波结束时间30分钟不在下屏
long time = parse.getTime();
if (time - current < 15 * 60 * 1000 || StringUtils.isBlank(equipCode)) {
if (current - time > 30 * 60 * 1000 || StringUtils.isBlank(equipCode)) {
continue;
}
messageParam.setFlg(2);
messageParam.setType("TFMH");
induceSendService.send(messageParam);
log.info("当前绿波:{}, 诱导屏编号:{}, 下屏成功", greenId, equipCode);
Thread.sleep(500);
// 绿波结束时间大于15分钟,下屏
if (current - time > 15 * 60 * 1000) {
messageParam.setFlg(2);
messageParam.setType("TFMH");
induceSendService.send(messageParam);
log.info("当前绿波:{}, 诱导屏编号:{}, 下屏成功", greenId, equipCode);
Thread.sleep(500);
}
}
}
} catch (Exception e) {
......
......@@ -15,7 +15,7 @@
<!-- 查询绿波优化记录表当天结束的绿波-->
<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 > CURDATE() and control_method = -1) t1
(select green_id, max(control_time) control_time from t_strategy_green_opt_hist t1 where control_time > CURDATE() and control_method = -1 group by green_id) 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