燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-06-09 498718ad129e8a9010e6f2af2fde2f9d4508fd32
src/main/java/com/yssh/controller/WarningAnalyseController.java
@@ -79,14 +79,15 @@
        Object obj = CacheUtils.get(key);
        Map<String, List<Double>> map;
        if (null != obj) {
            map = (Map<String, List<Double>>) obj;
        } else {
            map = warningService.selectEachLocationDataChange();
            if (null != map && map.size() > 0) {
                CacheUtils.put(key, map);
            }
        }
        //if (null != obj) {
        //    map = (Map<String, List<Double>>) obj;
        //} else {
            //map = warningService.selectEachLocationDataChange();
            map = warningService.select3Hours();
        //    if (null != map && map.size() > 0) {
        //        CacheUtils.put(key, map);
        //    }
        //}
        return Result.ok(map);
    }
@@ -97,19 +98,19 @@
    public Result monthTop10() {
        //return Result.OK(warningService.selectThisMonthLocationValueDataTop10());
        String key = dateFormat.format(new Date()) + "_top10";
        Object obj = CacheUtils.get(key);
        //String key = dateFormat.format(new Date()) + "_top10";
        //Object obj = CacheUtils.get(key);
        List<Qxsh> list;
        if (null != obj) {
            list = (List<Qxsh>) obj;
        } else {
        //if (null != obj) {
        //    list = (List<Qxsh>) obj;
        //} else {
            //list = warningService.selectThisMonthLocationValueDataTop10();
            list = warningService.selectMonthTop10();
            if (null != list && list.size() > 0) {
                CacheUtils.put(key, list);
            }
        }
        //    if (null != list && list.size() > 0) {
        //        CacheUtils.put(key, list);
        //    }
        //}
        return Result.ok(list);
    }