瀏覽代碼

Merge remote-tracking branch 'origin/master'

Joburgess 5 年之前
父節點
當前提交
60d5ed901b

+ 14 - 0
edu-im/edu-im-server/src/main/java/com/keao/edu/im/controller/RoomController.java

@@ -99,6 +99,7 @@ public class RoomController{
         if(notify.getEvent() == 12 || notify.getEvent() == 3){
 //            result = roomService.statusSync(notify.getChannelId(), notify.getUserId());
         }else if(notify.getEvent() == 11){
+            roomService.startRecord(notify.getChannelId());
 //            Teacher teacher = teacherDao.get(Integer.parseInt(notify.getUserId()));
 //            Long roomId = Long.parseLong(notify.getChannelId().substring(1));
 //            CourseSchedule courseSchedule = courseScheduleDao.get(roomId);
@@ -199,6 +200,19 @@ public class RoomController{
         return new BaseResponse<>(result);
     }
 
+    /**
+     * 屏蔽指定学员
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "/shieldStudent", method = RequestMethod.POST)
+    public Object shieldStudent(@RequestBody ReqDeviceControlData data)throws Exception {
+        log.info("batchControl: {}",JSONObject.toJSON(data));
+        boolean result = roomService.batchControlDevice(data);
+        return new BaseResponse<>(result);
+    }
+
     @RequestMapping(value = "/device/batchControl", method = RequestMethod.POST)
     public Object batchControlDevice(@RequestBody ReqDeviceControlData data)throws Exception {
         log.info("batchControl: {}",JSONObject.toJSON(data));

+ 18 - 3
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -89,7 +89,22 @@ public class RoomServiceImpl implements RoomService {
     @Override
     public void startRecord(String roomId) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        IMApiResultInfo imApiResultInfo = imHelper.startRecord(sysUser.getId().toString(), roomId);
+        Integer userId = sysUser.getId();
+        ExamRoom examRoom = eduUserFeignService.getExamRoom(Integer.parseInt(roomId));
+        boolean isAssistant = false;
+        if (StringUtils.isNotEmpty(examRoom.getAssistantTeacherUserIdList())){
+            List<String> list = Arrays.asList(examRoom.getAssistantTeacherUserIdList().split(","));
+            if(list.contains(userId)){
+                isAssistant = true;
+            }
+        }
+        if(sysUser.getId().equals(examRoom.getMainTeacherUserId())){
+            return;
+        }else if(isAssistant){
+            return;
+        }else {
+            imHelper.startRecord(userId.toString(), roomId);
+        }
     }
 
     @Override
@@ -349,8 +364,8 @@ public class RoomServiceImpl implements RoomService {
                 eduUserFeignService.updateFinishedExam(registrationId,0);
             }
             this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
-            IMApiResultInfo imApiResultInfo = imHelper.startRecord(userId, roomId);
-            eduUserFeignService.updateSessionId(registrationId,imApiResultInfo.getSessionId());
+//            IMApiResultInfo imApiResultInfo = imHelper.startRecord(userId, roomId);
+//            eduUserFeignService.updateSessionId(registrationId,imApiResultInfo.getSessionId());
         }
         return baseResponse;
     }

+ 4 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamReviewServiceImpl.java

@@ -107,9 +107,12 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
 		Long examRegistrationId = examReview.getExamRegistrationId();
 		ExamReview byRegistrationId = examReviewDao.findByRegistrationId(examRegistrationId,sysUser.getId());
 		if(byRegistrationId != null){
-			throw new BizException("评审失败请勿重复操作");
+			throw new BizException("评审失败请勿重复操作");
 		}
 		ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationService.getExamRoomStudentRelation(examRegistrationId);
+		if(examRoomStudentRelation.getSignInTime() == null){
+			throw new BizException("评审失败:学员未考试");
+		}
 		examReview.setExaminationBasicId(examRoomStudentRelation.getExaminationBasicId());
 		examReview.setTeacherId(sysUser.getId());
 		examReview.setStudentId(examRoomStudentRelation.getStudentId());

+ 2 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -480,6 +480,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			}else if(roomStudentListDto.getFinishedExam() == 2){
 				//未开始
 				nextStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,sysUser.getId());
+			}else {
+				throw new BizException("操作失败:没有待考学员");
 			}
 		}
 	}

+ 1 - 3
edu-user/edu-user-server/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -108,6 +108,7 @@
 
     <sql id="querySubPageSql">
         <where>
+                s.del_flag_ = 0
             <if test="tenantId != null">
                 AND s.tenant_id_ = #{tenantId}
             </if>
@@ -117,9 +118,6 @@
             <if test="parentId == null">
                 AND s.parent_subject_id_ != 0
             </if>
-            <if test="delFlag != null">
-                AND s.del_flag_ = #{delFlag}
-            </if>
         </where>
     </sql>