Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

Joburgess 5 vuotta sitten
vanhempi
commit
f73bb84d61
15 muutettua tiedostoa jossa 117 lisäystä ja 45 poistoa
  1. 10 0
      edu-im/edu-im-api/src/main/java/com/keao/edu/im/api/entity/MemberChangedMessage.java
  2. 11 0
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java
  3. 4 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java
  4. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java
  5. 0 11
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java
  6. 0 11
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java
  7. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomListQueryInfo.java
  8. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java
  9. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentExamResultService.java
  10. 5 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java
  11. 5 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  12. 46 15
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java
  13. 8 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml
  14. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  15. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml

+ 10 - 0
edu-im/edu-im-api/src/main/java/com/keao/edu/im/api/entity/MemberChangedMessage.java

@@ -8,6 +8,7 @@ public class MemberChangedMessage extends BaseMessage{
     public final static int Action_Kick = 3;
     public final static int Action_Recorded = 4;
     public final static int Student_Queue = 5;
+    public final static int Shield_UserId = 6;
 
     private int action;
 
@@ -17,6 +18,7 @@ public class MemberChangedMessage extends BaseMessage{
 //    private String appParamJson;
     private Integer waitNum;
     private Integer openFlag;
+    private String shieldUserId;
     private Integer classroomSwitch;
     private String webParamJson;
     private boolean camera;
@@ -26,6 +28,14 @@ public class MemberChangedMessage extends BaseMessage{
 
     private Date timestamp;
 
+    public String getShieldUserId() {
+        return shieldUserId;
+    }
+
+    public void setShieldUserId(String shieldUserId) {
+        this.shieldUserId = shieldUserId;
+    }
+
     public Integer getOpenFlag() {
         return openFlag;
     }

+ 11 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java

@@ -72,6 +72,17 @@ public class ExamRoom {
 	/**  */
 	private String tenantId;
 
+	@ApiModelProperty(value = "需要屏蔽音频流的用户")
+	private String shieldUserId;
+
+	public String getShieldUserId() {
+		return shieldUserId;
+	}
+
+	public void setShieldUserId(String shieldUserId) {
+		this.shieldUserId = shieldUserId;
+	}
+
 	public Integer getExamFlag() {
 		return examFlag;
 	}

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

@@ -110,9 +110,9 @@ public class StudentExamResultController extends BaseController {
      * @return
      * @throws Exception
      */
-    /*@RequestMapping(value = "/shieldUserId", method = RequestMethod.POST)
-    public Object shieldUserId(Long roomId)throws Exception {
-        studentExamResultService.shieldUserId(roomId);
+    @RequestMapping(value = "/shieldUserId", method = RequestMethod.POST)
+    public Object shieldUserId(Long roomId,Integer shieldFlag)throws Exception {
+        studentExamResultService.shieldUserId(roomId,shieldFlag);
         return succeed();
-    }*/
+    }
 }

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java

@@ -94,4 +94,11 @@ public interface StudentExamResultDao extends BaseDAO<Long, StudentExamResult> {
      * @param sessionId
      */
     void updateSessionId(@Param("examRegistrationId") Long examRegistrationId, @Param("sessionId") String sessionId);
+
+    /**
+     * 修改屏蔽用户
+     * @param examRegistrationId
+     * @param shieldUserId
+     */
+    void updateShield(@Param("examRegistrationId") Long examRegistrationId, @Param("shieldUserId") String shieldUserId);
 }

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

@@ -31,17 +31,6 @@ 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;
     }

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

@@ -64,17 +64,6 @@ public class StudentExamResult {
 	@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;
 	}

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomListQueryInfo.java

@@ -13,9 +13,20 @@ public class ExamRoomListQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "结束时间")
     private String endTime;
 
+    @ApiModelProperty(value = "线上线下")
+    private String examMode;
+
     @ApiModelProperty(value = "考试状态")
     private String examBaseStatus;
 
+    public String getExamMode() {
+        return examMode;
+    }
+
+    public void setExamMode(String examMode) {
+        this.examMode = examMode;
+    }
+
     public String getStartTime() {
         return startTime;
     }

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java

@@ -156,4 +156,11 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
      * @return
      */
     Integer countSignInNum(Long examRoomId);
+
+    /**
+     * 获取报名学员所在教室
+     * @param examRegistrationId
+     * @return
+     */
+    ExamRoomStudentRelation getStudentExamRoom(Long examRegistrationId);
 }

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

@@ -76,5 +76,5 @@ public interface StudentExamResultService extends BaseService<Long, StudentExamR
      * 屏蔽指定用户
      * @param roomId
      */
-//    void shieldUserId(Long roomId);
+    void shieldUserId(Long roomId,Integer shieldFlag);
 }

+ 5 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -755,6 +755,11 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		ExamRoom examRoom = examRoomDao.get(examRoomId);
 		examRoom.setId(examRoomId);
 		examRoom.setOpenFlag(openFlag);
+		if(StringUtils.isEmpty(examRoom.getAssistantTeacherUserIdList())){
+			examRoom.setShieldUserId(examRoom.getMainTeacherUserId().toString());
+		}else {
+			examRoom.setShieldUserId(examRoom.getMainTeacherUserId() + "," + examRoom.getAssistantTeacherUserIdList());
+		}
 		if(openFlag == 0){
 			examRoom.setExamFlag(openFlag);
 			Integer num = examRoomStudentRelationService.countSignInNum(examRoomId);

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

@@ -444,6 +444,11 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	}
 
 	@Override
