| | |
| | | * 获取实时报警 |
| | | */ |
| | | public List<Qxsh> getRunTimeAlarmAnalyse(Integer start, Integer end) { |
| | | List<Qxsh> list = qxshMapper.selectAlarmByBeginAndEnd(start, end); |
| | | //List<Qxsh> list = qxshMapper.selectAlarmByBeginAndEnd(start, end); |
| | | String key = "qxshMapper.selectAlarmByBeginAndEnd." + start + "." + end; |
| | | List<Qxsh> list = CacheUtils.getListByKey(key); |
| | | if (null == list) { |
| | | list = qxshMapper.selectAlarmByBeginAndEnd(start, end); |
| | | copeHasSuYuan(list); |
| | | CacheUtils.putListByKey(key, list); |
| | | } |
| | | |
| | | return copeHasSuYuan(list); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取实时预警 |
| | | */ |
| | | public List<Qxsh> getRunTimeWarningAnalyse(Integer start, Integer end) { |
| | | List<Qxsh> list = qxshMapper.selectWarnByBeginAndEnd(start, end); |
| | | //List<Qxsh> list = qxshMapper.selectWarnByBeginAndEnd(start, end); |
| | | String key = "qxshMapper.selectWarnByBeginAndEnd." + start + "." + end; |
| | | List<Qxsh> list = CacheUtils.getListByKey(key); |
| | | if (null == list) { |
| | | list = qxshMapper.selectWarnByBeginAndEnd(start, end); |
| | | copeHasSuYuan(list); |
| | | CacheUtils.putListByKey(key, list); |
| | | } |
| | | |
| | | return copeHasSuYuan(list); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | Integer start = Integer.parseInt(DateUtils.getYyyyMmDdHh(startDate)); |
| | | Integer end = Integer.parseInt(DateUtils.getYyyyMmDdHh(endDate)); |
| | | |
| | | String key = "WAS.monthCount." + start + "." + end; |
| | | Object obj = CacheUtils.get(key); |
| | | if (obj instanceof Map<?, ?>) { |
| | | return (Map<String, Integer>) obj; |
| | | } |
| | | |
| | | Map<String, Integer> result = new HashMap<>(); |
| | | Integer warnNum = qxshMapper.countMonthForWarn(start, end); |
| | | result.put("warningNumber", null == warnNum ? 0 : warnNum); |
| | | |
| | | Integer alarmNum = qxshMapper.countMonthForAlarm(start, end); |
| | | result.put("alarmNumber", null == alarmNum ? 0 : alarmNum); |
| | | |
| | | CacheUtils.put(key, result); |
| | | |
| | | return result; |
| | | } |
| | |
| | | Integer start = Integer.parseInt(DateUtils.getYyyyMmDdHh(startDate)); |
| | | |
| | | Map<String, List<Map<String, Object>>> result = new HashMap<>(); |
| | | List<Map<String, Object>> warnList = qxshMapper.count7DayForWarn(start, end); |
| | | //List<Map<String, Object>> warnList = qxshMapper.count7DayForWarn(start, end); |
| | | String key = "qxshMapper.count7DayForWarn." + start + "." + end; |
| | | List<Map<String, Object>> warnList = CacheUtils.getListByKey(key); |
| | | if (null == warnList) { |
| | | warnList = qxshMapper.count7DayForWarn(start, end); |
| | | CacheUtils.putListByKey(key, warnList); |
| | | } |
| | | result.put("warningDayCount", warnList); |
| | | |
| | | List<Map<String, Object>> alarmList = qxshMapper.count7DayForAlarm(start, end); |
| | | //List<Map<String, Object>> alarmList = qxshMapper.count7DayForAlarm(start, end); |
| | | String key2 = "qxshMapper.count7DayForAlarm." + start + "." + end; |
| | | List<Map<String, Object>> alarmList = CacheUtils.getListByKey(key2); |
| | | if (null == alarmList) { |
| | | alarmList = qxshMapper.count7DayForAlarm(start, end); |
| | | CacheUtils.putListByKey(key2, alarmList); |
| | | } |
| | | result.put("alarmDayCount", alarmList); |
| | | |
| | | return result; |
| | |
| | | |
| | | WarningDetail wd = new WarningDetail(0L, tab, suYuanId, qxsh.getName(), null, 0, qxsh.getValue()); |
| | | DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(tab, suYuanId); |
| | | if (null == suYuan) { |
| | | String[] strs = suYuanId.split("_"); |
| | | suYuan = new DistanceSuYuan(null, null, 0.0, suYuanId, Integer.parseInt(strs[0]), Integer.parseInt(strs[1]), 0, 0, null, 0.0, 0.0, 0.0, 0.0); |
| | | } |
| | | //List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50); |
| | | //DistanceSuYuan suMax = suYuanMapper.getSuYuan500Max(tab, ids3d); |
| | | |
| | | //String filter = CalculateUtils.getFilterByExtend(point, 50); |
| | | String filter = getFilterByPoint(point, 50); |
| | | DistanceSuYuan suMax = suYuanMapper.getSuYuan500MaxByFilter(tab, filter); |
| | | if (null == suMax) { |
| | | String[] strs = suYuanId.split("_"); |
| | | suMax = new DistanceSuYuan(null, null, 0.0, suYuanId, Integer.parseInt(strs[0]), Integer.parseInt(strs[1]), 0, 0, null, 0.0, 0.0, 0.0, 0.0); |
| | | } |
| | | suMax.setAddr(getAddr(suMax.getId())); |
| | | |
| | | Report report = Report.calcReport(wd, suYuan, suMax); |