zouxuan 5 年之前
父节点
当前提交
a1f45d4e44
共有 20 个文件被更改,包括 637 次插入99 次删除
  1. 16 8
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamCertificationController.java
  2. 2 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRegistrationController.java
  3. 4 5
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java
  4. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentController.java
  5. 23 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java
  6. 29 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomStudentRelationDao.java
  7. 0 7
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/SysUserDao.java
  8. 91 15
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamCertificationDto.java
  9. 176 9
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamRegistrationDto.java
  10. 138 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/NeedCheckingDetailDto.java
  11. 11 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamCertificationService.java
  12. 2 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRegistrationService.java
  13. 8 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java
  14. 39 36
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java
  15. 2 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java
  16. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  17. 43 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml
  18. 17 6
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  19. 23 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  20. 1 5
      edu-user/edu-user-server/src/main/resources/config/mybatis/SysUserMapper.xml

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

@@ -5,6 +5,7 @@ import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.page.QueryInfo;
 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.ExamLocation;
 import com.keao.edu.user.page.ExamCertificationQueryInfo;
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
+import java.util.List;
 
 @RestController
 @RequestMapping("examCertification")
@@ -26,15 +28,21 @@ 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 = "findByStuAndBasicId")
+//    public HttpResponseResult<ExamCertification> findByStuAndBasicId(Integer studentId,Integer basicId) {
+//        return succeed(examCertificationService.findByStuAndBasicId(studentId,basicId));
+//    }
 
-    @ApiOperation("获取学员准考证列表")
+    @ApiOperation("学生端获取学员准考证列表")
     @GetMapping(value = "queryCertificationPage")
-    public HttpResponseResult<PageInfo<ExamCertificationDto>> queryCertificationPage(ExamCertificationQueryInfo queryInfo) {
-        return succeed(examCertificationService.queryCertificationPage(queryInfo));
+    public HttpResponseResult<List<ExamCertificationDto>> queryCertification() {
+        return succeed(examCertificationService.queryCertificationPage());
+    }
+
+    @ApiOperation("学生端待考详情")
+    @GetMapping(value = "needCheckingDetail")
+    public HttpResponseResult<NeedCheckingDetailDto> needCheckingDetail(Long examRegistrationId) {
+        return succeed(examCertificationService.needCheckingDetail(examRegistrationId));
     }
 }

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

@@ -5,6 +5,7 @@ import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.thirdparty.ocr.Ocr;
 import com.keao.edu.user.dto.ExamRecordDto;
 import com.keao.edu.user.dto.ExamRegistrationDto;
