|
@@ -27,6 +27,7 @@ import java.lang.reflect.Field;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Method;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.math.RoundingMode;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -135,13 +136,13 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
// 满分
|
|
// 满分
|
|
BigDecimal totalScore = tbPaper.getTotalScore();
|
|
BigDecimal totalScore = tbPaper.getTotalScore();
|
|
// 赋分系数
|
|
// 赋分系数
|
|
- String coefficient = "";
|
|
|
|
|
|
+ String coefficient;
|
|
BigDecimal paperCoefficient = tbPaper.getCoefficient();
|
|
BigDecimal paperCoefficient = tbPaper.getCoefficient();
|
|
paperCoefficient = paperCoefficient.stripTrailingZeros();
|
|
paperCoefficient = paperCoefficient.stripTrailingZeros();
|
|
AssignEnum assignEnum = tbPaper.getScoreType();
|
|
AssignEnum assignEnum = tbPaper.getScoreType();
|
|
- if (AssignEnum.SPECIAL_ASSIGN_SCORE.equals(assignEnum)){
|
|
|
|
|
|
+ if (AssignEnum.SPECIAL_ASSIGN_SCORE.equals(assignEnum)) {
|
|
coefficient = SystemConstant.DEFAULT_SIGN;
|
|
coefficient = SystemConstant.DEFAULT_SIGN;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
coefficient = paperCoefficient.toPlainString();
|
|
coefficient = paperCoefficient.toPlainString();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -163,14 +164,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
DoubleSummaryStatistics totalStatistics = totalScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
DoubleSummaryStatistics totalStatistics = totalScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
double avgScore = totalStatistics.getAverage();
|
|
double avgScore = totalStatistics.getAverage();
|
|
long passCount = totalScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
long passCount = totalScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
- BigDecimal passRate = BigDecimal.valueOf(passCount).divide(BigDecimal.valueOf(realityCount), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal passRate = BigDecimal.valueOf(passCount).divide(BigDecimal.valueOf(realityCount), 4, RoundingMode.HALF_UP);
|
|
|
|
|
|
// -------------------卷面分------------------------
|
|
// -------------------卷面分------------------------
|
|
List<Double> paperTotalScoreList = totalDatasource.stream().filter(e -> !e.getAbsent()).map(e -> e.getTotalScore().doubleValue()).collect(Collectors.toList());
|
|
List<Double> paperTotalScoreList = totalDatasource.stream().filter(e -> !e.getAbsent()).map(e -> e.getTotalScore().doubleValue()).collect(Collectors.toList());
|
|
DoubleSummaryStatistics paperTotalStatistics = paperTotalScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
DoubleSummaryStatistics paperTotalStatistics = paperTotalScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
double paperAvgScore = paperTotalStatistics.getAverage();
|
|
double paperAvgScore = paperTotalStatistics.getAverage();
|
|
long paperPassCount = paperTotalScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
long paperPassCount = paperTotalScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
- BigDecimal paperPassRate = BigDecimal.valueOf(paperPassCount).divide(BigDecimal.valueOf(realityCount), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal paperPassRate = BigDecimal.valueOf(paperPassCount).divide(BigDecimal.valueOf(realityCount), 4, RoundingMode.HALF_UP);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -186,7 +187,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
if (pastTotalCount != pastRealityCount + pastAbsentCount) {
|
|
if (pastTotalCount != pastRealityCount + pastAbsentCount) {
|
|
throw ExceptionResultEnum.ERROR.exception("考试往届生人数数据异常");
|
|
throw ExceptionResultEnum.ERROR.exception("考试往届生人数数据异常");
|
|
}
|
|
}
|
|
- BigDecimal pastRealityRate = BigDecimal.valueOf(pastRealityCount).divide(BigDecimal.valueOf(realityCount), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal pastRealityRate = BigDecimal.valueOf(pastRealityCount).divide(BigDecimal.valueOf(realityCount), 4, RoundingMode.HALF_UP);
|
|
|
|
|
|
/*
|
|
/*
|
|
该课程应届生成绩分析
|
|
该课程应届生成绩分析
|
|
@@ -201,13 +202,13 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
if (currentTotalCount != currentRealityCount + currentAbsentCount) {
|
|
if (currentTotalCount != currentRealityCount + currentAbsentCount) {
|
|
throw ExceptionResultEnum.ERROR.exception("考试应届生人数数据异常");
|
|
throw ExceptionResultEnum.ERROR.exception("考试应届生人数数据异常");
|
|
}
|
|
}
|
|
- BigDecimal currentRealityRate = BigDecimal.valueOf(currentRealityCount).divide(BigDecimal.valueOf(realityCount), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal currentRealityRate = BigDecimal.valueOf(currentRealityCount).divide(BigDecimal.valueOf(realityCount), 4, RoundingMode.HALF_UP);
|
|
|
|
|
|
// 通过率统计
|
|
// 通过率统计
|
|
List<Double> currentScoreList = currentDatasource.stream().filter(e -> !e.getAbsent()).map(e -> e.getAssignedScore().doubleValue()).collect(Collectors.toList());
|
|
List<Double> currentScoreList = currentDatasource.stream().filter(e -> !e.getAbsent()).map(e -> e.getAssignedScore().doubleValue()).collect(Collectors.toList());
|
|
DoubleSummaryStatistics currentStatistics = currentScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
DoubleSummaryStatistics currentStatistics = currentScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
long currentPassCount = currentScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
long currentPassCount = currentScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
- BigDecimal currentPassRate = BigDecimal.valueOf(currentPassCount).divide(BigDecimal.valueOf(currentRealityCount), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal currentPassRate = BigDecimal.valueOf(currentPassCount).divide(BigDecimal.valueOf(currentRealityCount), 4, RoundingMode.HALF_UP);
|
|
|
|
|
|
// 描述统计
|
|
// 描述统计
|
|
double currentMinScore = currentStatistics.getMin();
|
|
double currentMinScore = currentStatistics.getMin();
|
|
@@ -236,19 +237,19 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
BigDecimal scoreRate;
|
|
BigDecimal scoreRate;
|
|
double standardAvgScore = currentDatasource.stream().collect(Collectors.summarizingDouble(e -> e.getTotalScore().doubleValue())).getAverage();
|
|
double standardAvgScore = currentDatasource.stream().collect(Collectors.summarizingDouble(e -> e.getTotalScore().doubleValue())).getAverage();
|
|
if (standardAvgScore != 0 && totalScore.compareTo(BigDecimal.ZERO) > 0) {
|
|
if (standardAvgScore != 0 && totalScore.compareTo(BigDecimal.ZERO) > 0) {
|
|
- scoreRate = BigDecimal.valueOf(standardAvgScore).divide(totalScore, 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ scoreRate = BigDecimal.valueOf(standardAvgScore).divide(totalScore, 4, RoundingMode.HALF_UP);
|
|
} else {
|
|
} else {
|
|
scoreRate = BigDecimal.ZERO;
|
|
scoreRate = BigDecimal.ZERO;
|
|
}
|
|
}
|
|
// 难度系数保留1位数
|
|
// 难度系数保留1位数
|
|
- scoreRate = scoreRate.setScale(1, BigDecimal.ROUND_HALF_UP); // 难度系数保留1位有效数字
|
|
|
|
|
|
+ scoreRate = scoreRate.setScale(1, RoundingMode.HALF_UP); // 难度系数保留1位有效数字
|
|
String difficulty = this.handleLevel(examId, effectiveCourseCode, "难度等级", scoreRate.doubleValue());
|
|
String difficulty = this.handleLevel(examId, effectiveCourseCode, "难度等级", scoreRate.doubleValue());
|
|
//--------------------------应届-卷面成绩-----------------------
|
|
//--------------------------应届-卷面成绩-----------------------
|
|
List<Double> paperCurrentScoreList = currentDatasource.stream().filter(e -> !e.getAbsent()).map(e -> e.getTotalScore().doubleValue()).collect(Collectors.toList());
|
|
List<Double> paperCurrentScoreList = currentDatasource.stream().filter(e -> !e.getAbsent()).map(e -> e.getTotalScore().doubleValue()).collect(Collectors.toList());
|
|
DoubleSummaryStatistics paperCurrentStatistics = paperCurrentScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
DoubleSummaryStatistics paperCurrentStatistics = paperCurrentScoreList.stream().collect(Collectors.summarizingDouble(e -> e));
|
|
double paperCurrentAvgScore = paperCurrentStatistics.getAverage();
|
|
double paperCurrentAvgScore = paperCurrentStatistics.getAverage();
|
|
long paperCurrentPassCount = paperCurrentScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
long paperCurrentPassCount = paperCurrentScoreList.stream().filter(e -> e >= passScore.doubleValue()).count();
|
|
- BigDecimal paperCurrentPassRate = BigDecimal.valueOf(paperCurrentPassCount).divide(BigDecimal.valueOf(currentRealityCount), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal paperCurrentPassRate = BigDecimal.valueOf(paperCurrentPassCount).divide(BigDecimal.valueOf(currentRealityCount), 4, RoundingMode.HALF_UP);
|
|
|
|
|
|
/*
|
|
/*
|
|
学院信息
|
|
学院信息
|
|
@@ -270,11 +271,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
teachCollegeName = tbSchoolCollege.getName();
|
|
teachCollegeName = tbSchoolCollege.getName();
|
|
}
|
|
}
|
|
int inspectCollegeCount = inspectCollegeIdList.size();
|
|
int inspectCollegeCount = inspectCollegeIdList.size();
|
|
- if (inspectCollegeIdList.size() == 0){
|
|
|
|
|
|
+ if (inspectCollegeIdList.size() == 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("没有考察学院");
|
|
throw ExceptionResultEnum.ERROR.exception("没有考察学院");
|
|
}
|
|
}
|
|
List<SysOrg> sysOrgList = sysOrgService.listByIds(inspectCollegeIdList);
|
|
List<SysOrg> sysOrgList = sysOrgService.listByIds(inspectCollegeIdList);
|
|
- String inspectCollegeNames = StringUtils.join(sysOrgList.stream().map(SysOrg::getName).collect(Collectors.toList()),'、');
|
|
|
|
|
|
+ String inspectCollegeNames = StringUtils.join(sysOrgList.stream().map(SysOrg::getName).collect(Collectors.toList()), '、');
|
|
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -361,10 +362,10 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
long sameCount = dataSource.stream().filter(e -> e.getTotalScore().compareTo(totalScore) == 0).count(); // 和我相同的人数
|
|
long sameCount = dataSource.stream().filter(e -> e.getTotalScore().compareTo(totalScore) == 0).count(); // 和我相同的人数
|
|
int totalCount = dataSource.size(); //总人数
|
|
int totalCount = dataSource.size(); //总人数
|
|
// 标准回归系数
|
|
// 标准回归系数
|
|
- if (standardDeviation.compareTo(BigDecimal.ZERO) == 0){
|
|
|
|
|
|
+ if (standardDeviation.compareTo(BigDecimal.ZERO) == 0) {
|
|
standardDeviation = BigDecimal.valueOf(0.001);
|
|
standardDeviation = BigDecimal.valueOf(0.001);
|
|
}
|
|
}
|
|
- BigDecimal standardizedCoefficients = (taExamCourseRecord.getAssignedScore().subtract(avgScore)).divide(standardDeviation, 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal standardizedCoefficients = (taExamCourseRecord.getAssignedScore().subtract(avgScore)).divide(standardDeviation, 4, RoundingMode.HALF_UP);
|
|
|
|
|
|
int percentGrade = this.handlePercentGrade(BigDecimal.valueOf(lowCount), BigDecimal.valueOf(sameCount), BigDecimal.valueOf(totalCount));
|
|
int percentGrade = this.handlePercentGrade(BigDecimal.valueOf(lowCount), BigDecimal.valueOf(sameCount), BigDecimal.valueOf(totalCount));
|
|
taExamCourseRecord.setPercentGrade(percentGrade);
|
|
taExamCourseRecord.setPercentGrade(percentGrade);
|
|
@@ -509,16 +510,16 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.eq(TBExamStudent::getCourseCode, effectiveCourseCode)
|
|
.eq(TBExamStudent::getCourseCode, effectiveCourseCode)
|
|
.eq(TBExamStudent::getClazzId, clazzId));
|
|
.eq(TBExamStudent::getClazzId, clazzId));
|
|
List<Long> teachCollegeIdList = tbExamStudentList.stream().map(TBExamStudent::getTeachCollegeId).distinct().collect(Collectors.toList());
|
|
List<Long> teachCollegeIdList = tbExamStudentList.stream().map(TBExamStudent::getTeachCollegeId).distinct().collect(Collectors.toList());
|
|
- String collegeName = "";
|
|
|
|
|
|
+ StringBuilder collegeName = new StringBuilder();
|
|
for (Long collegeId : teachCollegeIdList) {
|
|
for (Long collegeId : teachCollegeIdList) {
|
|
SysOrg tbSchoolCollege = sysOrgService.getById(collegeId);
|
|
SysOrg tbSchoolCollege = sysOrgService.getById(collegeId);
|
|
if (Objects.isNull(tbSchoolCollege)) {
|
|
if (Objects.isNull(tbSchoolCollege)) {
|
|
- collegeName = collegeName + SystemConstant.DEFAULT_SIGN + ",";
|
|
|
|
|
|
+ collegeName.append(SystemConstant.DEFAULT_SIGN).append(",");
|
|
} else {
|
|
} else {
|
|
- collegeName = collegeName + tbSchoolCollege.getName() + ",";
|
|
|
|
|
|
+ collegeName.append(tbSchoolCollege.getName()).append(",");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- collegeName = collegeName.substring(0, collegeName.length() - 1);
|
|
|
|
|
|
+ collegeName = new StringBuilder(collegeName.substring(0, collegeName.length() - 1));
|
|
|
|
|
|
TAExamCourseClazz taExamCourseClazz = new TAExamCourseClazz();
|
|
TAExamCourseClazz taExamCourseClazz = new TAExamCourseClazz();
|
|
taExamCourseClazz.setId(SystemConstant.getDbUuid());
|
|
taExamCourseClazz.setId(SystemConstant.getDbUuid());
|
|
@@ -533,7 +534,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
taExamCourseClazz.setRealityCount(realityCount);
|
|
taExamCourseClazz.setRealityCount(realityCount);
|
|
taExamCourseClazz.setAbsentCount(absentCount);
|
|
taExamCourseClazz.setAbsentCount(absentCount);
|
|
taExamCourseClazz.setTotalCount(totalCount);
|
|
taExamCourseClazz.setTotalCount(totalCount);
|
|
- taExamCourseClazz.setCollegeName(collegeName);
|
|
|
|
|
|
+ taExamCourseClazz.setCollegeName(collegeName.toString());
|
|
taExamCourseClazzList.add(taExamCourseClazz);
|
|
taExamCourseClazzList.add(taExamCourseClazz);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -586,7 +587,6 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
throw ExceptionResultEnum.ERROR.exception("试卷基础数据查找失败");
|
|
throw ExceptionResultEnum.ERROR.exception("试卷基础数据查找失败");
|
|
}
|
|
}
|
|
for (TBPaper tbPaper : tbPaperList) {
|
|
for (TBPaper tbPaper : tbPaperList) {
|
|
- String paperType = tbPaper.getPaperType();
|
|
|
|
Long paperId = tbPaper.getId();
|
|
Long paperId = tbPaper.getId();
|
|
// 试卷结构数据源
|
|
// 试卷结构数据源
|
|
List<TBPaperStruct> tbPaperStructList = tbPaperStructService.list(new QueryWrapper<TBPaperStruct>().lambda()
|
|
List<TBPaperStruct> tbPaperStructList = tbPaperStructService.list(new QueryWrapper<TBPaperStruct>().lambda()
|
|
@@ -851,8 +851,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
// 删除原有数据
|
|
// 删除原有数据
|
|
taExamCourseTeacherDioService.remove(new QueryWrapper<TAExamCourseTeacherDio>().lambda()
|
|
taExamCourseTeacherDioService.remove(new QueryWrapper<TAExamCourseTeacherDio>().lambda()
|
|
- .eq(TAExamCourseTeacherDio::getExamId,examId)
|
|
|
|
- .eq(TAExamCourseTeacherDio::getCourseCode,effectiveCourseCode));
|
|
|
|
|
|
+ .eq(TAExamCourseTeacherDio::getExamId, examId)
|
|
|
|
+ .eq(TAExamCourseTeacherDio::getCourseCode, effectiveCourseCode));
|
|
|
|
|
|
taExamCourseTeacherDioService.insertByTAExamCourseRecordDio(examId, effectiveCourseCode);
|
|
taExamCourseTeacherDioService.insertByTAExamCourseRecordDio(examId, effectiveCourseCode);
|
|
}
|
|
}
|
|
@@ -867,8 +867,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
// 删除原有数据
|
|
// 删除原有数据
|
|
taExamCourseTeacherCollegeDioService.remove(new QueryWrapper<TAExamCourseTeacherCollegeDio>().lambda()
|
|
taExamCourseTeacherCollegeDioService.remove(new QueryWrapper<TAExamCourseTeacherCollegeDio>().lambda()
|
|
- .eq(TAExamCourseTeacherCollegeDio::getExamId,examId)
|
|
|
|
- .eq(TAExamCourseTeacherCollegeDio::getCourseCode,effectiveCourseCode));
|
|
|
|
|
|
+ .eq(TAExamCourseTeacherCollegeDio::getExamId, examId)
|
|
|
|
+ .eq(TAExamCourseTeacherCollegeDio::getCourseCode, effectiveCourseCode));
|
|
|
|
|
|
taExamCourseTeacherCollegeDioService.insertByTAExamCourseRecordDio(examId, effectiveCourseCode);
|
|
taExamCourseTeacherCollegeDioService.insertByTAExamCourseRecordDio(examId, effectiveCourseCode);
|
|
}
|
|
}
|
|
@@ -911,14 +911,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
numberType.equals(e.getNumberType()) &&
|
|
numberType.equals(e.getNumberType()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
- if (oneQuestionAnswerDetailList.size() == 0){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.size() == 0) {
|
|
System.out.println("异常");
|
|
System.out.println("异常");
|
|
}
|
|
}
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
- if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)) {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -926,8 +926,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
|
|
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
- BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
- BigDecimal scoreRate = standardScoreRate.setScale(1, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, RoundingMode.HALF_UP);
|
|
|
|
+ BigDecimal scoreRate = standardScoreRate.setScale(1, RoundingMode.HALF_UP);
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
|
|
|
|
double validity = this.calculateValidity(oneQuestionAnswerDetailList, fullScore.doubleValue());
|
|
double validity = this.calculateValidity(oneQuestionAnswerDetailList, fullScore.doubleValue());
|
|
@@ -1011,14 +1011,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
numberType.equals(e.getNumberType()) &&
|
|
numberType.equals(e.getNumberType()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某学院某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某学院某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
- if (oneQuestionAnswerDetailList.size() == 0){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.size() == 0) {
|
|
System.out.println("异常");
|
|
System.out.println("异常");
|
|
}
|
|
}
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
- if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)) {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1026,8 +1026,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
|
|
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
- BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
- BigDecimal scoreRate = standardScoreRate.setScale(1, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, RoundingMode.HALF_UP);
|
|
|
|
+ BigDecimal scoreRate = standardScoreRate.setScale(1, RoundingMode.HALF_UP);
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
|
|
|
|
TAExamCourseCollegePaperStruct taExamCourseCollegePaperStruct = new TAExamCourseCollegePaperStruct();
|
|
TAExamCourseCollegePaperStruct taExamCourseCollegePaperStruct = new TAExamCourseCollegePaperStruct();
|
|
@@ -1112,14 +1112,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
numberType.equals(e.getNumberType()) &&
|
|
numberType.equals(e.getNumberType()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某教师某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某教师某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
- if (oneQuestionAnswerDetailList.size() == 0){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.size() == 0) {
|
|
System.out.println("异常");
|
|
System.out.println("异常");
|
|
}
|
|
}
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
- if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)) {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1127,8 +1127,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
|
|
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
- BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
- BigDecimal scoreRate = standardScoreRate.setScale(1, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, RoundingMode.HALF_UP);
|
|
|
|
+ BigDecimal scoreRate = standardScoreRate.setScale(1, RoundingMode.HALF_UP);
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
|
|
|
|
TAExamCourseTeacherPaperStruct taExamCourseTeacherPaperStruct = new TAExamCourseTeacherPaperStruct();
|
|
TAExamCourseTeacherPaperStruct taExamCourseTeacherPaperStruct = new TAExamCourseTeacherPaperStruct();
|
|
@@ -1200,13 +1200,9 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
if (tbPaperStructList.size() == 0) {
|
|
if (tbPaperStructList.size() == 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("试卷结构数据异常");
|
|
throw ExceptionResultEnum.ERROR.exception("试卷结构数据异常");
|
|
}
|
|
}
|
|
- /**
|
|
|
|
- * 试卷下
|
|
|
|
- */
|
|
|
|
|
|
+ // 试卷下
|
|
for (Long teacherId : teacherIdSet) {
|
|
for (Long teacherId : teacherIdSet) {
|
|
- /**
|
|
|
|
- * 教师下
|
|
|
|
- */
|
|
|
|
|
|
+ // 教师下
|
|
String teacherName = sysUserService.getById(teacherId).getRealName();
|
|
String teacherName = sysUserService.getById(teacherId).getRealName();
|
|
|
|
|
|
// 参考该试卷的考察学院id集合
|
|
// 参考该试卷的考察学院id集合
|
|
@@ -1217,15 +1213,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|
|
|
|
|
|
for (Long inspectCollegeId : inspectCollegeIdSet) {
|
|
for (Long inspectCollegeId : inspectCollegeIdSet) {
|
|
- /**
|
|
|
|
- * 学院下
|
|
|
|
- */
|
|
|
|
|
|
+ // 学院下
|
|
String inspectCollegeName = sysOrgService.getById(inspectCollegeId).getName();
|
|
String inspectCollegeName = sysOrgService.getById(inspectCollegeId).getName();
|
|
|
|
|
|
for (TBPaperStruct paperStruct : tbPaperStructList) {
|
|
for (TBPaperStruct paperStruct : tbPaperStructList) {
|
|
- /**
|
|
|
|
- * 试题下
|
|
|
|
- */
|
|
|
|
|
|
+ // 试题下
|
|
String numberType = paperStruct.getNumberType();
|
|
String numberType = paperStruct.getNumberType();
|
|
String mainNumber = paperStruct.getBigQuestionNumber();
|
|
String mainNumber = paperStruct.getBigQuestionNumber();
|
|
String subNumber = paperStruct.getSmallQuestionNumber();
|
|
String subNumber = paperStruct.getSmallQuestionNumber();
|
|
@@ -1237,14 +1229,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
numberType.equals(e.getNumberType()) &&
|
|
numberType.equals(e.getNumberType()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
mainNumber.equals(e.getMainNumber()) &&
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某教师某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
subNumber.equals(e.getSubNumber())).collect(Collectors.toList()); //某教师某道小题的所有参考学生作答信息(并且按照该科目的参考学生百分等级从高到低排序了)
|
|
- if (oneQuestionAnswerDetailList.size() == 0){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.size() == 0) {
|
|
System.out.println("异常");
|
|
System.out.println("异常");
|
|
}
|
|
}
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
- if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)){
|
|
|
|
|
|
+ if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)) {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.NOT_QUITE_RIGHT;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1252,8 +1244,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
|
|
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
double scoreAvg = descriptiveStatistics.getAverage();
|
|
- BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
- BigDecimal scoreRate = standardScoreRate.setScale(1, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, RoundingMode.HALF_UP);
|
|
|
|
+ BigDecimal scoreRate = standardScoreRate.setScale(1, RoundingMode.HALF_UP);
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
|
|
|
|
TAExamCourseTeacherCollegePaperStruct taExamCourseTeacherCollegePaperStruct = new TAExamCourseTeacherCollegePaperStruct();
|
|
TAExamCourseTeacherCollegePaperStruct taExamCourseTeacherCollegePaperStruct = new TAExamCourseTeacherCollegePaperStruct();
|
|
@@ -1312,7 +1304,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
List<TBCommonLevelConfig> configLevelDatasource = tbCommonLevelConfigService.list(new QueryWrapper<TBCommonLevelConfig>().lambda()
|
|
List<TBCommonLevelConfig> configLevelDatasource = tbCommonLevelConfigService.list(new QueryWrapper<TBCommonLevelConfig>().lambda()
|
|
.eq(TBCommonLevelConfig::getExamId, examId)
|
|
.eq(TBCommonLevelConfig::getExamId, examId)
|
|
.eq(TBCommonLevelConfig::getCourseCode, effectiveCourseCode)
|
|
.eq(TBCommonLevelConfig::getCourseCode, effectiveCourseCode)
|
|
- .eq(TBCommonLevelConfig::getLevelType,"难度等级"));// 该科目试题难度情况数据源
|
|
|
|
|
|
+ .eq(TBCommonLevelConfig::getLevelType, "难度等级"));// 该科目试题难度情况数据源
|
|
|
|
|
|
List<TAPaperStruct> questionDatasource = taPaperStructService.list(new QueryWrapper<TAPaperStruct>().lambda()
|
|
List<TAPaperStruct> questionDatasource = taPaperStructService.list(new QueryWrapper<TAPaperStruct>().lambda()
|
|
.eq(TAPaperStruct::getExamId, examId).eq(TAPaperStruct::getCourseCode, effectiveCourseCode));// 该科目试题情况数据源
|
|
.eq(TAPaperStruct::getExamId, examId).eq(TAPaperStruct::getCourseCode, effectiveCourseCode));// 该科目试题情况数据源
|
|
@@ -1340,11 +1332,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
// 学院id集合
|
|
// 学院id集合
|
|
List<Long> collegeIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
List<Long> collegeIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
- .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
- .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
- .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
- .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
- .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
|
|
|
|
+ .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
+ .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
+ .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
+ .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
+ .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
.stream()
|
|
.stream()
|
|
.map(TAExamCourseRecord::getInspectCollegeId).distinct()
|
|
.map(TAExamCourseRecord::getInspectCollegeId).distinct()
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -1354,7 +1346,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.filter(e -> collegeId.equals(e.getCollegeId())).collect(Collectors.toList());
|
|
.filter(e -> collegeId.equals(e.getCollegeId())).collect(Collectors.toList());
|
|
|
|
|
|
double colAvgScoreRate = 0;
|
|
double colAvgScoreRate = 0;
|
|
- if (answerDetailForCol.size() > 0){
|
|
|
|
|
|
+ if (answerDetailForCol.size() > 0) {
|
|
colAvgScoreRate = answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getAnswerScore().doubleValue())).getSum() / answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getFullScore().doubleValue())).getSum();
|
|
colAvgScoreRate = answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getAnswerScore().doubleValue())).getSum() / answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getFullScore().doubleValue())).getSum();
|
|
}
|
|
}
|
|
// 得分率保留2位小数处理
|
|
// 得分率保留2位小数处理
|
|
@@ -1430,11 +1422,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
// 教师id集合
|
|
// 教师id集合
|
|
List<Long> teacherIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
List<Long> teacherIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
- .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
- .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
- .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
- .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
- .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
|
|
|
|
+ .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
+ .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
+ .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
+ .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
+ .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
.stream()
|
|
.stream()
|
|
.map(TAExamCourseRecord::getTeacherId).distinct()
|
|
.map(TAExamCourseRecord::getTeacherId).distinct()
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -1512,11 +1504,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
// 学院id集合
|
|
// 学院id集合
|
|
List<Long> collegeIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
List<Long> collegeIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
- .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
- .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
- .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
- .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
- .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
|
|
|
|
+ .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
+ .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
+ .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
+ .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
+ .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
.stream()
|
|
.stream()
|
|
.map(TAExamCourseRecord::getInspectCollegeId).distinct()
|
|
.map(TAExamCourseRecord::getInspectCollegeId).distinct()
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -1538,18 +1530,18 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.filter(e -> collegeId.equals(e.getCollegeId())).collect(Collectors.toList());
|
|
.filter(e -> collegeId.equals(e.getCollegeId())).collect(Collectors.toList());
|
|
|
|
|
|
double colAvgScoreRate = 0;
|
|
double colAvgScoreRate = 0;
|
|
- if (answerDetailForCol.size() > 0){
|
|
|
|
|
|
+ if (answerDetailForCol.size() > 0) {
|
|
colAvgScoreRate = answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getAnswerScore().doubleValue())).getSum() / answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getFullScore().doubleValue())).getSum();
|
|
colAvgScoreRate = answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getAnswerScore().doubleValue())).getSum() / answerDetailForCol.stream().collect(Collectors.summarizingDouble(e -> e.getFullScore().doubleValue())).getSum();
|
|
}
|
|
}
|
|
|
|
|
|
// 教师id集合
|
|
// 教师id集合
|
|
List<Long> teacherIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
List<Long> teacherIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
- .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
- .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
- .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
- .eq(TAExamCourseRecord::getInspectCollegeId,collegeId)
|
|
|
|
- .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
- .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
|
|
|
|
+ .eq(TAExamCourseRecord::getExamId, examId)
|
|
|
|
+ .eq(TAExamCourseRecord::getCourseCode, effectiveCourseCode)
|
|
|
|
+ .eq(TAExamCourseRecord::getPaperId, paperId)
|
|
|
|
+ .eq(TAExamCourseRecord::getInspectCollegeId, collegeId)
|
|
|
|
+ .eq(TAExamCourseRecord::getAbsent, false)
|
|
|
|
+ .eq(TAExamCourseRecord::getStudentCurrent, true))
|
|
.stream()
|
|
.stream()
|
|
.map(TAExamCourseRecord::getTeacherId).distinct()
|
|
.map(TAExamCourseRecord::getTeacherId).distinct()
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -1613,14 +1605,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
.map(TAExamCourseRecord::getInspectCollegeId).distinct().collect(Collectors.toList());
|
|
.map(TAExamCourseRecord::getInspectCollegeId).distinct().collect(Collectors.toList());
|
|
// 考查学院数量
|
|
// 考查学院数量
|
|
int collegeCount = inspectCollegeInfo.size();
|
|
int collegeCount = inspectCollegeInfo.size();
|
|
- String inspectCollegeNames = "";
|
|
|
|
|
|
+ StringBuilder inspectCollegeNames = new StringBuilder();
|
|
if (collegeCount > 0) {
|
|
if (collegeCount > 0) {
|
|
for (Long inspectCollegeId : inspectCollegeInfo) {
|
|
for (Long inspectCollegeId : inspectCollegeInfo) {
|
|
SysOrg college = sysOrgService.getById(inspectCollegeId);
|
|
SysOrg college = sysOrgService.getById(inspectCollegeId);
|
|
- inspectCollegeNames = inspectCollegeNames + college.getName() + "、";
|
|
|
|
|
|
+ inspectCollegeNames.append(college.getName()).append("、");
|
|
}
|
|
}
|
|
// 考查学院名称
|
|
// 考查学院名称
|
|
- inspectCollegeNames = inspectCollegeNames.substring(0, inspectCollegeNames.length() - 1);
|
|
|
|
|
|
+ inspectCollegeNames = new StringBuilder(inspectCollegeNames.substring(0, inspectCollegeNames.length() - 1));
|
|
}
|
|
}
|
|
|
|
|
|
// 课程
|
|
// 课程
|
|
@@ -1654,7 +1646,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
taExamTotal.setExamId(examId);
|
|
taExamTotal.setExamId(examId);
|
|
taExamTotal.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
taExamTotal.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
taExamTotal.setCollegeCount(collegeCount);
|
|
taExamTotal.setCollegeCount(collegeCount);
|
|
- taExamTotal.setCollegeNames(inspectCollegeNames);
|
|
|
|
|
|
+ taExamTotal.setCollegeNames(inspectCollegeNames.toString());
|
|
taExamTotal.setCourseCount(courseCount);
|
|
taExamTotal.setCourseCount(courseCount);
|
|
taExamTotal.setPublicCourseCount(courseCount);
|
|
taExamTotal.setPublicCourseCount(courseCount);
|
|
taExamTotal.setMajorCourseCount(0);
|
|
taExamTotal.setMajorCourseCount(0);
|
|
@@ -1849,7 +1841,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
// 计算教师排名
|
|
// 计算教师排名
|
|
for (TAExamCourseCollegeTeacher taExamCourseCollegeTeacher : rankTempList) {
|
|
for (TAExamCourseCollegeTeacher taExamCourseCollegeTeacher : rankTempList) {
|
|
BigDecimal thisAvgScoreAssign = taExamCourseCollegeTeacher.getAvgScoreAssign();
|
|
BigDecimal thisAvgScoreAssign = taExamCourseCollegeTeacher.getAvgScoreAssign();
|
|
- int rank = (int) (rankTempList.stream().filter(e -> (e.getAvgScoreAssign().setScale(SystemConstant.FINAL_SCALE,BigDecimal.ROUND_HALF_UP)).compareTo(thisAvgScoreAssign.setScale(SystemConstant.FINAL_SCALE,BigDecimal.ROUND_HALF_UP)) > 0).count() + 1);
|
|
|
|
|
|
+ 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);
|
|
taExamCourseCollegeTeacher.setTeacherRank(rank);
|
|
taExamCourseCollegeTeacher.setTeacherRank(rank);
|
|
taExamCourseCollegeTeacherList.add(taExamCourseCollegeTeacher);
|
|
taExamCourseCollegeTeacherList.add(taExamCourseCollegeTeacher);
|
|
}
|
|
}
|
|
@@ -1947,7 +1939,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
- public String updateCoursePublishStatus(Long examId, String courseCode,PublishStatusEnum publishStatusEnum ) {
|
|
|
|
|
|
+ public String updateCoursePublishStatus(Long examId, String courseCode, PublishStatusEnum publishStatusEnum) {
|
|
// 可分析有效课程信息
|
|
// 可分析有效课程信息
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
List<TBExamCourse> tbExamCourseList = new ArrayList<>();
|
|
List<TBExamCourse> tbExamCourseList = new ArrayList<>();
|
|
@@ -1964,9 +1956,9 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
- public void dataCalculate(Long examId,String courseCode) throws Exception {
|
|
|
|
|
|
+ public void dataCalculate(Long examId, String courseCode) throws Exception {
|
|
AnalyzeForReportService analyzeForReportService = SpringContextHolder.getBean(AnalyzeForReportService.class);
|
|
AnalyzeForReportService analyzeForReportService = SpringContextHolder.getBean(AnalyzeForReportService.class);
|
|
- analyzeForReportService.buildAnalyzeExamCourse(examId,courseCode);
|
|
|
|
|
|
+ analyzeForReportService.buildAnalyzeExamCourse(examId, courseCode);
|
|
analyzeForReportService.buildAnalyzeExamCourseRecord(examId, courseCode);
|
|
analyzeForReportService.buildAnalyzeExamCourseRecord(examId, courseCode);
|
|
analyzeForReportService.buildAnalyzeExamCourseCollegeInspect(examId, courseCode);
|
|
analyzeForReportService.buildAnalyzeExamCourseCollegeInspect(examId, courseCode);
|
|
analyzeForReportService.buildAnalyzeExamCourseClazz(examId, courseCode);
|
|
analyzeForReportService.buildAnalyzeExamCourseClazz(examId, courseCode);
|
|
@@ -1989,29 +1981,29 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
@Override
|
|
@Override
|
|
public void realityForCalculate(Long examId, String courseCode) {
|
|
public void realityForCalculate(Long examId, String courseCode) {
|
|
this.verifyComputing(examId, courseCode);
|
|
this.verifyComputing(examId, courseCode);
|
|
- this.updateCoursePublishStatus(examId, courseCode,PublishStatusEnum.COMPUTING);
|
|
|
|
|
|
+ this.updateCoursePublishStatus(examId, courseCode, PublishStatusEnum.COMPUTING);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void publishReport(Long examId, String courseCode, PublishStatusEnum publishStatusEnum) {
|
|
public void publishReport(Long examId, String courseCode, PublishStatusEnum publishStatusEnum) {
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
- .eq(TBExamCourse::getExamId,examId)
|
|
|
|
- .eq(TBExamCourse::getCourseCode,courseCode));
|
|
|
|
|
|
+ .eq(TBExamCourse::getExamId, examId)
|
|
|
|
+ .eq(TBExamCourse::getCourseCode, courseCode));
|
|
PublishStatusEnum status = tbExamCourse.getPublishStatus();
|
|
PublishStatusEnum status = tbExamCourse.getPublishStatus();
|
|
- if (publishStatusEnum.equals(PublishStatusEnum.PUBLISH) && status.equals(PublishStatusEnum.UN_PUBLISH)){
|
|
|
|
|
|
+ if (publishStatusEnum.equals(PublishStatusEnum.PUBLISH) && status.equals(PublishStatusEnum.UN_PUBLISH)) {
|
|
// 待发布状态 -》 发布
|
|
// 待发布状态 -》 发布
|
|
tbExamCourse.setPublishStatus(publishStatusEnum);
|
|
tbExamCourse.setPublishStatus(publishStatusEnum);
|
|
- }else if (publishStatusEnum.equals(PublishStatusEnum.UN_PUBLISH) && status.equals(PublishStatusEnum.PUBLISH)){
|
|
|
|
|
|
+ } else if (publishStatusEnum.equals(PublishStatusEnum.UN_PUBLISH) && status.equals(PublishStatusEnum.PUBLISH)) {
|
|
// 发布状态 -》 撤回
|
|
// 发布状态 -》 撤回
|
|
tbExamCourse.setPublishStatus(publishStatusEnum);
|
|
tbExamCourse.setPublishStatus(publishStatusEnum);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
String statusDesc = "未明确的操作";
|
|
String statusDesc = "未明确的操作";
|
|
- if (publishStatusEnum.equals(PublishStatusEnum.PUBLISH)){
|
|
|
|
|
|
+ if (publishStatusEnum.equals(PublishStatusEnum.PUBLISH)) {
|
|
statusDesc = "发布";
|
|
statusDesc = "发布";
|
|
- }else if (publishStatusEnum.equals(PublishStatusEnum.UN_PUBLISH)){
|
|
|
|
|
|
+ } else if (publishStatusEnum.equals(PublishStatusEnum.UN_PUBLISH)) {
|
|
statusDesc = "撤回";
|
|
statusDesc = "撤回";
|
|
}
|
|
}
|
|
- throw ExceptionResultEnum.ERROR.exception("【" + status + "】状态的课程无法进行" + "【" + statusDesc + "】" );
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("【" + status + "】状态的课程无法进行" + "【" + statusDesc + "】");
|
|
}
|
|
}
|
|
tbExamCourseService.updateById(tbExamCourse);
|
|
tbExamCourseService.updateById(tbExamCourse);
|
|
}
|
|
}
|
|
@@ -2051,7 +2043,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
BigDecimal assignScore;
|
|
BigDecimal assignScore;
|
|
// 当该试卷的赋分系数不为0时赋分
|
|
// 当该试卷的赋分系数不为0时赋分
|
|
if (coefficient != null && coefficient.compareTo(BigDecimal.ZERO) > 0 && !absent) {
|
|
if (coefficient != null && coefficient.compareTo(BigDecimal.ZERO) > 0 && !absent) {
|
|
- 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, RoundingMode.HALF_UP)).setScale(0, RoundingMode.HALF_UP);
|
|
} else {
|
|
} else {
|
|
assignScore = myScore;
|
|
assignScore = myScore;
|
|
}
|
|
}
|
|
@@ -2083,15 +2075,15 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private void verifyComputing(Long examId,String courseCode){
|
|
|
|
|
|
+ private void verifyComputing(Long examId, String courseCode) {
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId, courseCode);
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
.eq(TBExamCourse::getExamId, examId)
|
|
.eq(TBExamCourse::getExamId, examId)
|
|
.eq(TBExamCourse::getCourseCode, effectiveCourseCode));
|
|
.eq(TBExamCourse::getCourseCode, effectiveCourseCode));
|
|
PublishStatusEnum publishStatusEnum = tbExamCourse.getPublishStatus();
|
|
PublishStatusEnum publishStatusEnum = tbExamCourse.getPublishStatus();
|
|
- if (publishStatusEnum.equals(PublishStatusEnum.COMPUTING)){
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("计算中的课程无法再计算 课程【" +tbExamCourse.getCourseName() + "】");
|
|
|
|
|
|
+ if (publishStatusEnum.equals(PublishStatusEnum.COMPUTING)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("计算中的课程无法再计算 课程【" + tbExamCourse.getCourseName() + "】");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2107,8 +2099,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
private int handlePercentGrade(BigDecimal lowCount, BigDecimal sameCount, BigDecimal totalCount) {
|
|
private int handlePercentGrade(BigDecimal lowCount, BigDecimal sameCount, BigDecimal totalCount) {
|
|
// ((lowCount + sameCount * 0.5) / totalCount) * 100
|
|
// ((lowCount + sameCount * 0.5) / totalCount) * 100
|
|
BigDecimal percentGrade = (lowCount.add(sameCount.multiply(new BigDecimal("0.5"))))
|
|
BigDecimal percentGrade = (lowCount.add(sameCount.multiply(new BigDecimal("0.5"))))
|
|
- .divide(totalCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
|
|
|
|
- int result = percentGrade.setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
|
|
|
|
|
|
+ .divide(totalCount, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
|
|
|
+ int result = percentGrade.setScale(0, RoundingMode.HALF_UP).intValue();
|
|
if (result == 100) {
|
|
if (result == 100) {
|
|
result = 99;
|
|
result = 99;
|
|
}
|
|
}
|
|
@@ -2177,7 +2169,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
double lowCount = examRecordSameCol.stream().filter(e -> e.getAssignedScore().compareTo(taExamCourseRecord.getAssignedScore()) < 0).count();
|
|
double lowCount = examRecordSameCol.stream().filter(e -> e.getAssignedScore().compareTo(taExamCourseRecord.getAssignedScore()) < 0).count();
|
|
BigDecimal overCollegeRate;
|
|
BigDecimal overCollegeRate;
|
|
if (examRecordSameCol.size() > 1) {
|
|
if (examRecordSameCol.size() > 1) {
|
|
- overCollegeRate = BigDecimal.valueOf(lowCount).divide(BigDecimal.valueOf(examRecordSameCol.size() - 1), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ overCollegeRate = BigDecimal.valueOf(lowCount).divide(BigDecimal.valueOf(examRecordSameCol.size() - 1), 4, RoundingMode.HALF_UP);
|
|
} else {
|
|
} else {
|
|
overCollegeRate = BigDecimal.ONE;
|
|
overCollegeRate = BigDecimal.ONE;
|
|
}
|
|
}
|
|
@@ -2524,7 +2516,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
}
|
|
}
|
|
temp.setRank(rank);
|
|
temp.setRank(rank);
|
|
}
|
|
}
|
|
- if (sortList.size() == 0){
|
|
|
|
|
|
+ if (sortList.size() == 0) {
|
|
System.out.println("异常");
|
|
System.out.println("异常");
|
|
}
|
|
}
|
|
double endRank = sortList.get(sortList.size() - 1).getRank();
|
|
double endRank = sortList.get(sortList.size() - 1).getRank();
|