Commit 20326cc8 authored by caotao's avatar caotao

缓存数据时新增logger提示 移动mapper文件到正确位置

parent a2f1fb5e
......@@ -12,6 +12,7 @@ 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.mapper2.SjglZsjZsbtzMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
......@@ -22,7 +23,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Component
public class StationCacheDataInit implements CommandLineRunner {
Logger logger = LoggerFactory.getLogger(StationCacheDataInit.class);
......@@ -39,6 +40,7 @@ public class StationCacheDataInit implements CommandLineRunner {
@Resource
private RedisTemplate redisTemplate;
public void run(String... args) throws Exception {
log.info("-------------------------------------开始缓存场站基础数据----------------------------");
List<StationCacheInfoDto> stationCacheInfoDtos = new ArrayList<>();
redisTemplate.delete("station_info_cache");
List<Region> regionList = regionMapper.selectList(new QueryWrapper<Region>().eq("LEVEL", 1));
......@@ -65,5 +67,6 @@ public class StationCacheDataInit implements CommandLineRunner {
stationCacheInfoDtos.add(stationCacheInfoDto);
});
redisTemplate.opsForList().leftPushAll("station_info_cache",stationCacheInfoDtos);
log.info("-------------------------------------结束缓存场站基础数据----------------------------");
}
}
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