|
@@ -28,6 +28,7 @@ import com.qmth.teachcloud.report.business.entity.*;
|
|
|
import com.qmth.teachcloud.report.business.enums.AssignEnum;
|
|
|
import com.qmth.teachcloud.report.business.enums.ExamCloudDataEnum;
|
|
|
import com.qmth.teachcloud.report.business.enums.NumberTypeEnum;
|
|
|
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
|
|
|
import com.qmth.teachcloud.report.business.service.*;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -1021,6 +1022,67 @@ public class BasicDatasourceController {
|
|
|
return ResultUtil.ok("有【" + count + "】条缺考学生数据被更新");
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "异常考生-按学号处理")
|
|
|
+ @RequestMapping(value = "/exception_student/dispose_by_student_code", method = RequestMethod.POST)
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
|
+ public Result exceptionStudentDisposeByStudentCode(@RequestParam String schoolId, @RequestParam String examId, @RequestParam List<String> courseCodeList, @RequestParam String year) {
|
|
|
+ for (String courseCode : courseCodeList) {
|
|
|
+ TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
+ .eq(TBExamCourse::getExamId,examId)
|
|
|
+ .eq(TBExamCourse::getSchoolId,schoolId)
|
|
|
+ .eq(TBExamCourse::getCourseCode,courseCode));
|
|
|
+ if (tbExamCourse.getPublishStatus().equals(PublishStatusEnum.PUBLISH)){
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("已经发布的课程【" + tbExamCourse.getCourseName() + "】不能进行特殊处理");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 更改 ‘t_b_exam_student’表考生应届状态
|
|
|
+ List<TBExamStudent> tbExamStudentList = tbExamStudentService.list(new QueryWrapper<TBExamStudent>().lambda()
|
|
|
+ .eq(TBExamStudent::getSchoolId,schoolId)
|
|
|
+ .eq(TBExamStudent::getExamId,examId)
|
|
|
+ .in(TBExamStudent::getCourseCode,courseCodeList));
|
|
|
+ // 全部改为应届
|
|
|
+ for (TBExamStudent tbExamStudent : tbExamStudentList) {
|
|
|
+ tbExamStudent.setStudentCurrent(true);
|
|
|
+ }
|
|
|
+ tbExamStudentService.updateBatchById(tbExamStudentList);
|
|
|
+ // 非应届考生
|
|
|
+ tbExamStudentList = tbExamStudentList.stream()
|
|
|
+ .filter(e -> !e.getStudentCode().substring(0,4).equals(year))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 更改 ‘t_a_exam_course_record’表考生应届状态
|
|
|
+ List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
|
+ .eq(TAExamCourseRecord::getSchoolId,schoolId)
|
|
|
+ .eq(TAExamCourseRecord::getExamId,examId)
|
|
|
+ .in(TAExamCourseRecord::getCourseCode,courseCodeList));
|
|
|
+ // 全部改为应届
|
|
|
+ for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
|
|
|
+ taExamCourseRecord.setStudentCurrent(true);
|
|
|
+ }
|
|
|
+ taExamCourseRecordService.updateBatchById(taExamCourseRecordList);
|
|
|
+
|
|
|
+ // 非应届考生记录
|
|
|
+ taExamCourseRecordList =taExamCourseRecordList.stream()
|
|
|
+ .filter(e -> !e.getStudentCode().substring(0,4).equals(year))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (tbExamStudentList.size() > 0){
|
|
|
+ for (TBExamStudent tbExamStudent : tbExamStudentList) {
|
|
|
+ tbExamStudent.setStudentCurrent(false);
|
|
|
+ }
|
|
|
+ tbExamStudentService.updateBatchById(tbExamStudentList);
|
|
|
+
|
|
|
+ if (tbExamStudentList.size() == taExamCourseRecordList.size()){
|
|
|
+ for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
|
|
|
+ taExamCourseRecord.setStudentCurrent(false);
|
|
|
+ }
|
|
|
+ taExamCourseRecordService.updateBatchById(taExamCourseRecordList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultUtil.ok("有【" + tbExamStudentList.size() + "】条非应届学生数据被更新");
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "特殊科目合并题目处理")
|
|
|
@RequestMapping(value = "/special/combine", method = RequestMethod.POST)
|
|
|
@Transactional(rollbackFor = Exception.class)
|