|
@@ -69,7 +69,10 @@ public class WarningOfSmokeRecordServiceImpl extends ServiceImpl<WarningOfSmokeR
|
|
|
wrapper.orderByDesc("publish_time");
|
|
wrapper.orderByDesc("publish_time");
|
|
|
wrapper.last("limit 1");
|
|
wrapper.last("limit 1");
|
|
|
WarningOfSmokeRecordEntity oldRecord = this.getOne(wrapper);
|
|
WarningOfSmokeRecordEntity oldRecord = this.getOne(wrapper);
|
|
|
- if (oldRecord != null && Math.abs(ChronoUnit.SECONDS.between(cameraAlarmMessageDTO.getCreated_at(), oldRecord.getPublishTime())) > pushFrequency.intValue()) {
|
|
|
|
|
|
|
+ if (oldRecord != null && oldRecord.getPublishTime()!=null&&Math.abs
|
|
|
|
|
+ (ChronoUnit.SECONDS.between(cameraAlarmMessageDTO.getCreated_at(), oldRecord.getPublishTime())) < pushFrequency.intValue()) {
|
|
|
|
|
+ log.info("消息半小时内多次发送,系统未保存该信息【{}】", cameraAlarmMessageDTO.toString());
|
|
|
|
|
+ } else {
|
|
|
// 保存记录
|
|
// 保存记录
|
|
|
WarningOfSmokeRecordEntity entity = new WarningOfSmokeRecordEntity();
|
|
WarningOfSmokeRecordEntity entity = new WarningOfSmokeRecordEntity();
|
|
|
entity.setPlace(cameraAlarmMessageDTO.getDeviceName());
|
|
entity.setPlace(cameraAlarmMessageDTO.getDeviceName());
|
|
@@ -84,9 +87,9 @@ public class WarningOfSmokeRecordServiceImpl extends ServiceImpl<WarningOfSmokeR
|
|
|
|
|
|
|
|
// 发送通知
|
|
// 发送通知
|
|
|
warningOfSmokePushRecordService.pushWarningInfo(entity);
|
|
warningOfSmokePushRecordService.pushWarningInfo(entity);
|
|
|
- } else {
|
|
|
|
|
- log.info("消息半小时内多次发送,系统未保存该信息【{}】", cameraAlarmMessageDTO.toString());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|