zouxuan 5 years ago
parent
commit
456e0c8d9d

+ 5 - 5
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamCertificationController.java

@@ -28,11 +28,11 @@ public class ExamCertificationController extends BaseController {
     @Autowired
     private ExamCertificationService examCertificationService;
 
-//    @ApiOperation("获取学员准考证详情")
-//    @GetMapping(value = "findByStuAndBasicId")
-//    public HttpResponseResult<ExamCertification> findByStuAndBasicId(Integer studentId,Integer basicId) {
-//        return succeed(examCertificationService.findByStuAndBasicId(studentId,basicId));
-//    }
+    @ApiOperation("后台获取学员准考证详情")
+    @GetMapping(value = "findDetailByStudentId")
+    public HttpResponseResult<ExamCertificationDto> findDetailByStudentId(Integer studentId, Long examRegistrationId) {
+        return succeed(examCertificationService.findDetailByStudentId(studentId,examRegistrationId));
+    }
 
     @ApiOperation("学生端获取学员准考证列表")
     @GetMapping(value = "queryCertificationPage")

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

@@ -56,7 +56,7 @@ public class ExamRoomStudentRelationController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation("获取考场待考队列")
+    @ApiOperation("获取后台考场待考队列")
     @PostMapping(value = "/queryNeedCheckingList")
     public HttpResponseResult queryNeedCheckingList(Long roomId) {
         return succeed(examRoomStudentRelationService.queryNeedCheckingList(roomId));

+ 9 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java

@@ -16,10 +16,10 @@ public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
     /**
      * 获取学员准考证
      * @param studentId
-     * @param basicId
+     * @param examRegistrationId
      * @return
      */
-    ExamCertification findByStuAndBasicId(@Param("studentId") Integer studentId, @Param("basicId") Integer basicId);
+    ExamCertification findByStuAndBasicId(@Param("studentId") Integer studentId, @Param("examRegistrationId") Long examRegistrationId);
 
     int deleteWithRegist(@Param("registIds") List<Long> registIds);
 
@@ -42,4 +42,11 @@ public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
      * @return
      */
     NeedCheckingDetailDto needCheckingDetail(Long examRegistrationId);
+
+    /**
+     * 获取监考端准考证详情
+     * @param examRegistrationId
+     * @return
+     */
+    ExamCertificationDto getExamCertificationDto(@Param("examRegistrationId") Long examRegistrationId);
 }

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

@@ -34,6 +34,17 @@ public class ExamCertificationDto{
     @ApiModelProperty(value = "证件照")
     private String certificatePhoto;
 
+    @ApiModelProperty(value = "考试内容")
+    private String songJson;
+
+    public String getSongJson() {
+        return songJson;
+    }
+
+    public void setSongJson(String songJson) {
+        this.songJson = songJson;
+    }
+
     public String getCertificatePhoto() {
         return certificatePhoto;
     }

+ 10 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamCertificationService.java

@@ -16,10 +16,10 @@ public interface ExamCertificationService extends BaseService<Long, ExamCertific
     /**
      * 获取学员准考证
      * @param studentId
-     * @param basicId
+     * @param examRegistrationId
      * @return
      */
-    ExamCertification findByStuAndBasicId(Integer studentId, Integer basicId);
+    ExamCertification findByStuAndBasicId(Integer studentId,Long examRegistrationId);
 
     /**
      * 获取学员的准考证列表
@@ -33,4 +33,12 @@ public interface ExamCertificationService extends BaseService<Long, ExamCertific
      * @return
      */
     NeedCheckingDetailDto needCheckingDetail(Long examRegistrationId);
+
+    /**
+     * 获取后台准考证详情
+     * @param studentId
+     * @param examRegistrationId
+     * @return
+     */
+    ExamCertificationDto findDetailByStudentId(Integer studentId, Long examRegistrationId);
 }

+ 18 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java

@@ -8,11 +8,12 @@ import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.api.entity.Student;
 import com.keao.edu.user.dao.ExamCertificationDao;
 import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
+import com.keao.edu.user.dao.SubjectDao;
 import com.keao.edu.user.dto.ExamCertificationDto;
 import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.entity.ExamCertification;
+import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.service.ExamCertificationService;
-import com.keao.edu.user.service.ExamRoomStudentRelationService;
 import com.keao.edu.user.service.StudentService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -29,6 +30,8 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 	@Autowired
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
 	@Autowired
+	private SubjectDao subjectDao;
+	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
 	private StudentService studentService;
@@ -39,8 +42,8 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 	}
 
 	@Override
