Commit 96fba4c9 authored by duanruiming's avatar duanruiming

[add] 优化控制表中无数据插入逻辑;优化事件告警逻辑

parent e668828c
......@@ -99,12 +99,13 @@ public class SignalCommandSyncTask {
signalCommandPOMapper.updateBatch(updateList);
List<SignalCommandLogPO> signalCommandLogPOS = new ArrayList<>(updateList.size());
BeanListUtils.populateList(updateList, signalCommandLogPOS, SignalCommandLogPO.class);
signalCommandLogPOMapper.updateBatch(signalCommandLogPOS);
signalCommandLogPOMapper.insertBatch(signalCommandLogPOS);
log.info("路口状态控制模式变动,数据库更新成功:{}", updateList);
}
signalCommandPOS.addAll(insertList);
signalCommandPOS.addAll(updateList);
sendAlarmKafka(signalCommandPOS);
List<SignalCommandPO> sendList = new ArrayList<>();
sendList.addAll(insertList);
sendList.addAll(updateList);
sendAlarmKafka(sendList);
} else {
log.error("从路口灯态缓存获取控制模式在线离线状态为空:{}", crossLightsStatusMap);
}
......
......@@ -17,7 +17,6 @@
<foreach collection="list" item="item" index="index" open="" separator=";" close="">
UPDATE t_signal_command_log
<set>
<if test="item.commandResult != null">command_result = #{item.commandResult},</if>
<if test="item.runMode != null">run_mode = #{item.runMode},</if>
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
<if test="item.status != null">status = #{item.status},</if>
......
......@@ -17,7 +17,6 @@
<foreach collection="list" item="item" index="index" open="" separator=";" close="">
UPDATE t_signal_command
<set>
<if test="item.commandResult != null">command_result = #{item.commandResult},</if>
<if test="item.runMode != null">run_mode = #{item.runMode},</if>
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
<if test="item.status != null">status = #{item.status},</if>
......
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