diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java index d67c31e9d..52c4e8225 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java @@ -361,23 +361,12 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi /** * 通过计费模板id查询计费模板详情 - * 缓存30分账,修改清缓存 + * 缓存1天,修改清缓存 * @param id * @return */ @Override - public List queryBillingDetailById(Long id) { - String redisKey = CacheConstants.QUERY_BILLING_DETAIL_BY_ID + id; - List pileBillingDetails = redisCache.getCacheList(redisKey); - if (CollectionUtils.isEmpty(pileBillingDetails)) { - pileBillingDetails = pileBillingTemplateMapper.queryBillingDetailByTemplateId(id); - if (CollectionUtils.isNotEmpty(pileBillingDetails)) { - redisCache.setCacheList(redisKey, pileBillingDetails); - redisCache.expire(redisKey, 30, TimeUnit.MINUTES); - } - } - return pileBillingDetails; - } + public List queryBillingDetailById(Long id) @Override public List queryPublicBillingTemplateList() { 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 70d22de87..ddfe44c13 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 @@ -390,17 +390,18 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService { */ @Override public List getUniAppConnectorList(Long stationId) { - // TODO 加缓存 - // String redisKey = CacheConstants.GET_UNIAPP_CONNECTOR_LIST_BY_STATION_ID + stationId; - // List list = redisCache.getCacheObject(redisKey); - // if (CollectionUtils.isEmpty(list)) { - // // 查数据库 - // list = pileConnectorInfoMapper.getUniAppConnectorList(stationId); - // if (CollectionUtils.isNotEmpty(list)) { - // redisCache.setCacheObject(redisKey, list, 5, TimeUnit.MINUTES); - // } - // } - return pileConnectorInfoMapper.getUniAppConnectorList(stationId); + // 加缓存 + String redisKey = CacheConstants.GET_UNIAPP_CONNECTOR_LIST_BY_STATION_ID + stationId; + List list = redisCache.getCacheList(redisKey); + if (CollectionUtils.isEmpty(list)) { + // 查数据库 + list = pileConnectorInfoMapper.getUniAppConnectorList(stationId); + if (CollectionUtils.isNotEmpty(list)) { + redisCache.setCacheList(redisKey, list); + redisCache.expire(redisKey, CacheConstants.cache_expire_time_1d); + } + } + return list; } public List getConnectorListForLianLian(Long stationId) {