Commit f8de0161 authored by zhouleilei's avatar zhouleilei

[update] 控制指令下发失败,定时恢复的定时任务修改

parent 1f7be484
...@@ -50,7 +50,7 @@ public class CommandFaildTask { ...@@ -50,7 +50,7 @@ public class CommandFaildTask {
@Resource @Resource
private SignalCommandLogPOMapper signalCommandLogPOMapper; private SignalCommandLogPOMapper signalCommandLogPOMapper;
@Scheduled(cron = "0/5 * * * * ?") @Scheduled(fixedRate = 5 * 1000, initialDelay = 10 * 1000)
public void commandFaildTask() throws Exception { public void commandFaildTask() throws Exception {
try { try {
LambdaQueryWrapper<SignalCommandPO> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SignalCommandPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
...@@ -244,9 +244,9 @@ public class CommandFaildTask { ...@@ -244,9 +244,9 @@ public class CommandFaildTask {
//插入日志表 //插入日志表
int insert = signalCommandLogPOMapper.insert(signalCommandLogPO); int insert = signalCommandLogPOMapper.insert(signalCommandLogPO);
if (insert > 0) { if (insert > 0) {
log.info("定时任务 插入t_signal_command_log成功,crossId = {},commandType = {},time = {},insert = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER),insert); log.info("定时任务 插入t_signal_command_log成功,crossId = {},commandType = {},time = {},insert = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER), insert);
}else { } else {
log.info("定时任务 插入t_signal_command_log失败,crossId = {},commandType = {},time = {},insert = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER),insert); log.info("定时任务 插入t_signal_command_log失败,crossId = {},commandType = {},time = {},insert = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER), insert);
} }
SignalCommandPO signalCommandPO = new SignalCommandPO(); SignalCommandPO signalCommandPO = new SignalCommandPO();
BeanUtil.copyProperties(signalCommandLogPO, signalCommandPO); BeanUtil.copyProperties(signalCommandLogPO, signalCommandPO);
...@@ -256,9 +256,9 @@ public class CommandFaildTask { ...@@ -256,9 +256,9 @@ public class CommandFaildTask {
lambdaQueryWrapper.eq(SignalCommandPO::getCrossId, jsonObject.getString("crossId")); lambdaQueryWrapper.eq(SignalCommandPO::getCrossId, jsonObject.getString("crossId"));
int update = signalCommandPOMapper.update(signalCommandPO, lambdaQueryWrapper); int update = signalCommandPOMapper.update(signalCommandPO, lambdaQueryWrapper);
if (update > 0) { if (update > 0) {
log.info("定时任务 更新t_signal_command成功,crossId = {},commandType = {},time = {},update = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER),update); log.info("定时任务 更新t_signal_command成功,crossId = {},commandType = {},time = {},update = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER), update);
}else { } else {
log.info("定时任务 更新t_signal_command失败,crossId = {},commandType = {},time = {},update = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER),update); log.info("定时任务 更新t_signal_command失败,crossId = {},commandType = {},time = {},update = {}", jsonObject.getString("crossId"), commandType, LocalDateTimeUtil.formatNow(LocalDateTimeUtil.TIMEFORMATTER), update);
} }
List<SignalCommandPO> signalCommandPOS = signalCommandPOMapper.selectList(lambdaQueryWrapper); List<SignalCommandPO> signalCommandPOS = signalCommandPOMapper.selectList(lambdaQueryWrapper);
log.error("定时任务 更新t_signal_command成功,数据库中查询结果集:{}", signalCommandPOS); log.error("定时任务 更新t_signal_command成功,数据库中查询结果集:{}", signalCommandPOS);
......
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