Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
045c9935bc

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

@@ -200,19 +200,6 @@ 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));

+ 12 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java

@@ -103,4 +103,16 @@ public class StudentExamResultController extends BaseController {
         studentExamResultService.confirmStudent(examRegistrationId);
         return succeed();
     }
+
+    /**
+     * 屏蔽指定用户
+     * @param roomId
+     * @return
+     * @throws Exception
+     */
+    /*@RequestMapping(value = "/shieldUserId", method = RequestMethod.POST)
+    public Object shieldUserId(Long roomId)throws Exception {
+        studentExamResultService.shieldUserId(roomId);
+        return succeed();
+    }*/
 }

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java

@@ -31,6 +31,17 @@ public class RoomStudentListDto {
     @ApiModelProperty(value = "学员编号")
     private Integer studentId;
 
+    @ApiModelProperty(value = "需要屏蔽音频流的用户")
+    private String shieldUserId;
+
+    public String getShieldUserId() {
+        return shieldUserId;
+    }
+
+    public void setShieldUserId(String shieldUserId) {
+        this.shieldUserId = shieldUserId;
+    }
+
     public Integer getFinishedExam() {
         return finishedExam;
     }

+ 13 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java

@@ -58,10 +58,23 @@ public class StudentExamResult {
 
 	private String tenantId;
 
+	@ApiModelProperty(value = "录制开始时间")
 	private Date recordStartTime;
 
+	@ApiModelProperty(value = "是否录制")
 	private Integer recordFlag;
 
+	@ApiModelProperty(value = "需要屏蔽音频流的用户编号")
+	private String shieldUserId;
+
+	public String getShieldUserId() {
+		return shieldUserId;
+	}
+
+	public void setShieldUserId(String shieldUserId) {
+		this.shieldUserId = shieldUserId;
+	}
+
 	public Long getExamRoomId() {
 		return examRoomId;
 	}

+ 6 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentExamResultService.java

@@ -71,4 +71,10 @@ public interface StudentExamResultService extends BaseService<Long, StudentExamR
      * @param sessionId
      */
     void updateSessionId(Long examRegistrationId, String sessionId);
+
+    /**
+     * 屏蔽指定用户
+     * @param roomId
+     */
+//    void shieldUserId(Long roomId);
 }

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

@@ -117,7 +117,7 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
 		examReview.setTeacherId(sysUser.getId());
 		examReview.setStudentId(examRoomStudentRelation.getStudentId());
 		examReview.setExamRoomId(examRoomStudentRelation.getExamRoomId());
-		examReview.setStudentId(Integer.parseInt(examRoomStudentRelation.getTenantId()));
+		examReview.setTenantId(examRoomStudentRelation.getTenantId());
 		examReviewDao.insert(examReview);
 	}
 

+ 23 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java

@@ -1,6 +1,8 @@
 package com.keao.edu.user.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.dal.BaseDAO;
 import com.keao.edu.common.enums.MessageTypeEnum;
 import com.keao.edu.common.exception.BizException;
@@ -16,6 +18,7 @@ import com.keao.edu.user.dao.ExaminationBasicDao;
 import com.keao.edu.user.dao.StudentExamResultDao;
 import com.keao.edu.user.dto.ExaminationBasicDto;
 import com.keao.edu.user.dto.RecordNotify;
+import com.keao.edu.user.dto.RoomStudentListDto;
 import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
 import com.keao.edu.user.entity.ExaminationBasic;
 import com.keao.edu.user.entity.Organization;
@@ -50,6 +53,8 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 	private OrganizationService organizationService;
 	@Autowired
 	private SysMessageService sysMessageService;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
 
 	private final static Logger logger = LoggerFactory.getLogger(StudentExamResultServiceImpl.class);
 
@@ -206,4 +211,22 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 	public void updateSessionId(Long examRegistrationId, String sessionId) {
 		studentExamResultDao.updateSessionId(examRegistrationId,sessionId);
 	}
+
+	/*@Override
+	public void shieldUserId(Long roomId) {
+		List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(roomId);
+		if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
+			RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
+			SysUser sysUser = sysUserFeignService.queryUserInfo();
+			String shieldUserId = roomStudentListDto.getShieldUserId();
+			if(StringUtils.isNotEmpty(shieldUserId)){
+				if(!shieldUserId.contains(sysUser.getId().toString())) {
+					shieldUserId += "," + sysUser.getId();
+				}
+			}else {
+				shieldUserId = sysUser.getId().toString();
+			}
+			examRoomStudentRelationDao.updateShield();
+		}
+	}*/
 }

+ 2 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -213,10 +213,11 @@
 		<result property="signInTime" column="sign_in_time_"/>
 		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
 		<result property="finishedExam" column="is_finished_exam_"/>
+		<result property="shieldUserId" column="shield_user_id_"/>
 	</resultMap>
 	<select id="queryStudentList" resultMap="RoomStudentListDtoMap">
 		SELECT ersr.id_ exam_room_student_relation_id_,ersr.exam_registration_id_,su.real_name_,ersr.sign_in_time_,
-		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_,ser.is_finished_exam_
+		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_,ser.is_finished_exam_,ser.shield_user_id_
 		FROM exam_room_student_relation ersr
 		LEFT JOIN exam_certification ec ON ec.exam_registration_id_ = ersr.exam_registration_id_
 		LEFT JOIN `subject` s ON s.id_ = ec.subject_id_