|
@@ -169,16 +169,18 @@ public class InitBusiness {
|
|
|
*/
|
|
*/
|
|
|
public void initUserBalance() {
|
|
public void initUserBalance() {
|
|
|
List<PtBagVo> list = bagService.selectBalanceBag();
|
|
List<PtBagVo> list = bagService.selectBalanceBag();
|
|
|
- Map<String, BigDecimal> sumMap = new HashMap<>();
|
|
|
|
|
|
|
+ Map<Long, BigDecimal> sumMap = new HashMap<>();
|
|
|
for (PtBagVo vo : list) {
|
|
for (PtBagVo vo : list) {
|
|
|
- String userId = String.valueOf(vo.getUserId());
|
|
|
|
|
|
|
+ Long userId = vo.getUserId();
|
|
|
BigDecimal amount = vo.getBalance();
|
|
BigDecimal amount = vo.getBalance();
|
|
|
sumMap.merge(userId, amount, BigDecimal::add);
|
|
sumMap.merge(userId, amount, BigDecimal::add);
|
|
|
}
|
|
}
|
|
|
- for (Map.Entry<String, BigDecimal> entry : sumMap.entrySet()) {
|
|
|
|
|
- RedisUtils.setCacheMapValue(CacheNames.USER_TOTAL_BALANCE, entry.getKey(), entry.getValue());
|
|
|
|
|
|
|
+ for (Map.Entry<Long, BigDecimal> entry : sumMap.entrySet()) {
|
|
|
|
|
+ // RedisUtils.setCacheMapValue(CacheNames.USER_TOTAL_BALANCE, entry.getKey(), entry.getValue());
|
|
|
|
|
+ bagService.cacheUserTotalBalance(entry.getKey(), entry.getValue());
|
|
|
}
|
|
}
|
|
|
- RedisUtils.expire(CacheNames.USER_TOTAL_BALANCE, Duration.ofHours(5));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // RedisUtils.expire(CacheNames.USER_TOTAL_BALANCE, Duration.ofHours(5));
|
|
|
log.info("初始化人员余额参数完成");
|
|
log.info("初始化人员余额参数完成");
|
|
|
}
|
|
}
|
|
|
|
|
|