Bladeren bron

获取考生信息

xiatian 1 jaar geleden
bovenliggende
commit
dcb392466d

+ 18 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanStudentController.java

@@ -1,12 +1,20 @@
 package com.qmth.distributed.print.api.mark;
 
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import io.swagger.annotations.Api;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.qmth.teachcloud.mark.bean.student.StudentQuery;
+import com.qmth.teachcloud.mark.bean.student.StudentVo;
+import com.qmth.teachcloud.mark.service.MarkStudentService;
 
-import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 
 /**
  * <p>
@@ -20,5 +28,12 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_SCAN + "/student")
 public class ScanStudentController {
+	@Autowired
+	private MarkStudentService markStudentService;
 
+    @ApiOperation(value = "考生查询")
+    @RequestMapping(value = "find", method = RequestMethod.POST)
+    public StudentVo student(@Validated StudentQuery query) {
+        return markStudentService.findOne(query);
+    }
 }

+ 40 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/student/StudentQuery.java

@@ -0,0 +1,40 @@
+package com.qmth.teachcloud.mark.bean.student;
+
+import javax.validation.constraints.NotNull;
+
+public class StudentQuery {
+
+    @NotNull(message = "考试Id不能为空")
+    private Long examId;
+
+    @NotNull(message = "coursePaperId不能为空")
+    private String coursePaperId;
+
+    @NotNull(message = "studentCode不能为空")
+    private String studentCode;
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public String getCoursePaperId() {
+		return coursePaperId;
+	}
+
+	public void setCoursePaperId(String coursePaperId) {
+		this.coursePaperId = coursePaperId;
+	}
+
+	public String getStudentCode() {
+		return studentCode;
+	}
+
+	public void setStudentCode(String studentCode) {
+		this.studentCode = studentCode;
+	}
+
+}

+ 123 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/student/StudentVo.java

@@ -0,0 +1,123 @@
+package com.qmth.teachcloud.mark.bean.student;
+
+import com.qmth.teachcloud.common.enums.ScanStatus;
+
+public class StudentVo {
+
+    private Long id;
+
+    private String studentName;
+
+    private String studentCode;
+
+    private String courseCode;
+    private String courseName;
+    private String coursePaperNumber;
+    private String coursePaperId;
+    private String packageCode;
+
+    private String examPlace;
+
+    private String examRoom;
+
+    private String siteNumber;
+    
+    private ScanStatus status;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getStudentName() {
+		return studentName;
+	}
+
+	public void setStudentName(String studentName) {
+		this.studentName = studentName;
+	}
+
+	public String getStudentCode() {
+		return studentCode;
+	}
+
+	public void setStudentCode(String studentCode) {
+		this.studentCode = studentCode;
+	}
+
+	public String getCourseCode() {
+		return courseCode;
+	}
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+
+	public String getCourseName() {
+		return courseName;
+	}
+
+	public void setCourseName(String courseName) {
+		this.courseName = courseName;
+	}
+
+	public String getCoursePaperNumber() {
+		return coursePaperNumber;
+	}
+
+	public void setCoursePaperNumber(String coursePaperNumber) {
+		this.coursePaperNumber = coursePaperNumber;
+	}
+
+	public String getCoursePaperId() {
+		return coursePaperId;
+	}
+
+	public void setCoursePaperId(String coursePaperId) {
+		this.coursePaperId = coursePaperId;
+	}
+
+	public String getPackageCode() {
+		return packageCode;
+	}
+
+	public void setPackageCode(String packageCode) {
+		this.packageCode = packageCode;
+	}
+
+	public String getExamPlace() {
+		return examPlace;
+	}
+
+	public void setExamPlace(String examPlace) {
+		this.examPlace = examPlace;
+	}
+
+	public String getExamRoom() {
+		return examRoom;
+	}
+
+	public void setExamRoom(String examRoom) {
+		this.examRoom = examRoom;
+	}
+
+	public String getSiteNumber() {
+		return siteNumber;
+	}
+
+	public void setSiteNumber(String siteNumber) {
+		this.siteNumber = siteNumber;
+	}
+
+	public ScanStatus getStatus() {
+		return status;
+	}
+
+	public void setStatus(ScanStatus status) {
+		this.status = status;
+	}
+
+}

+ 4 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java

@@ -3,6 +3,8 @@ package com.qmth.teachcloud.mark.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.teachcloud.mark.bean.student.StudentQuery;
+import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import org.apache.ibatis.annotations.Param;
@@ -24,4 +26,6 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
     List<MarkStudent> listAbsentOrBreachMarkTaskStudent(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 
     IPage<MarkStudent> listUnMarkTaskStudent(@Param("page") Page<MarkStudent> page, @Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("groupNumber") Integer groupNumber);
+
+	StudentVo findOne(@Param("req") StudentQuery query);
 }

+ 4 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java

@@ -11,6 +11,8 @@ import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
 import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamCheckInfoVo;
 import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamInfoVo;
+import com.qmth.teachcloud.mark.bean.student.StudentQuery;
+import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.dto.mark.score.SheetUrlDto;
 import com.qmth.teachcloud.mark.dto.mark.score.StudentObjectiveDetailDto;
 import com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto;
@@ -62,4 +64,6 @@ public interface MarkStudentService extends IService<MarkStudent> {
     boolean saveUploadStudent(MarkStudent student);
 
 	void updateStudentAndPaper(SysUser user, Long studentId, List<ScanStudentPaper> studentPaperList);
+
+	StudentVo findOne(StudentQuery query);
 }

+ 7 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -18,6 +18,8 @@ import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.mark.bean.scanexaminfo.CheckTask;
 import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamCheckInfoVo;
 import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamInfoVo;
+import com.qmth.teachcloud.mark.bean.student.StudentQuery;
+import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.dto.mark.ScoreInfo;
 import com.qmth.teachcloud.mark.dto.mark.score.*;
 import com.qmth.teachcloud.mark.entity.*;
@@ -419,4 +421,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         // 更新考生状态
         updateStudentByPaper(user.getId(), id, true);
     }
+
+	@Override
+	public StudentVo findOne(StudentQuery query) {
+		return baseMapper.findOne(query);
+	}
 }

+ 5 - 1
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -154,5 +154,9 @@
                               ms.id = mt.student_id
                             AND mt.group_number = #{groupNumber})
     </select>
-
+	<select id="findStudentCountByBatch" resultType="com.qmth.teachcloud.mark.bean.student.StudentVo">
+		SELECT t.*,t.paper_number coursePaperNumber
+		FROM mark_student t
+		WHERE t.exam_id=#{req.examId} and t.course_paper_id=#{req.coursePaperId} and t.student_code=#{req.studentCode}
+	</select>
 </mapper>