Browse Source

mqtt设备列表

tjf 6 days ago
parent
commit
ca0c09fe6a

+ 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());