|
|
@@ -28,6 +28,9 @@ public class UserHoldCountCache {
|
|
|
private RedisTemplate<String, Object> redisTemplate;
|
|
|
|
|
|
public void allUserHold() {
|
|
|
+ // 清理用户持仓缓存
|
|
|
+ redisTemplate.delete(Constants.USER_HOLD_CACHE_KEY);
|
|
|
+
|
|
|
Map<String, BigDecimal> minPriceMap = new HashMap<>();
|
|
|
List<Map<String, String>> assets = assetRepo.findAllUserHold();
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
@@ -62,6 +65,7 @@ public class UserHoldCountCache {
|
|
|
if (CollectionUtils.isNotEmpty(userHoldDTOS)) {
|
|
|
userHoldDTOS.sort(Comparator.comparing(UserHoldDTO::getPrice).reversed());
|
|
|
}
|
|
|
+ // 重新缓存持仓信息
|
|
|
redisTemplate.opsForValue().set(Constants.USER_HOLD_CACHE_KEY, userHoldDTOS);
|
|
|
}
|
|
|
|