diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java index 3bdfb4a..7cc733b 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java @@ -72,19 +72,21 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { return; } // 告警已处理 - if(handlers.contains(alarm.getAlarmContext())){ + if(CollectionUtil.isNotEmpty(handlers) && handlers.contains(alarm.getAlarmContext())){ return; } // 告警已延后处理 - if(delays.contains(alarm.getAlarmContext())){ + if(CollectionUtil.isNotEmpty(delays) && delays.contains(alarm.getAlarmContext())){ return; } // 近5分钟内告警重复 - for (String key : keys) { - String value = stringRedisTemplate.opsForValue().get(key); - if (value.equals(optional.get().getName()+alarm.getAlarmContext())){ - return; - } + if(CollectionUtil.isNotEmpty(keys)){ + for (String key : keys) { + String value = stringRedisTemplate.opsForValue().get(key); + if (value.equals(optional.get().getName()+alarm.getAlarmContext())){ + return; + } + } } // fpd告警拼接站点名称 if(AlarmConstants.EARLY_WARNING.equals(alarm.getAlarmSource())){ diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java index 2f4527c..c80c634 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java @@ -21,4 +21,8 @@ public interface AlarmHandleMapper extends UserDataScopeBaseMapper selectHandlePage(IPage page, @Param("param") HandleQueryVo param); List handles(@Param("start") String start,@Param("end") String end); + + List sameDayContent(@Param("start") String start,@Param("end") String end); + + List incompleteContent(@Param("end") String end); } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml index 971f958..0a0ff34 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml @@ -40,4 +40,24 @@ AND (HANDLER.DELAY_TIME > #{end} OR HANDLER.DELAY_TIME IS NULL) + + diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java index b53128a..0a954e2 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java @@ -31,10 +31,7 @@ import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -172,12 +169,16 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl sameDayContent() { - return null; + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.HOUR_OF_DAY,-1); + String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; + String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); + return this.baseMapper.sameDayContent(start,end); } /** @@ -186,6 +187,7 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl incompleteContent() { - return null; + String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); + return this.baseMapper.incompleteContent(end); } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java index 34c0a4f..2f6588a 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java @@ -42,5 +42,5 @@ public interface IInteractiveService { */ R knowledgeAsk(String question, String sessionId, String userId, String knowledge); - Object sendRemoteControl(ControlDTO operate); + R sendRemoteControl(ControlDTO operate); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java index 0395fd4..f5571dd 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java @@ -274,7 +274,7 @@ public class InteractiveServiceImpl implements IInteractiveService { * @return */ @Override - public Object sendRemoteControl(ControlDTO operate) { + public R sendRemoteControl(ControlDTO operate) { return remoteClient.sendCtrl(operate); } }