From bad30f2847f819b6ede7e211768d0cb172216181 Mon Sep 17 00:00:00 2001 From: Lemon Date: Wed, 6 Nov 2024 13:41:06 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E6=89=B9=E9=87=8F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9E=AA=E5=8F=A3=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/service/impl/PileConnectorInfoServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); } }