|
@@ -25,7 +25,6 @@ import com.qmth.exam.reserve.entity.StudentCourseEntity;
|
|
import com.qmth.exam.reserve.entity.StudentEntity;
|
|
import com.qmth.exam.reserve.entity.StudentEntity;
|
|
import com.qmth.exam.reserve.enums.AsyncTaskType;
|
|
import com.qmth.exam.reserve.enums.AsyncTaskType;
|
|
import com.qmth.exam.reserve.enums.EventType;
|
|
import com.qmth.exam.reserve.enums.EventType;
|
|
-import com.qmth.exam.reserve.enums.FileUploadType;
|
|
|
|
import com.qmth.exam.reserve.enums.Role;
|
|
import com.qmth.exam.reserve.enums.Role;
|
|
import com.qmth.exam.reserve.service.*;
|
|
import com.qmth.exam.reserve.service.*;
|
|
import com.qmth.exam.reserve.template.execute.StudentPhotoUploadService;
|
|
import com.qmth.exam.reserve.template.execute.StudentPhotoUploadService;
|
|
@@ -44,7 +43,10 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.StringJoiner;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -102,12 +104,16 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public StudentEntity findByOpenIdAndUid(String openId, String uid) {
|
|
|
|
|
|
+ public StudentEntity findByOpenIdAndUid(Long applyTaskId, String openId, String uid) {
|
|
|
|
+ if (applyTaskId == null) {
|
|
|
|
+ throw new StatusException("预约任务ID不能为空");
|
|
|
|
+ }
|
|
if (StringUtils.isEmpty(openId)) {
|
|
if (StringUtils.isEmpty(openId)) {
|
|
throw new StatusException("微信OID不能为空");
|
|
throw new StatusException("微信OID不能为空");
|
|
}
|
|
}
|
|
|
|
|
|
LambdaQueryWrapper<StudentEntity> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StudentEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(StudentEntity::getApplyTaskId, applyTaskId);
|
|
wrapper.eq(StudentEntity::getOpenId, openId);
|
|
wrapper.eq(StudentEntity::getOpenId, openId);
|
|
if (StringUtils.isNotEmpty(uid)) {
|
|
if (StringUtils.isNotEmpty(uid)) {
|
|
wrapper.eq(StudentEntity::getUid, uid);
|
|
wrapper.eq(StudentEntity::getUid, uid);
|
|
@@ -228,9 +234,9 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
@Transactional
|
|
@Transactional
|
|
public void delete(Long[] studentCourseIds, LoginUser loginUser) {
|
|
public void delete(Long[] studentCourseIds, LoginUser loginUser) {
|
|
// 考生科目ID
|
|
// 考生科目ID
|
|
- for(Long studentCourseId : studentCourseIds) {
|
|
|
|
|
|
+ for (Long studentCourseId : studentCourseIds) {
|
|
StudentCourseEntity studentCourseEntity = studentCourseService.getById(studentCourseId);
|
|
StudentCourseEntity studentCourseEntity = studentCourseService.getById(studentCourseId);
|
|
- if(studentCourseEntity == null) {
|
|
|
|
|
|
+ if (studentCourseEntity == null) {
|
|
throw new StatusException("考生科目不存在");
|
|
throw new StatusException("考生科目不存在");
|
|
}
|
|
}
|
|
Long studentId = studentCourseEntity.getStudentId();
|
|
Long studentId = studentCourseEntity.getStudentId();
|