Commit aec3c8bc by 吕明尚

Merge branch 'test'

parents ad1a5cdc d81f6dbf
...@@ -749,14 +749,7 @@ public class RedisTask { ...@@ -749,14 +749,7 @@ public class RedisTask {
@XxlJob("AutoUpdateOpenid") @XxlJob("AutoUpdateOpenid")
public void AutoUpdateOpenid() { public void AutoUpdateOpenid() {
logger.debug("AutoUpdateOpenid:自动更新用户unionid开始"); logger.debug("AutoUpdateOpenid:自动更新用户unionid开始");
List<SConsumerToken> sConsumerTokenList = sConsumerTokenService.list(new LambdaQueryWrapper<SConsumerToken>().isNotNull(SConsumerToken::getUnionId).isNull(SConsumerToken::getOpenId));
if (CollectionUtils.isEmpty(sConsumerTokenList)) {
return;
}
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
if (sConsumerTokenList.size() > 100) {
sConsumerTokenList = sConsumerTokenList.subList(0, 100);
}
List<String> wechatUSERList = wechatNewService.getWechatUSERList(list, ""); List<String> wechatUSERList = wechatNewService.getWechatUSERList(list, "");
Map<String, String> openIdMap = new ConcurrentHashMap<>(); Map<String, String> openIdMap = new ConcurrentHashMap<>();
// 使用IntStream优化分批逻辑,并行处理各批次数据 // 使用IntStream优化分批逻辑,并行处理各批次数据
...@@ -771,6 +764,11 @@ public class RedisTask { ...@@ -771,6 +764,11 @@ public class RedisTask {
logger.error("处理微信用户信息失败", e); logger.error("处理微信用户信息失败", e);
} }
}); });
//获取openIdMap所有的键
List<SConsumerToken> sConsumerTokenList = sConsumerTokenService.list(new LambdaQueryWrapper<SConsumerToken>().in(SConsumerToken::getUnionId, openIdMap.keySet()).isNull(SConsumerToken::getOpenId));
if (CollectionUtils.isEmpty(sConsumerTokenList)) {
return;
}
sConsumerTokenList.forEach(item -> { sConsumerTokenList.forEach(item -> {
String openId = openIdMap.get(item.getUnionId()); String openId = openIdMap.get(item.getUnionId());
if (openId != null) { if (openId != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment