|
@@ -451,7 +451,7 @@ public class BasicDatasourceController {
|
|
Long examId = tbExam.getId();
|
|
Long examId = tbExam.getId();
|
|
Long schoolId = tbExamService.getById(examId).getSchoolId();
|
|
Long schoolId = tbExamService.getById(examId).getSchoolId();
|
|
|
|
|
|
- if (!schoolId.equals(pSchoolId)){
|
|
|
|
|
|
+ if (!schoolId.equals(pSchoolId)) {
|
|
throw ExceptionResultEnum.ERROR.exception("学校id不匹配");
|
|
throw ExceptionResultEnum.ERROR.exception("学校id不匹配");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -491,34 +491,57 @@ public class BasicDatasourceController {
|
|
// TODO: 2021/6/2 筛选并创建学校教师表
|
|
// TODO: 2021/6/2 筛选并创建学校教师表
|
|
// 查询考务关系
|
|
// 查询考务关系
|
|
List<TBExaminationRelation> tbExaminationRelationList = tbExaminationRelationService.list(new QueryWrapper<TBExaminationRelation>().lambda()
|
|
List<TBExaminationRelation> tbExaminationRelationList = tbExaminationRelationService.list(new QueryWrapper<TBExaminationRelation>().lambda()
|
|
- .eq(TBExaminationRelation::getExamId,examId));
|
|
|
|
|
|
+ .eq(TBExaminationRelation::getExamId, examId));
|
|
|
|
|
|
List<TBSchoolTeacherDto> tbSchoolTeacherDtoList = new ArrayList<>();
|
|
List<TBSchoolTeacherDto> tbSchoolTeacherDtoList = new ArrayList<>();
|
|
- List<String> teacherList = finalList.stream()
|
|
|
|
- .map(e -> String.valueOf(e.get(ExamCloudDataEnum.TEACHER.getName())))
|
|
|
|
- .distinct().collect(Collectors.toList());
|
|
|
|
- for (String teacherInfo : teacherList) {
|
|
|
|
|
|
+
|
|
|
|
+ List<Map<String, String>> teacherList = finalList.stream()
|
|
|
|
+ .flatMap(e -> {
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("subjectName", String.valueOf(e.get(ExamCloudDataEnum.SUBJECT_NAME.getName())));
|
|
|
|
+ map.put("teacherInfo", String.valueOf(e.get(ExamCloudDataEnum.TEACHER.getName())));
|
|
|
|
+ return Stream.of(map);
|
|
|
|
+ }).distinct().collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ for (Map<String, String> teacherPackage : teacherList) {
|
|
|
|
+
|
|
|
|
+ String teacherInfo = teacherPackage.get("teacherInfo");
|
|
|
|
+ String subjectName = teacherPackage.get("subjectName");
|
|
|
|
+ List<TBExamCourse> tmpList = tbExamCourseList.stream().filter(e -> e.getCourseName().equals(subjectName)).collect(Collectors.toList());
|
|
|
|
+ if (tmpList.size() != 1) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("课程信息异常");
|
|
|
|
+ }
|
|
|
|
+ Long teacherCollegeId = tmpList.get(0).getTeachCollegeId();
|
|
|
|
+
|
|
|
|
+ // 教师信息统一化处理逻辑
|
|
|
|
+ Map<String, String> map = this.disposeTeacherInfo(teacherInfo);
|
|
|
|
+ String teacherName = map.get("teacherName");
|
|
|
|
+ String teacherCode = map.get("teacherCode");
|
|
|
|
+
|
|
List<TBExaminationRelation> tbExaminationRelations = tbExaminationRelationList.stream()
|
|
List<TBExaminationRelation> tbExaminationRelations = tbExaminationRelationList.stream()
|
|
- .filter(e -> teacherInfo.equals(e.getTeacherName()))
|
|
|
|
|
|
+ .filter(e -> teacherName.equals(e.getTeacherName()))
|
|
.distinct().collect(Collectors.toList());
|
|
.distinct().collect(Collectors.toList());
|
|
|
|
|
|
- String teacherCode;
|
|
|
|
|
|
+ // TODO: 2021/7/26 研究下面臃肿且被考务数据限制死的的教师机构获取方式是否可以使用上面的替代
|
|
Long orgId = null;
|
|
Long orgId = null;
|
|
- if (tbExaminationRelations.size() == 0){
|
|
|
|
- teacherCode = teacherInfo;
|
|
|
|
- }else {
|
|
|
|
|
|
+ if (tbExaminationRelations.size() == 0) {
|
|
|
|
+ if (!SystemConstant.strNotNull(teacherCode)) {
|
|
|
|
+ teacherCode = teacherInfo;
|
|
|
|
+ }
|
|
|
|
+ orgId = teacherCollegeId;
|
|
|
|
+ } else {
|
|
List<String> teacherCodeList = tbExaminationRelations.stream().map(TBExaminationRelation::getTeacherCode).distinct().collect(Collectors.toList());
|
|
List<String> teacherCodeList = tbExaminationRelations.stream().map(TBExaminationRelation::getTeacherCode).distinct().collect(Collectors.toList());
|
|
- if (teacherCodeList.size() != 1){
|
|
|
|
|
|
+ if (teacherCodeList.size() != 1) {
|
|
throw ExceptionResultEnum.ERROR.exception("考务数据-教师对应的教师编号有误");
|
|
throw ExceptionResultEnum.ERROR.exception("考务数据-教师对应的教师编号有误");
|
|
}
|
|
}
|
|
List<String> teachCollegeNameList = tbExaminationRelations.stream().map(TBExaminationRelation::getTeachCollegeName).distinct().collect(Collectors.toList());
|
|
List<String> teachCollegeNameList = tbExaminationRelations.stream().map(TBExaminationRelation::getTeachCollegeName).distinct().collect(Collectors.toList());
|
|
- if (teachCollegeNameList.size() != 1){
|
|
|
|
|
|
+ if (teachCollegeNameList.size() != 1) {
|
|
throw ExceptionResultEnum.ERROR.exception("考务数据-教师对应的开课学院有误");
|
|
throw ExceptionResultEnum.ERROR.exception("考务数据-教师对应的开课学院有误");
|
|
}
|
|
}
|
|
teacherCode = teacherCodeList.get(0);
|
|
teacherCode = teacherCodeList.get(0);
|
|
String teachCollegeName = teachCollegeNameList.get(0);
|
|
String teachCollegeName = teachCollegeNameList.get(0);
|
|
- List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getName,teachCollegeName).eq(SysOrg::getSchoolId,schoolId));
|
|
|
|
- if (sysOrgList.size() != 1){
|
|
|
|
|
|
+ List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getName, teachCollegeName).eq(SysOrg::getSchoolId, schoolId));
|
|
|
|
+ if (sysOrgList.size() != 1) {
|
|
throw ExceptionResultEnum.ERROR.exception("未能找到考务数据中学院名称的学院");
|
|
throw ExceptionResultEnum.ERROR.exception("未能找到考务数据中学院名称的学院");
|
|
}
|
|
}
|
|
orgId = sysOrgList.get(0).getId();
|
|
orgId = sysOrgList.get(0).getId();
|
|
@@ -527,7 +550,7 @@ public class BasicDatasourceController {
|
|
TBSchoolTeacherDto tbSchoolTeacherDto = new TBSchoolTeacherDto();
|
|
TBSchoolTeacherDto tbSchoolTeacherDto = new TBSchoolTeacherDto();
|
|
tbSchoolTeacherDto.setSchoolId(schoolId);
|
|
tbSchoolTeacherDto.setSchoolId(schoolId);
|
|
tbSchoolTeacherDto.setTeacherCode(teacherCode);
|
|
tbSchoolTeacherDto.setTeacherCode(teacherCode);
|
|
- tbSchoolTeacherDto.setTeacherName(teacherInfo);
|
|
|
|
|
|
+ tbSchoolTeacherDto.setTeacherName(teacherName);
|
|
tbSchoolTeacherDto.setOrgId(orgId);
|
|
tbSchoolTeacherDto.setOrgId(orgId);
|
|
tbSchoolTeacherDtoList.add(tbSchoolTeacherDto);
|
|
tbSchoolTeacherDtoList.add(tbSchoolTeacherDto);
|
|
}
|
|
}
|
|
@@ -545,6 +568,7 @@ public class BasicDatasourceController {
|
|
int count = paperTypeList.size();
|
|
int count = paperTypeList.size();
|
|
int i = 0;
|
|
int i = 0;
|
|
|
|
|
|
|
|
+ Map<String, TBStudent> checkMap = new HashMap<>();
|
|
for (Map map : finalList) {
|
|
for (Map map : finalList) {
|
|
String subjectCode = (String) map.get(ExamCloudDataEnum.SUBJECT_CODE.getName()); //科目代码
|
|
String subjectCode = (String) map.get(ExamCloudDataEnum.SUBJECT_CODE.getName()); //科目代码
|
|
String subjectName = (String) map.get(ExamCloudDataEnum.SUBJECT_NAME.getName()); //科目名称
|
|
String subjectName = (String) map.get(ExamCloudDataEnum.SUBJECT_NAME.getName()); //科目名称
|
|
@@ -563,6 +587,9 @@ public class BasicDatasourceController {
|
|
String college = (String) map.get(ExamCloudDataEnum.COLLEGE.getName()); //学院
|
|
String college = (String) map.get(ExamCloudDataEnum.COLLEGE.getName()); //学院
|
|
String className = (String) map.get(ExamCloudDataEnum.CLASS_NAME.getName()); //班级名称
|
|
String className = (String) map.get(ExamCloudDataEnum.CLASS_NAME.getName()); //班级名称
|
|
String teacher = (String) map.get(ExamCloudDataEnum.TEACHER.getName()); //教师
|
|
String teacher = (String) map.get(ExamCloudDataEnum.TEACHER.getName()); //教师
|
|
|
|
+ Map<String, String> teacherMap = this.disposeTeacherInfo(teacher);
|
|
|
|
+ String teacherName = teacherMap.get("teacherName");
|
|
|
|
+ String teacherCode = teacherMap.get("teacherCode");
|
|
// 缺考状态 2 -> 缺考 ; 3 -> 违纪
|
|
// 缺考状态 2 -> 缺考 ; 3 -> 违纪
|
|
int status = (int) map.get(ExamCloudDataEnum.STATUS.getName()); //学生考试状态
|
|
int status = (int) map.get(ExamCloudDataEnum.STATUS.getName()); //学生考试状态
|
|
String totalScore = (String) map.get(ExamCloudDataEnum.TOTAL_SCORE.getName()); //考生总分
|
|
String totalScore = (String) map.get(ExamCloudDataEnum.TOTAL_SCORE.getName()); //考生总分
|
|
@@ -571,26 +598,32 @@ public class BasicDatasourceController {
|
|
List<Map<Object, Object>> objectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.OBJECTIVE_SCORE_DETAIL.getName()); //客观题明细
|
|
List<Map<Object, Object>> objectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.OBJECTIVE_SCORE_DETAIL.getName()); //客观题明细
|
|
List<Map<Object, Object>> subjectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.SUBJECTIVE_SCORE_DETAIL.getName()); //主观题答题明细
|
|
List<Map<Object, Object>> subjectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.SUBJECTIVE_SCORE_DETAIL.getName()); //主观题答题明细
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
组建学生基础信息 student
|
|
组建学生基础信息 student
|
|
*/
|
|
*/
|
|
- TBStudent studentTemp = tbStudentService.getOne(new QueryWrapper<TBStudent>().lambda()
|
|
|
|
- .eq(TBStudent::getSchoolId, schoolId)
|
|
|
|
- .eq(TBStudent::getStudentCode, studentCode));
|
|
|
|
- Long studentId;
|
|
|
|
- if (Objects.nonNull(studentTemp)) {
|
|
|
|
- studentId = studentTemp.getId();
|
|
|
|
|
|
+ if (checkMap.containsKey(studentCode)) {
|
|
|
|
+ if (!checkMap.get(studentCode).getName().equals(name)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("有学号【" + studentCode + "】的学生名称不同意");
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- studentId = SystemConstant.getDbUuid();
|
|
|
|
|
|
+ TBStudent studentTemp = tbStudentService.getOne(new QueryWrapper<TBStudent>().lambda()
|
|
|
|
+ .eq(TBStudent::getSchoolId, schoolId)
|
|
|
|
+ .eq(TBStudent::getStudentCode, studentCode));
|
|
|
|
+ Long studentId;
|
|
|
|
+ if (Objects.nonNull(studentTemp)) {
|
|
|
|
+ studentId = studentTemp.getId();
|
|
|
|
+ } else {
|
|
|
|
+ studentId = SystemConstant.getDbUuid();
|
|
|
|
+ }
|
|
|
|
+ TBStudent tbStudent = new TBStudent();
|
|
|
|
+ tbStudent.setId(studentId);
|
|
|
|
+ tbStudent.setSchoolId(schoolId);
|
|
|
|
+ tbStudent.setName(name);
|
|
|
|
+ tbStudent.setStudentCode(studentCode);
|
|
|
|
+ checkMap.put(studentCode, tbStudent);
|
|
|
|
+ tbStudentList.add(tbStudent);
|
|
}
|
|
}
|
|
- TBStudent tbStudent = new TBStudent();
|
|
|
|
- tbStudent.setId(studentId);
|
|
|
|
- tbStudent.setSchoolId(schoolId);
|
|
|
|
- tbStudent.setName(name);
|
|
|
|
- tbStudent.setStudentCode(studentCode);
|
|
|
|
- tbStudentList.add(tbStudent);
|
|
|
|
|
|
+
|
|
|
|
|
|
/*
|
|
/*
|
|
组建考生考试信息 exm_pap_tik
|
|
组建考生考试信息 exm_pap_tik
|
|
@@ -617,7 +650,7 @@ public class BasicDatasourceController {
|
|
// 获取关联的基础表主键
|
|
// 获取关联的基础表主键
|
|
SysOrg tbSchoolCollege = sysOrgService.findByForeignKey(schoolId, college, college);
|
|
SysOrg tbSchoolCollege = sysOrgService.findByForeignKey(schoolId, college, college);
|
|
TBSchoolClazz tbSchoolClazz = tbSchoolClazzService.findByForeignKey(schoolId, className, className);
|
|
TBSchoolClazz tbSchoolClazz = tbSchoolClazzService.findByForeignKey(schoolId, className, className);
|
|
- SysUser tbSchoolTeacher = sysUserService.findByForeignKey(schoolId, teacher);
|
|
|
|
|
|
+ SysUser tbSchoolTeacher = sysUserService.findByForeignKey(schoolId, teacherName);
|
|
|
|
|
|
TBExamStudent tbExamStudent = new TBExamStudent();
|
|
TBExamStudent tbExamStudent = new TBExamStudent();
|
|
Long examStudentId = SystemConstant.getDbUuid();
|
|
Long examStudentId = SystemConstant.getDbUuid();
|
|
@@ -625,7 +658,7 @@ public class BasicDatasourceController {
|
|
tbExamStudent.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
tbExamStudent.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
tbExamStudent.setExamId(examId);
|
|
tbExamStudent.setExamId(examId);
|
|
tbExamStudent.setName(name);
|
|
tbExamStudent.setName(name);
|
|
- tbExamStudent.setStudentId(studentId);
|
|
|
|
|
|
+ tbExamStudent.setStudentId(checkMap.get(studentCode).getId());
|
|
tbExamStudent.setStudentCode(studentCode);
|
|
tbExamStudent.setStudentCode(studentCode);
|
|
tbExamStudent.setCourseCode(courseCode);
|
|
tbExamStudent.setCourseCode(courseCode);
|
|
tbExamStudent.setCourseName(courseName);
|
|
tbExamStudent.setCourseName(courseName);
|
|
@@ -633,9 +666,9 @@ public class BasicDatasourceController {
|
|
tbExamStudent.setInspectCollegeId(tbSchoolCollege.getId());
|
|
tbExamStudent.setInspectCollegeId(tbSchoolCollege.getId());
|
|
tbExamStudent.setClazzId(tbSchoolClazz.getId());
|
|
tbExamStudent.setClazzId(tbSchoolClazz.getId());
|
|
tbExamStudent.setMajorId(0L);
|
|
tbExamStudent.setMajorId(0L);
|
|
- if (Objects.nonNull(tbSchoolTeacher)){
|
|
|
|
|
|
+ if (Objects.nonNull(tbSchoolTeacher)) {
|
|
tbExamStudent.setTeacherId(tbSchoolTeacher.getId());
|
|
tbExamStudent.setTeacherId(tbSchoolTeacher.getId());
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
tbExamStudent.setTeacherId(0L);
|
|
tbExamStudent.setTeacherId(0L);
|
|
}
|
|
}
|
|
tbExamStudent.setTicketNumber(examNumber);
|
|
tbExamStudent.setTicketNumber(examNumber);
|
|
@@ -761,7 +794,7 @@ public class BasicDatasourceController {
|
|
// 迁移数据至't_a_exam_course_record'
|
|
// 迁移数据至't_a_exam_course_record'
|
|
List<TAExamCourseRecord> taExamCourseRecordList = new ArrayList<>();
|
|
List<TAExamCourseRecord> taExamCourseRecordList = new ArrayList<>();
|
|
for (BasicExamRecordDto basicExamRecordDto : basicExamRecordDtoList) {
|
|
for (BasicExamRecordDto basicExamRecordDto : basicExamRecordDtoList) {
|
|
- if (basicExamRecordDto.getStudentCode().equals("2020303041027")){
|
|
|
|
|
|
+ if (basicExamRecordDto.getStudentCode().equals("2020303041027")) {
|
|
System.out.println("进入");
|
|
System.out.println("进入");
|
|
}
|
|
}
|
|
// 正常公式赋分操作
|
|
// 正常公式赋分操作
|
|
@@ -775,7 +808,7 @@ public class BasicDatasourceController {
|
|
BigDecimal coefficient = tbPaper.getCoefficient();
|
|
BigDecimal coefficient = tbPaper.getCoefficient();
|
|
BigDecimal assignScore;
|
|
BigDecimal assignScore;
|
|
if (coefficient != null && coefficient.compareTo(BigDecimal.ZERO) > 0 && !basicExamRecordDto.getAbsent()) {
|
|
if (coefficient != null && coefficient.compareTo(BigDecimal.ZERO) > 0 && !basicExamRecordDto.getAbsent()) {
|
|
- assignScore = myScore.add(fullScore.subtract(myScore).divide(coefficient, 4, BigDecimal.ROUND_HALF_UP)).setScale(0,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ assignScore = myScore.add(fullScore.subtract(myScore).divide(coefficient, 4, BigDecimal.ROUND_HALF_UP)).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
} else {
|
|
} else {
|
|
assignScore = myScore;
|
|
assignScore = myScore;
|
|
}
|
|
}
|
|
@@ -835,7 +868,7 @@ public class BasicDatasourceController {
|
|
.filter(e -> assExamId.equals(e.getExamId()) && s.equals(e.getCourseCode()) && assStudentCode.equals(e.getStudentCode()))
|
|
.filter(e -> assExamId.equals(e.getExamId()) && s.equals(e.getCourseCode()) && assStudentCode.equals(e.getStudentCode()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
if (taExamCourseRecordList.size() != 1) {
|
|
if (taExamCourseRecordList.size() != 1) {
|
|
- if (taExamCourseRecordList.size() < 1){
|
|
|
|
|
|
+ if (taExamCourseRecordList.size() < 1) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
System.out.println("-----------------------");
|
|
System.out.println("-----------------------");
|
|
@@ -872,12 +905,12 @@ public class BasicDatasourceController {
|
|
@RequestMapping(value = "/course/create", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/course/create", method = RequestMethod.POST)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
- public Result courseCreate(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode,@RequestParam String courseName,@RequestParam(required = false) String examinationCourseCode,@RequestParam(required = false) String teachCollegeName) {
|
|
|
|
- if ((!SystemConstant.strNotNull(examinationCourseCode) && !SystemConstant.strNotNull(teachCollegeName)) || (SystemConstant.strNotNull(examinationCourseCode) && SystemConstant.strNotNull(teachCollegeName))){
|
|
|
|
|
|
+ public Result courseCreate(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode, @RequestParam String courseName, @RequestParam(required = false) String examinationCourseCode, @RequestParam(required = false) String teachCollegeName) {
|
|
|
|
+ if ((!SystemConstant.strNotNull(examinationCourseCode) && !SystemConstant.strNotNull(teachCollegeName)) || (SystemConstant.strNotNull(examinationCourseCode) && SystemConstant.strNotNull(teachCollegeName))) {
|
|
throw ExceptionResultEnum.ERROR.exception("参数异常 : 考务课程编号和课程授课学院不能全不传或全传");
|
|
throw ExceptionResultEnum.ERROR.exception("参数异常 : 考务课程编号和课程授课学院不能全不传或全传");
|
|
}
|
|
}
|
|
- basicCourseService.createCourse(schoolId,courseCode,courseName);
|
|
|
|
- tbExamCourseService.createCourse(schoolId,SystemConstant.convertIdToLong(examId),courseCode,courseName,examinationCourseCode,teachCollegeName);
|
|
|
|
|
|
+ basicCourseService.createCourse(schoolId, courseCode, courseName);
|
|
|
|
+ tbExamCourseService.createCourse(schoolId, SystemConstant.convertIdToLong(examId), courseCode, courseName, examinationCourseCode, teachCollegeName);
|
|
|
|
|
|
return ResultUtil.ok(Collections.singletonMap(SystemConstant.SUCCESS, true));
|
|
return ResultUtil.ok(Collections.singletonMap(SystemConstant.SUCCESS, true));
|
|
}
|
|
}
|
|
@@ -886,7 +919,7 @@ public class BasicDatasourceController {
|
|
@RequestMapping(value = "/examination/sync", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/examination/sync", method = RequestMethod.POST)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
- public Result examinationSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,@RequestParam Long schoolId, @RequestParam String examId) throws IOException, NoSuchFieldException {
|
|
|
|
|
|
+ public Result examinationSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file, @RequestParam Long schoolId, @RequestParam String examId) throws IOException, NoSuchFieldException {
|
|
if (Objects.isNull(file)) {
|
|
if (Objects.isNull(file)) {
|
|
throw ExceptionResultEnum.ERROR.exception("附件不存在");
|
|
throw ExceptionResultEnum.ERROR.exception("附件不存在");
|
|
}
|
|
}
|
|
@@ -933,7 +966,7 @@ public class BasicDatasourceController {
|
|
tbExamination.setTeacherCode(teacherCode);
|
|
tbExamination.setTeacherCode(teacherCode);
|
|
tbExamination.setTeacherName(teacherName);
|
|
tbExamination.setTeacherName(teacherName);
|
|
tbExamination.setTeachCollegeName(teachCollegeName);
|
|
tbExamination.setTeachCollegeName(teachCollegeName);
|
|
- if (SystemConstant.strNotNull(credit)){
|
|
|
|
|
|
+ if (SystemConstant.strNotNull(credit)) {
|
|
tbExamination.setCredit(credit);
|
|
tbExamination.setCredit(credit);
|
|
}
|
|
}
|
|
tbExamination.setStudentCode(studentCode);
|
|
tbExamination.setStudentCode(studentCode);
|
|
@@ -947,15 +980,15 @@ public class BasicDatasourceController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<Map<String,Object>> tbExaminationRelationMapList = tbExaminationList.stream().flatMap(e -> {
|
|
|
|
|
|
+ List<Map<String, Object>> tbExaminationRelationMapList = tbExaminationList.stream().flatMap(e -> {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
- map.put("schoolId",e.getSchoolId());
|
|
|
|
- map.put("examId",e.getExamId());
|
|
|
|
- map.put("examinationCourseCode",e.getExaminationCourseCode());
|
|
|
|
- map.put("courseName",e.getCourseName());
|
|
|
|
- map.put("teachCollegeName",e.getTeachCollegeName());
|
|
|
|
- map.put("teacherCode",e.getTeacherCode());
|
|
|
|
- map.put("teacherName",e.getTeacherName());
|
|
|
|
|
|
+ map.put("schoolId", e.getSchoolId());
|
|
|
|
+ map.put("examId", e.getExamId());
|
|
|
|
+ map.put("examinationCourseCode", e.getExaminationCourseCode());
|
|
|
|
+ map.put("courseName", e.getCourseName());
|
|
|
|
+ map.put("teachCollegeName", e.getTeachCollegeName());
|
|
|
|
+ map.put("teacherCode", e.getTeacherCode());
|
|
|
|
+ map.put("teacherName", e.getTeacherName());
|
|
return Stream.of(map);
|
|
return Stream.of(map);
|
|
}).distinct().collect(Collectors.toList());
|
|
}).distinct().collect(Collectors.toList());
|
|
|
|
|
|
@@ -973,8 +1006,8 @@ public class BasicDatasourceController {
|
|
tbExaminationRelationList.add(tbExaminationRelation);
|
|
tbExaminationRelationList.add(tbExaminationRelation);
|
|
}
|
|
}
|
|
|
|
|
|
- tbExaminationService.remove(new QueryWrapper<TBExamination>().lambda().eq(TBExamination::getExamId,examId));
|
|
|
|
- tbExaminationRelationService.remove(new QueryWrapper<TBExaminationRelation>().lambda().eq(TBExaminationRelation::getExamId,examId));
|
|
|
|
|
|
+ tbExaminationService.remove(new QueryWrapper<TBExamination>().lambda().eq(TBExamination::getExamId, examId));
|
|
|
|
+ tbExaminationRelationService.remove(new QueryWrapper<TBExaminationRelation>().lambda().eq(TBExaminationRelation::getExamId, examId));
|
|
|
|
|
|
tbExaminationService.saveBatch(tbExaminationList);
|
|
tbExaminationService.saveBatch(tbExaminationList);
|
|
tbExaminationRelationService.saveBatch(tbExaminationRelationList);
|
|
tbExaminationRelationService.saveBatch(tbExaminationRelationList);
|
|
@@ -991,15 +1024,15 @@ public class BasicDatasourceController {
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号[" + courseCode + "]的课程分析数据已测试或发布,不能变更基础数据");
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号[" + courseCode + "]的课程分析数据已测试或发布,不能变更基础数据");
|
|
}
|
|
}
|
|
List<TBExamination> tbExaminationList = tbExaminationService.list(new QueryWrapper<TBExamination>().lambda()
|
|
List<TBExamination> tbExaminationList = tbExaminationService.list(new QueryWrapper<TBExamination>().lambda()
|
|
- .eq(TBExamination::getExamId,SystemConstant.convertIdToLong(examId))
|
|
|
|
- .eq(TBExamination::getSchoolId,SystemConstant.convertIdToLong(schoolId))
|
|
|
|
- .eq(TBExamination::getExaminationCourseCode,tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
|
- .eq(TBExamCourse::getExamId,examId)
|
|
|
|
- .eq(TBExamCourse::getCourseCode,courseCode)
|
|
|
|
- .eq(TBExamCourse::getSchoolId,schoolId))
|
|
|
|
|
|
+ .eq(TBExamination::getExamId, SystemConstant.convertIdToLong(examId))
|
|
|
|
+ .eq(TBExamination::getSchoolId, SystemConstant.convertIdToLong(schoolId))
|
|
|
|
+ .eq(TBExamination::getExaminationCourseCode, tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
|
+ .eq(TBExamCourse::getExamId, examId)
|
|
|
|
+ .eq(TBExamCourse::getCourseCode, courseCode)
|
|
|
|
+ .eq(TBExamCourse::getSchoolId, schoolId))
|
|
.getExaminationCourseCode())
|
|
.getExaminationCourseCode())
|
|
- .eq(TBExamination::getCourseName,courseName)
|
|
|
|
- .ne(TBExamination::getStudyType,"普通"));
|
|
|
|
|
|
+ .eq(TBExamination::getCourseName, courseName)
|
|
|
|
+ .ne(TBExamination::getStudyType, "普通"));
|
|
int count = tbExaminationList.size();
|
|
int count = tbExaminationList.size();
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
List<TBExamStudent> tbExamStudentList = tbExamStudentService.list(new QueryWrapper<TBExamStudent>().lambda()
|
|
List<TBExamStudent> tbExamStudentList = tbExamStudentService.list(new QueryWrapper<TBExamStudent>().lambda()
|
|
@@ -1030,18 +1063,18 @@ public class BasicDatasourceController {
|
|
public Result exceptionStudentDisposeByStudentCode(@RequestParam String schoolId, @RequestParam String examId, @RequestParam List<String> courseCodeList, @RequestParam String year) {
|
|
public Result exceptionStudentDisposeByStudentCode(@RequestParam String schoolId, @RequestParam String examId, @RequestParam List<String> courseCodeList, @RequestParam String year) {
|
|
for (String courseCode : courseCodeList) {
|
|
for (String courseCode : courseCodeList) {
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
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)){
|
|
|
|
|
|
+ .eq(TBExamCourse::getExamId, examId)
|
|
|
|
+ .eq(TBExamCourse::getSchoolId, schoolId)
|
|
|
|
+ .eq(TBExamCourse::getCourseCode, courseCode));
|
|
|
|
+ if (tbExamCourse.getPublishStatus().equals(PublishStatusEnum.PUBLISH)) {
|
|
throw ExceptionResultEnum.ERROR.exception("已经发布的课程【" + tbExamCourse.getCourseName() + "】不能进行特殊处理");
|
|
throw ExceptionResultEnum.ERROR.exception("已经发布的课程【" + tbExamCourse.getCourseName() + "】不能进行特殊处理");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 更改 ‘t_b_exam_student’表考生应届状态
|
|
// 更改 ‘t_b_exam_student’表考生应届状态
|
|
List<TBExamStudent> tbExamStudentList = tbExamStudentService.list(new QueryWrapper<TBExamStudent>().lambda()
|
|
List<TBExamStudent> tbExamStudentList = tbExamStudentService.list(new QueryWrapper<TBExamStudent>().lambda()
|
|
- .eq(TBExamStudent::getSchoolId,schoolId)
|
|
|
|
- .eq(TBExamStudent::getExamId,examId)
|
|
|
|
- .in(TBExamStudent::getCourseCode,courseCodeList));
|
|
|
|
|
|
+ .eq(TBExamStudent::getSchoolId, schoolId)
|
|
|
|
+ .eq(TBExamStudent::getExamId, examId)
|
|
|
|
+ .in(TBExamStudent::getCourseCode, courseCodeList));
|
|
// 全部改为应届
|
|
// 全部改为应届
|
|
for (TBExamStudent tbExamStudent : tbExamStudentList) {
|
|
for (TBExamStudent tbExamStudent : tbExamStudentList) {
|
|
tbExamStudent.setStudentCurrent(true);
|
|
tbExamStudent.setStudentCurrent(true);
|
|
@@ -1049,14 +1082,14 @@ public class BasicDatasourceController {
|
|
tbExamStudentService.updateBatchById(tbExamStudentList);
|
|
tbExamStudentService.updateBatchById(tbExamStudentList);
|
|
// 非应届考生
|
|
// 非应届考生
|
|
tbExamStudentList = tbExamStudentList.stream()
|
|
tbExamStudentList = tbExamStudentList.stream()
|
|
- .filter(e -> !e.getStudentCode().substring(0,4).equals(year))
|
|
|
|
|
|
+ .filter(e -> !e.getStudentCode().substring(0, 4).equals(year))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
// 更改 ‘t_a_exam_course_record’表考生应届状态
|
|
// 更改 ‘t_a_exam_course_record’表考生应届状态
|
|
List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
- .eq(TAExamCourseRecord::getSchoolId,schoolId)
|
|
|
|
- .eq(TAExamCourseRecord::getExamId,examId)
|
|
|
|
- .in(TAExamCourseRecord::getCourseCode,courseCodeList));
|
|
|
|
|
|
+ .eq(TAExamCourseRecord::getSchoolId, schoolId)
|
|
|
|
+ .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
+ .in(TAExamCourseRecord::getCourseCode, courseCodeList));
|
|
// 全部改为应届
|
|
// 全部改为应届
|
|
for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
|
|
for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
|
|
taExamCourseRecord.setStudentCurrent(true);
|
|
taExamCourseRecord.setStudentCurrent(true);
|
|
@@ -1064,17 +1097,17 @@ public class BasicDatasourceController {
|
|
taExamCourseRecordService.updateBatchById(taExamCourseRecordList);
|
|
taExamCourseRecordService.updateBatchById(taExamCourseRecordList);
|
|
|
|
|
|
// 非应届考生记录
|
|
// 非应届考生记录
|
|
- taExamCourseRecordList =taExamCourseRecordList.stream()
|
|
|
|
- .filter(e -> !e.getStudentCode().substring(0,4).equals(year))
|
|
|
|
|
|
+ taExamCourseRecordList = taExamCourseRecordList.stream()
|
|
|
|
+ .filter(e -> !e.getStudentCode().substring(0, 4).equals(year))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- if (tbExamStudentList.size() > 0){
|
|
|
|
|
|
+ if (tbExamStudentList.size() > 0) {
|
|
for (TBExamStudent tbExamStudent : tbExamStudentList) {
|
|
for (TBExamStudent tbExamStudent : tbExamStudentList) {
|
|
tbExamStudent.setStudentCurrent(false);
|
|
tbExamStudent.setStudentCurrent(false);
|
|
}
|
|
}
|
|
tbExamStudentService.updateBatchById(tbExamStudentList);
|
|
tbExamStudentService.updateBatchById(tbExamStudentList);
|
|
|
|
|
|
- if (tbExamStudentList.size() == taExamCourseRecordList.size()){
|
|
|
|
|
|
+ if (tbExamStudentList.size() == taExamCourseRecordList.size()) {
|
|
for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
|
|
for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
|
|
taExamCourseRecord.setStudentCurrent(false);
|
|
taExamCourseRecord.setStudentCurrent(false);
|
|
}
|
|
}
|
|
@@ -1099,18 +1132,18 @@ public class BasicDatasourceController {
|
|
String comMain = combineDto.getComMain();
|
|
String comMain = combineDto.getComMain();
|
|
String comSub = combineDto.getComSub();
|
|
String comSub = combineDto.getComSub();
|
|
// TODO: 2021/6/25 合题的检验
|
|
// TODO: 2021/6/25 合题的检验
|
|
- TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId,examId).eq(TBPaper::getCourseCode,courseCode));
|
|
|
|
|
|
+ TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId, examId).eq(TBPaper::getCourseCode, courseCode));
|
|
Long paperId = tbPaper.getId();
|
|
Long paperId = tbPaper.getId();
|
|
- List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId,examId).eq(TBExamRecord::getPaperId,paperId));
|
|
|
|
|
|
+ List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId, examId).eq(TBExamRecord::getPaperId, paperId));
|
|
List<Long> examRecordIdList = tbExamRecordList.stream().map(TBExamRecord::getId).distinct().collect(Collectors.toList());
|
|
List<Long> examRecordIdList = tbExamRecordList.stream().map(TBExamRecord::getId).distinct().collect(Collectors.toList());
|
|
|
|
|
|
- List<TBAnswer> tbAnswerList = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId,examRecordIdList));
|
|
|
|
|
|
+ List<TBAnswer> tbAnswerList = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId, examRecordIdList));
|
|
|
|
|
|
List<Long> willDeleteList = new ArrayList<>();
|
|
List<Long> willDeleteList = new ArrayList<>();
|
|
List<TBAnswer> willInsertList = new ArrayList<>();
|
|
List<TBAnswer> willInsertList = new ArrayList<>();
|
|
for (Long examRecordId : examRecordIdList) {
|
|
for (Long examRecordId : examRecordIdList) {
|
|
List<TBAnswer> oneStudentAnswerList = tbAnswerList.stream().filter(e -> e.getExamRecordId().equals(examRecordId)).collect(Collectors.toList());
|
|
List<TBAnswer> oneStudentAnswerList = tbAnswerList.stream().filter(e -> e.getExamRecordId().equals(examRecordId)).collect(Collectors.toList());
|
|
- if (oneStudentAnswerList.size() == 0){
|
|
|
|
|
|
+ if (oneStudentAnswerList.size() == 0) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
// 原始1题
|
|
// 原始1题
|
|
@@ -1127,7 +1160,7 @@ public class BasicDatasourceController {
|
|
|
|
|
|
Long org2Id = org2.getId();
|
|
Long org2Id = org2.getId();
|
|
BigDecimal org2Score = org2.getScore();
|
|
BigDecimal org2Score = org2.getScore();
|
|
- if (!org1.getNumberType().equals(org2.getNumberType())){
|
|
|
|
|
|
+ if (!org1.getNumberType().equals(org2.getNumberType())) {
|
|
throw ExceptionResultEnum.ERROR.exception("题目类型不一致 合题失败");
|
|
throw ExceptionResultEnum.ERROR.exception("题目类型不一致 合题失败");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1154,20 +1187,20 @@ public class BasicDatasourceController {
|
|
@RequestMapping(value = "/exception_answer/score_dispose", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/exception_answer/score_dispose", method = RequestMethod.POST)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
- public Result exceptionAnswerScoreDispose(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode,@RequestParam String numberType,@RequestParam String mainNumber,@RequestParam String subNumber,@RequestParam String answer,@RequestParam BigDecimal score) {
|
|
|
|
|
|
+ public Result exceptionAnswerScoreDispose(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode, @RequestParam String numberType, @RequestParam String mainNumber, @RequestParam String subNumber, @RequestParam String answer, @RequestParam BigDecimal score) {
|
|
|
|
|
|
- TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getCourseCode,courseCode).eq(TBPaper::getExamId,examId));
|
|
|
|
|
|
+ TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getCourseCode, courseCode).eq(TBPaper::getExamId, examId));
|
|
Long paperId = tbPaper.getId();
|
|
Long paperId = tbPaper.getId();
|
|
- List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId,examId).eq(TBExamRecord::getPaperId,paperId));
|
|
|
|
|
|
+ List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId, examId).eq(TBExamRecord::getPaperId, paperId));
|
|
List<Long> examRecordIdList = tbExamRecordList.stream().map(TBExamRecord::getId).distinct().collect(Collectors.toList());
|
|
List<Long> examRecordIdList = tbExamRecordList.stream().map(TBExamRecord::getId).distinct().collect(Collectors.toList());
|
|
|
|
|
|
// 要改分的作答记录
|
|
// 要改分的作答记录
|
|
List<TBAnswer> tbAnswerList = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda()
|
|
List<TBAnswer> tbAnswerList = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda()
|
|
- .in(TBAnswer::getExamRecordId,examRecordIdList)
|
|
|
|
- .eq(TBAnswer::getNumberType,numberType)
|
|
|
|
- .eq(TBAnswer::getMainNumber,mainNumber)
|
|
|
|
- .eq(TBAnswer::getSubNumber,subNumber)
|
|
|
|
- .eq(TBAnswer::getAnswer,answer));
|
|
|
|
|
|
+ .in(TBAnswer::getExamRecordId, examRecordIdList)
|
|
|
|
+ .eq(TBAnswer::getNumberType, numberType)
|
|
|
|
+ .eq(TBAnswer::getMainNumber, mainNumber)
|
|
|
|
+ .eq(TBAnswer::getSubNumber, subNumber)
|
|
|
|
+ .eq(TBAnswer::getAnswer, answer));
|
|
|
|
|
|
List<TBExamRecord> willUpdateRecordList = new ArrayList<>();
|
|
List<TBExamRecord> willUpdateRecordList = new ArrayList<>();
|
|
for (TBAnswer tbAnswer : tbAnswerList) {
|
|
for (TBAnswer tbAnswer : tbAnswerList) {
|
|
@@ -1179,15 +1212,15 @@ public class BasicDatasourceController {
|
|
// 对该考生 总体考试成绩的得分修改
|
|
// 对该考生 总体考试成绩的得分修改
|
|
TBExamRecord tbExamRecord = tbExamRecordList.stream().filter(e -> e.getId().equals(tbAnswer.getExamRecordId())).collect(Collectors.toList()).get(0);
|
|
TBExamRecord tbExamRecord = tbExamRecordList.stream().filter(e -> e.getId().equals(tbAnswer.getExamRecordId())).collect(Collectors.toList()).get(0);
|
|
BigDecimal totalScore = tbExamRecord.getTotalScore();
|
|
BigDecimal totalScore = tbExamRecord.getTotalScore();
|
|
- if (numberType.equals("客观题")){
|
|
|
|
|
|
+ if (numberType.equals("客观题")) {
|
|
BigDecimal objectiveScore = tbExamRecord.getObjectiveScore();
|
|
BigDecimal objectiveScore = tbExamRecord.getObjectiveScore();
|
|
objectiveScore = objectiveScore.add(scoreGap);
|
|
objectiveScore = objectiveScore.add(scoreGap);
|
|
tbExamRecord.setObjectiveScore(objectiveScore);
|
|
tbExamRecord.setObjectiveScore(objectiveScore);
|
|
- }else if (numberType.equals("主观题")){
|
|
|
|
|
|
+ } else if (numberType.equals("主观题")) {
|
|
BigDecimal subjectiveScore = tbExamRecord.getSubjectiveScore();
|
|
BigDecimal subjectiveScore = tbExamRecord.getSubjectiveScore();
|
|
subjectiveScore = subjectiveScore.add(scoreGap);
|
|
subjectiveScore = subjectiveScore.add(scoreGap);
|
|
tbExamRecord.setSubjectiveScore(subjectiveScore);
|
|
tbExamRecord.setSubjectiveScore(subjectiveScore);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
throw ExceptionResultEnum.ERROR.exception("题目类型有误");
|
|
throw ExceptionResultEnum.ERROR.exception("题目类型有误");
|
|
}
|
|
}
|
|
totalScore = totalScore.add(scoreGap);
|
|
totalScore = totalScore.add(scoreGap);
|
|
@@ -1199,16 +1232,16 @@ public class BasicDatasourceController {
|
|
tbExamRecordService.updateBatchById(willUpdateRecordList);
|
|
tbExamRecordService.updateBatchById(willUpdateRecordList);
|
|
|
|
|
|
// 成绩核对
|
|
// 成绩核对
|
|
- List<TBExamRecord> verifyExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId,examId).eq(TBExamRecord::getPaperId,paperId));
|
|
|
|
|
|
+ List<TBExamRecord> verifyExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId, examId).eq(TBExamRecord::getPaperId, paperId));
|
|
for (TBExamRecord verifyRecord : verifyExamRecordList) {
|
|
for (TBExamRecord verifyRecord : verifyExamRecordList) {
|
|
BigDecimal totalScore = verifyRecord.getTotalScore();
|
|
BigDecimal totalScore = verifyRecord.getTotalScore();
|
|
Long examRecordId = verifyRecord.getId();
|
|
Long examRecordId = verifyRecord.getId();
|
|
- List<TBAnswer> oneStudentAnswer = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().eq(TBAnswer::getExamRecordId,examRecordId));
|
|
|
|
- if (oneStudentAnswer.size() == 0 && totalScore.compareTo(BigDecimal.ZERO) != 0){
|
|
|
|
|
|
+ List<TBAnswer> oneStudentAnswer = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().eq(TBAnswer::getExamRecordId, examRecordId));
|
|
|
|
+ if (oneStudentAnswer.size() == 0 && totalScore.compareTo(BigDecimal.ZERO) != 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("计算数据异常");
|
|
throw ExceptionResultEnum.ERROR.exception("计算数据异常");
|
|
} else {
|
|
} else {
|
|
double scoreSum = oneStudentAnswer.stream().collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue())).getSum();
|
|
double scoreSum = oneStudentAnswer.stream().collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue())).getSum();
|
|
- if (totalScore.compareTo(BigDecimal.valueOf(scoreSum)) != 0){
|
|
|
|
|
|
+ if (totalScore.compareTo(BigDecimal.valueOf(scoreSum)) != 0) {
|
|
System.out.println("考试总分 : " + totalScore + ",作答总分 : " + scoreSum);
|
|
System.out.println("考试总分 : " + totalScore + ",作答总分 : " + scoreSum);
|
|
throw ExceptionResultEnum.ERROR.exception("考试总分和作答总分不一致");
|
|
throw ExceptionResultEnum.ERROR.exception("考试总分和作答总分不一致");
|
|
}
|
|
}
|
|
@@ -1230,11 +1263,11 @@ public class BasicDatasourceController {
|
|
}
|
|
}
|
|
// 查找留学生
|
|
// 查找留学生
|
|
List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
- .eq(TAExamCourseRecord::getCourseCode,courseCode)
|
|
|
|
- .eq(TAExamCourseRecord::getExamId,examId)
|
|
|
|
- .eq(TAExamCourseRecord::getTotalScore,0)
|
|
|
|
- .gt(TAExamCourseRecord::getAssignedScore,0));
|
|
|
|
- if (taExamCourseRecordList.size() > 0){
|
|
|
|
|
|
+ .eq(TAExamCourseRecord::getCourseCode, courseCode)
|
|
|
|
+ .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
+ .eq(TAExamCourseRecord::getTotalScore, 0)
|
|
|
|
+ .gt(TAExamCourseRecord::getAssignedScore, 0));
|
|
|
|
+ if (taExamCourseRecordList.size() > 0) {
|
|
List<Long> willDeleteTAExamCourseRecordIds = taExamCourseRecordList.stream().map(TAExamCourseRecord::getId).distinct().collect(Collectors.toList());
|
|
List<Long> willDeleteTAExamCourseRecordIds = taExamCourseRecordList.stream().map(TAExamCourseRecord::getId).distinct().collect(Collectors.toList());
|
|
List<String> willDeleteStudentCodeList = taExamCourseRecordList.stream().map(TAExamCourseRecord::getStudentCode).distinct().collect(Collectors.toList());
|
|
List<String> willDeleteStudentCodeList = taExamCourseRecordList.stream().map(TAExamCourseRecord::getStudentCode).distinct().collect(Collectors.toList());
|
|
List<Long> willDeleteExamRecordIdList = taExamCourseRecordList.stream().map(TAExamCourseRecord::getExamRecordId).distinct().collect(Collectors.toList());
|
|
List<Long> willDeleteExamRecordIdList = taExamCourseRecordList.stream().map(TAExamCourseRecord::getExamRecordId).distinct().collect(Collectors.toList());
|
|
@@ -1243,16 +1276,16 @@ public class BasicDatasourceController {
|
|
taExamCourseRecordService.removeByIds(willDeleteTAExamCourseRecordIds);
|
|
taExamCourseRecordService.removeByIds(willDeleteTAExamCourseRecordIds);
|
|
|
|
|
|
// 删除‘t_b_exam_student’
|
|
// 删除‘t_b_exam_student’
|
|
- if (willDeleteStudentCodeList.size() > 0){
|
|
|
|
- tbExamStudentService.remove(new QueryWrapper<TBExamStudent>().lambda().eq(TBExamStudent::getExamId,examId).eq(TBExamStudent::getCourseCode,courseCode).in(TBExamStudent::getStudentCode,willDeleteStudentCodeList).gt(TBExamStudent::getId,0));
|
|
|
|
|
|
+ if (willDeleteStudentCodeList.size() > 0) {
|
|
|
|
+ tbExamStudentService.remove(new QueryWrapper<TBExamStudent>().lambda().eq(TBExamStudent::getExamId, examId).eq(TBExamStudent::getCourseCode, courseCode).in(TBExamStudent::getStudentCode, willDeleteStudentCodeList).gt(TBExamStudent::getId, 0));
|
|
}
|
|
}
|
|
|
|
|
|
- if (willDeleteExamRecordIdList.size() > 0){
|
|
|
|
|
|
+ if (willDeleteExamRecordIdList.size() > 0) {
|
|
// 删除't_b_exam_record'
|
|
// 删除't_b_exam_record'
|
|
tbExamRecordService.removeByIds(willDeleteExamRecordIdList);
|
|
tbExamRecordService.removeByIds(willDeleteExamRecordIdList);
|
|
|
|
|
|
// 删除‘t_b_answer’
|
|
// 删除‘t_b_answer’
|
|
- tbAnswerService.remove(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId,willDeleteExamRecordIdList).gt(TBAnswer::getId,0));
|
|
|
|
|
|
+ tbAnswerService.remove(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId, willDeleteExamRecordIdList).gt(TBAnswer::getId, 0));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1261,7 +1294,6 @@ public class BasicDatasourceController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 更新或新增专业信息
|
|
* 更新或新增专业信息
|
|
*
|
|
*
|
|
@@ -1333,7 +1365,7 @@ public class BasicDatasourceController {
|
|
*/
|
|
*/
|
|
private void saveCollegeInfo(List<TBSchoolCollegeDto> tbSchoolCollegeDtoList) {
|
|
private void saveCollegeInfo(List<TBSchoolCollegeDto> tbSchoolCollegeDtoList) {
|
|
for (TBSchoolCollegeDto tbSchoolCollegeDto : tbSchoolCollegeDtoList) {
|
|
for (TBSchoolCollegeDto tbSchoolCollegeDto : tbSchoolCollegeDtoList) {
|
|
- sysOrgService.searchOrInsert(tbSchoolCollegeDto.getSchoolId(),tbSchoolCollegeDto.getCollegeName());
|
|
|
|
|
|
+ sysOrgService.searchOrInsert(tbSchoolCollegeDto.getSchoolId(), tbSchoolCollegeDto.getCollegeName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1372,4 +1404,52 @@ public class BasicDatasourceController {
|
|
sysUserService.saveUserNoAuth(userSaveParams);
|
|
sysUserService.saveUserNoAuth(userSaveParams);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 由于不同大学的教师数据在云阅卷中出现了不同的储存样式,为了解决这种问题进行统一处理
|
|
|
|
+ * 1.武汉大学:教师名称A
|
|
|
|
+ * 2.山东师范大学:教师编号A/教师名称A;教师编号B/教师名称B......
|
|
|
|
+ * 将教师信息统一处理成如下格式:
|
|
|
|
+ * teacherCode(教师编号):教师编号A;教师编号B......
|
|
|
|
+ * teacherName(教师名称):教师名称A:教师名称B......
|
|
|
|
+ *
|
|
|
|
+ * @param teacherInfo 教师信息
|
|
|
|
+ * @return 键值对
|
|
|
|
+ */
|
|
|
|
+ private Map<String, String> disposeTeacherInfo(String teacherInfo) {
|
|
|
|
+ String teacherName = "";
|
|
|
|
+ String teacherCode = "";
|
|
|
|
+ teacherInfo = teacherInfo.trim().replaceAll(";", ";").replaceAll("\\\\", "/");
|
|
|
|
+ String[] teacherInfoArr = teacherInfo.split(";");
|
|
|
|
+ for (String teacher : teacherInfoArr) {
|
|
|
|
+ String cellName = "";
|
|
|
|
+ String cellCode = "";
|
|
|
|
+ String[] cellArr = teacher.split("/");
|
|
|
|
+ if (cellArr.length == 1) {
|
|
|
|
+ cellName = cellArr[0];
|
|
|
|
+ } else if (cellArr.length == 2) {
|
|
|
|
+ cellCode = cellArr[0];
|
|
|
|
+ cellName = cellArr[1];
|
|
|
|
+ } else {
|
|
|
|
+ System.out.println("error");
|
|
|
|
+ }
|
|
|
|
+ if (SystemConstant.strNotNull(cellName)) {
|
|
|
|
+ teacherName = teacherName + cellName + ";";
|
|
|
|
+ }
|
|
|
|
+ if (SystemConstant.strNotNull(cellCode)) {
|
|
|
|
+ teacherCode = teacherCode + cellCode + ";";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (SystemConstant.strNotNull(teacherName)) {
|
|
|
|
+ teacherName = teacherName.substring(0, teacherName.length() - 1);
|
|
|
|
+ }
|
|
|
|
+ if (SystemConstant.strNotNull(teacherCode)) {
|
|
|
|
+ teacherCode = teacherCode.substring(0, teacherCode.length() - 1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("teacherName", teacherName);
|
|
|
|
+ map.put("teacherCode", teacherCode);
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
}
|
|
}
|