|
@@ -0,0 +1,34 @@
|
|
|
|
+package com.ruoyi.system.service.impl;
|
|
|
|
+
|
|
|
|
+import com.ruoyi.common.constant.CacheConstants;
|
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
+import com.ruoyi.common.core.redis.RedisCache;
|
|
|
|
+import com.ruoyi.system.domain.SysConfig;
|
|
|
|
+import com.ruoyi.system.service.IndexService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
+
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Author: tjf
|
|
|
|
+ * @Date: 2022/8/15 14:34
|
|
|
|
+ * @Describe:
|
|
|
|
+ */
|
|
|
|
+public class IndexServiceImpl implements IndexService {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private RedisCache redisCache;
|
|
|
|
+ /**
|
|
|
|
+ * 后台首页统计本月核酸人数,本周人数,对比上周人数
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public AjaxResult getIndexData() {
|
|
|
|
+ Map<String, Object> indexData = redisCache.getCacheMap(CacheConstants.INDEX_DATA);
|
|
|
|
+ if (indexData != null && indexData.size() > 0){
|
|
|
|
+ return AjaxResult.success(indexData);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.error("暂未获取到数据");
|
|
|
|
+ }
|
|
|
|
+}
|