Commit 7a6fcd08 by 吕明尚

优化获取用户UUID定时任务

parent 79a3ee3c
......@@ -547,11 +547,16 @@ public class RedisTask {
logger.error("处理微信用户信息失败", e);
}
});
List<SConsumerToken> updateList = new ArrayList<>();
sConsumerTokenList.forEach(item -> {
item.setOpenId(openIdMap.get(item.getUnionId()));
updateList.add(item);
String openId = openIdMap.get(item.getUnionId());
if (openId != null) {
item.setOpenId(openId);
try {
sConsumerTokenService.updateById(item);
} catch (Exception e) {
logger.error("更新消费者令牌失败", e);
}
}
});
if (!CollectionUtils.isEmpty(updateList)) sConsumerTokenService.updateBatchById(updateList);
}
}
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