浏览代码

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

yonge 5 年之前
父节点
当前提交
8b70ac2496
共有 17 个文件被更改,包括 146 次插入86 次删除
  1. 0 1
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/pojo/RoomResult.java
  2. 3 3
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java
  3. 9 0
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/EduUserFeignService.java
  4. 5 0
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/fallback/EduUserFeignServiceFallback.java
  5. 2 11
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java
  6. 7 14
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java
  7. 7 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java
  8. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java
  9. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java
  10. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java
  11. 2 6
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java
  12. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentExamResultService.java
  13. 64 38
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  14. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java
  15. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml
  16. 6 4
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  17. 7 3
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml

+ 0 - 1
edu-im/edu-im-server/src/main/java/com/keao/edu/im/pojo/RoomResult.java

@@ -15,7 +15,6 @@ public class RoomResult {
     private @Getter @Setter String roomId;
     private @Getter @Setter Date startTime;
     private @Getter @Setter int surplusTime;
-    private @Getter @Setter int examFlag;
     private @Getter @Setter Long registrationId;
     private @Getter @Setter String imToken;
     private @Getter @Setter String authorization;

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

@@ -200,10 +200,10 @@ public class RoomServiceImpl implements RoomService {
     public BaseResponse joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera, boolean isMusicMode, String roomId) throws ApiException, Exception {
         if(registrationId != null){
             StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
-            Integer recordFlag = examResult.getRecordFlag();
+            /*Integer recordFlag = examResult.getRecordFlag();
             if(recordFlag != null && recordFlag == 1){
                 joinRecorded(registrationId);
-            }
+            }*/
             roomId = examResult.getRoomId();
         }
 
@@ -333,12 +333,12 @@ public class RoomServiceImpl implements RoomService {
         if (registrationId != null){
             roomResult.setRegistrationId(registrationId);
         }
-        roomResult.setExamFlag(examRoom.getExamFlag());
         roomResult.setMembers(roomMemberDao.findByRid(roomId));
 //        List<Whiteboard> whiteboardList = whiteboardDao.findByRid(roomId);
 //        roomResult.setWhiteboards(whiteboardList);
         log.info("join success: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, roleEnum);
         if(registrationId != null){
+            eduUserFeignService.updateFinishedExam(registrationId,0);
             this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
         }
         return baseResponse;

+ 9 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/EduUserFeignService.java

@@ -8,6 +8,7 @@ import com.keao.edu.user.api.client.fallback.EduUserFeignServiceFallback;
 import com.keao.edu.user.api.entity.ExamRoom;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.api.enums.StudentExamResultApiDto;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -64,4 +65,12 @@ public interface EduUserFeignService {
 	 */
 	@PostMapping(value = "examRoomStudentRelation/api/getExamRoomStudentRelation")
 	ExamRoomStudentRelation getExamRoomStudentRelation(@RequestParam("registrationId") Long registrationId);
+
+	/**
+	 * 修改学员考试状态
+	 * @param examRegistrationId
+	 * @param finishedExam
+	 */
+	@PostMapping(value = "studentExamResult/api/updateFinishedExam")
+	void updateFinishedExam(@RequestParam("examRegistrationId") Long examRegistrationId, @RequestParam("finishedExam") Integer finishedExam);
 }

+ 5 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/fallback/EduUserFeignServiceFallback.java

@@ -39,4 +39,9 @@ public class EduUserFeignServiceFallback implements EduUserFeignService {
 	public ExamRoomStudentRelation getExamRoomStudentRelation(Long registrationId) {
 		return null;
 	}
+
+	@Override
+	public void updateFinishedExam(Long examRegistrationId, Integer finishedExam) {
+
+	}
 }

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

@@ -1,6 +1,5 @@
 package com.keao.edu.user.api.entity;
 
-import com.keao.edu.common.enums.YesOrNoEnum;
 import com.keao.edu.user.api.enums.ExamModeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -55,8 +54,8 @@ public class ExamRoom {
 	@ApiModelProperty(value = "考场状态0关闭1开启")
 	private Integer openFlag;
 
-	@ApiModelProperty(value = "考试状态1开始0关闭")
-	private Integer examFlag;
+//	@ApiModelProperty(value = "考试状态1开始0关闭")
+//	private Integer examFlag;
 
 	private Integer examPlanPushFlag;
 
@@ -73,14 +72,6 @@ public class ExamRoom {
 	/**  */
 	private String tenantId;
 
-	public Integer getExamFlag() {
-		return examFlag;
-	}
-
-	public void setExamFlag(Integer examFlag) {
-		this.examFlag = examFlag;
-	}
-
 	public ExamRoom() {
 	}
 

+ 7 - 14
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java

@@ -51,29 +51,22 @@ public class ExamRoomStudentRelationController extends BaseController {
 
     @ApiOperation("下一位")
     @PostMapping(value = "/nextBit")
-    public HttpResponseResult nextBit(Long nextExamRoomStudentRelationId,Long examRoomStudentRelationId,Integer examStatus,Long roomId) {
-        examRoomStudentRelationService.nextBit(nextExamRoomStudentRelationId,examRoomStudentRelationId,examStatus,roomId);
+    public HttpResponseResult nextBit(Integer examStatus,Long roomId) {
+        examRoomStudentRelationService.nextBit(examStatus,roomId);
         return succeed();
     }
 
-    @ApiOperation("开始考试")
+    /*@ApiOperation("开始考试")
     @PostMapping(value = "/actionExam")
     public HttpResponseResult actionExam(Long examRoomStudentRelationId) {
         examRoomStudentRelationService.actionExam(examRoomStudentRelationId);
         return succeed();
-    }
-
-    @ApiOperation("关闭考试")
-    @PostMapping(value = "/closeExam")
-    public HttpResponseResult closeExam(Long examRoomStudentRelationId) {
-        examRoomStudentRelationService.actionExam(examRoomStudentRelationId);
-        return succeed();
-    }
+    }*/
 
-    @ApiOperation("监考端指定学员去录播")
+    @ApiOperation("监考端选择去录播")
     @PostMapping(value = "/webRecorded")
-    public HttpResponseResult webRecorded(Long nextExamRoomStudentRelationId,Long examRoomStudentRelationId,Long roomId) {
-        examRoomStudentRelationService.recorded(nextExamRoomStudentRelationId,examRoomStudentRelationId,roomId);
+    public HttpResponseResult webRecorded(Long roomId) {
+        examRoomStudentRelationService.recorded(roomId);
         return succeed();
     }
 

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

@@ -15,10 +15,7 @@ import com.keao.edu.user.service.StudentExamResultService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Objects;
 
@@ -59,6 +56,12 @@ public class StudentExamResultController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation("修改考试状态")
+    @PostMapping(value = "/api/updateFinishedExam")
+    public void updateFinishedExam(Long examRegistrationId,Integer finishedExam){
+        studentExamResultService.updateFinishedExam(examRegistrationId,finishedExam);
+    }
+
     @ApiOperation("获取考试结果")
     @PostMapping(value = "/api/get")
     public StudentExamResultApiDto get(Long id){

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

@@ -70,4 +70,11 @@ public interface StudentExamResultDao extends BaseDAO<Long, StudentExamResult> {
      * @param examRegistrationId
      */
     void confirmStudent(Long examRegistrationId);
+
+    /**
+     * 修改学员考试状态
+     * @param examRegistrationId
+     * @param finishedExam
+     */
+    void updateFinishedExam(@Param("examRegistrationId") Long examRegistrationId, @Param("finishedExam") Integer finishedExam);
 }

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

@@ -22,12 +22,23 @@ public class RoomStudentListDto {
     @ApiModelProperty(value = "级别")
     private Integer level;
 
+    @ApiModelProperty(value = "学员考试状态 0考试中,1呼叫中,2已签到,3未签到,4录播中,5已完成")
+    private Integer finishedExam;
+
     @ApiModelProperty(value = "房间编号")
     private Long examRoomId;
 
     @ApiModelProperty(value = "学员编号")
     private Integer studentId;
 
+    public Integer getFinishedExam() {
+        return finishedExam;
+    }
+
+    public void setFinishedExam(Integer finishedExam) {
+        this.finishedExam = finishedExam;
+    }
+
     public String getSignInTime() {
         return signInTime;
     }

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

@@ -43,7 +43,7 @@ public class StudentExamResult {
 	@ApiModelProperty(value = "操作者")
 	private Integer operatorId;
 
-	@ApiModelProperty(value = "是否参与考试")
+	@ApiModelProperty(value = "学员考试状态 0考试中,1呼叫中,2已签到,3未签到,4录播中,5已完成")
 	private Integer isFinishedExam;
 
 	@ApiModelProperty(value = "视频连接")

+ 2 - 6
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java

@@ -71,11 +71,9 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
 
     /**
      * 下一位
-     * @param nextExamRoomStudentRelationId 下一位学员
-     * @param examRoomStudentRelationId 学员考场关联
      * @param examStatus 是否完成考试1是0否
      */
-    void nextBit(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Integer examStatus,Long roomId);
+    void nextBit(Integer examStatus,Long roomId);
 
     public void publishMessage(ExamRoomStudentRelation examRoomStudentRelation,Integer action,Boolean isPush);
 
@@ -103,11 +101,9 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
 
     /**
      * 监考端去录播
-     * @param nextExamRoomStudentRelationId 下一位学员房间关联id
-     * @param examRoomStudentRelationId 当前学员房间关联id
      * @param roomId 房间编号
      */
-    void recorded(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Long roomId);
+    void recorded(Long roomId);
 
     /**
      * 学生端去录播

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

@@ -50,4 +50,11 @@ public interface StudentExamResultService extends BaseService<Long, StudentExamR
      * @param examRegistrationId
      */
     void confirmStudent(Long examRegistrationId);
+
+    /**
+     * 修改学员考试状态
+     * @param examRegistrationId
+     * @param finishedExam
+     */
+    void updateFinishedExam(Long examRegistrationId, Integer finishedExam);
 }

+ 64 - 38
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -293,17 +293,33 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void recorded(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Long roomId) {
-		if(examRoomStudentRelationId != null){
-			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
+	public void recorded(Long roomId) {
+		List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(roomId);
+		if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
+			RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
+			if(roomStudentListDto.getFinishedExam() != 0){
+				throw new BizException("操作失败:当前学员状态不支持录播");
+			}
+			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(roomStudentListDto.getExamRoomStudentRelationId());
+
+			//修改学员考试状态
+			StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRoomStudentRelation.getExamRegistrationId());
+			studentExamResult.setRecordFlag(1);
+			studentExamResult.setIsFinishedExam(4);
+			studentExamResultDao.update(studentExamResult);
+			//关闭学员房间入口
 			examRoomStudentRelation.setClassroomSwitch(0);
 			examRoomStudentRelationDao.update(examRoomStudentRelation);
-			StudentExamResult byRegistrationId = studentExamResultDao.findByRegistrationId(examRoomStudentRelation.getExamRegistrationId());
-			byRegistrationId.setRecordFlag(1);
-			studentExamResultDao.update(byRegistrationId);
 			publishMessage(examRoomStudentRelation,MemberChangedMessage.Action_Recorded,true);
+			if(roomStudentListDtos.size() > 1){
+				RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
+				if(roomStudentListDto1.getFinishedExam() == 2){
+					nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
+				}
+			}
+			//将当前学员退出教室
+			imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
 		}
-		nextStudent(nextExamRoomStudentRelationId,false);
 	}
 
 	@Override
@@ -388,23 +404,22 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	@Transactional(rollbackFor = Exception.class)
 	public void stuEndRecord(Long examRegistrationId, String videoUrl) {
 		StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
-		//当前学员是否完成考试
 		if(studentExamResult.getIsFinishedExam() == 1){
 			throw new BizException("提交失败:您的考试已完成");
 		}
-		//是否允许录播
-		if(studentExamResult.getRecordFlag() == 0){
-			throw new BizException("提交失败:当前考试不允许录播");
+		//当前学员是否完成考试
+		if(studentExamResult.getIsFinishedExam() != 4){
+			throw new BizException("提交失败:当前考试状态不允许录播");
 		}
 		studentExamResult.setVideoUrl(videoUrl);
-		studentExamResult.setIsFinishedExam(1);
+		studentExamResult.setIsFinishedExam(5);
 		studentExamResultDao.update(studentExamResult);
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void actionExam(Long examRoomStudentRelationId) {
-		ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
+		/*ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
 		examRoomStudentRelation.setClassroomSwitch(1);
 
 		ExamRoom examRoom = examRoomDao.get(examRoomStudentRelation.getExamRoomId());
@@ -414,38 +429,47 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		examRoomStudentRelationDao.update(examRoomStudentRelation);
 		examRoom.setExamFlag(1);
 		examRoomDao.update(examRoom);
-		publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,true);
+		publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,true);*/
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
-		Boolean isPush = true;
-		if(currentExamRoomStudentRelationId != null){
-			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(currentExamRoomStudentRelationId);
-			//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
-			imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
-			if(examStatus == 0){
-				//未完成
-				examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
-			}else {
-				//结束考试
-				studentExamResultDao.endExam(examRoomStudentRelation.getExamRegistrationId());
+	public void nextBit(Integer examStatus,Long examRoomId) {
+		List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(examRoomId);
+		if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
+			RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
+			if(roomStudentListDto.getFinishedExam() == 0 || roomStudentListDto.getFinishedExam() == 1){
+				//考试中
+				currentStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,examStatus);
+				if(roomStudentListDtos.size() > 1){
+					RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
+					if(roomStudentListDto1.getFinishedExam() == 2){
+						nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
+					}
+				}
+			}else if(roomStudentListDto.getFinishedExam() == 2){
+				//未开始
+				nextStudent(roomStudentListDto.getExamRoomStudentRelationId(),true);
 			}
-			//关闭学员房间入口
-			examRoomStudentRelation.setClassroomSwitch(0);
-			examRoomStudentRelationDao.update(examRoomStudentRelation);
-			publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
 		}
-		nextStudent(nextExamRoomStudentRelationId,false);
+	}
 
-		/*try {
-			SysUser sysUser = sysUserFeignService.queryUserInfo();
-			String message = JSONObject.toJSONString(this.queryNeedCheckingList(examRoomId));
-			WebSocketServer.sendInfo(message,sysUser.getId().toString());
-		} catch (IOException e) {
-			e.printStackTrace();
-		}*/
+	private void currentStudent(Long examRoomStudentRelationId,Boolean isPush,Integer examStatus){
+		ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
+		//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
+		imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
+		if(examStatus == 0){
+			//未完成
+			examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
+			studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),2);
+		}else {
+			//结束考试
+			studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),4);
+		}
+		//关闭学员房间入口
+		examRoomStudentRelation.setClassroomSwitch(0);
+		examRoomStudentRelationDao.update(examRoomStudentRelation);
+		publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
 	}
 
 	private void nextStudent(Long nextExamRoomStudentRelationId,Boolean isPush){
@@ -539,6 +563,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 //		msg.setAppParamJson(needCheckingDetailDto.getWaitNum());
 		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
 		publishMessageDto.setMemberChangedMessage(msg);
+		//修改签到状态
+		studentExamResultDao.updateFinishedExam(examRegistrationId,2);
 		imFeignService.publishMessage(publishMessageDto);
 	}
 }

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

@@ -23,6 +23,7 @@ import com.keao.edu.user.service.StudentExamResultService;
 import com.keao.edu.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -138,4 +139,10 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 	public void confirmStudent(Long examRegistrationId) {
 		studentExamResultDao.confirmStudent(examRegistrationId);
 	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void updateFinishedExam(Long examRegistrationId, Integer finishedExam) {
+		studentExamResultDao.updateFinishedExam(examRegistrationId,finishedExam);
+	}
 }

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

@@ -138,7 +138,7 @@
 				AND er.teacher_type_=#{teacherType}
 			</if>
 			<if test="examStartTime!=null and examEndTime!=null">
-				AND DATE_FORMAT( ero.exam_start_time_, '%Y-%m-%d' ) BETWEEN  #{examStartTime} AND #{examEndTime}
+				AND DATE_FORMAT( ero.exam_start_time_, '%Y-%m-%d' ) BETWEEN  DATE_FORMAT( #{examStartTime}, '%Y-%m-%d' ) AND DATE_FORMAT( #{examEndTime}, '%Y-%m-%d' )
 			</if>
 			<if test="search!=null and search!=''">
 				AND su.real_name_ LIKE CONCAT('%', #{search}, '%')

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

@@ -207,16 +207,18 @@
 		<result property="examRoomId" column="exam_room_id_"/>
 		<result property="signInTime" column="sign_in_time_"/>
 		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
+		<result property="finishedExam" column="is_finished_exam_"/>
 	</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_ FROM exam_room_student_relation ersr
+		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_,ser.is_finished_exam_
+		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
+		WHERE ersr.exam_room_id_ = #{roomId}
+		ORDER BY ersr.sign_in_time_ IS NULL,ersr.sign_in_time_ ASC,ser.is_finished_exam_
 	</select>
     <select id="querySignTotalNum" resultType="java.lang.Integer">
 		SELECT COUNT(ersr.id_) FROM exam_room_student_relation ersr
@@ -236,7 +238,7 @@
 		FROM exam_room_student_relation ersr
 		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
 		WHERE ersr.exam_registration_id_ = #{examRegistrationId} AND ersr.sign_in_time_ IS NOT NULL
-		AND ser.is_finished_exam_ = 0 AND ersr.student_id_ != #{studentId}
+		AND ser.is_finished_exam_ IN (0,1,2) AND ersr.student_id_ != #{studentId}
 		<if test="signInTime != null and signInTime != ''">
 			AND ersr.sign_in_time_ &lt; #{signInTime}
 		</if>

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

@@ -101,14 +101,18 @@
 		</set> WHERE id_ = #{id}
 	</update>
     <update id="endExam">
-		UPDATE student_exam_result SET is_finished_exam_ = 1 AND update_time_ = NOW() WHERE exam_registration_id_ = #{examRegistrationId}
+		UPDATE student_exam_result SET is_finished_exam_ = 4 AND update_time_ = NOW() WHERE exam_registration_id_ = #{examRegistrationId}
 	</update>
     <update id="confirmStudent">
 		UPDATE student_exam_result SET confirm_status_ = 1 AND update_time_ = NOW()
 		WHERE exam_registration_id_ = #{examRegistrationId}
 	</update>
+	<update id="updateFinishedExam">
+		UPDATE student_exam_result SET is_finished_exam_ = #{finishedExam} AND update_time_ = NOW()
+		WHERE exam_registration_id_ = #{examRegistrationId}
+	</update>
 
-    <!-- 根据主键删除一条记录 -->
+	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM student_exam_result WHERE id_ = #{id} 
 	</delete>
@@ -160,7 +164,7 @@
 				AND er.level_=#{level}
 			</if>
 			<if test="examStartTime!=null and examEndTime!=null">
-				AND DATE_FORMAT(eb.actual_exam_start_time_, '%Y-%m-%d') BETWEEN #{examStartTime} AND #{examEndTime}
+				AND DATE_FORMAT(eb.actual_exam_start_time_, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{examStartTime}, '%Y-%m-%d') AND DATE_FORMAT(#{examEndTime}, '%Y-%m-%d')
 			</if>
 			<if test="isFinishedExam!=null">
 				AND ser.is_finished_exam_=#{isFinishedExam}