瀏覽代碼

Merge remote-tracking branch 'origin/master'

周箭河 5 年之前
父節點
當前提交
1eb938fbec

+ 4 - 4
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/core/filter/UsernameAuthenticationFilter.java

@@ -82,6 +82,10 @@ public class UsernameAuthenticationFilter extends AbstractAuthenticationProcessi
 			throw new UsernameNotFoundException("404.9");
 		}
 
+		if (!StringUtils.upperCase(userInfo.getSysUser().getUserType()).contains(StringUtils.upperCase(clientId))) {
+			throw new UsernameNotFoundException("用户不存在");
+		}
+
 		if(!userInfo.getSysUser().getIsSuperAdmin()){
 			if(clientId.equalsIgnoreCase("system")){
 				Integer lockFlag = sysUserService.queryEmployeeLockFlag(userInfo.getSysUser().getId());
@@ -90,10 +94,6 @@ public class UsernameAuthenticationFilter extends AbstractAuthenticationProcessi
 				}
 			}
 		}
-	
-		if (!StringUtils.upperCase(userInfo.getSysUser().getUserType()).contains(StringUtils.upperCase(clientId))) {
-			throw new UsernameNotFoundException("用户不存在");
-		}
 
 		UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(SecurityConstants.USERNAME_PRINCIPAL_PREFIX + username,
 				password);

+ 2 - 2
edu-auth/edu-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -61,9 +61,9 @@
     <insert id="insert" parameterType="com.keao.edu.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO sys_user
