Commit f0ee50d491b5b0ce360490db74065ad29ada4af6

Authored by 273548560@qq.com
1 parent 871cd1bf

修复bug

trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
@@ -23,6 +23,7 @@ import org.springframework.kafka.support.KafkaHeaders; @@ -23,6 +23,7 @@ import org.springframework.kafka.support.KafkaHeaders;
23 import org.springframework.messaging.handler.annotation.Header; 23 import org.springframework.messaging.handler.annotation.Header;
24 import org.springframework.messaging.handler.annotation.Payload; 24 import org.springframework.messaging.handler.annotation.Payload;
25 import org.springframework.stereotype.Component; 25 import org.springframework.stereotype.Component;
  26 +import org.springframework.transaction.annotation.Transactional;
26 27
27 import java.io.IOException; 28 import java.io.IOException;
28 import java.util.*; 29 import java.util.*;
@@ -51,8 +52,9 @@ public class Consumer { @@ -51,8 +52,9 @@ public class Consumer {
51 @Autowired 52 @Autowired
52 RedisCache redisCache; 53 RedisCache redisCache;
53 54
  55 + @Transactional
54 public void autoViolationWarning(String data,String id) throws InterruptedException { 56 public void autoViolationWarning(String data,String id) throws InterruptedException {
55 - 57 + log.info("开始报警,data:" + data);
56 58
57 String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警未按时间作业", 59 String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警未按时间作业",
58 "44030024=消纳场预警-未报开工作业", "44030025=消纳场预警-视频设备离线超时报警", "44030026=消纳场预警-三无车辆进入消纳场", "44030027=消纳场预警-未到指定的消纳场作业", 60 "44030024=消纳场预警-未报开工作业", "44030025=消纳场预警-视频设备离线超时报警", "44030026=消纳场预警-三无车辆进入消纳场", "44030027=消纳场预警-未到指定的消纳场作业",
@@ -180,9 +182,12 @@ public class Consumer { @@ -180,9 +182,12 @@ public class Consumer {
180 kafkaCompensation.setId(Long.valueOf(id)); 182 kafkaCompensation.setId(Long.valueOf(id));
181 kafkaCompensation.setStatus(1); 183 kafkaCompensation.setStatus(1);
182 SpringUtils.getBean(KafkaCompensationMapper.class).updateKafkaCompensation(kafkaCompensation); 184 SpringUtils.getBean(KafkaCompensationMapper.class).updateKafkaCompensation(kafkaCompensation);
  185 + log.info("报警结束,data:" + data);
183 } 186 }
184 187
  188 + @Transactional
185 public String insertKafkaCompensation(String data){ 189 public String insertKafkaCompensation(String data){
  190 + log.info("添加kafka补偿信息,data:" + data);
186 KafkaCompensation kafkaCompensation = new KafkaCompensation(); 191 KafkaCompensation kafkaCompensation = new KafkaCompensation();
187 kafkaCompensation.setData(data); 192 kafkaCompensation.setData(data);
188 kafkaCompensation.setCreateTime(DateUtils.getNowDate()); 193 kafkaCompensation.setCreateTime(DateUtils.getNowDate());