Commit 6f90c35eff65450b290b9511229f4949942dd5d3

Authored by 273548560@qq.com
1 parent e2c42fdd

修复bug

trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
@@ -312,7 +312,7 @@ public class DriverTask @@ -312,7 +312,7 @@ public class DriverTask
312 * kafka补偿机制,每半小时一次 312 * kafka补偿机制,每半小时一次
313 * @throws InterruptedException 313 * @throws InterruptedException
314 */ 314 */
315 - public void kafkaCompensation() throws InterruptedException { 315 + public void kafkaCompensation() throws InterruptedException, IOException {
316 KafkaCompensation kafkaCompensation = new KafkaCompensation(); 316 KafkaCompensation kafkaCompensation = new KafkaCompensation();
317 kafkaCompensation.setStatus(0); 317 kafkaCompensation.setStatus(0);
318 List<KafkaCompensation> kafkaCompensationList = SpringUtils.getBean(KafkaCompensationMapper.class).selectKafkaCompensationList(kafkaCompensation); 318 List<KafkaCompensation> kafkaCompensationList = SpringUtils.getBean(KafkaCompensationMapper.class).selectKafkaCompensationList(kafkaCompensation);
trash-ui/src/views/casefile/violationCaseFile/violationCaseTable.vue
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 <el-date-picker 10 <el-date-picker
11 v-model="createTime" 11 v-model="createTime"
12 type="daterange" 12 type="daterange"
  13 + :picker-options="pickerOptions"
13 range-separator="至" 14 range-separator="至"
14 start-placeholder="开始日期" 15 start-placeholder="开始日期"
15 end-placeholder="结束日期"> 16 end-placeholder="结束日期">
@@ -50,6 +51,27 @@ export default { @@ -50,6 +51,27 @@ export default {
50 createTime: [], 51 createTime: [],
51 areas: [], 52 areas: [],
52 hackReset: false, 53 hackReset: false,
  54 + pickerMinDate: null,
  55 + pickerMaxDate: null,
  56 + pickerOptions: {
  57 + onPick: ({ maxDate, minDate }) => {
  58 + if (minDate && this.pickerMinDate) {
  59 + this.pickerMinDate = null;
  60 + } else if (minDate) {
  61 + this.pickerMinDate = minDate.getTime();
  62 + }
  63 + },
  64 + disabledDate: (time) => {
  65 + if (this.pickerMinDate) {
  66 + const day1 = 30 * 24 * 3600 * 1000
  67 + let maxTime = this.pickerMinDate + day1
  68 + let minTime = this.pickerMinDate - day1
  69 + return time.getTime() > maxTime || time.getTime()<minTime || time.getTime() > Date.now()
  70 + } else {
  71 + return time.getTime() > Date.now()
  72 + }
  73 + },
  74 + },
53 } 75 }
54 }, 76 },
55 created() { 77 created() {
trash-ui/src/views/casefile/violationWarningInformation/violationWarningInformationTable.vue
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 <el-date-picker 10 <el-date-picker
11 v-model="createTime" 11 v-model="createTime"
12 type="daterange" 12 type="daterange"
  13 + :picker-options="pickerOptions"
13 range-separator="至" 14 range-separator="至"
14 start-placeholder="开始日期" 15 start-placeholder="开始日期"
15 end-placeholder="结束日期"> 16 end-placeholder="结束日期">
@@ -49,6 +50,27 @@ export default { @@ -49,6 +50,27 @@ export default {
49 createTime: [], 50 createTime: [],
50 areas: [], 51 areas: [],
51 hackReset:false, 52 hackReset:false,
  53 + pickerMinDate: null,
  54 + pickerMaxDate: null,
  55 + pickerOptions: {
  56 + onPick: ({ maxDate, minDate }) => {
  57 + if (minDate && this.pickerMinDate) {
  58 + this.pickerMinDate = null;
  59 + } else if (minDate) {
  60 + this.pickerMinDate = minDate.getTime();
  61 + }
  62 + },
  63 + disabledDate: (time) => {
  64 + if (this.pickerMinDate) {
  65 + const day1 = 30 * 24 * 3600 * 1000
  66 + let maxTime = this.pickerMinDate + day1
  67 + let minTime = this.pickerMinDate - day1
  68 + return time.getTime() > maxTime || time.getTime()<minTime || time.getTime() > Date.now()
  69 + } else {
  70 + return time.getTime() > Date.now()
  71 + }
  72 + },
  73 + },
52 } 74 }
53 }, 75 },
54 created() { 76 created() {
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
@@ -37,7 +37,7 @@ public class Consumer { @@ -37,7 +37,7 @@ public class Consumer {
37 private IViolationWarningInformationService violationWarningInformationService; 37 private IViolationWarningInformationService violationWarningInformationService;
38 38
39 @KafkaListener(topics = "record_process_alarm") 39 @KafkaListener(topics = "record_process_alarm")
40 - public void consume(@Payload String data) throws InterruptedException { 40 + public void consume(@Payload String data) throws InterruptedException, IOException {
41 log.info("kafka消费数据成功,data:" + data); 41 log.info("kafka消费数据成功,data:" + data);
42 String id = insertKafkaCompensation(data); 42 String id = insertKafkaCompensation(data);
43 autoViolationWarning(data,id); 43 autoViolationWarning(data,id);
@@ -53,7 +53,7 @@ public class Consumer { @@ -53,7 +53,7 @@ public class Consumer {
53 RedisCache redisCache; 53 RedisCache redisCache;
54 54
55 @Transactional 55 @Transactional
56 - public void autoViolationWarning(String data,String id) throws InterruptedException { 56 + public void autoViolationWarning(String data,String id) throws InterruptedException, IOException {
57 57
58 String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警未按时间作业", 58 String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警未按时间作业",
59 "44030024=消纳场预警-未报开工作业", "44030025=消纳场预警-视频设备离线超时报警", "44030026=消纳场预警-三无车辆进入消纳场", "44030027=消纳场预警-未到指定的消纳场作业", 59 "44030024=消纳场预警-未报开工作业", "44030025=消纳场预警-视频设备离线超时报警", "44030026=消纳场预警-三无车辆进入消纳场", "44030027=消纳场预警-未到指定的消纳场作业",
@@ -164,11 +164,8 @@ public class Consumer { @@ -164,11 +164,8 @@ public class Consumer {
164 } 164 }
165 violationWarningInformation.setDescribe(describe); 165 violationWarningInformation.setDescribe(describe);
166 // 业务逻辑 166 // 业务逻辑
167 - try {  
168 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
169 - } catch (IOException e) {  
170 - e.printStackTrace();  
171 - } 167 + violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  168 +
172 } else { 169 } else {
173 String describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(new Date(), "yyyy/MM/dd HH:mm:ss") + " " 170 String describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(new Date(), "yyyy/MM/dd HH:mm:ss") + " "
174 + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "在" + 171 + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "在" +