|
@@ -1,9 +1,9 @@
|
|
|
package com.qmth.teachcloud.report.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.qmth.teachcloud.common.contant.SpringContextHolder;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
+import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
|
import com.qmth.teachcloud.common.service.SysOrgService;
|
|
@@ -19,6 +19,8 @@ import com.qmth.teachcloud.report.business.utils.AnalyzeScopeUtil;
|
|
|
import com.qmth.teachcloud.report.business.utils.ConversionUtils;
|
|
|
import com.qmth.teachcloud.report.business.utils.MathUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -30,6 +32,7 @@ import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* @Description: 学生看板数据计算
|
|
@@ -108,11 +111,17 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
private TAExamCourseTeacherPaperStructService taExamCourseTeacherPaperStructService;
|
|
|
@Resource
|
|
|
private TAExamCourseTeacherCollegePaperStructService taExamCourseTeacherCollegePaperStructService;
|
|
|
+ @Resource
|
|
|
+ private TAExamCourseClazzTeacherService taExamCourseClazzTeacherService;
|
|
|
+ @Resource
|
|
|
+ private TBSchoolClazzService tbSchoolClazzService;
|
|
|
+
|
|
|
+ private final Logger log = LoggerFactory.getLogger(AnalyzeForReportServiceImpl.class);
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourse(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourse(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
|
// 考试下考生作答数据源
|
|
@@ -288,7 +297,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourse.setExamId(examId);
|
|
|
taExamCourse.setExamName(tbExam.getExamName());
|
|
|
taExamCourse.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourse.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourse.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourse.setSchoolId(tbExam.getSchoolId());
|
|
|
taExamCourse.setTeachCollegeId(teachCollegeId);
|
|
|
taExamCourse.setTeachCollegeName(teachCollegeName);
|
|
@@ -331,12 +340,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseList.add(taExamCourse);
|
|
|
}
|
|
|
taExamCourseService.saveBatch(taExamCourseList);
|
|
|
- return " 't_a_exam_course' 表构建完毕 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseRecord(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseRecord(Long examId, String courseCode) {
|
|
|
// 获取本次考试所有考试记录数据源
|
|
|
List<TAExamCourseRecord> taExamCourseRecordDatasource = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
|
.eq(TAExamCourseRecord::getExamId, examId)
|
|
@@ -378,12 +386,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
taExamCourseRecordService.saveOrUpdateBatch(dataSource);
|
|
|
}
|
|
|
- return " 't_a_exam_course_record' 表更新完成";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseCollegeInspect(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseCollegeInspect(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
List<TAExamCourseRecord> recordDatasource = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
|
.eq(TAExamCourseRecord::getExamId, examId));
|
|
@@ -449,7 +456,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseCollegeInspect.setExamId(examId);
|
|
|
taExamCourseCollegeInspect.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseCollegeInspect.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseCollegeInspect.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseCollegeInspect.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseCollegeInspect.setCollegeId(collegeId);
|
|
|
taExamCourseCollegeInspect.setMaxScore(BigDecimal.valueOf(maxScore));
|
|
|
taExamCourseCollegeInspect.setMinScore(BigDecimal.valueOf(minScore));
|
|
@@ -467,12 +474,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
}
|
|
|
taExamCourseCollegeInspectService.saveBatch(inspectCollegeList);
|
|
|
- return "t_a_exam_course_college_inspect";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseClazz(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseClazz(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
|
|
|
List<TAExamCourseRecord> recordDatasource = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
@@ -530,7 +536,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseClazz.setExamId(examId);
|
|
|
taExamCourseClazz.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseClazz.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseClazz.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseClazz.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseClazz.setClazzId(clazzId);
|
|
|
taExamCourseClazz.setMaxScore(BigDecimal.valueOf(maxScore));
|
|
|
taExamCourseClazz.setMinScore(BigDecimal.valueOf(minScore));
|
|
@@ -543,12 +549,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
}
|
|
|
taExamCourseClazzService.saveBatch(taExamCourseClazzList);
|
|
|
- return " 't_a_exam_course_clazz'表构建成功 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzePointScoreRate(Long examId, String courseCode) throws Exception {
|
|
|
+ public void buildAnalyzePointScoreRate(Long examId, String courseCode) throws Exception {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -669,7 +674,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseRecordDio.setStudentId(taExamCourseRecord.getStudentId());
|
|
|
taExamCourseRecordDio.setStudentCode(taExamCourseRecord.getStudentCode());
|
|
|
taExamCourseRecordDio.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseRecordDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseRecordDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
String[] dimCodeArr = s.split("-");
|
|
|
if (dimCodeArr.length != 2) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("获得的考查点标识不符合标准,标准为 type-dimensionCode,结果为: " + s);
|
|
@@ -722,7 +727,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseRecordMod.setExamId(taExamCourseRecord.getExamId());
|
|
|
taExamCourseRecordMod.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseRecordMod.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseRecordMod.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseRecordMod.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseRecordMod.setModuleType(s);
|
|
|
taExamCourseRecordMod.setTotalScore(BigDecimal.valueOf(studentScore));
|
|
|
taExamCourseRecordMod.setScoreRate(BigDecimal.valueOf(rate));
|
|
@@ -766,7 +771,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseDio.setExamId(examId);
|
|
|
taExamCourseDio.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseDio.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseDio.setPaperId(paperId);
|
|
|
taExamCourseDio.setDimensionType(dimensionType);
|
|
|
taExamCourseDio.setDimensionCode(dimensionCode);
|
|
@@ -829,12 +834,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseRecordModService.updateBatchById(examCourseRecordModList);
|
|
|
|
|
|
}
|
|
|
- return "维度表构建完毕";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseCollegeInspectDio(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseCollegeInspectDio(Long examId, String courseCode) {
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
@@ -845,12 +849,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
taExamCourseCollegeInspectDioService.insertByTAExamCourseRecordDio(examId, effectiveCourseCode);
|
|
|
}
|
|
|
- return "'t_a_exam_course_college_inspect_dio'表构建完成 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseTeacherDio(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseTeacherDio(Long examId, String courseCode) {
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
@@ -861,12 +864,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
taExamCourseTeacherDioService.insertByTAExamCourseRecordDio(examId, effectiveCourseCode);
|
|
|
}
|
|
|
- return "'t_a_exam_course_teacher_dio'表构建完成 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseTeacherCollegeDio(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseTeacherCollegeDio(Long examId, String courseCode) {
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
@@ -877,12 +879,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
taExamCourseTeacherCollegeDioService.insertByTAExamCourseRecordDio(examId, effectiveCourseCode);
|
|
|
}
|
|
|
- return "'t_a_exam_course_teacher_college_dio'表构建完成 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzePaperStruct(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzePaperStruct(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -944,7 +945,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taPaperStruct.setExamId(examId);
|
|
|
taPaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taPaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taPaperStruct.setPaperId(paperId);
|
|
|
taPaperStruct.setPaperType(paperType);
|
|
|
taPaperStruct.setQuestionName(paperStruct.getQuestionName());
|
|
@@ -968,12 +969,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
taPaperStructService.saveBatch(taPaperStructList);
|
|
|
}
|
|
|
- return " 't_a_paper_struct'表构建成功 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeCollegePaperStruct(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeCollegePaperStruct(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1043,7 +1043,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseCollegePaperStruct.setExamId(examId);
|
|
|
taExamCourseCollegePaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseCollegePaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseCollegePaperStruct.setPaperId(paperId);
|
|
|
taExamCourseCollegePaperStruct.setInspectCollegeId(inspectCollegeId);
|
|
|
taExamCourseCollegePaperStruct.setInspectCollegeName(inspectCollegeName);
|
|
@@ -1070,12 +1070,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
taExamCourseCollegePaperStructService.saveBatch(taExamCourseCollegePaperStructList);
|
|
|
}
|
|
|
- return "'t_a_exam_course_college_paper_struct'表构建成功 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeTeacherPaperStruct(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeTeacherPaperStruct(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1145,7 +1144,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherPaperStruct.setExamId(examId);
|
|
|
taExamCourseTeacherPaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseTeacherPaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherPaperStruct.setPaperId(paperId);
|
|
|
taExamCourseTeacherPaperStruct.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherPaperStruct.setTeacherName(teacherName);
|
|
@@ -1172,12 +1171,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
taExamCourseTeacherPaperStructService.saveBatch(taExamCourseTeacherPaperStructList);
|
|
|
}
|
|
|
- return "'t_a_exam_course_teacher_paper_struct'表构建成功 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeTeacherCollegePaperStruct(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeTeacherCollegePaperStruct(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1263,7 +1261,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherCollegePaperStruct.setExamId(examId);
|
|
|
taExamCourseTeacherCollegePaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseTeacherCollegePaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherCollegePaperStruct.setPaperId(paperId);
|
|
|
taExamCourseTeacherCollegePaperStruct.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherCollegePaperStruct.setTeacherName(teacherName);
|
|
@@ -1294,12 +1292,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
taExamCourseTeacherCollegePaperStructService.saveBatch(tAExamCourseTeacherCollegePaperStructList);
|
|
|
}
|
|
|
- return "'t_a_exam_course_teacher_college_paper_struct'表构建成功 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildExamPaperDifficult(Long examId, String courseCode) {
|
|
|
+ public void buildExamPaperDifficult(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1366,7 +1363,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseDifficult.setId(SystemConstant.getDbUuid());
|
|
|
taExamCourseDifficult.setExamId(examId);
|
|
|
taExamCourseDifficult.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseDifficult.setPaperId(paperId);
|
|
|
taExamCourseDifficult.setPaperType(tbPaperService.getById(paperId).getPaperType());
|
|
|
taExamCourseDifficult.setCollegeId(collegeId);
|
|
@@ -1384,13 +1381,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
taExamCourseDifficultService.saveBatch(taExamCourseDifficultList);
|
|
|
}
|
|
|
-
|
|
|
- return "'t_a_exam_course_difficult' 表构建完成";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildExamPaperTeacherDifficult(Long examId, String courseCode) {
|
|
|
+ public void buildExamPaperTeacherDifficult(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1459,7 +1454,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherDifficult.setPaperId(paperId);
|
|
|
taExamCourseTeacherDifficult.setPaperType(tbPaperService.getById(paperId).getPaperType());
|
|
|
taExamCourseTeacherDifficult.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherDifficult.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherDifficult.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseTeacherDifficult.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
@@ -1476,13 +1471,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
taExamCourseTeacherDifficultService.saveBatch(taExamCourseTeacherDifficultList);
|
|
|
}
|
|
|
-
|
|
|
- return "'t_a_exam_course_teacher_difficult' 表构建完成";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseTeacherCollegeDifficult(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseTeacherCollegeDifficult(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1575,7 +1568,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherCollegeDifficult.setPaperId(paperId);
|
|
|
taExamCourseTeacherCollegeDifficult.setPaperType(tbPaperService.getById(paperId).getPaperType());
|
|
|
taExamCourseTeacherCollegeDifficult.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherCollegeDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherCollegeDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherCollegeDifficult.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherCollegeDifficult.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseTeacherCollegeDifficult.setInspectCollegeId(collegeId);
|
|
@@ -1597,13 +1590,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
taExamCourseTeacherCollegeDifficultService.saveBatch(taExamCourseTeacherCollegeDifficultList);
|
|
|
}
|
|
|
-
|
|
|
- return "'t_a_exam_course_teacher_college_difficult' 表构建完成";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamTotal(Long examId) {
|
|
|
+ public void buildAnalyzeExamTotal(Long examId) {
|
|
|
// 删除原数据
|
|
|
taExamTotalService.remove(new QueryWrapper<TAExamTotal>().lambda()
|
|
|
.eq(TAExamTotal::getExamId, examId));
|
|
@@ -1671,12 +1662,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamTotal.setExamTime(examTime);
|
|
|
|
|
|
taExamTotalService.save(taExamTotal);
|
|
|
- return " 't_a_exam_total'表构建完毕 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseCollegeTeacher(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseCollegeTeacher(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1816,7 +1806,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseCollegeTeacher.setExamId(examId);
|
|
|
taExamCourseCollegeTeacher.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseCollegeTeacher.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseCollegeTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseCollegeTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseCollegeTeacher.setTeacherId(teacherId);
|
|
|
taExamCourseCollegeTeacher.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseCollegeTeacher.setMinScoreAssign(BigDecimal.valueOf(minScoreAssign));
|
|
@@ -1860,14 +1850,237 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
}
|
|
|
taExamCourseCollegeTeacherService.saveBatch(taExamCourseCollegeTeacherList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void buildAnalyzeExamCourseClazzTeacher(Long examId, String courseCode) {
|
|
|
+ Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
+ // 可分析有效课程信息
|
|
|
+ List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
|
+ for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
|
+ // 删除该课程原有分析
|
|
|
+ taExamCourseClazzTeacherService.remove(new QueryWrapper<TAExamCourseClazzTeacher>().lambda()
|
|
|
+ .eq(TAExamCourseClazzTeacher::getExamId, examId)
|
|
|
+ .eq(TAExamCourseClazzTeacher::getCourseCode, effectiveCourseCode));
|
|
|
+
|
|
|
+ List<TAExamCourseClazzTeacher> taExamCourseClazzTeacherList = new ArrayList<>();
|
|
|
+ // 整体该课程下数据源
|
|
|
+ List<TAExamCourseRecord> dataSource = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
|
+ .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
+ .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode));
|
|
|
+
|
|
|
+ // 授课班级
|
|
|
+ Set<Long> clazzIdSet = dataSource.stream().map(TAExamCourseRecord::getClazzId).collect(Collectors.toSet());
|
|
|
+
|
|
|
+
|
|
|
+ for (Long clazzId : clazzIdSet) {
|
|
|
+ // 该班级下授课教师
|
|
|
+ Set<Long> teacherIdSet = dataSource.stream()
|
|
|
+ .filter(e -> clazzId.equals(e.getClazzId()) && e.getStudentCurrent() && !e.getAbsent())
|
|
|
+ .map(TAExamCourseRecord::getTeacherId)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+
|
|
|
+ // 教师人数
|
|
|
+ for (Long teacherId : teacherIdSet) {
|
|
|
+ // 该教师数据
|
|
|
+ // ----- 教师在本院学生数据 ------
|
|
|
+ List<TAExamCourseRecord> teacherRecordList = dataSource.stream()
|
|
|
+ .filter(e -> clazzId.equals(e.getClazzId()) && teacherId.equals(e.getTeacherId()) && e.getStudentCurrent())
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 学生人数
|
|
|
+ int totalCount = teacherRecordList.size();
|
|
|
+ List<TAExamCourseRecord> teacherEffectiveList = teacherRecordList.stream().filter(e -> !e.getAbsent()).collect(Collectors.toList());
|
|
|
+ int realityCount = teacherEffectiveList.size();
|
|
|
+ if (realityCount == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ int absentCount = totalCount - realityCount;
|
|
|
+
|
|
|
+ // 成绩统计
|
|
|
+ DoubleSummaryStatistics describeStatistic = teacherEffectiveList.stream()
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getAssignedScore().doubleValue())); // 学生赋分的描述统计
|
|
|
+ double minScoreAssign = describeStatistic.getMin();
|
|
|
+ double maxScoreAssign = describeStatistic.getMax();
|
|
|
+ double avgScoreAssign = describeStatistic.getAverage();
|
|
|
+ double avgScore = teacherEffectiveList.stream()
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getTotalScore().doubleValue())).getAverage();
|
|
|
+ double objAvgScore = teacherEffectiveList.stream()
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getObjectiveScore().doubleValue())).getAverage();
|
|
|
+ double subAvgScore = teacherEffectiveList.stream()
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getSubjectiveScore().doubleValue())).getAverage();
|
|
|
+ List<Double> assignedScore = teacherEffectiveList.stream().map(e -> e.getAssignedScore().doubleValue()).collect(Collectors.toList());
|
|
|
+ // 计算上四分位数
|
|
|
+ double upperQuartile = MathUtil.calculateQuantile(assignedScore, QuantileEnum.UPPER_QUARTILE.getValue());
|
|
|
+
|
|
|
+ // 计算中位数
|
|
|
+ double median = MathUtil.calculateQuantile(assignedScore, QuantileEnum.MEDIAN.getValue());
|
|
|
|
|
|
+ // 计算下四分位数
|
|
|
+ double lowerQuartile = MathUtil.calculateQuantile(assignedScore, QuantileEnum.LOWER_QUARTILE.getValue());
|
|
|
+
|
|
|
+ // 极端情况下分位数值处理
|
|
|
+ if (upperQuartile == 0) {
|
|
|
+ upperQuartile = median;
|
|
|
+ }
|
|
|
+ if (lowerQuartile == 0) {
|
|
|
+ lowerQuartile = median;
|
|
|
+ }
|
|
|
+
|
|
|
+ String mode = MathUtil.calculateMode(assignedScore); // 众数
|
|
|
+ double standardDeviation = MathUtil.calculateStandardDeviation(assignedScore); // 标准差
|
|
|
+
|
|
|
+ double relativePosition = teacherEffectiveList.stream()
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getStandardizedCoefficients().doubleValue())).getAverage(); // 相对位置
|
|
|
+
|
|
|
+
|
|
|
+ // ----- 教师在其他班级数据 -----
|
|
|
+ List<TAExamCourseRecord> teacherRecordOtherClazzList = dataSource.stream()
|
|
|
+ .filter(e -> !clazzId.equals(e.getClazzId()) && teacherId.equals(e.getTeacherId()) && e.getStudentCurrent())
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 学生人数
|
|
|
+ int otherClazzTotalCount = teacherRecordOtherClazzList.size();
|
|
|
+ List<TAExamCourseRecord> teacherEffectiveOtherClazzList = teacherRecordOtherClazzList.stream().filter(e -> !e.getAbsent()).collect(Collectors.toList());
|
|
|
+ int otherClazzRealityCount = teacherEffectiveOtherClazzList.size();
|
|
|
+ int otherClazzAbsentCount = otherClazzTotalCount - otherClazzRealityCount;
|
|
|
+
|
|
|
+ // 成绩统计
|
|
|
+ DoubleSummaryStatistics otherClazzDescribeStatistic = teacherEffectiveOtherClazzList.stream()
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getAssignedScore().doubleValue())); // 学生赋分的描述统计
|
|
|
+ double otherClazzMinScoreAssign = otherClazzDescribeStatistic.getMin();
|
|
|
+ double otherClazzMaxScoreAssign = otherClazzDescribeStatistic.getMax();
|
|
|
+ if (otherClazzRealityCount == 0) {
|
|
|
+ otherClazzMinScoreAssign = 0;
|
|
|
+ otherClazzMaxScoreAssign = 0;
|
|
|
+ }
|
|
|
+ double otherClazzAvgScoreAssign = otherClazzDescribeStatistic.getAverage();
|
|
|
+ double otherClazzAvgScore = teacherEffectiveOtherClazzList.stream()
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getTotalScore().doubleValue())).getAverage();
|
|
|
+ List<Double> otherClazzAssignedScore = teacherEffectiveOtherClazzList.stream().map(e -> e.getAssignedScore().doubleValue()).collect(Collectors.toList());
|
|
|
+ // 计算上四分位数
|
|
|
+ double otherClazzUpperQuartile = MathUtil.calculateQuantile(otherClazzAssignedScore, QuantileEnum.UPPER_QUARTILE.getValue());
|
|
|
+
|
|
|
+ // 计算中位数
|
|
|
+ double otherClazzMedian = MathUtil.calculateQuantile(otherClazzAssignedScore, QuantileEnum.MEDIAN.getValue());
|
|
|
+
|
|
|
+ // 计算下四分位数
|
|
|
+ double otherClazzLowerQuartile = MathUtil.calculateQuantile(otherClazzAssignedScore, QuantileEnum.LOWER_QUARTILE.getValue());
|
|
|
+
|
|
|
+ // 极端情况下分位数值处理
|
|
|
+ if (otherClazzUpperQuartile == 0) {
|
|
|
+ otherClazzUpperQuartile = otherClazzMedian;
|
|
|
+ }
|
|
|
+ if (otherClazzLowerQuartile == 0) {
|
|
|
+ otherClazzLowerQuartile = otherClazzMedian;
|
|
|
+ }
|
|
|
+
|
|
|
+ String otherClazzMode = MathUtil.calculateMode(otherClazzAssignedScore); // 众数
|
|
|
+
|
|
|
+
|
|
|
+ // 开课学院数据
|
|
|
+ List<Long> teachCollegeIdList = teacherEffectiveList.stream().map(TAExamCourseRecord::getTeachCollegeId).distinct().collect(Collectors.toList());
|
|
|
+ if (teachCollegeIdList.size() > 1) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("有多个开课学院");
|
|
|
+ }
|
|
|
+ Long teachCollegeId = teachCollegeIdList.get(0);
|
|
|
+ String teachCollegeName = SystemConstant.DEFAULT_SIGN;
|
|
|
+ if (teachCollegeId > 0) {
|
|
|
+ teachCollegeName = sysOrgService.getById(teachCollegeId).getName();
|
|
|
+ }
|
|
|
+ // ↓主体考察学院数据(班级内绝大多数学生所在的学院为主体考察学院,排名也按照这个来)
|
|
|
+ Map<Long, Integer> inspectCollegeMap = teacherEffectiveList.stream()
|
|
|
+ .sorted(Comparator.comparing(TAExamCourseRecord::getInspectCollegeId))
|
|
|
+ .collect(Collectors.toMap(TAExamCourseRecord::getInspectCollegeId, e -> 1, Integer::sum));
|
|
|
+ // 主体学院id集合
|
|
|
+ List<Long> mainCollegeIdList = new ArrayList<>();
|
|
|
+ List<Integer> countList = inspectCollegeMap.keySet().stream().flatMap(k -> {
|
|
|
+ Integer v = inspectCollegeMap.get(k);
|
|
|
+ return Stream.of(v);
|
|
|
+ }).sorted(Comparator.reverseOrder()).collect(Collectors.toList());
|
|
|
+ Integer max = countList.get(0);
|
|
|
+
|
|
|
+ mainCollegeIdList = inspectCollegeMap.keySet()
|
|
|
+ .stream()
|
|
|
+ .filter(e -> Objects.equals(max,inspectCollegeMap.get(e)))
|
|
|
+ .sorted()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ // 主体学院id 逗号隔开
|
|
|
+ String mainCollegeIds = mainCollegeIdList.stream().map(String::valueOf).collect(Collectors.joining(","));
|
|
|
+ // 主体学院名称 逗号隔开
|
|
|
+ String mainCollegeNames = mainCollegeIdList.stream().flatMap(e -> {
|
|
|
+ SysOrg sysOrg = sysOrgService.getById(e);
|
|
|
+ if (Objects.isNull(sysOrg)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("未找到机构信息");
|
|
|
+ }
|
|
|
+ return Stream.of(sysOrg.getName());
|
|
|
+ }).collect(Collectors.joining(","));
|
|
|
+
|
|
|
+
|
|
|
+ TAExamCourseClazzTeacher taExamCourseClazzTeacher = new TAExamCourseClazzTeacher();
|
|
|
+ taExamCourseClazzTeacher.setId(SystemConstant.getDbUuid());
|
|
|
+ taExamCourseClazzTeacher.setExamId(examId);
|
|
|
+ taExamCourseClazzTeacher.setClazzId(clazzId);
|
|
|
+ taExamCourseClazzTeacher.setClazzCode(tbSchoolClazzService.getById(clazzId).getClazzCode());
|
|
|
+ taExamCourseClazzTeacher.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
+ taExamCourseClazzTeacher.setCourseCode(effectiveCourseCode);
|
|
|
+ taExamCourseClazzTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
+ taExamCourseClazzTeacher.setTeacherId(teacherId);
|
|
|
+ SysUser teacher = sysUserService.getById(teacherId);
|
|
|
+ if (Objects.nonNull(teacher)){
|
|
|
+ taExamCourseClazzTeacher.setTeacherName(teacher.getRealName());
|
|
|
+ }
|
|
|
+ taExamCourseClazzTeacher.setObjAvgScore(BigDecimal.valueOf(objAvgScore));
|
|
|
+ taExamCourseClazzTeacher.setSubAvgScore(BigDecimal.valueOf(subAvgScore));
|
|
|
+ taExamCourseClazzTeacher.setMinScoreAssign(BigDecimal.valueOf(minScoreAssign));
|
|
|
+ taExamCourseClazzTeacher.setMaxScoreAssign(BigDecimal.valueOf(maxScoreAssign));
|
|
|
+ taExamCourseClazzTeacher.setAvgScoreAssign(BigDecimal.valueOf(avgScoreAssign));
|
|
|
+ taExamCourseClazzTeacher.setAvgScore(BigDecimal.valueOf(avgScore));
|
|
|
+ taExamCourseClazzTeacher.setUpperQuartile(BigDecimal.valueOf(upperQuartile));
|
|
|
+ taExamCourseClazzTeacher.setMedian(BigDecimal.valueOf(median));
|
|
|
+ taExamCourseClazzTeacher.setLowerQuartile(BigDecimal.valueOf(lowerQuartile));
|
|
|
+ taExamCourseClazzTeacher.setMode(mode);
|
|
|
+ taExamCourseClazzTeacher.setStandardDeviation(BigDecimal.valueOf(standardDeviation));
|
|
|
+ taExamCourseClazzTeacher.setRelativePosition(BigDecimal.valueOf(relativePosition));
|
|
|
+ taExamCourseClazzTeacher.setRealityCount(realityCount);
|
|
|
+ taExamCourseClazzTeacher.setTotalCount(totalCount);
|
|
|
+ taExamCourseClazzTeacher.setAbsentCount(absentCount);
|
|
|
+ taExamCourseClazzTeacher.setMainCollegeIds(mainCollegeIds);
|
|
|
+ taExamCourseClazzTeacher.setMainCollegeNames(mainCollegeNames);
|
|
|
+ taExamCourseClazzTeacher.setTeachCollegeId(teachCollegeId);
|
|
|
+ taExamCourseClazzTeacher.setTeachCollegeName(teachCollegeName);
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzMinScoreAssign(BigDecimal.valueOf(otherClazzMinScoreAssign));
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzMaxScoreAssign(BigDecimal.valueOf(otherClazzMaxScoreAssign));
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzAvgScoreAssign(BigDecimal.valueOf(otherClazzAvgScoreAssign));
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzUpperQuartile(BigDecimal.valueOf(otherClazzUpperQuartile));
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzMedian(BigDecimal.valueOf(otherClazzMedian));
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzLowerQuartile(BigDecimal.valueOf(otherClazzLowerQuartile));
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzMode(otherClazzMode);
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzRealityCount(otherClazzRealityCount);
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzAbsentCount(otherClazzAbsentCount);
|
|
|
+ taExamCourseClazzTeacher.setOtherClazzTotalCount(otherClazzTotalCount);
|
|
|
+ taExamCourseClazzTeacherList.add(taExamCourseClazzTeacher);
|
|
|
+ }
|
|
|
+ // 计算教师排名(按照主体学院排名)
|
|
|
+ for (TAExamCourseClazzTeacher taExamCourseClazzTeacher : taExamCourseClazzTeacherList) {
|
|
|
+ // 主体学院
|
|
|
+ String mainCollegeIds = taExamCourseClazzTeacher.getMainCollegeIds();
|
|
|
+ List<TAExamCourseClazzTeacher> rankTempList = taExamCourseClazzTeacherList.stream().filter(e -> mainCollegeIds.equals(e.getMainCollegeIds())).collect(Collectors.toList());
|
|
|
+ int teacherCount = rankTempList.size();
|
|
|
+ BigDecimal thisAvgScoreAssign = taExamCourseClazzTeacher.getAvgScoreAssign();
|
|
|
+ int rank = (int) (rankTempList.stream().filter(e -> (e.getAvgScoreAssign().setScale(SystemConstant.FINAL_SCALE, RoundingMode.HALF_UP)).compareTo(thisAvgScoreAssign.setScale(SystemConstant.FINAL_SCALE, RoundingMode.HALF_UP)) > 0).count() + 1);
|
|
|
+ taExamCourseClazzTeacher.setTeacherRank(rank);
|
|
|
+ taExamCourseClazzTeacher.setTeacherCount(teacherCount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ taExamCourseClazzTeacherService.saveBatch(taExamCourseClazzTeacherList);
|
|
|
}
|
|
|
- return " 't_a_exam_course_college_teacher' 表构建我那成";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamCourseTeacher(Long examId, String courseCode) {
|
|
|
+ public void buildAnalyzeExamCourseTeacher(Long examId, String courseCode) {
|
|
|
Long schoolId = tbExamService.findSchoolIdByExamId(examId);
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
@@ -1929,7 +2142,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacher.setExamId(examId);
|
|
|
taExamCourseTeacher.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseTeacher.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacher.setTeacherId(teacherId);
|
|
|
taExamCourseTeacher.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseTeacher.setMinScore(BigDecimal.valueOf(minScore));
|
|
@@ -1948,12 +2161,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
}
|
|
|
taExamCourseTeacherService.saveBatch(taExamCourseTeacherList);
|
|
|
}
|
|
|
- return " 't_a_exam_course_teacher'表构建完毕 ";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String updateCoursePublishStatus(Long examId, String courseCode, PublishStatusEnum publishStatusEnum) {
|
|
|
+ public void updateCoursePublishStatus(Long examId, String courseCode, PublishStatusEnum publishStatusEnum) {
|
|
|
// 可分析有效课程信息
|
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
|
List<TBExamCourse> tbExamCourseList = new ArrayList<>();
|
|
@@ -1965,31 +2177,30 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
tbExamCourseList.add(tbExamCourse);
|
|
|
}
|
|
|
tbExamCourseService.updateBatchById(tbExamCourseList);
|
|
|
- return " 't_b_exam_course' 表状态更新完成";
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public void dataCalculate(Long examId, String courseCode) throws Exception {
|
|
|
- AnalyzeForReportService analyzeForReportService = SpringContextHolder.getBean(AnalyzeForReportService.class);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourse(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseRecord(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseCollegeInspect(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseClazz(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzePointScoreRate(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseCollegeInspectDio(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseTeacherDio(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzePaperStruct(examId, courseCode);
|
|
|
- analyzeForReportService.buildExamPaperDifficult(examId, courseCode);
|
|
|
- analyzeForReportService.buildExamPaperTeacherDifficult(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamTotal(examId);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseCollegeTeacher(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseTeacher(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseTeacherCollegeDio(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamCourseTeacherCollegeDifficult(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeCollegePaperStruct(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeTeacherPaperStruct(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeTeacherCollegePaperStruct(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourse(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseRecord(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseCollegeInspect(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseClazz(examId, courseCode);
|
|
|
+ this.buildAnalyzePointScoreRate(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseCollegeInspectDio(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseTeacherDio(examId, courseCode);
|
|
|
+ this.buildAnalyzePaperStruct(examId, courseCode);
|
|
|
+ this.buildExamPaperDifficult(examId, courseCode);
|
|
|
+ this.buildExamPaperTeacherDifficult(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamTotal(examId);
|
|
|
+ this.buildAnalyzeExamCourseCollegeTeacher(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseClazzTeacher(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseTeacher(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseTeacherCollegeDio(examId, courseCode);
|
|
|
+ this.buildAnalyzeExamCourseTeacherCollegeDifficult(examId, courseCode);
|
|
|
+ this.buildAnalyzeCollegePaperStruct(examId, courseCode);
|
|
|
+ this.buildAnalyzeTeacherPaperStruct(examId, courseCode);
|
|
|
+ this.buildAnalyzeTeacherCollegePaperStruct(examId, courseCode);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -2032,7 +2243,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
// 获取当前课程下所有学生考试成绩记录
|
|
|
List<BasicExamRecordDto> basicExamRecordDtoDatasource = tbExamRecordService.findByExamIdAndCourseCodeS(examId, courseCodeList);
|
|
|
for (String s : courseCodeList) {
|
|
|
- if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, s, basicCourseService.findByCourseCode(s,schoolId).getName())) {
|
|
|
+ if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, s, basicCourseService.findByCourseCode(s, schoolId).getName())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号[" + s + "]的课程分析数据已测试或发布,不能变更基础数据");
|
|
|
}
|
|
|
List<BasicExamRecordDto> basicExamRecordDtoList = basicExamRecordDtoDatasource.stream()
|
|
@@ -2055,8 +2266,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
BigDecimal myScore = basicExamRecordDto.getTotalScore();
|
|
|
BigDecimal coefficient = tbPaper.getCoefficient();
|
|
|
BigDecimal assignScore;
|
|
|
- // 当该试卷的赋分系数不为0时赋分
|
|
|
- if (coefficient != null && coefficient.compareTo(BigDecimal.ZERO) > 0 && !absent) {
|
|
|
+ // 当该试卷的赋分系数不为0且,不缺考,原卷不为0分时赋分
|
|
|
+ if (coefficient != null && coefficient.compareTo(BigDecimal.ZERO) > 0 && !absent && myScore.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
assignScore = myScore.add((fullScore.subtract(myScore)).divide(coefficient, 4, RoundingMode.HALF_UP)).setScale(0, RoundingMode.HALF_UP);
|
|
|
} else {
|
|
|
assignScore = myScore;
|
|
@@ -2078,6 +2289,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseRecord.setTeachCollegeId(basicExamRecordDto.getTeachCollegeId());
|
|
|
taExamCourseRecord.setInspectCollegeId(basicExamRecordDto.getInspectCollegeId());
|
|
|
taExamCourseRecord.setMajorId(basicExamRecordDto.getMajorId());
|
|
|
+ taExamCourseRecord.setObjectiveScore(basicExamRecordDto.getObjectiveScore());
|
|
|
+ taExamCourseRecord.setSubjectiveScore(basicExamRecordDto.getSubjectiveScore());
|
|
|
taExamCourseRecord.setTotalScore(myScore);
|
|
|
taExamCourseRecord.setAbsent(absent);
|
|
|
taExamCourseRecord.setStudentCurrent(basicExamRecordDto.getStudentCurrent());
|