|
@@ -59,6 +59,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ym.enums.RoleEnum.RoleStudent;
|
|
@@ -365,6 +366,14 @@ public class RoomServiceImpl implements RoomService {
|
|
|
|
|
|
List<RoomMember> roomMemberList = roomMemberDao.findByRid(roomId);
|
|
|
if (CollectionUtils.isNotEmpty(roomMemberList)) {
|
|
|
+
|
|
|
+
|
|
|
+ Collection<RoomMember> roomMembers = roomMemberList.stream()
|
|
|
+ .collect(Collectors.toMap(RoomMember::getUid, Function.identity(), (o, n) -> n)).values();
|
|
|
+
|
|
|
+
|
|
|
+ roomMemberList = Lists.newArrayList(roomMembers);
|
|
|
+
|
|
|
Set<String> userIds = roomMemberList.stream().map(RoomMember::getUid).collect(Collectors.toSet());
|
|
|
Map<Integer, String> midiMap = MapUtil.convertMybatisMap(courseScheduleStudentPaymentDao.queryMidiByUserIdsAndCourseId(userIds, courseId.toString()));
|
|
|
Map<Integer, String> examSongMap = MapUtil.convertMybatisMap(courseScheduleStudentPaymentDao.queryExamSongByUserIdsAndCourseId(userIds, courseId.toString()));
|
|
@@ -712,9 +721,9 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
String leaveSuccessKey = "leaveRoomSuccess" + roomId + userId;
|
|
|
- Boolean aBoolean = redisTemplate.opsForValue().setIfAbsent(leaveSuccessKey, roomId, 1l, TimeUnit.SECONDS);
|
|
|
+ Boolean aBoolean = redisTemplate.opsForValue().setIfAbsent(leaveSuccessKey, roomId, 1L, TimeUnit.SECONDS);
|
|
|
log.info("leaveRoomSuccess: roomId={}, userId={},deviceNum={},aBoolean={}", roomId, userId, deviceNum, aBoolean);
|
|
|
- if (!aBoolean) {
|
|
|
+ if (Boolean.FALSE.equals(aBoolean)) {
|
|
|
if (StringUtils.isNotEmpty(deviceNum)) {
|
|
|
|
|
|
if (roleEnum == RoleTeacher) {
|
|
@@ -1770,6 +1779,14 @@ public class RoomServiceImpl implements RoomService {
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(roomMemberList)) {
|
|
|
+
|
|
|
+
|
|
|
+ Collection<RoomMember> roomMembers = roomMemberList.stream()
|
|
|
+ .collect(Collectors.toMap(RoomMember::getUid, Function.identity(), (o, n) -> n)).values();
|
|
|
+
|
|
|
+
|
|
|
+ roomMemberList = Lists.newArrayList(roomMembers);
|
|
|
+
|
|
|
List<CourseScheduleStudentMusicScore> scheduleStudentMusicScores = courseScheduleStudentMusicScoreDao.queryByScoreIdAndCourseId(null, Long.parseLong(roomId.substring(1)), null, null, null);
|
|
|
RoomResult roomResult = new RoomResult();
|
|
|
Set<String> userIds = roomMemberList.stream().map(RoomMember::getUid).collect(Collectors.toSet());
|