diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmAssociationController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmAssociationController.java index a8a918a..cb14b0e 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmAssociationController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmAssociationController.java @@ -76,6 +76,4 @@ public class EmAssociationController extends BladeController { return R.status(emAssociationService.deleteLogic(Func.toLongList(ids))); } - - } 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 d044fbf..20c2f8a 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 @@ -61,9 +61,9 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { return false; } // 步骤2.查询当天处理的告警 - List handlers = handleService.sameDayContent(); + List handlers = handleService.sameDayContent(stations.getData().stream().map(StationEntity::getCode).collect(Collectors.toList())); // 步骤3.查询延后未完成的告警 - List delays = handleService.incompleteContent(); + List delays = handleService.incompleteContent(stations.getData().stream().map(StationEntity::getCode).collect(Collectors.toList())); // 步骤4.近5分钟内告警 Set keys = stringRedisTemplate.keys("hzims:queue:filter:alarm" + "*"); // 步骤5.遍历保存告警数据 diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java index 97c53b0..82880ad 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java @@ -29,7 +29,7 @@ public class HZ300MqttConsumer implements SubscribeCallBack { private AlarmSaveService alarmSaveService; @Override public void onMessage(Map data) { - log.info("HZ3000队列监听到消息 : {}",data); + log.error("HZ3000队列监听到消息 : {}",data); //消费代码 List alarmEntities = systemAlarmService.receiveMessage(JSONObject.toJSONString(data)); if(CollectionUtil.isEmpty(alarmEntities)){ 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 c80c634..83cc21f 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 @@ -22,7 +22,7 @@ public interface AlarmHandleMapper extends UserDataScopeBaseMapper handles(@Param("start") String start,@Param("end") String end); - List sameDayContent(@Param("start") String start,@Param("end") String end); + List sameDayContent(@Param("start") String start,@Param("end") String end,@Param("stations") List stations); - List incompleteContent(@Param("end") String end); + List incompleteContent(@Param("end") String end,@Param("stations") List stations); } 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 029edcc..33cd2e4 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 @@ -50,6 +50,12 @@ AND HANDLER.CREATE_TIME BETWEEN #{start} AND #{end} + + and HANDLER.STATION_CODE in + + #{station} + + diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java index b06840b..8911c3d 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java @@ -26,7 +26,7 @@ public interface AlarmHandleService extends BaseService { List handles(); - List sameDayContent(); + List sameDayContent(List stations); - List incompleteContent(); + List incompleteContent(List stations); } 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 0a954e2..849a47e 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 @@ -173,12 +173,12 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl sameDayContent() { + public List sameDayContent(List stations) { 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); + return this.baseMapper.sameDayContent(start,end,stations); } /** @@ -186,8 +186,8 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl incompleteContent() { + public List incompleteContent(List stations) { String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); - return this.baseMapper.incompleteContent(end); + return this.baseMapper.incompleteContent(end,stations); } }