Commit 821235e6 authored by duanruiming's avatar duanruiming

[update] 实时监控->路口关联缓存优化

parent da754aed
......@@ -28,10 +28,20 @@ public class CrossRidInfoCache implements CommandLineRunner {
private static List<RidInfoEntity> ridInfoList = new ArrayList<>();
/**
* 获取所有路口关联列表
* @return
*/
public List<RidInfoEntity> getRidInfoAllList() {
return ridInfoList;
}
/**
* 通过上下游路口编号获取关联路口列表
* @param startCrossId
* @param endCrossId
* @return
*/
public List<RidInfoEntity> getRidInfoListByCrossId(String startCrossId, String endCrossId) {
Stream<RidInfoEntity> stream = ridInfoList.stream();
if (StringUtils.isNotBlank(startCrossId)) {
......@@ -43,6 +53,13 @@ public class CrossRidInfoCache implements CommandLineRunner {
return stream.collect(Collectors.toList());
}
/**
* 刷新缓存
*/
public void refresh() {
init();
}
@Override
public void run(String... args) throws Exception {
init();
......
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