家族列表接口修改
This commit is contained in:
parent
19af3ba254
commit
d80f94ecc7
@ -26,11 +26,7 @@ import com.red.circle.other.inner.model.dto.famliy.FamilyDetailsDTO;
|
||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||
import com.red.circle.tool.core.num.NumUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -54,7 +50,7 @@ public class FamilyHomeListExe {
|
||||
|
||||
public PageResult<FamilyHomeListCO> execute(FamilyHomeListCmd cmd) {
|
||||
List<FamilyBaseInfo> familyList = getFamilyList(cmd);
|
||||
|
||||
|
||||
if (CollectionUtils.isEmpty(familyList)) {
|
||||
return PageResult.newPageResult(0);
|
||||
}
|
||||
@ -87,18 +83,12 @@ public class FamilyHomeListExe {
|
||||
}
|
||||
|
||||
private List<FamilyBaseInfo> getFamilyList(FamilyHomeListCmd cmd) {
|
||||
IPage<FamilyBaseInfo> page = new Page<>();
|
||||
page.setCurrent(cmd.getCurrent());
|
||||
page.setSize(cmd.getSize());
|
||||
FamilyMemberInfo familyMemberInfo = familyMemberInfoService.getFamilyMemberByUserId(cmd.getReqUserId());
|
||||
if (familyMemberInfo == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return familyBaseInfoService.page(
|
||||
page,
|
||||
familyBaseInfoService.query()
|
||||
.eq(FamilyBaseInfo::getSysOrigin, cmd.requireReqSysOrigin())
|
||||
.eq(FamilyBaseInfo::getFamilyStatus, FamilyStatusEnum.NORMAL.name())
|
||||
.orderByDesc(FamilyBaseInfo::getCreateTime)
|
||||
.getWrapper()
|
||||
).getRecords();
|
||||
return List.of(familyBaseInfoService.getBaseInfoById(familyMemberInfo.getId()));
|
||||
}
|
||||
|
||||
private FamilyHomeListCO buildFamilyHomeCO(FamilyHomeListCmd cmd, FamilyBaseInfo family, BigDecimal totalExp) {
|
||||
@ -119,7 +109,7 @@ public class FamilyHomeListExe {
|
||||
|
||||
List<FamilyHomeMemberCO> displayMembers = buildDisplayMembers(cmd, members, onlineUserIds);
|
||||
|
||||
List<ActiveVoiceRoom> onlineRooms = activeVoiceRoomService.listByFamilyId(family.getId(), 4);
|
||||
List<ActiveVoiceRoom> onlineRooms = activeVoiceRoomService.listByFamilyId(family.getId(), 30);
|
||||
List<FamilyHomeRoomCO> roomCOs = buildRoomCOs(onlineRooms);
|
||||
|
||||
return new FamilyHomeListCO()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user