mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
通过桩sn号查询计费模板 加缓存
This commit is contained in:
@@ -839,7 +839,16 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
||||
*/
|
||||
@Override
|
||||
public BillingTemplateVO selectBillingTemplateDetailByPileSn(String pileSn) {
|
||||
return pileBillingTemplateMapper.selectBillingTemplateByPileSn(pileSn);
|
||||
String redisKey = CacheConstants.BILLING_TEMPLATE_BY_PILE_SN + pileSn;
|
||||
Object cacheObject = redisCache.getCacheObject(redisKey);
|
||||
if (cacheObject != null) {
|
||||
return JSON.parseObject(cacheObject.toString(), BillingTemplateVO.class);
|
||||
}
|
||||
BillingTemplateVO billingTemplateVO = pileBillingTemplateMapper.selectBillingTemplateByPileSn(pileSn);
|
||||
if (billingTemplateVO != null) {
|
||||
redisCache.setCacheObject(redisKey, JSON.toJSONString(billingTemplateVO), CacheConstants.cache_expire_time_1d);
|
||||
}
|
||||
return billingTemplateVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user