mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 11:49:49 +08:00
update 批量查询枪口列表
This commit is contained in:
@@ -510,7 +510,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
|||||||
}
|
}
|
||||||
// 先将已经有数据的stationId进行收集
|
// 先将已经有数据的stationId进行收集
|
||||||
List<String> hasDataStationIds = new ArrayList<>(map.keySet());
|
List<String> hasDataStationIds = new ArrayList<>(map.keySet());
|
||||||
Collection<List<ConnectorInfoVO>> values = map.values();
|
List<List<ConnectorInfoVO>> values = new ArrayList<>(map.values());
|
||||||
// 筛选出没有数据的stationIds
|
// 筛选出没有数据的stationIds
|
||||||
List<String> noDataStationIds = stationIds.stream()
|
List<String> noDataStationIds = stationIds.stream()
|
||||||
.filter(x -> !hasDataStationIds.contains(x))
|
.filter(x -> !hasDataStationIds.contains(x))
|
||||||
@@ -520,7 +520,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
|||||||
// 通过stationIds批量查询数据库
|
// 通过stationIds批量查询数据库
|
||||||
List<ConnectorInfoVO> newConnectorInfoList = pileConnectorInfoMapper.batchSelectConnectorList(noDataStationIds);
|
List<ConnectorInfoVO> newConnectorInfoList = pileConnectorInfoMapper.batchSelectConnectorList(noDataStationIds);
|
||||||
if (CollectionUtils.isEmpty(values)) {
|
if (CollectionUtils.isEmpty(values)) {
|
||||||
values = new ArrayList<>();
|
values = Lists.newArrayList();
|
||||||
}
|
}
|
||||||
values.add(newConnectorInfoList);
|
values.add(newConnectorInfoList);
|
||||||
|
|
||||||
@@ -534,7 +534,8 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
|||||||
List<ConnectorInfoVO> voList = entry.getValue();
|
List<ConnectorInfoVO> voList = entry.getValue();
|
||||||
|
|
||||||
String redisKey = baseRedisKey + stationId;
|
String redisKey = baseRedisKey + stationId;
|
||||||
redisCache.setCacheObject(redisKey, voList, CacheConstants.cache_expire_time_1h);
|
redisCache.setCacheList(redisKey, voList);
|
||||||
|
redisCache.expire(redisKey, CacheConstants.cache_expire_time_1h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user