公会统计添加负责人fixed

This commit is contained in:
2025-08-20 17:16:26 +08:00
parent 98ffd02b94
commit f5fc0de086
2 changed files with 60 additions and 1 deletions

View File

@@ -205,6 +205,7 @@ public class WeekGuildStatService {
List<WeekActiveGuildStat> detailList = activeGuildPartitionMap.get(partitionId);
Map<Integer, Long> ownerUidMap = new HashMap<>();
Map<Integer, Integer> operatorIdMap = new HashMap<>();
List<Integer> guildIdList = detailList.stream().map(WeekActiveGuildStat::getGuildId).distinct().toList();
if (!CollectionUtils.isEmpty(guildIdList)){
@@ -223,10 +224,11 @@ public class WeekGuildStatService {
List<Guild> guildList = guildService.listByIds(guildIdList);
guildList.forEach(guild->{
ownerUidMap.put(guild.getId(), guild.getOwnerUid());
operatorIdMap.put(guild.getId(), guild.getOperatorId());
});
}
}
Map<Integer, String> guildOperatorMap = guildOperatorService.operatorNameMap(partitionId);
Map<Long, Users> ownerUserMap = usersService.getUsersMapByUids(ownerUidMap.values().stream().toList());
Map<Integer, String> regionNameMap = regionInfoService.getRegionName();
@@ -242,6 +244,11 @@ public class WeekGuildStatService {
item.setOwnerErbanNo(ownerUser.getErbanNo());
}
}
Integer operatorId = operatorIdMap.getOrDefault(item.getGuildId(), null);
if (operatorId != null) {
item.setOperatorId(operatorId);
item.setOperatorName(guildOperatorMap.getOrDefault(item.getOperatorId(), ""));
}
}).sorted(Comparator.comparing(WeekActiveGuildStat::getGuildDiamondFlow).reversed()).collect(Collectors.toList());
}