mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 查询站点计费模板使用缓存
This commit is contained in:
@@ -102,8 +102,8 @@ public interface PileBillingTemplateMapper {
|
||||
* @param stationId 站点id
|
||||
* @return
|
||||
*/
|
||||
List<BillingTemplateVO> queryStationBillingTemplateList(@Param("stationId") String stationId,
|
||||
@Param("stationDeptIds") List<String> stationDeptIds);
|
||||
List<BillingTemplateVO> queryStationBillingTemplateListWithAuth(@Param("stationId") String stationId,
|
||||
@Param("stationDeptIds") List<String> stationDeptIds);
|
||||
|
||||
/**
|
||||
* 根据站点id查询站点计费模板列表
|
||||
@@ -111,7 +111,7 @@ public interface PileBillingTemplateMapper {
|
||||
* @param stationId 站点id
|
||||
* @return
|
||||
*/
|
||||
List<BillingTemplateVO> queryStationBillingTemplateListForUniApp(@Param("stationId") String stationId);
|
||||
List<BillingTemplateVO> queryStationBillingTemplateList(@Param("stationId") String stationId);
|
||||
|
||||
/**
|
||||
* 通过桩sn号查询计费模板
|
||||
|
||||
@@ -332,7 +332,8 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
LocalTime localTime = LocalTime.now();
|
||||
String now = LocalTime.of(localTime.getHour(), localTime.getMinute(), localTime.getSecond()).toString();
|
||||
// 通过站点id查询计费模板
|
||||
BillingTemplateVO billingTemplateVO = pileBillingTemplateMapper.selectBillingTemplateByStationId(stationId);
|
||||
// BillingTemplateVO billingTemplateVO = pileBillingTemplateMapper.selectBillingTemplateByStationId(stationId);
|
||||
BillingTemplateVO billingTemplateVO = queryUsedBillingTemplate(stationId);
|
||||
if (Objects.nonNull(billingTemplateVO)) {
|
||||
result = new CurrentTimePriceDetails();
|
||||
result.setTemplateCode(billingTemplateVO.getTemplateCode());
|
||||
@@ -419,7 +420,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
// 为空表示没有权限,返回空数组
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return pileBillingTemplateMapper.queryStationBillingTemplateList(stationId, authorizedMap.getStationDeptIds());
|
||||
return pileBillingTemplateMapper.queryStationBillingTemplateListWithAuth(stationId, authorizedMap.getStationDeptIds());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -454,7 +455,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
String redisKey = CacheConstants.QUERY_STATION_BILLING_TEMPLATE_LIST + stationId;
|
||||
List<BillingTemplateVO> voList = redisCache.getCacheList(redisKey);
|
||||
if (CollectionUtils.isEmpty(voList)) {
|
||||
voList = pileBillingTemplateMapper.queryStationBillingTemplateListForUniApp(stationId);
|
||||
voList = pileBillingTemplateMapper.queryStationBillingTemplateList(stationId);
|
||||
if (CollectionUtils.isNotEmpty(voList)) {
|
||||
redisCache.setCacheList(redisKey, voList);
|
||||
redisCache.expire(redisKey, 15, TimeUnit.MINUTES);
|
||||
|
||||
Reference in New Issue
Block a user