+	public ExamRoomStudentRelation getStudentExamRoom(Long examRegistrationId) {
+		return examRoomStudentRelationDao.getStudentExamRoom(examRegistrationId);
+	}
+
+	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void nextBit(Integer examStatus,Long examRoomId) {
 		List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(examRoomId);

+ 46 - 15
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java

@@ -9,11 +9,14 @@ import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.SysMessageService;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.im.api.client.ImFeignService;
+import com.keao.edu.im.api.entity.MemberChangedMessage;
+import com.keao.edu.im.api.entity.PublishMessageDto;
 import com.keao.edu.thirdparty.message.provider.JiguangPushPlugin;
+import com.keao.edu.user.api.entity.ExamRoom;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.api.entity.Student;
 import com.keao.edu.user.api.enums.StudentExamResultApiDto;
-import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
 import com.keao.edu.user.dao.ExaminationBasicDao;
 import com.keao.edu.user.dao.StudentExamResultDao;
 import com.keao.edu.user.dto.ExaminationBasicDto;
@@ -27,6 +30,8 @@ import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.enums.ExamStatusEnum;
 import com.keao.edu.user.enums.LevelEnum;
 import com.keao.edu.user.page.StudentExamResultQueryInfo;
+import com.keao.edu.user.service.ExamRoomService;
+import com.keao.edu.user.service.ExamRoomStudentRelationService;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.user.service.StudentExamResultService;
 import com.keao.edu.util.collection.MapUtil;
@@ -48,13 +53,17 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 	@Autowired
 	private StudentExamResultDao studentExamResultDao;
 	@Autowired
-	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
+	private ExamRoomStudentRelationService examRoomStudentRelationService;
 	@Autowired
 	private OrganizationService organizationService;
 	@Autowired
 	private SysMessageService sysMessageService;
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private ImFeignService imFeignService;
+	@Autowired
+	private ExamRoomService examRoomService;
 
 	private final static Logger logger = LoggerFactory.getLogger(StudentExamResultServiceImpl.class);
 
@@ -171,7 +180,7 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 	@Override
 	public StudentExamResultApiDto getStudentExamResultApiDto(Long id) {
 		StudentExamResultApiDto resultApiDto = studentExamResultDao.getStudentExamResultApiDto(id);
-		ExamRoomStudentRelation studentExamRoom = examRoomStudentRelationDao.getStudentExamRoom(id);
+		ExamRoomStudentRelation studentExamRoom = examRoomStudentRelationService.getStudentExamRoom(id);
 		resultApiDto.setRoomId(studentExamRoom.getExamRoomId().toString());
 		return resultApiDto;
 	}
@@ -212,21 +221,43 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 		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();
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void shieldUserId(Long roomId,Integer shieldFlag) {
+		ExamRoom examRoom = examRoomService.get(roomId);
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		String userToString = sysUser.getId().toString();
+		String shieldUserId = examRoom.getShieldUserId();
+		//取消屏蔽
+		if(shieldFlag == 0){
+			if(StringUtils.isNotEmpty(shieldUserId)){
+				if(shieldUserId.contains("," + userToString)){
+					shieldUserId = shieldUserId.replace("," + userToString,"");
+				}else if(shieldUserId.contains(userToString + ",")){
+					shieldUserId = shieldUserId.replace(userToString + ",","");
+				}else {
+					shieldUserId = "";
+				}
+			}else {
+				shieldUserId = "";
+			}
+		}else {
 			if(StringUtils.isNotEmpty(shieldUserId)){
-				if(!shieldUserId.contains(sysUser.getId().toString())) {
-					shieldUserId += "," + sysUser.getId();
+				if(!shieldUserId.contains(userToString)) {
+					shieldUserId += "," + userToString;
 				}
 			}else {
-				shieldUserId = sysUser.getId().toString();
+				shieldUserId = userToString;
 			}
-			examRoomStudentRelationDao.updateShield();
 		}
-	}*/
+		examRoom.setShieldUserId(shieldUserId);
+		examRoomService.update(examRoom);
+		PublishMessageDto publishMessageDto = new PublishMessageDto();
+		publishMessageDto.setUserId(userToString);
+		publishMessageDto.setRoomId(roomId.toString());
+		MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Shield_UserId, userToString,3);
+		msg.setShieldUserId(shieldUserId);
+		publishMessageDto.setMemberChangedMessage(msg);
+		imFeignService.publishMessage(publishMessageDto);
+	}
 }

+ 8 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -28,6 +28,7 @@
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
 		<result column="exam_flag_" property="examFlag" />
+		<result column="shield_user_id_" property="shieldUserId" />
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -71,8 +72,11 @@
 	<update id="update" parameterType="com.keao.edu.user.api.entity.ExamRoom">
 		UPDATE exam_room
 		<set>
+			<if test="shieldUserId != null">
+				exam_flag_ = #{shieldUserId},
+			</if>
 			<if test="examFlag != null">
-				exam_flag_ = #{examFlag},
+				shield_user_id_ = #{examFlag},
 			</if>
 			<if test="delFlag != null">
 				del_flag_ = #{delFlag},
@@ -320,6 +324,9 @@
 			<if test="examBaseStatus != null and examBaseStatus != ''">
 				AND eb.status_ = #{examBaseStatus}
 			</if>
+			<if test="examMode != null and examMode != ''">
+				AND er.exam_mode_ = #{examMode}
+			</if>
 		</where>
 	</sql>
 	<select id="countExamRoomPage" resultType="java.lang.Integer">

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

@@ -91,7 +91,7 @@
 		WHERE exam_registration_id_ = #{examRegistrationId}
 	</update>
 
-    <!-- 根据主键删除一条记录 -->
+	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM exam_room_student_relation WHERE id_ = #{id} 
 	</delete>

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

@@ -118,7 +118,7 @@
 		WHERE exam_registration_id_ = #{examRegistrationId}
 	</update>
 
-	<!-- 根据主键删除一条记录 -->
+    <!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM student_exam_result WHERE id_ = #{id} 
 	</delete>