cp缓存问题处理

This commit is contained in:
tianfeng 2025-12-11 21:50:14 +08:00
parent a054181a4f
commit 174557924d

View File

@ -336,9 +336,9 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
Set<Long> cpUserIds = cpRelationshipList.stream() Set<Long> cpUserIds = cpRelationshipList.stream()
.map(CpRelationship::getCpUserId) .map(CpRelationship::getCpUserId)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
List<UserRunProfile> cpUserProfiles = userRunProfileService.listByIds(cpUserIds); List<BaseInfo> cpUserProfiles = baseInfoService.listByUserId(cpUserIds);
Map<Long, UserRunProfile> cpUserProfileMap = cpUserProfiles.stream() Map<Long, BaseInfo> cpUserProfileMap = cpUserProfiles.stream()
.collect(Collectors.toMap(UserRunProfile::getId, Function.identity())); .collect(Collectors.toMap(BaseInfo::getId, Function.identity()));
// 批量获取CP值 // 批量获取CP值
Set<Long> cpValIds = cpRelationshipList.stream() Set<Long> cpValIds = cpRelationshipList.stream()
@ -349,7 +349,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
// 组装CP列表 // 组装CP列表
List<CpSimpleUserProfileCO> cpList = cpRelationshipList.stream() List<CpSimpleUserProfileCO> cpList = cpRelationshipList.stream()
.map(cpRelationship -> { .map(cpRelationship -> {
UserRunProfile cpUser = cpUserProfileMap.get(cpRelationship.getCpUserId()); BaseInfo cpUser = cpUserProfileMap.get(cpRelationship.getCpUserId());
if (cpUser == null) { if (cpUser == null) {
return null; return null;
} }