Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	edu-common/src/main/java/com/keao/edu/common/enums/MessageTypeEnum.java
#	edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
Joburgess 5 éve
szülő
commit
d4a9006ec7

+ 1 - 0
edu-common/src/main/java/com/keao/edu/common/enums/MessageTypeEnum.java

@@ -12,6 +12,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     REGIST_PASS_PUSH("REGIST_PASS_PUSH", "报名审核通过"),
     REGIST_REJECT_PUSH("REGIST_REJECT_PUSH", "报名审核未通过"),
     REGIST_REJECT_SMS("REGIST_REJECT_SMS", "报名审核未通过"),
+    ACTION_EXAM_SIGN_PUSH("ACTION_EXAM_SIGN_PUSH", "开考签到提醒"),
     EXAM_ROOM_CONFIRM_ONLINE_STUDENT_PUSH("EXAM_ROOM_CONFIRM_ONLINE_STUDENT_PUSH", "考场已确认"),
     EXAM_ROOM_CONFIRM_ONLINE_STUDENT_SMS("EXAM_ROOM_CONFIRM_ONLINE_STUDENT_SMS", "考场已确认"),
     EXAM_ROOM_CONFIRM_OFFLINE_STUDENT_PUSH("EXAM_ROOM_CONFIRM_OFFLINE_STUDENT_PUSH", "考场已确认"),

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

