linhw 2024-06-24 13:55:16 +08:00
parent c7eaa22d5d
commit eef6b9d3bd
1 changed files with 15 additions and 11 deletions

View File

@ -296,19 +296,23 @@ public class AppUserServiceImpl implements IAppUserService {
companylList.sort(Comparator.comparingLong(AppUserDataVo::getFansNum).reversed());
// 好友的好友
List<Long> friendIds = appUserFriendMapper.selectByFriendId(ids);
entity.setFriendIds(friendIds);
entity.setCompanyName(null);
List<AppUserDataVo> friendList = appUserMapper.selectList(entity);
if (friendList == null || friendList.size() == 0) {
List<AppUserDataVo> friendList = null;
if (ids == null || ids.size() == 0) {
friendList = new ArrayList<>();
} else {
List<Long> friendIds = appUserFriendMapper.selectByFriendId(ids);
entity.setFriendIds(friendIds);
entity.setCompanyName(null);
friendList = appUserMapper.selectList(entity);
if (friendList == null || friendList.size() == 0) {
friendList = new ArrayList<>();
}
Collections.shuffle(friendList);
if (friendList.size() > limit) {
friendList = friendList.subList(0, limit);
}
friendList.sort(Comparator.comparingLong(AppUserDataVo::getFansNum).reversed());
}
Collections.shuffle(friendList);
if (friendList.size() > limit) {
friendList = friendList.subList(0, limit);
}
friendList.sort(Comparator.comparingLong(AppUserDataVo::getFansNum).reversed());
appUserNetVo.setFriendUserList(friendList);
appUserNetVo.setSchoolUserList(schoolList);
appUserNetVo.setCompanyUserList(companylList);