Commit 96fba4c9 authored by duanruiming's avatar duanruiming

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

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