Browse Source

Merge branch 'feature/0529-live' into master_saas

liujc 2 years ago
parent
commit
9057feebbe

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -4843,7 +4843,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             return livedStudentList;
         }
         // 学生ID集合
-        List<Integer> studentIds = records.stream().map(e->e.getStudentId()).collect(Collectors.toList());
+        List<Integer> studentIds = records.stream().map(LiveGroupWrapper.LiveGroupStudentList::getStudentId).collect(Collectors.toList());
 
         // 学生信息
         Map<Integer, Student> studentMap = studentService.getMapByIds(studentIds);
@@ -4851,7 +4851,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             return livedStudentList;
         }
         // 手机号
-        List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(studentIds.stream().collect(Collectors.toList()));
+        List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(studentIds);
 
         Set<Integer> coopIds = new HashSet<>();
         Set<Integer> organIds;
@@ -4874,7 +4874,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
 
         for (LiveGroupWrapper.LiveGroupStudentList record : records) {
-            Student student = studentMap.get(record.getStudentId().longValue());
+            Student student = studentMap.get(record.getStudentId());
             if (Objects.nonNull(student)) {
                 record.setStudentName(student.getUsername());
                 record.setOrganName(organizationMap.getOrDefault(student.getOrganId(), new Organization()).getName());

+ 10 - 2
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -54,6 +54,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
@@ -61,6 +62,7 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.MessageFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
@@ -303,6 +305,7 @@ public class RoomServiceImpl implements RoomService {
 
                     ImLiveBroadcastRoom updateInfo = new ImLiveBroadcastRoom();
                     updateInfo.setId(liveRoom.getId());
+                    updateInfo.setVideoRecord("");
                     updateInfo.setLiveStartTime(DateTime.now().toDate());
 
                     // 更新直播间状态
@@ -336,7 +339,7 @@ public class RoomServiceImpl implements RoomService {
             genRtcRoomMemberInfoConfig(roomId, joinRoom, sysUser, userId, teacher, courseSchedule, curTime, roomResult, courseId);
         }
 
-        log.info("join room: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId);
+        log.info("join room: roomId = {}, userId = {}", roomId, userId);
         return new BaseResponse(roomResult);
     }
 
@@ -366,7 +369,12 @@ public class RoomServiceImpl implements RoomService {
             liveRoom.setServiceProvider(liveClient);
         }
 
-        String roomUid = "LIVE-" + roomId + "-" + courseSchedule.getCreateTime().getTime();
+        String liveStartTime = MessageFormat.format("{0} {1}", DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN),
+                DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT));
+
+        DateTime time = DateTime.parse(liveStartTime, DateTimeFormat.forPattern(DateUtil.DEFAULT_PATTERN + " " + DateUtil.EXPANDED_TIME_FORMAT));
+
+        String roomUid = "LIVE-" + roomId + "-" + time.toDate().getTime();
         liveRoom.setTenantId(TenantContextHolder.getTenantId());
         liveRoom.setRoomUid(roomUid);
         //liveRoom.setRoomConfig(liveRoom.getRoomConfig());