-	public ExamCertification findByStuAndBasicId(Integer studentId, Integer basicId) {
-		return examCertificationDao.findByStuAndBasicId(studentId,basicId);
+	public ExamCertification findByStuAndBasicId(Integer studentId, Long examRegistrationId) {
+		return examCertificationDao.findByStuAndBasicId(studentId,examRegistrationId);
 	}
 
 	@Override
@@ -72,4 +75,16 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 		needCheckingDetailDto.setWaitNum(waitNum);
 		return needCheckingDetailDto;
 	}
+
+	@Override
+	public ExamCertificationDto findDetailByStudentId(Integer studentId, Long examRegistrationId) {
+		ExamCertificationDto examCertificationDto = examCertificationDao.getExamCertificationDto(examRegistrationId);
+		Subject subject = subjectDao.get(examCertificationDto.getSubjectId());
+		examCertificationDto.setSubjectName(subject.getName());
+		Student student = studentService.getStudent(studentId);
+		examCertificationDto.setRealName(student.getRealName());
+		examCertificationDto.setGender(student.getGender());
+		examCertificationDto.setCertificatePhoto(student.getCertificatePhoto());
+		return examCertificationDto;
+	}
 }

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

@@ -111,12 +111,20 @@
 	</select>
 
     <select id="findByStuAndBasicId" resultMap="ExamCertification">
-		SELECT * FROM exam_certification WHERE examination_basic_id_ = #{basicId} AND student_id_ = #{studentId} LIMIT 1
+		SELECT * FROM exam_certification WHERE exam_registration_id_ = #{examRegistrationId} AND student_id_ = #{studentId} LIMIT 1
+	</select>
+
+	<select id="getExamCertificationDto" resultMap="ExamCertificationDtoMap">
+		SELECT ec.exam_registration_id_,ec.exam_start_time_,ec.subject_id_,ec.level_,ec.exam_address_,er.song_json_,ec.card_no_
+		FROM exam_registration er
+		LEFT JOIN exam_certification ec ON er.id_ = ec.exam_registration_id_
+		WHERE er.id_ = #{examRegistrationId} LIMIT 1
 	</select>
 	<resultMap id="ExamCertificationDtoMap" type="com.keao.edu.user.dto.ExamCertificationDto">
 		<result column="exam_registration_id_" property="examRegistrationId" />
 		<result column="exam_start_time_" property="examTime" />
 		<result column="card_no_" property="cardNo" />
+		<result column="song_json_" property="songJson" />
 		<result column="subject_id_" property="subjectId" />
 		<result column="level_" property="level" />
 		<result column="address_" property="examAddress" />

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

@@ -210,13 +210,14 @@
 		<result property="examRoomId" column="exam_room_id_"/>
 		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
 	</resultMap>
-	<select id="queryStudentList" resultType="com.keao.edu.user.dto.RoomStudentListDto">
+	<select id="queryStudentList" resultMap="RoomStudentListDtoMap">
 		SELECT ersr.id_ exam_room_student_relation_id_,ersr.exam_registration_id_,su.real_name_,
 		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_
-		WHERE ersr.exam_room_id_ = #{roomId}
+		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
 	</select>
     <select id="querySignTotalNum" resultType="java.lang.Integer">
 		SELECT COUNT(ersr.id_) FROM exam_room_student_relation ersr