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