@@ -63,9 +64,7 @@ public class ExamRegistrationController extends BaseController {
 
     @ApiOperation(value = "学生端学员报名记录查询")
     @GetMapping(value = "applyList")
-    public HttpResponseResult<PageInfo<ExamRegistrationDto>> applyList(ExamRegistrationQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        queryInfo.setStudentId(sysUser.getId());
+    public HttpResponseResult<PageInfo<ExamRegistrationDto>> applyList(QueryInfo queryInfo) {
         return succeed(examRegistrationService.applyList(queryInfo));
     }
 

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

@@ -49,11 +49,10 @@ public class ExamRoomStudentRelationController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation("获取考场学员队列")
-    @PostMapping(value = "/queryStudentList")
-    public HttpResponseResult queryStudentList(Long roomId) {
-        List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationService.queryStudentList(roomId);
-        return succeed();
+    @ApiOperation("获取考场待考队列")
+    @PostMapping(value = "/queryNeedCheckingList")
+    public HttpResponseResult queryNeedCheckingList(Long roomId) {
+        return succeed(examRoomStudentRelationService.queryNeedCheckingList(roomId));
     }
 
     @ApiOperation("获取教室学员关联")

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

@@ -41,7 +41,7 @@ public class StudentController extends BaseController {
         return succeed(studentService.queryStudentPage(queryInfo));
     }
 
-    @ApiOperation(value = "学员报考列表")
+    @ApiOperation(value = "学生端学员报考记录列表(包括详情)")
     @PostMapping(value = "applyList")
     @PreAuthorize("@pcs.hasPermissions('student/applyList')")
     public HttpResponseResult<PageInfo<StudentExamPaymentDto>> applyList(StudentApplyQueryInfo queryInfo) {

+ 23 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java

@@ -1,10 +1,13 @@
 package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.dto.ExamCertificationDto;
+import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.entity.ExamCertification;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
 
@@ -19,4 +22,24 @@ public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
     ExamCertification findByStuAndBasicId(@Param("studentId") Integer studentId, @Param("basicId") Integer basicId);
 
     int deleteWithRegist(@Param("registIds") List<Long> registIds);
+
+    /**
+     * 获取学员准考证列表
+     * @param studentId
+     * @return
+     */
+    List<ExamCertificationDto> queryExamCertificationDtoPage(Integer studentId);
+    /**
+     * COUNT学员准考证列表
+     * @param params
+     * @return
+     */
+    Integer countExamCertificationDtoPage(Map<String, Object> params);
+
+    /**
+     * 学生端待考详情
+     * @param examRegistrationId
+     * @return
+     */
+    NeedCheckingDetailDto needCheckingDetail(Long examRegistrationId);
 }

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

@@ -100,4 +100,33 @@ public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStuden
      * @return
      */
     List<RoomStudentListDto> queryStudentList(Long roomId);
+
+    /**
+     * 获取签到总人数
+     * @param roomId
+     * @return
+     */
+    Integer querySignTotalNum(Long roomId);
+
+    /**
+     * 获取未签到总人数
+     * @param roomId
+     * @return
+     */
+    Integer queryNoSignTotalNum(Long roomId);
+
+    /**
+     * 获取未考试学院数
+     * @param roomId
+     * @return
+     */
+    Integer querySurplusNum(Long roomId);
+
+    /**
+     * 获取当前学员需要等待人数
+     * @param examRegistrationId
+     * @param signInTime
+     * @return
+     */
+    Integer sumWaitNum(@Param("examRegistrationId") Long examRegistrationId, @Param("signInTime") String signInTime, @Param("studentId") Integer studentId);
 }

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

@@ -11,13 +11,6 @@ import java.util.Set;
 public interface SysUserDao extends BaseDAO<Integer, SysUser> {
 
 	/**
-	 * 根据用户名查询对象
-	 * @param username
-	 * @return
-	 */
-	SysUser queryByUsername(String username);
-
-	/**
 	 * 根据手机号查询对象
 	 * @param phone
 	 * @return

+ 91 - 15
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamCertificationDto.java

@@ -1,25 +1,85 @@
 package com.keao.edu.user.dto;
 
-import com.keao.edu.user.entity.ExamCertification;
 import io.swagger.annotations.ApiModelProperty;
 
-public class ExamCertificationDto extends ExamCertification {
+public class ExamCertificationDto{
 
-    @ApiModelProperty(value = "考试项目")
-    private String examBaseName;
+    @ApiModelProperty(value = "报名编号")
+    private Long examRegistrationId;
 
-    @ApiModelProperty(value = "科目名称")
+    @ApiModelProperty(value = "准考证号")
+    private String cardNo;
+
+    @ApiModelProperty(value = "姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "性别")
+    private Integer gender;
+
+    @ApiModelProperty(value = "科目")
     private String subjectName;
 
-    @ApiModelProperty(value = "是否考试")
-    private Integer finishedExam;
+    @ApiModelProperty(value = "科目")
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "级别")
+    private Integer level;
+
+    @ApiModelProperty(value = "考试时间")
+    private String examTime;
+
+    @ApiModelProperty(value = "考试地点")
+    private String examAddress;
+
+    @ApiModelProperty(value = "证件照")
+    private String certificatePhoto;
+
+    public String getCertificatePhoto() {
+        return certificatePhoto;
+    }
+
+    public void setCertificatePhoto(String certificatePhoto) {
+        this.certificatePhoto = certificatePhoto;
+    }
 
-    public String getExamBaseName() {
-        return examBaseName;
+    public Integer getSubjectId() {
+        return subjectId;
     }
 
-    public void setExamBaseName(String examBaseName) {
-        this.examBaseName = examBaseName;
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Long getExamRegistrationId() {
+        return examRegistrationId;
+    }
+
+    public void setExamRegistrationId(Long examRegistrationId) {
+        this.examRegistrationId = examRegistrationId;
+    }
+
+    public String getCardNo() {
+        return cardNo;
+    }
+
+    public void setCardNo(String cardNo) {
+        this.cardNo = cardNo;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public Integer getGender() {
+        return gender;
+    }
+
+    public void setGender(Integer gender) {
+        this.gender = gender;
     }
 
     public String getSubjectName() {
@@ -30,11 +90,27 @@ public class ExamCertificationDto extends ExamCertification {
         this.subjectName = subjectName;
     }
 
-    public Integer isFinishedExam() {
-        return finishedExam;
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
+    public String getExamTime() {
+        return examTime;
+    }
+
+    public void setExamTime(String examTime) {
+        this.examTime = examTime;
+    }
+
+    public String getExamAddress() {
+        return examAddress;
     }
 
-    public void setFinishedExam(Integer finishedExam) {
-        this.finishedExam = finishedExam;
+    public void setExamAddress(String examAddress) {
+        this.examAddress = examAddress;
     }
 }

+ 176 - 9
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamRegistrationDto.java

@@ -1,14 +1,61 @@
 package com.keao.edu.user.dto;
 
-import com.keao.edu.user.entity.ExamRegistration;
+import com.keao.edu.user.enums.StudentRegistrationStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
 
-public class ExamRegistrationDto extends ExamRegistration {
+import java.math.BigDecimal;
 
-    @ApiModelProperty(value = "学员姓名")
-    private String studentName;
+public class ExamRegistrationDto{
 
-    @ApiModelProperty(value = "考试项目")
+    @ApiModelProperty(value = "报名编号")
+    private Long id;
+
+    @ApiModelProperty(value = "考级项目编号")
+    private Long examinationBasicId;
+
+    @ApiModelProperty(value = "专业编号")
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "报考级别")
+    private Integer level;
+
+    @ApiModelProperty(value = "考级费用")
+    private BigDecimal levelFee;
+
+    @ApiModelProperty(value = "乐理级别")
+    private Integer examMusicTheoryLevel;
+
+    @ApiModelProperty(value = "乐理考级费用")
+    private BigDecimal theoryLevelFee;
+
+    @ApiModelProperty(value = "考试内容")
+    private String songJson;
+
+    @ApiModelProperty(value = "上次报考级别")
+    private Integer lastExamLevel;
+
+    @ApiModelProperty(value = "上次报考证书")
+    private String lastExamCertificateUrl;
+
+    @ApiModelProperty(value = "上次乐理级别")
+    private Integer lastMusicTheoryLevel;
+
+    @ApiModelProperty(value = "上次乐理证书")
+    private String lastMusicTheoryCertificateUrl;
+
+    @ApiModelProperty(value = "证件号")
+    private String cardNo;
+
+    @ApiModelProperty(value = "报名状态(缴费状态)")
+    private StudentRegistrationStatusEnum status;
+
+    @ApiModelProperty(value = "备注")
+    private String memo;
+
+    @ApiModelProperty(value = "订单编号")
+    private String paymentOrderNo;
+
+    @ApiModelProperty(value = "考试项目名称")
     private String examBaseName;
 
     @ApiModelProperty(value = "考试专业")
@@ -26,6 +73,126 @@ public class ExamRegistrationDto extends ExamRegistration {
     @ApiModelProperty(value = "预计考试结束时间")
     private String examEndTime;
 
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getExaminationBasicId() {
+        return examinationBasicId;
+    }
+
+    public void setExaminationBasicId(Long examinationBasicId) {
+        this.examinationBasicId = examinationBasicId;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
+    public BigDecimal getLevelFee() {
+        return levelFee;
+    }
+
+    public void setLevelFee(BigDecimal levelFee) {
+        this.levelFee = levelFee;
+    }
+
+    public Integer getExamMusicTheoryLevel() {
+        return examMusicTheoryLevel;
+    }
+
+    public void setExamMusicTheoryLevel(Integer examMusicTheoryLevel) {
+        this.examMusicTheoryLevel = examMusicTheoryLevel;
+    }
+
+    public BigDecimal getTheoryLevelFee() {
+        return theoryLevelFee;
+    }
+
+    public void setTheoryLevelFee(BigDecimal theoryLevelFee) {
+        this.theoryLevelFee = theoryLevelFee;
+    }
+
+    public String getSongJson() {
+        return songJson;
+    }
+
+    public void setSongJson(String songJson) {
+        this.songJson = songJson;
+    }
+
+    public Integer getLastExamLevel() {
+        return lastExamLevel;
+    }
+
+    public void setLastExamLevel(Integer lastExamLevel) {
+        this.lastExamLevel = lastExamLevel;
+    }
+
+    public String getLastExamCertificateUrl() {
+        return lastExamCertificateUrl;
+    }
+
+    public void setLastExamCertificateUrl(String lastExamCertificateUrl) {
+        this.lastExamCertificateUrl = lastExamCertificateUrl;
+    }
+
+    public Integer getLastMusicTheoryLevel() {
+        return lastMusicTheoryLevel;
+    }
+
+    public void setLastMusicTheoryLevel(Integer lastMusicTheoryLevel) {
+        this.lastMusicTheoryLevel = lastMusicTheoryLevel;
+    }
+
+    public String getLastMusicTheoryCertificateUrl() {
+        return lastMusicTheoryCertificateUrl;
+    }
+
+    public void setLastMusicTheoryCertificateUrl(String lastMusicTheoryCertificateUrl) {
+        this.lastMusicTheoryCertificateUrl = lastMusicTheoryCertificateUrl;
+    }
+
+    public String getCardNo() {
+        return cardNo;
+    }
+
+    public void setCardNo(String cardNo) {
+        this.cardNo = cardNo;
+    }
+
+    public StudentRegistrationStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(StudentRegistrationStatusEnum status) {
+        this.status = status;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
     public String getExamBaseName() {
         return examBaseName;
     }
@@ -74,11 +241,11 @@ public class ExamRegistrationDto extends ExamRegistration {
         this.examEndTime = examEndTime;
     }
 
-    public String getStudentName() {
-        return studentName;
+    public String getPaymentOrderNo() {
+        return paymentOrderNo;
     }
 
-    public void setStudentName(String studentName) {
-        this.studentName = studentName;
+    public void setPaymentOrderNo(String paymentOrderNo) {
+        this.paymentOrderNo = paymentOrderNo;
     }
 }

+ 138 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/NeedCheckingDetailDto.java

@@ -0,0 +1,138 @@
+package com.keao.edu.user.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class NeedCheckingDetailDto {
+
+    @ApiModelProperty(value = "报名编号")
+    private Long examRegistrationId;
+
+    @ApiModelProperty(value = "考场与学员关联编号")
+    private Long examRoomStudentRelationId;
+
+    @ApiModelProperty(value = "开始时间")
+    private String examStartTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private String examEndTime;
+
+    @ApiModelProperty(value = "签到时间")
+    private String signInTime;
+
+    @ApiModelProperty(value = "房间入口开启状态")
+    private Integer classroomSwitch;
+
+    @ApiModelProperty(value = "考试是否开始")
+    private Integer openFlag;
+
+    @ApiModelProperty(value = "学员是否考试")
+    private Integer finishedExam;
+
+    @ApiModelProperty(value = "等待人数")
+    private Integer waitNum;
+
+    @ApiModelProperty(value = "考试名称")
+    private String baseExamName;
+
+    @ApiModelProperty(value = "房间编号")
+    private Long examRoomId;
+
+    @ApiModelProperty(value = "注意事项")
+    private String desc;
+
+    public Long getExamRoomStudentRelationId() {
+        return examRoomStudentRelationId;
+    }
+
+    public void setExamRoomStudentRelationId(Long examRoomStudentRelationId) {
+        this.examRoomStudentRelationId = examRoomStudentRelationId;
+    }
+
+    public Integer getFinishedExam() {
+        return finishedExam;
+    }
+
+    public void setFinishedExam(Integer finishedExam) {
+        this.finishedExam = finishedExam;
+    }
+
+    public Integer getOpenFlag() {
+        return openFlag;
+    }
+
+    public void setOpenFlag(Integer openFlag) {
+        this.openFlag = openFlag;
+    }
+
+    public Long getExamRegistrationId() {
+        return examRegistrationId;
+    }
+
+    public void setExamRegistrationId(Long examRegistrationId) {
+        this.examRegistrationId = examRegistrationId;
+    }
+
+    public String getExamStartTime() {
+        return examStartTime;
+    }
+
+    public void setExamStartTime(String examStartTime) {
+        this.examStartTime = examStartTime;
+    }
+
+    public String getExamEndTime() {
+        return examEndTime;
+    }
+
+    public void setExamEndTime(String examEndTime) {
+        this.examEndTime = examEndTime;
+    }
+
+    public String getSignInTime() {
+        return signInTime;
+    }
+
+    public void setSignInTime(String signInTime) {
+        this.signInTime = signInTime;
+    }
+
+    public Integer getClassroomSwitch() {
+        return classroomSwitch;
+    }
+
+    public void setClassroomSwitch(Integer classroomSwitch) {
+        this.classroomSwitch = classroomSwitch;
+    }
+
+    public Integer getWaitNum() {
+        return waitNum;
+    }
+
+    public void setWaitNum(Integer waitNum) {
+        this.waitNum = waitNum;
+    }
+
+    public String getBaseExamName() {
+        return baseExamName;
+    }
+
+    public void setBaseExamName(String baseExamName) {
+        this.baseExamName = baseExamName;
+    }
+
+    public Long getExamRoomId() {
+        return examRoomId;
+    }
+
+    public void setExamRoomId(Long examRoomId) {
+        this.examRoomId = examRoomId;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}

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

@@ -4,10 +4,13 @@ package com.keao.edu.user.service;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.BaseService;
 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.page.ExamCertificationQueryInfo;
 import org.springframework.data.domain.Page;
 
+import java.util.List;
+
 public interface ExamCertificationService extends BaseService<Long, ExamCertification> {
 
     /**
@@ -20,8 +23,14 @@ public interface ExamCertificationService extends BaseService<Long, ExamCertific
 
     /**
      * 获取学员的准考证列表
-     * @param queryInfo
      * @return
      */
-    PageInfo<ExamCertificationDto> queryCertificationPage(ExamCertificationQueryInfo queryInfo);
+    List<ExamCertificationDto> queryCertificationPage();
+
+    /**
+     * 学生端待考详情
+     * @param examRegistrationId
+     * @return
+     */
+    NeedCheckingDetailDto needCheckingDetail(Long examRegistrationId);
 }

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

@@ -2,6 +2,7 @@ package com.keao.edu.user.service;
 
 
 import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.user.dto.ExamRecordDto;
 import com.keao.edu.user.dto.ExamRegistrationDto;
@@ -42,7 +43,7 @@ public interface ExamRegistrationService extends BaseService<Long, ExamRegistrat
     * @param queryInfo
     * @return
     */
-   PageInfo<ExamRegistrationDto> applyList(ExamRegistrationQueryInfo queryInfo);
+   PageInfo<ExamRegistrationDto> applyList(QueryInfo queryInfo);
 
    /**
     * 考试记录

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

@@ -8,6 +8,7 @@ import com.keao.edu.user.dto.RoomStudentListDto;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 
 import java.util.List;
+import java.util.Map;
 
 public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRoomStudentRelation> {
 
@@ -81,4 +82,11 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
      * @return
      */
     List<RoomStudentListDto> queryStudentList(Long roomId);
+
+    /**
+     * 队列
+     * @param roomId
+     * @return
+     */
+    Map<String,Object> queryNeedCheckingList(Long roomId);
 }

+ 39 - 36
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java

@@ -1,21 +1,22 @@
 package com.keao.edu.user.service.impl;
 
 
-import com.alibaba.fastjson.JSON;
+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.page.PageInfo;
 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.dto.ExamCertificationDto;
+import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.entity.ExamCertification;
-import com.keao.edu.user.page.ExamCertificationQueryInfo;
 import com.keao.edu.user.service.ExamCertificationService;
-import com.keao.edu.util.collection.MapUtil;
+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;
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -25,6 +26,12 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 	
 	@Autowired
 	private ExamCertificationDao examCertificationDao;
+	@Autowired
+	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private StudentService studentService;
 
 	@Override
 	public BaseDAO<Long, ExamCertification> getDAO() {
@@ -37,36 +44,32 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 	}
 
 	@Override
-	public PageInfo<ExamCertificationDto> queryCertificationPage(ExamCertificationQueryInfo queryInfo) {
-		PageInfo<ExamCertificationDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-		Map<String, Object> params = new HashMap<>();
-		MapUtil.populateMap(params, queryInfo);
-
-		List<ExamCertificationDto> dataList = null;
-		int count = this.findCount(params);
-		if (count > 0) {
-			pageInfo.setTotal(count);
-			params.put("offset", pageInfo.getOffset());
-			dataList = JSON.parseArray(JSON.toJSONString(this.getDAO().queryPage(params)),ExamCertificationDto.class);
-			List<Long> basicIds = dataList.stream().map(e -> e.getExaminationBasicId()).collect(Collectors.toList());
-			List<Integer> studentIds = dataList.stream().map(e -> e.getStudentId()).collect(Collectors.toList());
-			List<Integer> subjectIds = dataList.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
-			Map<Integer, String> basicNameMap = this.getMap("examination_basic", "id_", "name_", basicIds, Integer.class, String.class);
-			Map<Integer, String> subjectNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
-			Map<String, Object> paramMap = new HashMap<>();
-			paramMap.put("examination_basic_id_",basicIds);
-			paramMap.put("student_id_",studentIds);
-			Map<Integer, Integer> finishedExamMap = this.getMap("student_exam_result", "examination_basic_id_", "is_finished_exam_", paramMap, Integer.class, Integer.class);
-			dataList.forEach(e->{
-				e.setSubjectName(subjectNameMap.get(e.getSubjectId()));
-				e.setExamBaseName(basicNameMap.get(e.getExaminationBasicId()));
-				e.setFinishedExam(finishedExamMap.get(e.getExaminationBasicId()));
-			});
+	public List<ExamCertificationDto> queryCertificationPage() {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		List<ExamCertificationDto> dataList = examCertificationDao.queryExamCertificationDtoPage(sysUser.getId());
+		if(dataList == null || dataList.size() < 0){
+			return dataList;
 		}
-		if (count == 0) {
-			dataList = new ArrayList<>();
-		}
-		pageInfo.setRows(dataList);
-		return pageInfo;
+		List<Integer> subjectIds = dataList.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
+		Map<Integer, String> subjectNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+		Student student = studentService.get(sysUser.getId());
+		dataList.forEach(e->{
+			e.setSubjectName(subjectNameMap.get(e.getSubjectId()));
+			e.setRealName(sysUser.getRealName());
+			e.setGender(sysUser.getGender());
+			e.setCertificatePhoto(student.getCertificatePhoto());
+		});
+		return dataList;
+	}
+
+	@Override
+	public NeedCheckingDetailDto needCheckingDetail(Long examRegistrationId) {
+		NeedCheckingDetailDto needCheckingDetailDto = examCertificationDao.needCheckingDetail(examRegistrationId);
+		//等待学员数
+		String signInTime = needCheckingDetailDto.getSignInTime();
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		Integer waitNum = examRoomStudentRelationDao.sumWaitNum(examRegistrationId,signInTime,sysUser.getId());
+		needCheckingDetailDto.setWaitNum(waitNum);
+		return needCheckingDetailDto;
 	}
 }

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

@@ -4,6 +4,7 @@ package com.keao.edu.user.service.impl;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.IdGeneratorService;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.dao.*;
@@ -217,7 +218,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
     }
 
     @Override
-    public PageInfo<ExamRegistrationDto> applyList(ExamRegistrationQueryInfo queryInfo) {
+    public PageInfo<ExamRegistrationDto> applyList(QueryInfo queryInfo) {
         PageInfo<ExamRegistrationDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);

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

@@ -297,4 +297,15 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	public List<RoomStudentListDto> queryStudentList(Long roomId) {
 		return examRoomStudentRelationDao.queryStudentList(roomId);
 	}
+
+	@Override
+	public Map<String, Object> queryNeedCheckingList(Long roomId) {
+		List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(roomId);
+		Map<String,Object> resultMap = new HashMap<>(4);
+		resultMap.put("studentList",roomStudentListDtos);
+		resultMap.put("signTotalNum",examRoomStudentRelationDao.querySignTotalNum(roomId));
+		resultMap.put("noSignTotalNum",examRoomStudentRelationDao.queryNoSignTotalNum(roomId));
+		resultMap.put("surplusNum",examRoomStudentRelationDao.querySurplusNum(roomId));
+		return resultMap;
+	}
 }

+ 43 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -113,4 +113,47 @@
     <select id="findByStuAndBasicId" resultMap="ExamCertification">
 		SELECT * FROM exam_certification WHERE examination_basic_id_ = #{basicId} AND student_id_ = #{studentId} 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="subject_id_" property="subjectId" />
+		<result column="level_" property="level" />
+		<result column="address_" property="examAddress" />
+	</resultMap>
+	<select id="queryExamCertificationDtoPage" resultMap="ExamCertificationDtoMap">
+		SELECT ec.exam_registration_id_,ec.exam_start_time_,ec.card_no_,ec.subject_id_,ec.level_,ec.exam_address_
+		FROM exam_room_student_relation ersr
+		LEFT JOIN exam_certification ec ON ec.exam_registration_id_ = ersr.exam_registration_id_
+		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
+		WHERE ersr.student_id_ = #{studentId} AND ser.is_finished_exam_ = 0
+		ORDER BY ec.exam_start_time_
+	</select>
+	<select id="countExamCertificationDtoPage" resultType="java.lang.Integer">
+		SELECT COUNT(DISTINCT ersr.exam_registration_id_)
+		FROM exam_room_student_relation ersr
+		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
+		WHERE ersr.student_id_ = #{studentId} AND ser.is_finished_exam_ = 0
+	</select>
+	<resultMap id="NeedCheckingDetailDtoMap" type="com.keao.edu.user.dto.NeedCheckingDetailDto">
+		<result column="exam_registration_id_" property="examRegistrationId" />
+		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
+		<result property="examRoomId" column="exam_room_id_"/>
+		<result property="signInTime" column="sign_in_time_"/>
+		<result property="examEndTime" column="exam_end_time_"/>
+		<result property="examStartTime" column="exam_start_time_"/>
+		<result property="baseExamName" column="exam_base_name_"/>
+		<result property="classroomSwitch" column="classroom_switch_"/>
+		<result property="openFlag" column="open_flag_"/>
+		<result property="finishedExam" column="is_finished_exam_"/>
+	</resultMap>
+	<select id="needCheckingDetail" resultMap="NeedCheckingDetailDtoMap">
+		SELECT ersr.id_ exam_room_student_relation_id_,eb.name_ exam_base_name_,er.exam_start_time_,er.exam_end_time_,er.open_flag_,
+		ser.is_finished_exam_,ersr.exam_room_id_,ersr.sign_in_time_,ersr.classroom_switch_
+		FROM exam_room_student_relation ersr
+		LEFT JOIN examination_basic eb ON eb.id_ = ersr.examination_basic_id_
+		LEFT JOIN exam_room er ON er.id_ = ersr.exam_room_id_
+		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
+		WHERE ersr.exam_registration_id_ = #{examRegistrationId} LIMIT 1
+	</select>
 </mapper>

+ 17 - 6
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -24,7 +24,7 @@
 		<result column="adviser_name_" property="adviserName" />
 		<result column="adviser_phone_" property="adviserPhone" />
 		<result column="card_no_" property="cardNo" />
-		<result column="status_" property="status" />
+		<result column="status_" property="status" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -425,8 +425,22 @@
 		</foreach>
 	</select>
 
-	<resultMap id="ExamRegistrationDtoMap" type="com.keao.edu.user.dto.ExamRegistrationDto" extends="ExamRegistration">
-		<result property="studentName" column="studentName"/>
+	<resultMap id="ExamRegistrationDtoMap" type="com.keao.edu.user.dto.ExamRegistrationDto">
+		<result column="examination_basic_id_" property="examinationBasicId" />
+		<result column="id_" property="id" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="level_" property="level" />
+		<result column="level_fee_" property="levelFee" />
+		<result column="song_json_" property="songJson" />
+		<result column="last_exam_level_" property="lastExamLevel" />
+		<result column="last_exam_certificate_url_" property="lastExamCertificateUrl" />
+		<result column="exam_music_theory_level_" property="examMusicTheoryLevel" />
+		<result column="theory_level_fee_" property="theoryLevelFee" />
+		<result column="last_music_theory_level_" property="lastMusicTheoryLevel" />
+		<result column="last_music_theory_certificate_url_" property="lastMusicTheoryCertificateUrl" />
+		<result column="card_no_" property="cardNo" />
+		<result column="status_" property="status" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+		<result column="memo_" property="memo" />
 		<result property="subjectName" column="subjectName"/>
 		<result property="examBaseName" column="examBaseName"/>
 		<result property="examStartTime" column="expect_exam_start_time_"/>
@@ -446,9 +460,6 @@
 			<if test="examRegistrationId != null">
 				er.id_ = #{examRegistrationId}
 			</if>
-			<if test="tenantId != null and tenantId != 0">
-				er.tenant_id_ = #{tenantId}
-			</if>
 			<if test="status != null and status != ''">
 				er.status_ = #{status}
 			</if>

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

@@ -209,4 +209,27 @@
 		LEFT JOIN sys_user su ON ersr.student_id_ = su.id_
 		WHERE ersr.exam_room_id_ = #{roomId}
 	</select>
+    <select id="querySignTotalNum" resultType="java.lang.Integer">
+		SELECT COUNT(ersr.id_) FROM exam_room_student_relation ersr
+		WHERE ersr.exam_room_id_ = #{roomId} AND ersr.sign_in_time_ IS NOT NULL
+	</select>
+    <select id="queryNoSignTotalNum" resultType="java.lang.Integer">
+		SELECT COUNT(ersr.id_) FROM exam_room_student_relation ersr
+		WHERE ersr.exam_room_id_ = #{roomId} AND ersr.sign_in_time_ IS NULL
+	</select>
+	<select id="querySurplusNum" resultType="java.lang.Integer">
+		SELECT COUNT(DISTINCT ersr.id_) FROM exam_room_student_relation ersr
+		LEFT JOIN student_exam_result ser ON ersr.exam_registration_id_ = ser.exam_registration_id_
+		WHERE ersr.exam_room_id_ = #{roomId} AND ersr.sign_in_time_ IS NOT NULL AND ser.is_finished_exam_ = 0
+	</select>
+	<select id="sumWaitNum" resultType="java.lang.Integer">
+		SELECT COUNT(DISTINCT ersr.id_)
+		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}
+		<if test="signInTime != null and signInTime != ''">
+			AND ersr.sign_in_time_ &lt; #{signInTime}
+		</if>
+	</select>
 </mapper>

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

@@ -167,12 +167,8 @@
         <include refid="queryCondition"/>
     </select>
 
-    <select id="queryByUsername" resultMap="SysUser">
-		select * from sys_user where username_ = #{username} OR phone_ = #{username} LIMIT 1 FOR UPDATE
-	</select>
-
     <select id="queryByPhone" resultMap="SysUser">
-		select * from sys_user where phone_ = #{phone} OR username_ = #{phone} LIMIT 1 FOR UPDATE
+		select * from sys_user where phone_ = #{phone} LIMIT 1 FOR UPDATE
 	</select>
 
     <select id="lockUser" resultType="int">