@@ -133,7 +133,7 @@ public class RoomServiceImpl implements RoomService {
         if(examRoomStudentRelation == null){
             throw new BizException("学员考试数据异常");
         }
-        if(examRoomStudentRelation.getClassroomSwitch() == YesOrNoEnum.NO){
+        if(examRoomStudentRelation.getClassroomSwitch() == 0){
             throw new BizException("考级入口已关闭");
         }
         if (memberList.isEmpty()) {
@@ -255,7 +255,7 @@ public class RoomServiceImpl implements RoomService {
                     baseResponse.setErrMsg("学员考试数据异常");
                     return getBaseResponse(baseResponse);
                 }
-                if(examRoomStudentRelation.getClassroomSwitch() == YesOrNoEnum.NO){
+                if(examRoomStudentRelation.getClassroomSwitch() == 0){
                     log.info("user join the room: roomId={} , userId={}", roomId, userId);
                     baseResponse.setErrMsg("考级入口已关闭");
                     return getBaseResponse(baseResponse);
@@ -282,7 +282,7 @@ public class RoomServiceImpl implements RoomService {
                     baseResponse.setErrMsg("学员考试数据异常");
                     return getBaseResponse(baseResponse);
                 }
-                if(examRoomStudentRelation.getClassroomSwitch() == YesOrNoEnum.NO){
+                if(examRoomStudentRelation.getClassroomSwitch() == 0){
                     log.info("user join the room: roomId={} , userId={}", roomId, userId);
                     baseResponse.setErrMsg("考级入口已关闭");
                     return getBaseResponse(baseResponse);

+ 3 - 3
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoomStudentRelation.java

@@ -35,7 +35,7 @@ public class ExamRoomStudentRelation extends  ExamRoom{
 	private String tenantId;
 
 	@ApiModelProperty(value = "房间是否开启")
-	private YesOrNoEnum classroomSwitch;
+	private Integer classroomSwitch;
 
 	public Date getSignInTime() {
 		return signInTime;
@@ -45,11 +45,11 @@ public class ExamRoomStudentRelation extends  ExamRoom{
 		this.signInTime = signInTime;
 	}
 
-	public YesOrNoEnum getClassroomSwitch() {
+	public Integer getClassroomSwitch() {
 		return classroomSwitch;
 	}
 
-	public void setClassroomSwitch(YesOrNoEnum classroomSwitch) {
+	public void setClassroomSwitch(Integer classroomSwitch) {
 		this.classroomSwitch = classroomSwitch;
 	}
 

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRegistrationController.java

@@ -72,7 +72,7 @@ public class ExamRegistrationController extends BaseController {
     }
 
     @ApiOperation(value = "学生端获取学员考试记录")
-    @PostMapping(value = "examList")
+    @GetMapping(value = "examList")
     public HttpResponseResult<PageInfo<ExamRecordDto>> examList(ExamRecordQueryInfo queryInfo) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         queryInfo.setStudentId(sysUser.getId());

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

@@ -141,4 +141,11 @@ public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStuden
      * @return
      */
     String getStudentIds(Long examRoomId);
+
+    /**
+     * 获取学员编号注册编号map
+     * @param examRoomId
+     * @return
+     */
+    List<Map<Integer, String>> getStuRegistrationMap(Long examRoomId);
 }

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

@@ -25,12 +25,23 @@ public class ExamReviewRecordDto {
     @ApiModelProperty(value = "评价")
     private String evaluationContent;
 
+    @ApiModelProperty(value = "视频地址")
+    private String videoUrl;
+
     @ApiModelProperty(value = "评分")
     private Integer evaluationResult;
 
     @ApiModelProperty(value = "评审编号")
     private Integer examReviewId;
 
+    public String getVideoUrl() {
+        return videoUrl;
+    }
+
+    public void setVideoUrl(String videoUrl) {
+        this.videoUrl = videoUrl;
+    }
+
     public Integer getRecordFlag() {
         return recordFlag;
     }

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

@@ -1,20 +1,41 @@
 package com.keao.edu.user.dto;
 
+import io.swagger.annotations.ApiModelProperty;
+
 public class RoomStudentListDto {
+
+    @ApiModelProperty(value = "学员房间关联id")
     private Long examRoomStudentRelationId;
 
+    @ApiModelProperty(value = "学员报名编号")
     private Long examRegistrationId;
 
+    @ApiModelProperty(value = "学员名称")
     private String realName;
 
+    @ApiModelProperty(value = "声部名")
     private String subjectName;
 
+    @ApiModelProperty(value = "签到时间(为空代表未签到)")
+    private String signInTime;
+
+    @ApiModelProperty(value = "级别")
     private Integer level;
 
+    @ApiModelProperty(value = "房间编号")
     private Long examRoomId;
 
+    @ApiModelProperty(value = "学员编号")
     private Integer studentId;
 
+    public String getSignInTime() {
+        return signInTime;
+    }
+
+    public void setSignInTime(String signInTime) {
+        this.signInTime = signInTime;
+    }
+
     public Long getExamRoomStudentRelationId() {
         return examRoomStudentRelationId;
     }

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

@@ -125,4 +125,11 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
     void deleteWithExamRooms(List<Long> examRoomIds);
 
     String getStudentIds(Long examRoomId);
+
+    /**
+     * 获取学员编号注册编号map
+     * @param examRoomId
+     * @return
+     */
+    List<Map<Integer, String>> getStuRegistrationMap(Long examRoomId);
 }

+ 7 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.service.impl;
 
 
+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;
@@ -63,6 +64,8 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
     private SysMessageService sysMessageService;
     @Autowired
     private SysUserDao sysUserDao;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @Override
     public BaseDAO<Long, ExamRegistration> getDAO() {
@@ -220,6 +223,8 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
         PageInfo<ExamRegistrationDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        params.put("studentId",sysUser.getId());
 
         List<ExamRegistrationDto> dataList = null;
         int count = examRegistrationDao.countStudentList(params);
@@ -260,8 +265,8 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
             Map<Integer, String> certificationNameMap = this.getMap("exam_certification", "exam_registration_id_", "card_no_", registrationIds, Integer.class, String.class);
             dataList.forEach(e -> {
                 e.setSubjectName(subjectNameMap.get(e.getSubjectId()));
-                e.setSubjectName(examNameMap.get(e.getExaminationBasicId()));
-                e.setSubjectName(certificationNameMap.get(e.getId()));
+                e.setExamBaseName(examNameMap.get(e.getExaminationBasicId()));
+                e.setCardNo(certificationNameMap.get(e.getId()));
             });
         }
         if (count == 0) {

+ 14 - 11
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -34,6 +34,7 @@ import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.collection.MapUtil;
 import com.keao.edu.util.date.DateUtil;
 import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -502,24 +503,26 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			String studentIds = examRoomStudentRelationService.getStudentIds(examRoomId);
 			StringBuffer stringBuffer = new StringBuffer();
 			stringBuffer.append(examRoom.getMainTeacherUserId());
-			if(StringUtils.isNotEmpty(stringBuffer)){
+			if(StringUtils.isNotEmpty(studentIds)){
 				stringBuffer.append(",").append(studentIds);
-			}
-			if(StringUtils.isNotEmpty(examRoom.getAssistantTeacherUserIdList())){
-				stringBuffer.append(",").append(examRoom.getAssistantTeacherUserIdList());
-			}
-			imFeignService.joinGroup(stringBuffer.toString(),examRoomId.toString(),examRoomId.toString());
-			//推送消息
-			if(StringUtils.isNotEmpty(stringBuffer)){
-
-				String[] split = stringBuffer.toString().split(",");
+				//推送消息
+				String[] split = studentIds.split(",");
 				Map<Integer, String> userPhoneMap = new HashMap<>(split.length);
+//				Map<Integer, String> map = MapUtil.convertMybatisMap(examRoomStudentRelationService.getStuRegistrationMap(examRoomId), Integer.class, String.class);
+
 				for (String s : split) {
 					userPhoneMap.put(Integer.parseInt(s),s);
 				}
-				sysMessageService.batchSendMessage(MessageTypeEnum.STUDENT_EXAM_START,
+//				String notifyUrl = "?examRegistrationId=" + studentExtraExercise.getId() + "&studentCourseHomeworkId=" + studentExtraExercise.getId() + "&extra=1";
+//				String extra = "dayaedu" + notifyUrl + "&userId=" + studentId;
+				sysMessageService.batchSendMessage(MessageTypeEnum.ACTION_EXAM_SIGN_PUSH,
 						userPhoneMap, null, 0, null, JiguangPushPlugin.PLUGIN_NAME);
 			}
+			if(StringUtils.isNotEmpty(examRoom.getAssistantTeacherUserIdList())){
+				stringBuffer.append(",").append(examRoom.getAssistantTeacherUserIdList());
+			}
+			imFeignService.joinGroup(stringBuffer.toString(),examRoomId.toString(),examRoomId.toString());
+
 		}else {
 			SysUser sysUser = sysUserFeignService.queryUserInfo();
 			imFeignService.dismissGroup(sysUser.getId().toString(),examRoomId.toString());

+ 12 - 7
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -192,7 +192,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			studentExamRoom.setExamRoomId(examRoomId);
 			studentExamRoom.setExamRegistrationId(examRegistration.getId().longValue());
 			studentExamRoom.setStudentId(examRegistration.getStudentId());
-			studentExamRoom.setClassroomSwitch(YesOrNoEnum.NO);
+			studentExamRoom.setClassroomSwitch(0);
 			examRoomStudentRelationDao.insert(studentExamRoom);
 			return;
 		}
@@ -276,7 +276,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
 			//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
 			//关闭学员房间入口
-			examRoomStudentRelation.setClassroomSwitch(YesOrNoEnum.NO);
+			examRoomStudentRelation.setClassroomSwitch(0);
 			examRoomStudentRelationDao.update(examRoomStudentRelation);
 			publishMessage(examRoomStudentRelation,MemberChangedMessage.Action_Recorded,true);
 		}
@@ -319,8 +319,13 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	}
 
 	@Override
+	public List<Map<Integer, String>> getStuRegistrationMap(Long examRoomId) {
+		return examRoomStudentRelationDao.getStuRegistrationMap(examRoomId);
+	}
+
+	@Override
 	public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
-		Boolean isPush = false;
+		Boolean isPush = true;
 		if(currentExamRoomStudentRelationId != null){
 			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(currentExamRoomStudentRelationId);
 			//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
@@ -333,11 +338,11 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 				studentExamResultDao.endExam(examRoomStudentRelation.getExamRegistrationId());
 			}
 			//关闭学员房间入口
-			examRoomStudentRelation.setClassroomSwitch(YesOrNoEnum.NO);
+			examRoomStudentRelation.setClassroomSwitch(0);
 			examRoomStudentRelationDao.update(examRoomStudentRelation);
-			publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
+//			publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
 		}
-		nextStudent(nextExamRoomStudentRelationId,isPush);
+		nextStudent(nextExamRoomStudentRelationId,false);
 
 		/*try {
 			SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -352,7 +357,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(nextExamRoomStudentRelationId != null){
 			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(nextExamRoomStudentRelationId);
 			//开启学员房间入口
-			examRoomStudentRelation.setClassroomSwitch(YesOrNoEnum.YES);
+			examRoomStudentRelation.setClassroomSwitch(1);
 			examRoomStudentRelationDao.update(examRoomStudentRelation);
 			publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
 		}

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

@@ -192,6 +192,7 @@
 		<result property="evaluationResult" column="evaluation_result_"/>
 		<result property="examReviewId" column="id_"/>
 		<result property="finishedExam" column="is_finished_exam_"/>
+		<result property="videoUrl" column="video_url_"/>
 	</resultMap>
 	<sql id="queryExamReviewRecordListSql">
 		<where>
@@ -212,7 +213,7 @@
 
 	<select id="queryExamReviewRecordList" resultMap="ExamReviewRecordDtoMap">
 		SELECT ser.is_finished_exam_,ser.record_flag_,ser.confirm_status_,er.evaluation_content_,
-		er.evaluation_result_,ersr.exam_registration_id_,er.id_,ersr.student_id_
+		er.evaluation_result_,ersr.exam_registration_id_,er.id_,ersr.student_id_,ser.video_url_
 		FROM exam_room_student_relation ersr
 		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
 		LEFT JOIN exam_review er ON ser.exam_registration_id_ = er.exam_registration_id_

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

@@ -12,7 +12,7 @@
 		<result column="exam_registration_id_" property="examRegistrationId" />
 		<result column="exam_room_id_" property="examRoomId" />
 		<result column="student_id_" property="studentId" />
-		<result column="classroom_switch_" property="classroomSwitch" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+		<result column="classroom_switch_" property="classroomSwitch"/>
 		<result column="sign_in_time_" property="signInTime" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -67,7 +67,7 @@
 				exam_registration_id_ = #{examRegistrationId},
 			</if>
 			<if test="classroomSwitch != null">
-				classroom_switch_ = #{classroomSwitch,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				classroom_switch_ = #{classroomSwitch},
 			</if>
 			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
@@ -169,7 +169,8 @@
 	</select>
 
 	<select id="findStudentsWithExamRoom" resultMap="ExamRoomStudentRelation">
-		SELECT id_, exam_registration_id_, examination_basic_id_, exam_room_id_, student_id_ FROM exam_room_student_relation WHERE exam_room_id_=#{examRoomId}
+		SELECT id_, exam_registration_id_, examination_basic_id_, exam_room_id_, student_id_
+		FROM exam_room_student_relation WHERE exam_room_id_=#{examRoomId}
 	</select>
 
 	<select id="findStudentsWithExamRooms" resultMap="ExamRoomStudentRelation">
@@ -204,16 +205,18 @@
 		<result property="level" column="level_"/>
 		<result property="realName" column="real_name_"/>
 		<result property="examRoomId" column="exam_room_id_"/>
+		<result property="signInTime" column="sign_in_time_"/>
 		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
 	</resultMap>
 	<select id="queryStudentList" resultMap="RoomStudentListDtoMap">
-		SELECT ersr.id_ exam_room_student_relation_id_,ersr.exam_registration_id_,su.real_name_,
+		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_ 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_
 		LEFT JOIN sys_user su ON ersr.student_id_ = su.id_
 		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
 		WHERE ersr.exam_room_id_ = #{roomId} AND ser.is_finished_exam_ = 0
+		ORDER BY ersr.sign_in_time_ IS NULL,ersr.sign_in_time_ ASC
 	</select>
     <select id="querySignTotalNum" resultType="java.lang.Integer">
 		SELECT COUNT(ersr.id_) FROM exam_room_student_relation ersr
@@ -241,6 +244,11 @@
     <select id="getStudentIds" resultType="java.lang.String">
 		SELECT GROUP_CONCAT(DISTINCT student_id_) FROM exam_room_student_relation WHERE exam_room_id_ = #{examRoomId}
 	</select>
+	<select id="getStuRegistrationMap" resultType="java.util.Map">
+		SELECT student_id_ 'key',GROUP_CONCAT(exam_registration_id_) 'value' FROM exam_room_student_relation
+		WHERE exam_room_id_ = #{examRoomId}
+		GROUP BY student_id_
+	</select>
 
     <select id="getNoSendExamPlanRooms" resultMap="ExamRoomStudentRelation">
 		SELECT