diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java index e35951018..7e39e7826 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java @@ -510,7 +510,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { } // 先将已经有数据的stationId进行收集 List hasDataStationIds = new ArrayList<>(map.keySet()); - Collection> values = map.values(); + List> values = new ArrayList<>(map.values()); // 筛选出没有数据的stationIds List noDataStationIds = stationIds.stream() .filter(x -> !hasDataStationIds.contains(x)) @@ -520,7 +520,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { // 通过stationIds批量查询数据库 List newConnectorInfoList = pileConnectorInfoMapper.batchSelectConnectorList(noDataStationIds); if (CollectionUtils.isEmpty(values)) { - values = new ArrayList<>(); + values = Lists.newArrayList(); } values.add(newConnectorInfoList); @@ -534,7 +534,8 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { List voList = entry.getValue(); 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); } }