|
|
@@ -88,6 +88,7 @@ public class InitBusiness {
|
|
|
public void initDiscountAndOther() {
|
|
|
List<Long> limitedTermIds = remoteLimitedService.selectLimitedTermIds();
|
|
|
if (CollUtil.isNotEmpty(limitedTermIds)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_LIMITEDTERM);
|
|
|
limitedTermIds.forEach(p -> {
|
|
|
String key = String.valueOf(p);
|
|
|
RedisUtils.setCacheMapValue(CacheNames.T_XF_LIMITEDTERM, key, p);
|
|
|
@@ -97,6 +98,7 @@ public class InitBusiness {
|
|
|
|
|
|
List<RemoteLimitedVo> limitedCards = remoteLimitedService.selectLimitedCards();
|
|
|
if (CollUtil.isNotEmpty(limitedCards)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_LIMITED);
|
|
|
limitedCards.forEach(p -> {
|
|
|
String key = String.valueOf(p.getCardType());
|
|
|
RedisUtils.setCacheMapValue(CacheNames.T_XF_LIMITED, key, p);
|
|
|
@@ -106,6 +108,7 @@ public class InitBusiness {
|
|
|
|
|
|
List<Long> discountTermIds = remoteDisCountService.selectDiscountTermIds();
|
|
|
if (CollUtil.isNotEmpty(discountTermIds)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_DISCOUNTTERM);
|
|
|
discountTermIds.forEach(p -> {
|
|
|
String key = String.valueOf(p);
|
|
|
RedisUtils.setCacheMapValue(CacheNames.T_XF_DISCOUNTTERM, key, p);
|
|
|
@@ -115,6 +118,7 @@ public class InitBusiness {
|
|
|
|
|
|
List<RemoteDiscountVo> discountCards = remoteDisCountService.selectDiscountCards();
|
|
|
if (CollUtil.isNotEmpty(discountCards)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_DISCOUNT);
|
|
|
discountCards.forEach(p -> {
|
|
|
String key = String.valueOf(p.getCardType());
|
|
|
RedisUtils.setCacheMapValue(CacheNames.T_XF_DISCOUNT, key, p);
|
|
|
@@ -124,6 +128,7 @@ public class InitBusiness {
|
|
|
|
|
|
List<Long> quotaTermIds = remoteQuotaService.selectQuotaTermIds();
|
|
|
if (CollUtil.isNotEmpty(quotaTermIds)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_QUOTATERM);
|
|
|
quotaTermIds.forEach(p -> {
|
|
|
String key = String.valueOf(p);
|
|
|
RedisUtils.setCacheMapValue(CacheNames.T_XF_QUOTATERM, key, p);
|
|
|
@@ -133,6 +138,7 @@ public class InitBusiness {
|
|
|
|
|
|
List<RemoteQuotaVo> quotaCards = remoteQuotaService.selectQuotaCards();
|
|
|
if (CollUtil.isNotEmpty(quotaCards)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_QUOTA);
|
|
|
quotaCards.forEach(p -> {
|
|
|
String key = String.valueOf(p.getCardType());
|
|
|
RedisUtils.setCacheMapValue(CacheNames.T_XF_QUOTA, key, p);
|
|
|
@@ -147,13 +153,15 @@ public class InitBusiness {
|
|
|
*/
|
|
|
public void initUserBalance() {
|
|
|
List<Long> idList = remoteUserAccountService.getUserAccountIdList();
|
|
|
- idList.forEach(id -> {
|
|
|
- String userId = String.valueOf(id);
|
|
|
- BigDecimal balance = bagService.getUserBalance(id);
|
|
|
- RedisUtils.setCacheMapValue(CacheNames.USER_TOTAL_BALANCE, userId, balance);
|
|
|
- });
|
|
|
- RedisUtils.expire(CacheNames.USER_TOTAL_BALANCE, Duration.ofHours(5));
|
|
|
-
|
|
|
+ if (CollUtil.isNotEmpty(idList)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_LIMITEDTERM);
|
|
|
+ idList.forEach(id -> {
|
|
|
+ String userId = String.valueOf(id);
|
|
|
+ BigDecimal balance = bagService.getUserBalance(id);
|
|
|
+ RedisUtils.setCacheMapValue(CacheNames.USER_TOTAL_BALANCE, userId, balance);
|
|
|
+ });
|
|
|
+ RedisUtils.expire(CacheNames.USER_TOTAL_BALANCE, Duration.ofHours(5));
|
|
|
+ }
|
|
|
log.info("人员余额参数完成");
|
|
|
}
|
|
|
|
|
|
@@ -174,17 +182,18 @@ public class InitBusiness {
|
|
|
*/
|
|
|
public void initUserCard() {
|
|
|
List<RemoteCardVo> list = remoteCardService.selectNormalCards();
|
|
|
- RedisUtils.deleteKeys(CacheNames.PT_USER_CARD_NO);
|
|
|
- RedisUtils.deleteKeys(CacheNames.PT_USER_CARD_USER_ID);
|
|
|
- list.forEach(v -> {
|
|
|
- String cardNo = String.valueOf(v.getCardNo());
|
|
|
- String factoryId = String.valueOf(v.getFactoryId());
|
|
|
- RedisUtils.setCacheMapValue(CacheNames.PT_USER_CARD_NO, cardNo, v);
|
|
|
- RedisUtils.setCacheMapValue(CacheNames.PT_USER_CARD_USER_ID, factoryId, v);
|
|
|
- });
|
|
|
- RedisUtils.expire(CacheNames.PT_USER_CARD_NO, Duration.ofHours(4));
|
|
|
- RedisUtils.expire(CacheNames.PT_USER_CARD_USER_ID, Duration.ofHours(4));
|
|
|
-
|
|
|
+ if (CollUtil.isNotEmpty(list)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.PT_USER_CARD_NO);
|
|
|
+ RedisUtils.deleteKeys(CacheNames.PT_USER_CARD_USER_ID);
|
|
|
+ list.forEach(v -> {
|
|
|
+ String cardNo = String.valueOf(v.getCardNo());
|
|
|
+ String factoryId = String.valueOf(v.getFactoryId());
|
|
|
+ RedisUtils.setCacheMapValue(CacheNames.PT_USER_CARD_NO, cardNo, v);
|
|
|
+ RedisUtils.setCacheMapValue(CacheNames.PT_USER_CARD_USER_ID, factoryId, v);
|
|
|
+ });
|
|
|
+ RedisUtils.expire(CacheNames.PT_USER_CARD_NO, Duration.ofHours(4));
|
|
|
+ RedisUtils.expire(CacheNames.PT_USER_CARD_USER_ID, Duration.ofHours(4));
|
|
|
+ }
|
|
|
log.info("初始化人员卡片参数完成");
|
|
|
}
|
|
|
|
|
|
@@ -213,7 +222,7 @@ public class InitBusiness {
|
|
|
List<RemoteUserAccountVo> list = remoteUserAccountService.getAllUserAccountVo();
|
|
|
List<RemoteUserAccountVo> filterList = list.stream().filter(
|
|
|
p -> p.getDelFlag().equals("0")
|
|
|
- && p.getLifespan().getTime() > System.currentTimeMillis()).toList();
|
|
|
+ && p.getLifespan().getTime() > System.currentTimeMillis()).toList();
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
|
|
RedisUtils.deleteKeys(CacheNames.USER_TOTAL_BALANCE);
|
|
|
@@ -239,6 +248,7 @@ public class InitBusiness {
|
|
|
/**
|
|
|
* 初始化账户信息
|
|
|
* 账户基本信息、账户余额信息
|
|
|
+ *
|
|
|
* @param id 人员Id
|
|
|
*/
|
|
|
public void initUserAccountById(Long id) {
|
|
|
@@ -246,6 +256,7 @@ public class InitBusiness {
|
|
|
if (ObjectUtil.isNotEmpty(accountVo)) {
|
|
|
String strUserId = String.valueOf(id);
|
|
|
String strUserNo = String.valueOf(accountVo.getUserNo());
|
|
|
+
|
|
|
RedisUtils.setCacheMapValue(CacheNames.PT_USER_ACCOUNT_ID, strUserId, accountVo);
|
|
|
RedisUtils.setCacheMapValue(CacheNames.PT_USER_ACCOUNT_NO, strUserNo, accountVo);
|
|
|
|
|
|
@@ -261,7 +272,8 @@ public class InitBusiness {
|
|
|
public void initXfCardLimited() {
|
|
|
XfCardLimitedBo bo = new XfCardLimitedBo();
|
|
|
List<XfCardLimitedVo> list = cardLimitedService.queryList(bo);
|
|
|
- if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ if (CollUtil.isNotEmpty(list)) {
|
|
|
+ RedisUtils.deleteKeys(CacheNames.T_XF_CARD_LIMITED);
|
|
|
list.forEach(p -> {
|
|
|
RedisUtils.setCacheMapValue(CacheNames.T_XF_CARD_LIMITED, p.getCardNo().toString(), p);
|
|
|
});
|