|
@@ -13,6 +13,7 @@ import org.dromara.common.json.utils.JsonUtils;
|
|
|
import org.dromara.common.redis.utils.RedisUtils;
|
|
import org.dromara.common.redis.utils.RedisUtils;
|
|
|
import org.dromara.server.common.util.CardDateUtils;
|
|
import org.dromara.server.common.util.CardDateUtils;
|
|
|
import org.dromara.server.consume.cache.CardCacheManager;
|
|
import org.dromara.server.consume.cache.CardCacheManager;
|
|
|
|
|
+import org.dromara.server.consume.cache.UserAccountCacheManager;
|
|
|
import org.dromara.server.consume.cache.ValidationParam;
|
|
import org.dromara.server.consume.cache.ValidationParam;
|
|
|
import org.dromara.server.consume.domain.bo.XfCardLimitedBo;
|
|
import org.dromara.server.consume.domain.bo.XfCardLimitedBo;
|
|
|
import org.dromara.server.consume.domain.vo.PtBagVo;
|
|
import org.dromara.server.consume.domain.vo.PtBagVo;
|
|
@@ -50,6 +51,7 @@ public class InitBusiness {
|
|
|
private final IXfTermService xfTermService;
|
|
private final IXfTermService xfTermService;
|
|
|
private final ValidationParam validationParam;
|
|
private final ValidationParam validationParam;
|
|
|
private final CardCacheManager cardCacheManager;
|
|
private final CardCacheManager cardCacheManager;
|
|
|
|
|
+ private final UserAccountCacheManager userAccountCacheManager;
|
|
|
|
|
|
|
|
@DubboReference
|
|
@DubboReference
|
|
|
private final RemotePtParameterService remotePtParameterService;
|
|
private final RemotePtParameterService remotePtParameterService;
|
|
@@ -223,22 +225,7 @@ public class InitBusiness {
|
|
|
&& p.getLifespan().getTime() > System.currentTimeMillis()).toList();
|
|
&& p.getLifespan().getTime() > System.currentTimeMillis()).toList();
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
|
|
- RedisUtils.deleteKeys(CacheNames.PT_USER_ACCOUNT_ID);
|
|
|
|
|
- RedisUtils.deleteKeys(CacheNames.PT_USER_ACCOUNT_NUMB);
|
|
|
|
|
- RedisUtils.deleteKeys(CacheNames.PT_USER_ACCOUNT_NO);
|
|
|
|
|
-
|
|
|
|
|
- filterList.parallelStream().forEach(p -> {
|
|
|
|
|
- String strUserId = String.valueOf(p.getUserId());
|
|
|
|
|
- String strUserNo = String.valueOf(p.getUserNo());
|
|
|
|
|
- String userNumb = String.valueOf(p.getUserNumb());
|
|
|
|
|
-
|
|
|
|
|
- RedisUtils.setCacheMapValue(CacheNames.PT_USER_ACCOUNT_ID, strUserId, p);
|
|
|
|
|
- RedisUtils.setCacheMapValue(CacheNames.PT_USER_ACCOUNT_NO, strUserNo, p);
|
|
|
|
|
- RedisUtils.setCacheMapValue(CacheNames.PT_USER_ACCOUNT_NUMB, userNumb, p);
|
|
|
|
|
- });
|
|
|
|
|
- RedisUtils.expire(CacheNames.PT_USER_ACCOUNT_ID, Duration.ofHours(5));
|
|
|
|
|
- RedisUtils.expire(CacheNames.PT_USER_ACCOUNT_NUMB, Duration.ofHours(5));
|
|
|
|
|
- RedisUtils.expire(CacheNames.PT_USER_ACCOUNT_NO, Duration.ofHours(5));
|
|
|
|
|
|
|
+ filterList.forEach(userAccountCacheManager::cacheUserAccountVo);
|
|
|
}
|
|
}
|
|
|
log.info("初始化人员账户参数完成");
|
|
log.info("初始化人员账户参数完成");
|
|
|
}
|
|
}
|
|
@@ -250,22 +237,11 @@ public class InitBusiness {
|
|
|
* @param id 人员Id
|
|
* @param id 人员Id
|
|
|
*/
|
|
*/
|
|
|
public void initUserAccountById(Long id) {
|
|
public void initUserAccountById(Long id) {
|
|
|
- // RemoteUserAccountVo accountVo = remoteUserAccountService.getUserAccountVoById(id);
|
|
|
|
|
- // if (ObjectUtil.isNotEmpty(accountVo)) {
|
|
|
|
|
- // List<RemoteUserAccountVo> list = RedisUtils.getCacheList(CacheNames.PT_USER_ACCOUNT_LIST);
|
|
|
|
|
- // String strUserId = String.valueOf(id);
|
|
|
|
|
- // String strUserNo = String.valueOf(accountVo.getUserNo());
|
|
|
|
|
- //
|
|
|
|
|
- // RedisUtils.delCacheMapValue(CacheNames.PT_USER_ACCOUNT_ID, strUserId);
|
|
|
|
|
- // RedisUtils.delCacheMapValue(CacheNames.PT_USER_ACCOUNT_NO, strUserNo);
|
|
|
|
|
- //
|
|
|
|
|
- // RedisUtils.setCacheMapValue(CacheNames.PT_USER_ACCOUNT_ID, strUserId, accountVo);
|
|
|
|
|
- // RedisUtils.setCacheMapValue(CacheNames.PT_USER_ACCOUNT_NO, strUserNo, accountVo);
|
|
|
|
|
- //
|
|
|
|
|
- // BigDecimal balance = bagService.getUserBalance(id);
|
|
|
|
|
- // RedisUtils.delCacheMapValue(CacheNames.PT_USER_CARD_NO, strUserId);
|
|
|
|
|
- // RedisUtils.setCacheMapValue(CacheNames.USER_TOTAL_BALANCE, strUserId, balance);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ RemoteUserAccountVo accountVo = remoteUserAccountService.getUserAccountVoById(id);
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(accountVo)) {
|
|
|
|
|
+ userAccountCacheManager.cacheUserAccountVo(accountVo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
log.info("初始化指定人员账户参数完成,人员Id:{}", id);
|
|
log.info("初始化指定人员账户参数完成,人员Id:{}", id);
|
|
|
}
|
|
}
|
|
|
|
|
|