mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 汇付会员
This commit is contained in:
@@ -23,7 +23,9 @@ public class CacheConstants {
|
||||
|
||||
public static final int cache_expire_time_1d = 60 * 60 * 24;
|
||||
|
||||
public static final String PILE_PROGRAM_VERSION = "pile_program_version";
|
||||
public static final String ADAPAY_MEMBER_INFO = "adapay_member_info:";
|
||||
|
||||
public static final String PILE_PROGRAM_VERSION = "pile_program_version_";
|
||||
|
||||
public static final String QUERY_ORDER_CALLBACK = "query_order_callback:";
|
||||
|
||||
|
||||
@@ -16,4 +16,6 @@ public interface AdapayMemberInfoService {
|
||||
int updateByPrimaryKey(AdapayMemberInfo record);
|
||||
|
||||
AdapayMemberInfo selectByMerchantId(String merchantId);
|
||||
|
||||
AdapayMemberInfo selectByStationId(String stationId);
|
||||
}
|
||||
|
||||
@@ -70,4 +70,6 @@ public interface IPileMerchantInfoService {
|
||||
* @return
|
||||
*/
|
||||
List<String> queryByMerchantDeptIds(List<String> merchantDeptIds);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.pile.domain.AdapayMemberInfo;
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.mapper.AdapayMemberInfoMapper;
|
||||
import com.jsowell.pile.service.AdapayMemberInfoService;
|
||||
import com.jsowell.pile.service.IPileStationInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -12,6 +17,12 @@ public class AdapayMemberInfoServiceImpl implements AdapayMemberInfoService {
|
||||
@Resource
|
||||
private AdapayMemberInfoMapper adapayMemberInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private IPileStationInfoService pileStationInfoService;
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return adapayMemberInfoMapper.deleteByPrimaryKey(id);
|
||||
@@ -44,7 +55,24 @@ public class AdapayMemberInfoServiceImpl implements AdapayMemberInfoService {
|
||||
|
||||
@Override
|
||||
public AdapayMemberInfo selectByMerchantId(String merchantId) {
|
||||
return adapayMemberInfoMapper.selectByMerchantId(merchantId);
|
||||
String redisKey = CacheConstants.ADAPAY_MEMBER_INFO + merchantId;
|
||||
AdapayMemberInfo adapayMemberInfo = redisCache.getCacheObject(redisKey);
|
||||
if (adapayMemberInfo == null) {
|
||||
adapayMemberInfo = adapayMemberInfoMapper.selectByMerchantId(merchantId);
|
||||
if (adapayMemberInfo != null) {
|
||||
redisCache.setCacheObject(redisKey, adapayMemberInfo, CacheConstants.cache_expire_time_1d);
|
||||
}
|
||||
}
|
||||
return adapayMemberInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdapayMemberInfo selectByStationId(String stationId) {
|
||||
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId));
|
||||
if (pileStationInfo != null) {
|
||||
return selectByMerchantId(pileStationInfo.getMerchantId() + "");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
||||
if (pileStationInfo == null) {
|
||||
// 查数据库
|
||||
pileStationInfo = pileStationInfoMapper.selectPileStationInfoById(id);
|
||||
redisCache.setCacheObject(redisKey, pileStationInfo, 5, TimeUnit.MINUTES);
|
||||
redisCache.setCacheObject(redisKey, pileStationInfo, 15, TimeUnit.MINUTES);
|
||||
}
|
||||
return pileStationInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user