zouxuan 5 tahun lalu
induk
melakukan
05ae95971b

+ 1 - 7
edu-im/edu-im-server/src/main/java/com/keao/edu/im/mec/im/IMHelper.java

@@ -244,9 +244,7 @@ public class IMHelper {
         }
 
         JSONObject paramJson = new JSONObject();
-
         paramJson.put("sessionId",roomQuery(roomId));
-//        paramJson.put("sessionId",roomQuery(roomId));
 
         JSONObject config = new JSONObject();
         config.put("mode",3);
@@ -258,9 +256,6 @@ public class IMHelper {
         config.put("renderMode",1);
         config.put("hostUserId","");
         config.put("hostStreamId","");
-
-//        config.put("input",getInput(roomMembers));
-//        paramJson.put("config",config);
         againRecord(paramJson,registrationId,roomId,config);
     }
 
@@ -330,7 +325,7 @@ public class IMHelper {
         }
         JSONObject paramJson = new JSONObject();
         paramJson.put("sessionId",roomQuery(roomId));
-//        paramJson.put("sessionId",roomQuery(roomId));
+
         paramJson.put("mixLayout",1);
         paramJson.put("renderMode",1);
         paramJson.put("hostUserId","");
@@ -424,7 +419,6 @@ public class IMHelper {
         }
         JSONObject paramJson = new JSONObject();
         paramJson.put("sessionId",roomQuery(roomId));
-//        paramJson.put("sessionId",roomQuery(roomId));
 
         String body = paramJson.toJSONString();
 

+ 16 - 19
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -618,7 +618,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws ApiException, Exception {
+    public Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(whiteBoardId != null, "whiteBoardId must't be null");
         SysUser authUser = sysUserFeignService.queryUserInfo();
@@ -657,7 +657,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public List<RoomResult.WhiteboardResult> getWhiteboard(String roomId) throws ApiException, Exception {
+    public List<RoomResult.WhiteboardResult> getWhiteboard(String roomId){
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
 
@@ -674,7 +674,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws ApiException, Exception {
+    public Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(whiteBoardId != null, "whiteBoardId must't be null");
         SysUser authUser = sysUserFeignService.queryUserInfo();
@@ -692,7 +692,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
-    public Boolean controlDevice(String roomId, String userId, DeviceTypeEnum typeEnum, boolean enable) throws ApiException, Exception {
+    public Boolean controlDevice(String roomId, String userId, DeviceTypeEnum typeEnum, boolean enable) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(userId != null, "userId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
@@ -771,7 +771,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean approveControlDevice(String roomId, String ticket) throws ApiException, Exception {
+    public Boolean approveControlDevice(String roomId, String ticket) throws Exception {
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
@@ -795,7 +795,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean rejectControlDevice(String roomId, String ticket) throws ApiException, Exception {
+    public Boolean rejectControlDevice(String roomId, String ticket) throws Exception {
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
@@ -811,8 +811,8 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws ApiException, Exception {
+    @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
+    public Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
         SysUser authUser = sysUserFeignService.queryUserInfo();
@@ -837,7 +837,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public List<RoomResult.MemberResult> getMembers(String roomId) throws ApiException, Exception {
+    public List<RoomResult.MemberResult> getMembers(String roomId){
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         List<RoomMember> roomMemberList = roomMemberDao.findByRid(roomId);
         if(roomMemberList != null && roomMemberList.size() > 0){
@@ -885,7 +885,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
-    public Boolean approveSpeech(String roomId, String ticket) throws ApiException, Exception {
+    public Boolean approveSpeech(String roomId, String ticket) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
         SysUser authUser = sysUserFeignService.queryUserInfo();
@@ -929,7 +929,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean rejectSpeech(String roomId, String ticket) throws ApiException, Exception {
+    public Boolean rejectSpeech(String roomId, String ticket) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
         SysUser authUser = sysUserFeignService.queryUserInfo();
@@ -962,7 +962,7 @@ public class RoomServiceImpl implements RoomService {
     }*/
 
     @Override
-    public Boolean transfer(String roomId, String userId) throws ApiException, Exception {
+    public Boolean transfer(String roomId, String userId) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(userId != null, "userId must't be null");
         CheckUtils.checkArgument(!userId.equals(userId), "can't set self role");
@@ -987,7 +987,6 @@ public class RoomServiceImpl implements RoomService {
         }
 
         roomMemberDao.updateRoleByRidAndUid(roomId, userId, Student.getValue());
-//        roomMemberDao.updateRoleByRidAndUid(roomId, userId, RoleEnum.RoleAssistant.getValue());
 
         AssistantTransferMessage msg = new AssistantTransferMessage();
         msg.setOpUserId(userId);
@@ -1001,7 +1000,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean inviteUpgradeRole(String roomId, String targetUserId, int targetRole) throws ApiException, Exception {
+    public Boolean inviteUpgradeRole(String roomId, String targetUserId, int targetRole) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(targetUserId != null, "userId must't be null");
         CheckUtils.checkArgument(roomMemberDao.existsByRidAndUid(roomId, targetUserId), "room member not exist");
@@ -1014,8 +1013,6 @@ public class RoomServiceImpl implements RoomService {
             throw new ApiException(ErrorEnum.ERR_USER_NOT_EXIST_IN_ROOM);
         }
 
-//        checkOverMax(roomId, targetUser.get(0), targetRole);
-
         String ticket = IdentifierUtils.uuid();
 
         UpgradeRoleTaskInfo taskInfo = new UpgradeRoleTaskInfo();
@@ -1040,7 +1037,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean approveUpgradeRole(String roomId, String ticket) throws ApiException, Exception {
+    public Boolean approveUpgradeRole(String roomId, String ticket) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
@@ -1082,7 +1079,7 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public Boolean rejectUpgradeRole(String roomId, String ticket) throws ApiException, Exception {
+    public Boolean rejectUpgradeRole(String roomId, String ticket) throws Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
@@ -1103,7 +1100,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
-    public Boolean changeRole(String roomId, String targetUserId, int targetRole) throws ApiException, Exception {
+    public Boolean changeRole(String roomId, String targetUserId, int targetRole) throws Exception {
 
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(targetUserId != null, "userId must't be null");

+ 11 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java

@@ -134,4 +134,15 @@ public interface StudentExamResultDao extends BaseDAO<Long, StudentExamResult> {
      * @return java.util.Set<java.lang.Long>
      */
     Set<Long> getIsFinishedExamRegistIds(@Param("examId") Long examId);
+
+    /**
+     * @describe 清除视频
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/8/24
+     * @time 18:12
+     * @param examRegistrationId:
+     * @return void
+     */
+    void updateVideoExam(Long examRegistrationId);
 }

+ 1 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -684,6 +684,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
 			examRoomStudentRelation.setSignInTime(null);
 			studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),3);
+			studentExamResultDao.updateVideoExam(examRoomStudentRelation.getExamRegistrationId());
 			publishMessage(examRoomStudentRelation,MemberChangedMessage.Not_Finish,true,operator);
 			HashMap<Integer, String> map = new HashMap<>(1);
 			map.put(examRoomStudentRelation.getStudentId(),examRoomStudentRelation.getStudentId().toString());

+ 6 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/StudentExamResultMapper.xml

@@ -132,7 +132,12 @@
 		</foreach>
 	</update>
 
-	<!-- 根据主键删除一条记录 -->
+    <update id="updateVideoExam">
+		UPDATE student_exam_result SET video_url_ = NULL ,update_time_ = NOW()
+		WHERE exam_registration_id_ = #{examRegistrationId}
+	</update>
+
+    <!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM student_exam_result WHERE id_ = #{id} 
 	</delete>