|
@@ -843,4 +843,36 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
imFeignService.destroyRoom(examRoomId);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public HttpResponseResult forceCloseExamRoom(Long examRoomId) {
|
|
|
+ if(Objects.isNull(examRoomId)){
|
|
|
+ throw new BizException("请指定考场");
|
|
|
+ }
|
|
|
+ ExamRoom examRoom = examRoomDao.get(examRoomId);
|
|
|
+ if(Objects.isNull(examRoom)){
|
|
|
+ throw new BizException("考场不存在");
|
|
|
+ }
|
|
|
+ examRoom.setOpenFlag(0);
|
|
|
+ examRoomDao.update(examRoom);
|
|
|
+ imFeignService.dismissGroup(examRoom.getMainTeacherUserId().toString(),examRoomId.toString());
|
|
|
+ imFeignService.destroyRoom(examRoomId);
|
|
|
+ return BaseController.succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void cleanExamRoom() {
|
|
|
+ List<ExamRoom> examRooms = examRoomDao.getHistoryOpenExamRoom();
|
|
|
+ if(CollectionUtils.isEmpty(examRooms)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (ExamRoom examRoom : examRooms) {
|
|
|
+ examRoom.setOpenFlag(0);
|
|
|
+ imFeignService.dismissGroup(examRoom.getMainTeacherUserId().toString(),examRoom.getId().toString());
|
|
|
+ imFeignService.destroyRoom(examRoom.getId());
|
|
|
+ }
|
|
|
+ examRoomDao.batchUpdate(examRooms);
|
|
|
+ }
|
|
|
}
|