管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-02-29 671a88e789a4cd62851bbdc06bbd13b82b535246
添加查询钻孔数据,添加缓存时间设置
已修改2个文件
17 ■■■■ 文件已修改
src/main/java/com/lf/server/entity/all/StaticData.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/ReportService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/StaticData.java
@@ -18,10 +18,12 @@
    public final static int I1 = 1;
    public final static int TWO = 2;
    public final static int I2 = 2;
    public final static int FOUR = 4;
    public final static int I5 = 5;
    public final static int NINE = 9;
    public final static int I10 = 10;
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -1,7 +1,6 @@
package com.lf.server.service.sys;
import com.lf.server.entity.all.RedisCacheKey;
import com.lf.server.entity.all.SettingData;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.ctrl.CoordinateEntity;
import com.lf.server.entity.ctrl.CountEntity;
@@ -13,10 +12,8 @@
import com.lf.server.mapper.sys.ReportMapper;
import com.lf.server.service.all.RedisService;
import com.lf.server.service.data.DownloadService;
import com.lf.server.service.data.PublishService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.locationtech.jts.geom.Coordinate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -134,15 +131,15 @@
    @Override
    public List<CountEntity> countExplorationPoints() {
        String key = RedisCacheKey.dataCountKey("countExplorationPoints");
//        Object obj = redisService.get(key);
//        if (obj instanceof List<?>) {
//            return (List<CountEntity>) obj;
//        }
        Object obj = redisService.get(key);
        if (obj instanceof List<?>) {
            return (List<CountEntity>) obj;
        }
        List<CountEntity> list = reportMapper.countExplorationPoints();
        if (null != list && list.size() > 0) {
            countExplorationArea(list);
            redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES);
            redisService.put(key, list, StaticData.I2, TimeUnit.MINUTES);
        }
        return list;