| | |
| | | |
| | | private static String lastRunAlarm = ""; |
| | | |
| | | private static Map<String, Long> lastRunTime = new HashMap<>(); |
| | | |
| | | /** |
| | | * 监听预测完成,产生预警消息 |
| | | * |
| | |
| | | moduleType.equals(CommonConstant.NET_LDG2) || |
| | | moduleType.equals(CommonConstant.NET_LDG3)) { |
| | | log.info("moduleType:" + moduleType); |
| | | String runKey = "GasAlarm_" + predictTime.getTime(); |
| | | log.info("runKey:" + runKey); |
| | | log.info("lastRunAlarm:" + lastRunAlarm); |
| | | if (lastRunAlarm.equals(runKey)) { |
| | | if (lastRunTime.containsKey(moduleType) && lastRunTime.get(moduleType) == predictTime.getTime()) { |
| | | log.info("moduleType return"); |
| | | return; |
| | | } |
| | | lastRunAlarm = runKey; |
| | | |
| | | // 预警信息列表 |
| | | List<AlarmMessageRespDTO> alarmList = new ArrayList<>(); |
| | | // 根据管网查询相关预警配置 |
| | | lastRunTime.put(moduleType, predictTime.getTime()); |
| | | log.info("lastRunTime=" + JSONObject.toJSONString(lastRunTime)); |
| | | log.info("开始处理预警"); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("alarmObj", moduleType); |
| | | List<AlarmConfigRespDTO> configList = mcsApi.listAlarmConfig(params); |
| | |
| | | log.info("AlarmConfigList is empty"); |
| | | return; |
| | | } |
| | | log.info("configList=" + JSONArray.toJSONString(configList)); |
| | | |
| | | // 预警信息列表 |
| | | List<AlarmMessageRespDTO> alarmList = new ArrayList<>(); |
| | | List<String> outputIdList = configList.stream().map(item -> { |
| | | return item.getOutId(); |
| | | }).collect(Collectors.toList()); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | } |