mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-10 17:19:36 +08:00
update
This commit is contained in:
@@ -161,6 +161,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
// 清缓存
|
// 清缓存
|
||||||
cleanRedisCache(pileBasicInfo.getSn());
|
cleanRedisCache(pileBasicInfo.getSn());
|
||||||
pileBasicInfo.setUpdateTime(DateUtils.getNowDate());
|
pileBasicInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
redisCache.deleteObject(CacheConstants.GET_PILE_LIST_BY_STATION_ID + pileBasicInfo.getStationId());
|
||||||
return pileBasicInfoMapper.updatePileBasicInfo(pileBasicInfo);
|
return pileBasicInfoMapper.updatePileBasicInfo(pileBasicInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,9 +643,14 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
@Override
|
@Override
|
||||||
public List<PileBasicInfo> getPileListByStationId(String stationId) {
|
public List<PileBasicInfo> getPileListByStationId(String stationId) {
|
||||||
String redisKey = CacheConstants.GET_PILE_LIST_BY_STATION_ID + stationId;
|
String redisKey = CacheConstants.GET_PILE_LIST_BY_STATION_ID + stationId;
|
||||||
|
List<PileBasicInfo> pileList = redisCache.getCacheList(redisKey);
|
||||||
List<PileBasicInfo> pileList = pileBasicInfoMapper.getPileListByStationId(stationId);
|
if (CollectionUtils.isEmpty(pileList)) {
|
||||||
|
pileList = pileBasicInfoMapper.getPileListByStationId(stationId);
|
||||||
|
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||||
|
redisCache.setCacheList(redisKey, pileList);
|
||||||
|
redisCache.expire(redisKey, CacheConstants.cache_expire_time_1d);
|
||||||
|
}
|
||||||
|
}
|
||||||
return pileList;
|
return pileList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user