| | |
| | | public static final long CACHE_HOLD_TIME_24H = 24 * 60 * 60 * 1000L; |
| | | |
| | | //报警分析 |
| | | |
| | | /** |
| | | * 1.查询当前时间的所有点位value值(以47.dat查询即可) |
| | | * 2.筛选大于yssh_bjyj中的jcbj字段的值 返回id+经纬度+value |
| | |
| | | } |
| | | |
| | | //预警分析 |
| | | |
| | | /** |
| | | * 1.查询当前时间的所有点位value值(以47.dat查询即可) |
| | | * 2.筛选大于yssh_bjyj中的jcyj字段的值 返回id+经纬度+value |
| | |
| | | public Result locationDataChange() { |
| | | //return Result.OK(warningService.selectEachLocationDataChange()); |
| | | |
| | | String key = dateFormat.format(new Date()); |
| | | Map<String, List<Double>> map = null; |
| | | String key = dateFormat.format(new Date()) + "_local"; |
| | | Map<String, List<Double>> map; |
| | | if (cache.containsKey(key)) { |
| | | map = (Map<String, List<Double>>) cache.get(key); |
| | | } else { |
| | | map = warningService.selectEachLocationDataChange(); |
| | | if (null != map && map.size() > 0) { |
| | | if (cache.size() > 0) { |
| | | cache.clear(); |
| | | } |
| | | cache.put(key, map); |
| | | } |
| | | } |
| | |
| | | @ApiOperation(value = "获取本月监测大数据站点最大值TOP10", notes = "获取本月监测大数据站点最大值TOP10数量列表") |
| | | @GetMapping("/monthTop10") |
| | | public Result monthTop10(){ |
| | | return Result.OK(warningService.selectThisMonthLocationValueDataTop10()); |
| | | //return Result.OK(warningService.selectThisMonthLocationValueDataTop10()); |
| | | |
| | | String key = dateFormat.format(new Date()) + "_top10"; |
| | | List<Map<String, Object>> list; |
| | | if (cache.containsKey(key)) { |
| | | list = (List<Map<String, Object>>) cache.get(key); |
| | | } else { |
| | | list = warningService.selectThisMonthLocationValueDataTop10(); |
| | | if (null != list && list.size() > 0) { |
| | | cache.put(key, list); |
| | | } |
| | | } |
| | | |
| | | return Result.OK(list); |
| | | } |
| | | } |