|
|
|
@@ -37,7 +37,6 @@ import com.accompany.core.model.Users;
|
|
|
|
|
import com.accompany.core.service.common.JedisService;
|
|
|
|
|
import com.accompany.core.service.user.UsersBaseService;
|
|
|
|
|
import com.accompany.core.vo.UserLevelVo;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
@@ -251,21 +250,21 @@ public class ClanServiceImpl extends ServiceImpl<ClanMapper, Clan> implements Cl
|
|
|
|
|
return clanMapper.getClanBaseInfoByUid(uid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 填充等级信息
|
|
|
|
|
*
|
|
|
|
|
* @param memberList
|
|
|
|
|
*/
|
|
|
|
|
private void fillLevelVo(List<ClanMemberVO> memberList) {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(memberList)) {
|
|
|
|
|
List<String> uids = memberList.stream().map(member -> member.getUid().toString()).collect(Collectors.toList());
|
|
|
|
|
Map<Long, UserLevelVo> userLevelVoMap = levelService.getUserLevelVoMap(uids.toArray(new String[uids.size()]));
|
|
|
|
|
memberList.forEach((member) -> member.setUserLevelVo(userLevelVoMap.get(member.getUid())));
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public List<ClanRankListVO> listClanRankV2() {
|
|
|
|
|
Long begin = Long.valueOf((Constant.DEFAULT_PAGE - 1) * Constant.DEFAULT_PAGE_SIZE);
|
|
|
|
|
Long end = Long.valueOf(Constant.DEFAULT_PAGE * Constant.DEFAULT_PAGE_SIZE - 1);
|
|
|
|
|
return rankClanList(begin, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<ClanRankListVO> listClanRankV2() {
|
|
|
|
|
public List<ClanRankListVO> listClan() {
|
|
|
|
|
Long begin = Long.MIN_VALUE;
|
|
|
|
|
Long end = Long.MAX_VALUE;
|
|
|
|
|
return rankClanList(begin, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ClanRankListVO> rankClanList(Long begin, Long end) {
|
|
|
|
|
// 获取家族列表
|
|
|
|
|
List<ClanRankListVO> clanRankListVOS = clanMapper.listClanRankWithOutIncome();
|
|
|
|
|
|
|
|
|
@@ -286,8 +285,6 @@ public class ClanServiceImpl extends ServiceImpl<ClanMapper, Clan> implements Cl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
Long begin = Long.valueOf((Constant.DEFAULT_PAGE - 1) * Constant.DEFAULT_PAGE_SIZE);
|
|
|
|
|
Long end = Long.valueOf(Constant.DEFAULT_PAGE * Constant.DEFAULT_PAGE_SIZE - 1);
|
|
|
|
|
// 获取家族的周流水
|
|
|
|
|
Set<Map<String, Object>> mapSet = jedisService.zrevrangeWithScore(getClanWeekKey(date), begin, end);
|
|
|
|
|
if (!CollectionUtils.isEmpty(mapSet)) {
|
|
|
|
@@ -314,6 +311,19 @@ public class ClanServiceImpl extends ServiceImpl<ClanMapper, Clan> implements Cl
|
|
|
|
|
return clanRankListVOS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 填充等级信息
|
|
|
|
|
*
|
|
|
|
|
* @param memberList
|
|
|
|
|
*/
|
|
|
|
|
private void fillLevelVo(List<ClanMemberVO> memberList) {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(memberList)) {
|
|
|
|
|
List<String> uids = memberList.stream().map(member -> member.getUid().toString()).collect(Collectors.toList());
|
|
|
|
|
Map<Long, UserLevelVo> userLevelVoMap = levelService.getUserLevelVoMap(uids.toArray(new String[uids.size()]));
|
|
|
|
|
memberList.forEach((member) -> member.setUserLevelVo(userLevelVoMap.get(member.getUid())));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getClanWeekKey(Date date) {
|
|
|
|
|
String key = Constant.RankDatetype.week.toString() + ":" + DateTimeUtil.convertDate(DateTimeUtil.getMonday(date, 0, 0, 0), DateTimeUtil.DEFAULT_DATE_PATTERN);
|
|
|
|
|
return RedisKey.clan_rank.getKey(key);
|
|
|
|
|