-        (is_super_admin_,im_token_,id_,username_,salt_,phone_,avatar_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
+        (im_token_,id_,username_,salt_,phone_,avatar_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
         gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_)
-        VALUES(#{isSuperAdmin},#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
+        VALUES(#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
         #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName})
     </insert>
 

+ 17 - 71
edu-im/edu-im-server/src/main/java/com/keao/edu/im/controller/RoomController.java

@@ -36,24 +36,6 @@ public class RoomController{
         return roomService.joinRoom(data.getRegistrationId(), data.isAudience(), data.isDisableCamera(),data.isMusicMode(),data.getRoomId());
     }
 
-    /*@RequestMapping(value = "/joinRecorded", method = RequestMethod.POST)
-    public Object joinRecorded(Long registrationId)
-            throws Exception {
-        return new BaseResponse<>(roomService.joinRecorded(registrationId));
-    }*/
-
-    /*@RequestMapping(value = "/levelRecorded", method = RequestMethod.POST)
-    public Object levelRecorded(Long registrationId)
-            throws Exception {
-        return new BaseResponse<>(roomService.levelRecorded(registrationId));
-    }*/
-
-    /*@RequestMapping(value = "/startRecord", method = RequestMethod.POST)
-    public Object startRecord(String roomId) throws Exception {
-        roomService.startRecord(roomId);
-        return new BaseResponse<>();
-    }*/
-
     @RequestMapping(value = "/joinGroup", method = RequestMethod.POST)
     public Object joinGroup(String userIds, String groupId, String groupName) throws Exception {
         roomService.joinGroup(userIds,groupId,groupName);
@@ -74,17 +56,11 @@ public class RoomController{
 
     @RequestMapping(value = "/leave", method = RequestMethod.POST)
     public Object leaveRoom(@RequestBody ReqUserData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.leaveRoom(data.getRegistrationId(),data.getRoomId(),null);
         return new BaseResponse<>(result);
     }
 
-    /*@RequestMapping(value = "/sendImPlayMidiMessage", method = RequestMethod.POST)
-    public Object sendImPlayMidiMessage(@RequestBody PlayMidiMessageData playMidiMessageData) throws Exception {
-        roomService.sendImPlayMidiMessage(playMidiMessageData);
-        return new BaseResponse<>();
-    }*/
-
     @RequestMapping(value = "/statusSync")
     public Object statusSync(@RequestBody String body) throws Exception {
         ChannelStateNotify notify = JSONObject.parseObject(body, ChannelStateNotify.class);
@@ -95,7 +71,7 @@ public class RoomController{
 
     @RequestMapping(value = "/downgrade", method = RequestMethod.POST)
     public Object downRole(@RequestBody ReqChangeUserRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.downgrade(data.getRoomId(), data.getUsers());
         return new BaseResponse<>(result);
     }
@@ -107,7 +83,7 @@ public class RoomController{
 
     @RequestMapping(value = "/kick", method = RequestMethod.POST)
     public Object kickMember(@RequestBody ReqUserData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.kickMember(data);
         return new BaseResponse<>(result);
     }
@@ -118,39 +94,9 @@ public class RoomController{
         return new BaseResponse<>();
     }
 
-    //only teacher
-    /*@RequestMapping(value = "/display", method = RequestMethod.POST)
-    public Object display(@RequestBody ReqDisplayData data)
-            throws ApiException, Exception {
-        boolean result = roomService.display(data.getRoomId(), data.getType(), data.getUri());
-        return new BaseResponse<>(result);
-    }
-
-    @RequestMapping(value = "/whiteboard/create", method = RequestMethod.POST)
-    public Object createWhiteBoard(@RequestBody ReqWhiteboardData data)
-            throws ApiException, Exception {
-        String result = roomService.createWhiteBoard(data.getRoomId());
-        return new BaseResponse<>(result);
-    }
-
-
-    @RequestMapping(value = "/whiteboard/delete", method = RequestMethod.POST)
-    public Object destroyWhiteBoard(@RequestBody ReqWhiteboardData data)
-            throws ApiException, Exception {
-        boolean result = roomService.deleteWhiteboard(data.getRoomId(), data.getWhiteboardId());
-        return new BaseResponse<>(result);
-    }
-
-    @RequestMapping(value = "/whiteboard/list", method = RequestMethod.GET)
-    public Object getWhiteBoard(@RequestParam String roomId)
-            throws ApiException, Exception {
-        List<RoomResult.WhiteboardResult> whiteboards = roomService.getWhiteboard(roomId);
-        return new BaseResponse<>(whiteboards);
-    }*/
-
     @RequestMapping(value = "/device/approve", method = RequestMethod.POST)
     public Object approveControlDevice(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         result = roomService.approveControlDevice(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
@@ -158,7 +104,7 @@ public class RoomController{
 
     @RequestMapping(value = "/device/reject", method = RequestMethod.POST)
     public Object rejectControlDevice(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         result = roomService.rejectControlDevice(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
@@ -166,7 +112,7 @@ public class RoomController{
 
     @RequestMapping(value = "/device/control", method = RequestMethod.POST)
     public Object controlDevice(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         if (data.getCameraOn() != null) {
             result = roomService.controlDevice(data.getRoomId(), data.getUserId(), DeviceTypeEnum.Camera, data.getCameraOn());
@@ -189,7 +135,7 @@ public class RoomController{
 
     @RequestMapping(value = "/device/sync", method = RequestMethod.POST)
     public Object syncDeviceState(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         if (data.getCameraOn() != null) {
             result = roomService.syncDeviceState(data.getRoomId(), DeviceTypeEnum.Camera, data.getCameraOn());
@@ -205,14 +151,14 @@ public class RoomController{
 
     @RequestMapping(value = "/whiteboard/turn-page", method = RequestMethod.POST)
     public Object turnPage(@RequestBody ReqWhiteboardData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.turnWhiteBoardPage(data.getRoomId(), data.getWhiteboardId(), data.getPage());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/members", method = RequestMethod.GET)
     public Object getMembers(@RequestParam String roomId)
-            throws ApiException, Exception {
+            throws Exception {
         List<RoomResult.MemberResult> whiteboards = roomService.getMembers(roomId);
         return new BaseResponse<>(whiteboards);
     }
@@ -226,49 +172,49 @@ public class RoomController{
 
     @RequestMapping(value = "/speech/approve", method = RequestMethod.POST)
     public Object approval(@RequestBody ReqSpeechData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.approveSpeech(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/speech/reject", method = RequestMethod.POST)
     public Object reject(@RequestBody ReqSpeechData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.rejectSpeech(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/transfer", method = RequestMethod.POST)
     public Object transfer(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.transfer(data.getRoomId(), data.getUserId());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/upgrade/invite", method = RequestMethod.POST)
     public Object inviteUpgradeRole(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.inviteUpgradeRole(data.getRoomId(), data.getUserId(), data.getRole());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/upgrade/approve", method = RequestMethod.POST)
     public Object approveUpgradeRole(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.approveUpgradeRole(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/upgrade/reject", method = RequestMethod.POST)
     public Object rejectUpgradeRole(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.rejectUpgradeRole(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/change-role", method = RequestMethod.POST)
     public Object changeRole(@RequestBody ReqChangeRole data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.changeRole(data.getRoomId(), data.getUserId(), data.getRole());
         return new BaseResponse<>(result);
     }
@@ -278,7 +224,7 @@ public class RoomController{
                                      @RequestParam(value = "timestamp", required = false) String timestamp,
                                      @RequestParam(value = "nonce", required = false) String nonce,
                                      @RequestParam(value = "signature", required = false) String signature)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.memberOnlineStatus(statusList, nonce, timestamp, signature);
         return new BaseResponse<>(result);
     }

+ 0 - 147
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -35,10 +35,8 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
-
 import java.util.*;
 import java.util.stream.Collectors;
-
 import static com.keao.edu.im.pojo.RoleEnum.Student;
 
 /**
@@ -49,34 +47,24 @@ import static com.keao.edu.im.pojo.RoleEnum.Student;
 public class RoomServiceImpl implements RoomService {
     @Autowired
     private IMHelper imHelper;
-
     @Autowired
     private RoomDao roomDao;
-
     @Autowired
     private RoomMemberDao roomMemberDao;
-
     @Autowired
     private WhiteBoardHelper whiteBoardHelper;
-
     @Autowired
     private WhiteboardDao whiteboardDao;
-
     @Autowired
     private ScheduleManager scheduleManager;
-
     @Autowired
     private UserDao userDao;
-
     @Autowired
     private IMProperties imProperties;
-
     @Autowired
     private SysUserFeignService sysUserFeignService;
-
     @Autowired
     private EduUserFeignService eduUserFeignService;
-
     @Autowired
     private RedisTemplate<String,String> redisTemplate;
 
@@ -105,103 +93,6 @@ public class RoomServiceImpl implements RoomService {
         imHelper.stopRecord(userId,roomId);
     }
 
-    /*@Override
-    public RoomResult joinRecorded(Long examRegistrationId) throws Exception {
-        StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(examRegistrationId);
-//        String roomId = examResult.getRoomId();
-        String recordedRoomId = "recorded" + examResult.getRoomId();
-        CheckUtils.checkArgument(recordedRoomId != null, "joinRecorded roomId must't be null");
-
-        //是否超时
-        Integer isFinishedExam = examResult.getIsFinishedExam();
-        if(isFinishedExam == null || isFinishedExam == 1){
-            throw new BizException("加入失败,考试已结束");
-        }
-        Integer recordFlag = examResult.getRecordFlag();
-        if(recordFlag == null || recordFlag == 0){
-            throw new BizException("加入失败,当前考试不允许录制");
-        }
-        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.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.MemberResult userResult = new RoomResult.MemberResult();
-        List<RoomMember> memberList = roomMemberDao.findByRidAndUid(recordedRoomId, userId);
-        ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(examRegistrationId);
-        if(examRoomStudentRelation == null){
-            throw new BizException("学员考试数据异常");
-        }
-        if(examRoomStudentRelation.getClassroomSwitch() == 0){
-            throw new BizException("考级入口已关闭");
-        }
-        if (memberList.isEmpty()) {
-            saveRoomMember(userId,sysUser.getAvatar(), realName, recordedRoomId, Student.getValue(), true,true, date,examRegistrationId);
-            *//*IMApiResultInfo resultInfo = imHelper.joinGroup(new String[]{userId}, recordedRoomId, recordedRoomId);
-            if (!resultInfo.isSuccess()) {
-                throw new ApiException(ErrorEnum.ERR_CREATE_ROOM_ERROR, resultInfo.getErrorMessage());
-            }*//*
-            userResult.setMicrophone(true);
-            userResult.setCamera(true);
-            userResult.setHandUp(false);
-            userResult.setJoinTime(date);
-            log.info("joinRecorded user join the room: roomId={} , userId={}, roleEnum={}", recordedRoomId, userId, Student);
-        } else {
-            RoomMember roomMember = memberList.get(0);
-//            roomMemberDao.updateCameraByRidAndUid(roomId, userId, !isDisableCamera);
-            userResult.setCamera(roomMember.isCamera());
-            userResult.setHandUp(roomMember.isHand());
-            userResult.setJoinTime(roomMember.getJoinDt());
-            log.info("joinRecorded user exist in the room: roomId={} , userId={}, use the last role={}", recordedRoomId, userId, Student);
-        }
-
-        MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Join, userId, Student.getValue());
-        msg.setTimestamp(date);
-        msg.setUserName(realName);
-        msg.setCamera(true);
-        imHelper.publishMessage(userId, recordedRoomId, msg);
-
-        List<UserInfo> userInfoList = userDao.findByUid(userId);
-        if (userInfoList.isEmpty()) {
-            UserInfo userInfo = new UserInfo();
-            userInfo.setUid(userId);
-            userInfo.setName(realName);
-            userInfo.setCreateDt(date);
-            userInfo.setUpdateDt(date);
-            userDao.save(userInfo);
-        } else {
-            UserInfo user = userInfoList.get(0);
-            user.setUpdateDt(date);
-            userDao.save(user);
-        }
-
-        userResult.setUserName(realName);
-        userResult.setUserId(userId);
-        userResult.setRole(Student.getValue());
-        roomResult.setUserInfo(userResult);
-        roomResult.setRoomId(recordedRoomId);
-        roomResult.setRegistrationId(examRegistrationId);
-        roomResult.setMembers(roomMemberDao.findByRid(recordedRoomId));
-        log.info("joinRecorded join success: roomId = {}, userId = {}, userName={}, role = {}", recordedRoomId, userId, Student);
-        if(examRegistrationId != null){
-            this.publishMessage(eduUserFeignService.getPublishMessage(examRegistrationId));
-        }
-        return roomResult;
-    }*/
-
     private BaseResponse getBaseResponse(BaseResponse baseResponse){
         baseResponse.setErrCode(500);
         return baseResponse;
@@ -414,44 +305,6 @@ public class RoomServiceImpl implements RoomService {
         return true;
     }
 
-    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    @Override
-    public Boolean levelRecorded(Long registrationId) throws Exception {
-        StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
-        String roomId = "recorded" + examResult.getRoomId();
-        SysUser user = sysUserFeignService.queryUserInfo();
-        String userId = user.getId().toString();
-        log.info("levelRecorded: roomId={}, userId={}", roomId,userId);
-
-        CheckUtils.checkArgument(userId != null, "userId must't be null");
-        CheckUtils.checkArgument(roomId != null, "roomId must't be null");
-        List<Room> roomList = roomDao.findByRid(roomId);
-        if (roomList.size() == 0) {
-            log.error("levelRecorded room : {} not exist ", roomId);
-            return false;
-        }
-        RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
-        if (roomMember == null) {
-            log.error("levelRecorded {} not exist in room: {}", userId, roomId);
-            return false;
-        }
-
-        int userRole = roomMember.getRole();
-        log.info("levelRecorded: roomId={}, role={}", roomId, RoleEnum.getEnumByValue(userRole));
-
-        if (roomMemberDao.countByRid(roomId) == 1) {
-            roomMemberDao.deleteUserByRidAndUid(roomId, userId);
-            roomDao.deleteByRid(roomId);
-        } else {
-            roomMemberDao.deleteUserByRidAndUid(roomId, userId);
-        }
-        userDao.deleteByUid(userId);
-        if(registrationId != null){
-            this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
-        }
-        return true;
-    }
-
     @Override
     public void joinGroup(String userIds, String groupId, String groupName) throws Exception {
         IMApiResultInfo imApiResultInfo = imHelper.joinGroup(userIds.split(","), groupId, groupName);

+ 25 - 44
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/RoomService.java

@@ -2,12 +2,9 @@ package com.keao.edu.im.service;
 
 import com.keao.edu.im.api.entity.PublishMessageDto;
 import com.keao.edu.im.api.entity.ReqUserData;
-import com.keao.edu.im.common.ApiException;
 import com.keao.edu.im.common.BaseResponse;
 import com.keao.edu.im.pojo.*;
-import org.springframework.scheduling.annotation.Async;
 
-import java.io.IOException;
 import java.util.List;
 
 /**
@@ -15,7 +12,7 @@ import java.util.List;
  */
 public interface RoomService {
     //everyone
-    public BaseResponse joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera, boolean isMusicMode, String roomId) throws ApiException, Exception;
+    BaseResponse joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera, boolean isMusicMode, String roomId) throws Exception;
 
     void roomQuery(String roomId) throws Exception;
 
@@ -25,62 +22,58 @@ public interface RoomService {
 
     void stopRecord(String userId,String roomId) throws Exception;
 
-    public Boolean leaveRoom(Long registrationId,String roomId,String userId) throws ApiException, Exception;
+    Boolean leaveRoom(Long registrationId,String roomId,String userId) throws Exception;
 
     //only host
-    public Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws ApiException, Exception;
+    Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws Exception;
 
     /**
      * 销毁房间
      * @param roomId
      */
-    public void destroyRoom(Long roomId,String userId) throws Exception;
+    void destroyRoom(Long roomId,String userId) throws Exception;
 
-    public Boolean kickMember(ReqUserData data) throws ApiException, Exception;
+    Boolean kickMember(ReqUserData data) throws Exception;
 
+    String createWhiteBoard(String roomId) throws Exception;
 
-    //only teacher
-//    public Boolean display(String roomId, int type, String uri) throws ApiException, Exception;
+    Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws Exception;
 
-    public String createWhiteBoard(String roomId) throws ApiException, Exception;
+    List<RoomResult.WhiteboardResult> getWhiteboard(String roomId) throws Exception;
 
-    public Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws ApiException, Exception;
+    Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws Exception;
 
-    public List<RoomResult.WhiteboardResult> getWhiteboard(String roomId) throws ApiException, Exception;
-
-    public Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws ApiException, Exception;
-
-    public Boolean controlDevice(String roomId, String userId, DeviceTypeEnum type, boolean enable) throws ApiException, Exception;
+    Boolean controlDevice(String roomId, String userId, DeviceTypeEnum type, boolean enable) throws Exception;
 
     Boolean batchControlDevice(ReqDeviceControlData data) throws Exception;
 
-    public Boolean approveControlDevice(String roomId, String ticket) throws ApiException, Exception;
+    Boolean approveControlDevice(String roomId, String ticket) throws Exception;
+
+    Boolean rejectControlDevice(String roomId, String ticket) throws Exception;
 
-    public Boolean rejectControlDevice(String roomId, String ticket) throws ApiException, Exception;
+    List<RoomResult.MemberResult> getMembers(String roomId) throws Exception;
 
+    Boolean approveSpeech(String roomId, String requestId) throws Exception;
 
-    public List<RoomResult.MemberResult> getMembers(String roomId) throws  ApiException, Exception;
+    Boolean rejectSpeech(String roomId, String requestId) throws Exception;
 
-//    public Boolean applySpeech(String roomId) throws  ApiException, Exception;
+    Boolean transfer(String roomId, String userId) throws Exception;
 
-    public Boolean approveSpeech(String roomId, String requestId) throws  ApiException, Exception;
+    Boolean inviteUpgradeRole(String roomId, String userId, int role) throws Exception;
 
-    public Boolean rejectSpeech(String roomId, String requestId) throws  ApiException, Exception;
+    Boolean approveUpgradeRole(String roomId, String ticket) throws Exception;
 
+    Boolean rejectUpgradeRole(String roomId, String ticket) throws Exception;
 
-    public Boolean transfer(String roomId, String userId) throws ApiException, Exception;
+    Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws Exception;
 
-    public Boolean inviteUpgradeRole(String roomId, String userId, int role) throws  ApiException, Exception;
-    public Boolean approveUpgradeRole(String roomId, String ticket) throws ApiException, Exception;
-    public Boolean rejectUpgradeRole(String roomId, String ticket) throws ApiException, Exception;
+    Boolean changeRole(String roomId, String userId, int role) throws Exception;
 
-    public Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws ApiException, Exception;
+    void destroyRoom(String roomId);
 
-    public Boolean changeRole(String roomId, String userId, int role) throws ApiException, Exception;
+    Boolean memberOnlineStatus(List<ReqMemberOnlineStatus> statusList, String nonce, String timestamp, String signature) throws Exception;
 
-    public void destroyRoom(String roomId);
-    public Boolean memberOnlineStatus(List<ReqMemberOnlineStatus> statusList, String nonce, String timestamp, String signature) throws ApiException, Exception;
-    public void userIMOfflineKick(String userId);
+    void userIMOfflineKick(String userId);
 
     boolean statusSync(ChannelStateNotify notify) throws Exception;
 
@@ -91,18 +84,6 @@ public interface RoomService {
     void publishMessage(PublishMessageDto publishMessageDto) throws Exception;
 
     /**
-     * 开始录播
-     * @param examRegistrationId
-     */
-//    RoomResult joinRecorded(Long examRegistrationId) throws Exception;
-
-    /**
-     * 结束录播
-     * @param examRegistrationId
-     */
-    Boolean levelRecorded(Long examRegistrationId) throws Exception;
-
-    /**
      * 加入群组
      * @param userIds
      * @param groupId

+ 2 - 2
edu-im/edu-im-server/src/main/resources/application.yml

@@ -99,8 +99,8 @@ cn:
       secret: ay9pL#$Ws8Lpapo
       ttlInMilliSec: -1
     im:
-      appkey: 8luwapkv84g3l
-      secret: 7s6m56VCL6Pi
+      appkey: mgb7ka1nme0yg
+      secret: yYHbcfsVu69
       host: http://api-cn.ronghub.com
       rtcHost: http://rtcapi-cn.ronghub.com
     whiteboard:

+ 1 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRoomStudentRelationDao.java

@@ -23,6 +23,7 @@ public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStuden
     void switchClassRoom(@Param("openFlag") Integer openFlag, @Param("examinationBasicId") Integer examinationBasicId, @Param("studentId") Integer studentId);
 
     List<ExamRoomStudentRelationDto> findExamRoomStudents(Map<String, Object> params);
+
     int countExamRoomStudents(Map<String, Object> params);
 
     /**

+ 9 - 3
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java

@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.util.*;
@@ -201,8 +202,11 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
             List<Integer> organIds = dataList.stream().filter(e -> Objects.nonNull(e.getOrganId())).map(ExamRegistration::getOrganId).collect(Collectors.toList());
             Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
 
-            List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
-            Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+            List<Integer> subjectIds = dataList.stream().filter(e->Objects.nonNull(e.getSubjectId())).map(ExamRegistration::getSubjectId).collect(Collectors.toList());
+            Map<Integer, String> subjectIdNameMap = new HashMap<>();
+            if(!CollectionUtils.isEmpty(subjectIds)){
+                subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+            }
 
             List<Integer> studentIds = dataList.stream().map(ExamRegistration::getStudentId).collect(Collectors.toList());
             Map<Integer, String> idPhotoMap = this.getMap("student", "user_id_", "certificate_photo_", studentIds, Integer.class, String.class);
@@ -212,7 +216,9 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
 
             for (ExamRegistrationRoomDto examRegistration : dataList) {
                 examRegistration.setOrganization(new Organization(examRegistration.getOrganId(), organIdNameMap.get(examRegistration.getOrganId())));
-                examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getSubjectId()));
+                if(Objects.nonNull(examRegistration.getSubjectId())){
+                    examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getSubjectId()));
+                }
                 examRegistration.getSysUser().setCertificatePhoto(idPhotoMap.get(examRegistration.getStudentId()));
                 examRegistration.setIsFinishedExam(Objects.isNull(registExamStatusMap.get(examRegistration.getId())) ? 3 : registExamStatusMap.get(examRegistration.getId()));
                 examRegistration.setExaminationBasic(new ExaminationBasic(examRegistration.getExaminationBasicId(), examIdNameMap.get(examRegistration.getExaminationBasicId())));

+ 1 - 0
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -536,6 +536,7 @@
 		LEFT JOIN examination_basic eb ON eb.id_ = er.examination_basic_id_
 		LEFT JOIN exam_certification ec ON ec.exam_registration_id_ = er.id_
 		WHERE ser.id_ IS NOT NULL AND er.student_id_ = #{studentId}
+		ORDER BY ser.update_time_ DESC
 	</select>
 	<select id="countExamList" resultType="java.lang.Integer">
 		SELECT COUNT(er.id_) FROM exam_registration er

+ 2 - 5
edu-user/edu-user-biz/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -71,9 +71,9 @@
     <insert id="insert" parameterType="com.keao.edu.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO sys_user
-        (is_super_admin_,im_token_,id_,username_,salt_,phone_,avatar_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
+        (im_token_,id_,username_,salt_,phone_,avatar_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
         gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_)
-        VALUES(#{isSuperAdmin},#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
+        VALUES(#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
         #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName})
     </insert>
 
@@ -138,9 +138,6 @@
             <if test="realName != null">
                 real_name_ = #{realName},
             </if>
-            <if test="isSuperAdmin != null">
-                is_super_admin_ = #{isSuperAdmin},
-            </if>
             update_time_ = NOW()
         </set>
         WHERE id_ = #{id}

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/config/ResourceServerConfig.java

@@ -26,7 +26,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
     public void configure(HttpSecurity http) throws Exception {
         http.authorizeRequests()
                 .antMatchers("/task/*","/v2/api-docs", "/su/**", "/student/apply", "/examRegistration/ocr", "/examOrder/paymentResult",
-                        "/examOrder/notify","/examinationBasic/getInfo","/examOrder/executePayment","/examOrder/pageList","/studentExamResult/recordSync")
+                        "/examOrder/notify","/examinationBasic/getInfo","/examOrder/executePayment","/examOrder/pageList","/studentExamResult/recordSync", "/appVersionInfo/queryByPlatform")
                 .permitAll()
                 .anyRequest().authenticated().and().csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler)
                 .authenticationEntryPoint(baseAuthenticationEntryPoint).and();