|
@@ -1,6 +1,5 @@
|
|
|
package com.keao.edu.im.service.Impl;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.keao.edu.auth.api.client.SysUserFeignService;
|
|
|
import com.keao.edu.auth.api.entity.SysUser;
|
|
|
import com.keao.edu.common.enums.YesOrNoEnum;
|
|
@@ -111,23 +110,24 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
String recordStartTime = examResult.getRecordStartTime();
|
|
|
Date date = new Date();
|
|
|
+ RoomResult roomResult = new RoomResult();
|
|
|
if(recordStartTime != null){
|
|
|
Date startTime = DateUtil.stringToDate(recordStartTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
|
- int minutesBetween = DateUtil.minutesBetween(startTime, date);
|
|
|
- int record_minutes = Integer.parseInt(eduUserFeignService.getSysConfig("record_minutes"));
|
|
|
+ int minutesBetween = DateUtil.secondsBetween(startTime, date);
|
|
|
+ int record_minutes = Integer.parseInt(eduUserFeignService.getSysConfig("record_minutes")) * 60;
|
|
|
if(minutesBetween >= record_minutes){
|
|
|
throw new BizException("加入失败,录制超时");
|
|
|
}
|
|
|
+ roomResult.setSurplusTime(record_minutes - minutesBetween);
|
|
|
}
|
|
|
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
String userId = sysUser.getId().toString();
|
|
|
String realName = sysUser.getRealName();
|
|
|
// ExamRoom examRoom = eduUserFeignService.getExamRoom(Integer.parseInt(roomId));
|
|
|
- RoomResult roomResult = new RoomResult();
|
|
|
+
|
|
|
RoomResult.MemberResult userResult = new RoomResult.MemberResult();
|
|
|
List<RoomMember> memberList = roomMemberDao.findByRidAndUid(recordedRoomId, userId);
|
|
|
-
|
|
|
ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(examRegistrationId);
|
|
|
if(examRoomStudentRelation == null){
|
|
|
throw new BizException("学员考试数据异常");
|
|
@@ -188,13 +188,15 @@ public class RoomServiceImpl implements RoomService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
@Override
|
|
|
- public RoomResult joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera,boolean isMusicMode) throws ApiException, Exception {
|
|
|
- StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
|
|
|
- Integer recordFlag = examResult.getRecordFlag();
|
|
|
- if(recordFlag != null && recordFlag == 1){
|
|
|
- joinRecorded(registrationId);
|
|
|
+ public RoomResult joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera,boolean isMusicMode,String roomId) throws ApiException, Exception {
|
|
|
+ if(StringUtils.isNotEmpty(roomId)){
|
|
|
+ StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
|
|
|
+ Integer recordFlag = examResult.getRecordFlag();
|
|
|
+ if(recordFlag != null && recordFlag == 1){
|
|
|
+ joinRecorded(registrationId);
|
|
|
+ }
|
|
|
}
|
|
|
- String roomId = examResult.getRoomId();
|
|
|
+
|
|
|
CheckUtils.checkArgument(registrationId != null, "registrationId must't be null");
|
|
|
|
|
|
log.info("joinRoom: roomId={}, isAudience={}, isDisableCamera={},isMusicMode={}", roomId, isAudience, isDisableCamera,isMusicMode);
|