代理星级反转
This commit is contained in:
@@ -54,4 +54,6 @@ public class RechargeUserVo extends RechargeUser {
|
||||
|
||||
@ApiModelProperty("近三十天转赠的金币")
|
||||
private Long giveGold;
|
||||
|
||||
private Integer starLevelSeq;
|
||||
}
|
||||
|
@@ -9,7 +9,8 @@
|
||||
rur.seq,
|
||||
cr.type,
|
||||
r.room_id as roomId,
|
||||
ru.star_level starLevel
|
||||
ru.star_level starLevel,
|
||||
ru.star_level starLevelSeq
|
||||
from recharge_user as ru
|
||||
left join users as u on u.uid = ru.uid
|
||||
left join charge_region as cr on ((ru.`type` <![CDATA[ & ]]> cr.`type`) != 0)
|
||||
@@ -23,7 +24,8 @@
|
||||
u.erban_no as erbanNo,
|
||||
u.nick,
|
||||
u.avatar,
|
||||
ru.star_level starLevel
|
||||
ru.star_level starLevel,
|
||||
ru.star_level starLevelSeq
|
||||
from recharge_user ru
|
||||
inner join users u on ru.uid = u.uid
|
||||
where u.partition_id = #{partitionId}
|
||||
|
@@ -196,9 +196,8 @@ public class GuildUsdChannelService {
|
||||
}
|
||||
|
||||
Map<Long, BigDecimal> recordMap = recordList.stream().collect(Collectors.toMap(GuildUsdBillRecord::getTargetUid, GuildUsdBillRecord::getOperateCurrency));
|
||||
List<RechargeUserVo> voList = rechargeUserVoList.stream().sorted(Comparator.comparing(RechargeUserVo::getStarLevel).reversed())
|
||||
List<RechargeUserVo> voList = rechargeUserVoList.stream().sorted(Comparator.comparing(RechargeUserVo::getStarLevelSeq).reversed())
|
||||
.collect(Collectors.toList());
|
||||
Collections.reverse(voList);
|
||||
return voList;
|
||||
}
|
||||
}
|
||||
|
@@ -54,17 +54,18 @@ public class RechargeUserController {
|
||||
|
||||
List<RechargeUserVo> rechargeUserVos = rechargeUserService.selectList(regionCode);
|
||||
if (CollectionUtils.isNotEmpty(rechargeUserVos)) {
|
||||
// List<Long> uids = rechargeUserVos.stream().map(RechargeUser::getUid).collect(Collectors.toList());
|
||||
// Date date = new Date();
|
||||
// Map<Long, Long> fromUserGiveGoldMap = diamondGiveHistoryService.getFromUserGiveGoldMap(uids, DateUtil.offsetDay(date, -30), date);
|
||||
// for (RechargeUserVo rechargeUserVo : rechargeUserVos) {
|
||||
// Long goldNum = fromUserGiveGoldMap.get(rechargeUserVo.getUid());
|
||||
// goldNum = goldNum == null ? 0 : goldNum;
|
||||
// rechargeUserVo.setGiveGold(goldNum);
|
||||
// }
|
||||
Comparator<RechargeUserVo> comparator2 = Comparator.comparing(RechargeUserVo::getStarLevel).reversed()
|
||||
.thenComparing(RechargeUserVo::getIsOnline, Comparator.reverseOrder());
|
||||
rechargeUserVos.stream().sorted(comparator2) .collect(Collectors.toList());
|
||||
List<Long> uids = rechargeUserVos.stream().map(RechargeUser::getUid).collect(Collectors.toList());
|
||||
Date date = new Date();
|
||||
Map<Long, Long> fromUserGiveGoldMap = diamondGiveHistoryService.getFromUserGiveGoldMap(uids, DateUtil.offsetDay(date, -30), date);
|
||||
for (RechargeUserVo rechargeUserVo : rechargeUserVos) {
|
||||
Long goldNum = fromUserGiveGoldMap.get(rechargeUserVo.getUid());
|
||||
goldNum = goldNum == null ? 0 : goldNum;
|
||||
rechargeUserVo.setGiveGold(goldNum);
|
||||
}
|
||||
Comparator<RechargeUserVo> comparator2 = Comparator.comparing(RechargeUserVo::getStarLevelSeq).reversed();
|
||||
comparator2 = comparator2.thenComparing(RechargeUserVo::getIsOnline, Comparator.reverseOrder());
|
||||
comparator2 = comparator2.thenComparing(RechargeUserVo::getGiveGold, Comparator.reverseOrder());
|
||||
rechargeUserVos = rechargeUserVos.stream().sorted(comparator2).collect(Collectors.toList());
|
||||
}
|
||||
return BusiResult.success(rechargeUserVos);
|
||||
}
|
||||
|
Reference in New Issue
Block a user