瀏覽代碼

mqtt设备列表

tjf 6 天之前
父節點
當前提交
ca0c09fe6a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ruoyi-system/src/main/java/com/ruoyi/manage/service/impl/WarnManageServiceImpl.java

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/manage/service/impl/WarnManageServiceImpl.java

@@ -157,7 +157,7 @@ public class WarnManageServiceImpl implements IWarnManageService {
         }
 
         //上月告警数据
-        Map<String, Object> warnLastMonth = redisCache.getCacheMap(WARN_LAST_MONTH + DateUtils.getMonth());
+        Map<String, Object> warnLastMonth = redisCache.getCacheMap(WARN_LAST_MONTH + DateUtils.getLastMonth());
         if (warnLastMonth.isEmpty()) {
             Map<String, Object> lastMap = new HashMap<>();
             //从数据库查询
@@ -192,7 +192,7 @@ public class WarnManageServiceImpl implements IWarnManageService {
             lastMap.put("warnMonthLastAll", warnMonthLastAll);
             lastMap.put("warnMonthLastLeave", warnMonthLastLeave);
             lastMap.put("warnMonthLastPlay", warnMonthLastPlay);
-            redisCache.setCacheMap(WARN_LAST_MONTH + DateUtils.getMonth(), lastMap);
+            redisCache.setCacheMap(WARN_LAST_MONTH + DateUtils.getLastMonth(), lastMap);
         } else {
             warnMonthLastAll = Integer.parseInt(warnLastMonth.get("warnMonthLastAll").toString());
             warnMonthLastLeave = Integer.parseInt(warnLastMonth.get("warnMonthLastLeave").toString());