@@ -825,6 +825,58 @@ public class MyApiService {
|
||||
}
|
||||
stat.setEn2ActiveCountDetail(JSON.toJSONString(en2ActiveGuildStatList));
|
||||
}
|
||||
|
||||
Map<Integer, String> operatorNameMap;
|
||||
Map<Integer, Guild> guildMap;
|
||||
for (WeekGuildStat stat : lastWeekGuildStatList) {
|
||||
List<WeekActiveGuildStat> arNewCountDetail = JSON.parseArray(stat.getArNewCountDetail(), WeekActiveGuildStat.class);
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(arNewCountDetail)) {
|
||||
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.ARAB.getId());
|
||||
List<Integer> guildIds = arNewCountDetail.stream().map(WeekActiveGuildStat::getGuildId).collect(Collectors.toList());
|
||||
List<Guild> guildList = guildService.listByIds(guildIds);
|
||||
guildMap = guildList.stream().collect(Collectors.toMap(Guild::getId, guild->guild));
|
||||
for (WeekActiveGuildStat newCountstat : arNewCountDetail){
|
||||
Guild guild = guildMap.get(newCountstat.getGuildId());
|
||||
if (guild != null && guild.getOperatorId() != null) {
|
||||
newCountstat.setOperatorId(guild.getOperatorId());
|
||||
newCountstat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
stat.setArNewCountDetail(JSON.toJSONString(arNewCountDetail));
|
||||
|
||||
List<WeekActiveGuildStat> trNewGuildStatList = JSON.parseArray(stat.getTrNewCountDetail(), WeekActiveGuildStat.class);
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(trNewGuildStatList)) {
|
||||
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.TURKEY.getId());
|
||||
List<Integer> guildIds = trNewGuildStatList.stream().map(WeekActiveGuildStat::getGuildId).collect(Collectors.toList());
|
||||
List<Guild> guildList = guildService.listByIds(guildIds);
|
||||
guildMap = guildList.stream().collect(Collectors.toMap(Guild::getId, guild->guild));
|
||||
for (WeekActiveGuildStat activeGuildStat : trNewGuildStatList){
|
||||
Guild guild = guildMap.get(activeGuildStat.getGuildId());
|
||||
if (guild != null && guild.getOperatorId() != null) {
|
||||
activeGuildStat.setOperatorId(guild.getOperatorId());
|
||||
activeGuildStat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
stat.setTrNewCountDetail(JSON.toJSONString(trNewGuildStatList));
|
||||
|
||||
List<WeekActiveGuildStat> en2NewGuildStatList = JSON.parseArray(stat.getEn2NewCountDetail(), WeekActiveGuildStat.class);
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(en2NewGuildStatList)) {
|
||||
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.ENGLISH2.getId());
|
||||
List<Integer> guildIds = en2NewGuildStatList.stream().map(WeekActiveGuildStat::getGuildId).collect(Collectors.toList());
|
||||
List<Guild> guildList = guildService.listByIds(guildIds);
|
||||
guildMap = guildList.stream().collect(Collectors.toMap(Guild::getId, guild->guild));
|
||||
for (WeekActiveGuildStat activeGuildStat : en2NewGuildStatList){
|
||||
Guild guild = guildMap.get(activeGuildStat.getGuildId());
|
||||
if (guild != null && guild.getOperatorId() != null) {
|
||||
activeGuildStat.setOperatorId(guild.getOperatorId());
|
||||
activeGuildStat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
stat.setEn2NewCountDetail(JSON.toJSONString(en2NewGuildStatList));
|
||||
}
|
||||
weekGuildStatMapper.delete(null);
|
||||
weekGuildStatMapper.insert(lastWeekGuildStatList);
|
||||
}
|
||||
|
@@ -198,6 +198,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)){
|
||||
@@ -216,10 +217,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();
|
||||
@@ -235,6 +237,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());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user