Commit e77883dc authored by tangwei's avatar tangwei

解决冲突

parents a0d77385 24db090f
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.QueryDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESEquipmentsRepository;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
......@@ -382,5 +383,10 @@ public class DemoController extends BaseController {
map.put("1668801435891929089_sum",sum);
return map;
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "取缓存数据")
@GetMapping("/test12")
public List<StationCacheInfoDto> demoTest12() {
return commonServiceImpl.getListStationCacheInfoDto();
}
}
......@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
@Data
public class StationCacheInfoDto {
public class StationCacheInfoDto implements Serializable {
//场站id
private String stationId;
//场站名称
......
......@@ -7,10 +7,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.QueryDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto;
import com.yeejoin.amos.boot.module.jxiop.biz.initdata.StationCacheDataInit;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESEquipmentsRepository;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import net.bytebuddy.asm.Advice;
import org.apache.poi.ss.formula.functions.Count;
import org.apache.poi.ss.formula.functions.T;
import org.elasticsearch.index.query.BoolQueryBuilder;
......@@ -25,6 +28,7 @@ import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.core.query.Query;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -49,6 +53,11 @@ public class CommonServiceImpl {
private ElasticsearchRestTemplate elasticsearchTemplate;
@Autowired
ESEquipmentsRepository equipmentsRepository;
@Autowired
private StationCacheDataInit stationCacheDataInit;
@Autowired
private RedisTemplate redisTemplate;
/**
* 带参数 求平均值
......@@ -242,4 +251,17 @@ public class CommonServiceImpl {
socialContributionDtoPage.setCurrent(1);
return socialContributionDtoPage;
}
public List<StationCacheInfoDto> getListStationCacheInfoDto(){
List<StationCacheInfoDto> stationCacheInfoDtoList =redisTemplate.opsForList().range("station_info_cache",0,-1);
if(stationCacheInfoDtoList!=null){
try {
stationCacheDataInit.run();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
stationCacheInfoDtoList =redisTemplate.opsForList().range("station_info_cache",0,-1);
return stationCacheInfoDtoList;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment