家族榜单排名处理

This commit is contained in:
tianfeng 2025-12-29 17:08:41 +08:00
parent ef3ff35b91
commit 987b51d00e

View File

@ -45,7 +45,21 @@ public class FamilyMemberTop100Exe {
List<FamilyMemberTotalExp> top200Exp = getTop200TotalExp(member.getFamilyId());
if (CollectionUtils.isEmpty(top200Exp)) {
return new FamilyLeaderboardCO();
FamilyLeaderboardCO leaderboardCO = new FamilyLeaderboardCO();
Map<Long, UserProfile> userProfileMap = userProfileGateway.mapByUserIds(Set.of(cmd.getReqUserId()));
Set<Long> hostUserIds = getHostUserIds(Set.of(cmd.getReqUserId()));
FamilyMemberRankInfoCO myRankInfo = buildMyRankInfo(
cmd.getReqUserId(),
new FamilyMemberTotalExp().setExp(0L),
userProfileMap.get(cmd.getReqUserId()),
0,
0,
hostUserIds.contains(cmd.getReqUserId())
);
leaderboardCO.setMyRankInfo(myRankInfo);
return leaderboardCO;
}
Set<Long> userIds = top200Exp.stream()
@ -150,9 +164,9 @@ public class FamilyMemberTop100Exe {
) {
String rank;
if (isHost) {
rank = myRankInHost > 0 ? (myRankInHost > 100 ? "100+" : String.valueOf(myRankInHost)) : "100+";
rank = myRankInHost > 0 ? (myRankInHost > 100 ? "100+" : String.valueOf(myRankInHost)) : "0";
} else {
rank = myRankInSupporter > 0 ? (myRankInSupporter > 100 ? "100+" : String.valueOf(myRankInSupporter)) : "100+";
rank = myRankInSupporter > 0 ? (myRankInSupporter > 100 ? "100+" : String.valueOf(myRankInSupporter)) : "0";
}
return new FamilyMemberRankInfoCO()