|
@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -75,6 +76,17 @@ public class DataCountService {
|
|
|
}
|
|
|
|
|
|
List<DataCount> lookList = roomVisitLogService.getDataCountTop5(roomIds);
|
|
|
+ HashMap<String,Room> roomHashMap = new HashMap<>();
|
|
|
+ List<String> roomIdList = lookList.stream().map(DataCount::getDataKey).collect(Collectors.toList());
|
|
|
+ if(roomIdList.size() >0){
|
|
|
+ List<Room> roomListDb = roomService.listByIds(roomIdList);
|
|
|
+ roomListDb.forEach(entity-> roomHashMap.put(entity.getRoomId(),entity));
|
|
|
+ }
|
|
|
+ for (DataCount dataCount : lookList) {
|
|
|
+ if(dataCount != null && roomHashMap.get(dataCount.getDataKey()) != null){
|
|
|
+ dataCount.setDataKey(roomHashMap.get(dataCount.getDataKey()).getRoomTitle());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
List<DataCount> danmakuList = roomDanmakuService.getDataCountTop5(roomIds);
|
|
|
|
|
@@ -170,6 +182,7 @@ public class DataCountService {
|
|
|
wrapper.eq(Room::getRoomUserName,userName);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(roomTitle)){
|
|
|
+ roomTitle = URLEncoder.encode(roomTitle);
|
|
|
wrapper.like(Room::getRoomId,roomTitle);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(startTime)){
|