修复首页问题
This commit is contained in:
@@ -122,7 +122,7 @@ public class NameplateAdminService extends BaseService {
|
||||
}
|
||||
List<Integer> configValue = sysConfService.getJsonValueById(Constant.SysConfId.HEARTBEAT_NAMEPLATE, new TypeReference<List<Integer>>() {
|
||||
});
|
||||
List<NameplateVo> nameplateVos = nameplateMapper.getNameplateList(dto.getName(), dto.getNameplateType(), dto.getStatus(), dto.getType(), limit);
|
||||
List<NameplateVo> nameplateVos = nameplateMapper.getNameplateList(dto.getName(), dto.getNameplateType(), dto.getStatus(), dto.getType(), dto.getPartitionId(), limit);
|
||||
List<NameplateAdminVo> data = new ArrayList<>();
|
||||
for (NameplateVo nameplateVo : nameplateVos) {
|
||||
NameplateAdminVo vo = BeanMapper.map(nameplateVo, NameplateAdminVo.class);
|
||||
|
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
public interface NameplateMapper extends BaseMapper<Nameplate> {
|
||||
|
||||
List<NameplateVo> getNameplateList(@Param("name") String name, @Param("nameplateType") Integer nameplateType,
|
||||
@Param("status") Integer status,@Param("type") Integer type, @Param("limit") String limit);
|
||||
@Param("status") Integer status,@Param("type") Integer type, @Param("partitionId") Integer partitionId, @Param("limit") String limit);
|
||||
|
||||
Integer getNameplateCount(@Param("name") String name, @Param("nameplateType") Integer nameplateType,
|
||||
@Param("status") Integer status, @Param("type") Integer type, @Param("partitionId") Integer partitionId);
|
||||
|
@@ -3,7 +3,6 @@ package com.accompany.business.service.home;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.accompany.business.dto.HomeRoomListV2SysConf;
|
||||
import com.accompany.business.dto.miniGame.MiniGameRoomDto;
|
||||
import com.accompany.business.event.RoomCacheDealEvent;
|
||||
import com.accompany.business.model.miniGame.MiniGame;
|
||||
import com.accompany.business.model.miniGame.MiniGameSwitchRecord;
|
||||
@@ -26,7 +25,6 @@ import com.accompany.business.service.nameplate.UserNameplateService;
|
||||
import com.accompany.business.service.rank.RankService;
|
||||
import com.accompany.business.service.room.RoomRankService;
|
||||
import com.accompany.business.service.room.RoomService;
|
||||
import com.accompany.business.service.room.SingleBroadcastPopularityService;
|
||||
import com.accompany.business.service.roomtab.RoomTabHomeService;
|
||||
import com.accompany.business.service.roomtab.RoomTabMapService;
|
||||
import com.accompany.business.service.roomtab.RoomTabService;
|
||||
@@ -330,7 +328,8 @@ public class HomeService extends BaseService {
|
||||
* @return
|
||||
*/
|
||||
public List<TopRoomTabHomeVo> getTopRoomHome(Integer tabId) {
|
||||
List<TopRoomTabHomeVo> topRoomTabHomeVos = new ArrayList<>();;
|
||||
List<TopRoomTabHomeVo> topRoomTabHomeVos = new ArrayList<>();
|
||||
;
|
||||
QueryWrapper<RoomTabHome> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(RoomTabHome::getTabId, tabId);
|
||||
List<RoomTabHome> list = roomTabHomeService.list(wrapper);
|
||||
@@ -375,7 +374,8 @@ public class HomeService extends BaseService {
|
||||
* @return
|
||||
*/
|
||||
public List<TopRoomTabHomeVo> getRoomTabMapList(Integer tabId, Integer page, Integer pageSize) {
|
||||
List<TopRoomTabHomeVo> topRoomTabHomeVos = new ArrayList<>();;
|
||||
List<TopRoomTabHomeVo> topRoomTabHomeVos = new ArrayList<>();
|
||||
;
|
||||
QueryWrapper<RoomTabMap> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(RoomTabMap::getTabId, tabId).orderByDesc(RoomTabMap::getIsTop)
|
||||
.orderByAsc(RoomTabMap::getSeq);
|
||||
@@ -586,11 +586,12 @@ public class HomeService extends BaseService {
|
||||
if (ObjectUtil.isNull(roomTab)) throw new ServiceException(BusiStatus.NO_HOMEPAGE_RECOMMENDATION_TAB_SET);
|
||||
tabId = roomTab.getId();
|
||||
}
|
||||
List<TopRoomTabHomeVo> topRoomTabHomeVos = new ArrayList<>();;
|
||||
List<TopRoomTabHomeVo> topRoomTabHomeVos = new ArrayList<>();
|
||||
;
|
||||
QueryWrapper<RoomTabHome> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(RoomTabHome::getTabId, tabId);
|
||||
List<RoomTabHome> list = roomTabHomeService.list(wrapper);
|
||||
if(CollectionUtils.isEmpty(list)) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return topRoomTabHomeVos;
|
||||
}
|
||||
|
||||
@@ -614,15 +615,15 @@ public class HomeService extends BaseService {
|
||||
TopRoomTabHomeVo topRoomTabHomeVo = new TopRoomTabHomeVo();
|
||||
Room room = roomMap.get(roomTabHome.getRoomUid());
|
||||
Users users = userMap.get(roomTabHome.getRoomUid());
|
||||
if(room == null) {
|
||||
if (room == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!u.getPartitionId().equals(room.getPartitionId())){
|
||||
if (!u.getPartitionId().equals(room.getPartitionId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
BeanUtils.copyProperties(roomTabHome,topRoomTabHomeVo);
|
||||
BeanUtils.copyProperties(roomTabHome, topRoomTabHomeVo);
|
||||
//已置顶并且置顶时间未失效
|
||||
boolean isTop = roomTabHome.getIsTop() && ObjectUtil.isNotNull(roomTabHome.getTopStart()) && ObjectUtil.isNotNull(roomTabHome.getTopEnd())
|
||||
&& currentDate.compareTo(roomTabHome.getTopStart()) >= 0
|
||||
@@ -763,7 +764,7 @@ public class HomeService extends BaseService {
|
||||
List<Room> roomList = roomService.getRoomListByUids(roomUidList);
|
||||
Map<Long, Room> roomMap = roomList.stream().collect(Collectors.toMap(Room::getUid, room -> room));
|
||||
List<Users> usersList = usersBaseService.getUsersListByUids(roomUidList);
|
||||
Map<Long,Users> userMap = usersList.stream().collect(Collectors.toMap(Users::getUid, users -> users));
|
||||
Map<Long, Users> userMap = usersList.stream().collect(Collectors.toMap(Users::getUid, users -> users));
|
||||
|
||||
Users u = usersService.getUsersByUid(uid);
|
||||
|
||||
@@ -781,7 +782,7 @@ public class HomeService extends BaseService {
|
||||
TopRoomTabHomeVo topRoomTabHomeVo = new TopRoomTabHomeVo();
|
||||
Room room = roomMap.get(roomTabMap.getRoomUid());
|
||||
Users users = userMap.get(roomTabMap.getRoomUid());
|
||||
if(ObjectUtil.isNull(room) || ObjectUtil.isNull(users)) continue;
|
||||
if (ObjectUtil.isNull(room) || ObjectUtil.isNull(users)) continue;
|
||||
|
||||
if (!u.getPartitionId().equals(room.getPartitionId())) continue;
|
||||
|
||||
@@ -897,23 +898,7 @@ public class HomeService extends BaseService {
|
||||
* @return
|
||||
*/
|
||||
public List<HomeRoomTabVo> getHomeRoomTabV2() {
|
||||
List<HomeRoomTabVo> homeRoomTabVoList = this.getHomeRoomTab();
|
||||
if (CollectionUtils.isEmpty(homeRoomTabVoList)) return homeRoomTabVoList;
|
||||
|
||||
QueryWrapper<RoomTab> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(RoomTab::getIsHomeRecommen, true);
|
||||
RoomTab roomTab = roomTabService.getBaseMapper().selectOne(queryWrapper);
|
||||
|
||||
if (ObjectUtil.isNotNull(roomTab)) {
|
||||
Long tabId = Long.valueOf(roomTab.getId());
|
||||
|
||||
homeRoomTabVoList = homeRoomTabVoList.stream().filter(homeRoomTabVo -> {
|
||||
if (homeRoomTabVo.getId().equals(tabId)) return false;
|
||||
else return true;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return homeRoomTabVoList;
|
||||
return this.getHomeRoomTab();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user