|
@@ -1,14 +1,5 @@
|
|
|
package com.qmth.exam.reserve.service.impl;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -20,6 +11,14 @@ import com.qmth.exam.reserve.entity.CategoryEntity;
|
|
|
import com.qmth.exam.reserve.entity.StudentEntity;
|
|
|
import com.qmth.exam.reserve.service.CategoryService;
|
|
|
import com.qmth.exam.reserve.service.StudentService;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> implements StudentService {
|
|
@@ -60,11 +59,25 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
return baseMapper.selectOne(wrapper);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int findStudentApplyNumberById(Long studentId) {
|
|
|
+ // 只查询applyNumber等少量字段
|
|
|
+ LambdaQueryWrapper<StudentEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.select(StudentEntity::getApplyNumber);
|
|
|
+ wrapper.eq(StudentEntity::getId, studentId);
|
|
|
+ StudentEntity stu = this.getOne(wrapper);
|
|
|
+ if (stu == null) {
|
|
|
+ log.warn("学生信息不存在!studentId:{}", studentId);
|
|
|
+ throw new StatusException("学生信息不存在");
|
|
|
+ }
|
|
|
+ return stu.getApplyNumber();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public StudentEntity findLessInfoByStudentId(Long studentId) {
|
|
|
- // 只查询id、applyNumber、applyFinished等少量字段
|
|
|
+ // 只查询id、name等少量字段
|
|
|
LambdaQueryWrapper<StudentEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.select(StudentEntity::getId, StudentEntity::getApplyNumber, StudentEntity::getApplyFinished);
|
|
|
+ wrapper.select(StudentEntity::getId, StudentEntity::getName);
|
|
|
wrapper.eq(StudentEntity::getId, studentId);
|
|
|
return this.getOne(wrapper);
|
|
|
}
|