|
@@ -126,7 +126,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
List<ScoreRangeVo> scoreRangeVoList = finalScoreDto.getScoreRange();
|
|
List<ScoreRangeVo> scoreRangeVoList = finalScoreDto.getScoreRange();
|
|
if (!CollectionUtils.isEmpty(scoreRangeVoList)) {
|
|
if (!CollectionUtils.isEmpty(scoreRangeVoList)) {
|
|
Integer failCount = scoreRangeVoList.get(0).getStudentCount();//第一行数据默认为不及格
|
|
Integer failCount = scoreRangeVoList.get(0).getStudentCount();//第一行数据默认为不及格
|
|
- Double failRate = scoreRangeVoList.get(0).getRate();
|
|
|
|
|
|
+ BigDecimal failRate = new BigDecimal(scoreRangeVoList.get(0).getRate());
|
|
|
|
|
|
scoreRangeVoList.remove(0);
|
|
scoreRangeVoList.remove(0);
|
|
List<ReportScoreRangeViewDto> scoreRangeViewDtoList = GsonUtil.fromJson(JacksonUtil.parseJson(scoreRangeVoList), new TypeToken<List<ReportScoreRangeViewDto>>() {
|
|
List<ReportScoreRangeViewDto> scoreRangeViewDtoList = GsonUtil.fromJson(JacksonUtil.parseJson(scoreRangeVoList), new TypeToken<List<ReportScoreRangeViewDto>>() {
|
|
@@ -154,7 +154,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
}
|
|
}
|
|
|
|
|
|
// Map<String, Map<Long, Map<Long, DimensionDto>>> finalScoreExamStudentDimensionMap = new LinkedHashMap<>();//汇总考生课程目标-知识点卷面分(知识点得分用)
|
|
// Map<String, Map<Long, Map<Long, DimensionDto>>> finalScoreExamStudentDimensionMap = new LinkedHashMap<>();//汇总考生课程目标-知识点卷面分(知识点得分用)
|
|
- Map<String, Map<Long, Double>> finalScoreExamStudentTargetMap = new LinkedHashMap<>();//汇总考生课程目标-课程目标卷面分
|
|
|
|
|
|
+ Map<String, Map<Long, BigDecimal>> finalScoreExamStudentTargetMap = new LinkedHashMap<>();//汇总考生课程目标-课程目标卷面分
|
|
Map<Long, Map<Long, DimensionDto>> targetDimensionMap = new LinkedHashMap<>();//课程目标-知识点-卷面分(word报表用)
|
|
Map<Long, Map<Long, DimensionDto>> targetDimensionMap = new LinkedHashMap<>();//课程目标-知识点-卷面分(word报表用)
|
|
|
|
|
|
List<ReportExamStudentDto> examStudentList = null;//考生集合
|
|
List<ReportExamStudentDto> examStudentList = null;//考生集合
|
|
@@ -193,13 +193,13 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
if (courseWeightDetailDto.getEnable() && Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
|
|
if (courseWeightDetailDto.getEnable() && Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
|
|
FinalScoreWordDto finalScoreWordDto = new FinalScoreWordDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto);
|
|
FinalScoreWordDto finalScoreWordDto = new FinalScoreWordDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto);
|
|
courseTargetWordDto.setFinalScoreDto(finalScoreWordDto);
|
|
courseTargetWordDto.setFinalScoreDto(finalScoreWordDto);
|
|
- ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, 0.0d);
|
|
|
|
|
|
+ ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, new BigDecimal(0));
|
|
reportEvaluationDtoList.add(reportEvaluationDto);
|
|
reportEvaluationDtoList.add(reportEvaluationDto);
|
|
}//非期末考试
|
|
}//非期末考试
|
|
else if (courseWeightDetailDto.getEnable() && !Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
|
|
else if (courseWeightDetailDto.getEnable() && !Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
|
|
// BigDecimal usualScoreRealityWeight = usualScoreWordDto.getUsualScoreTargetSumWeight().divide(SystemConstant.PERCENT, 2, BigDecimal.ROUND_HALF_UP).multiply(courseWeightDetailDto.getWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal usualScoreRealityWeight = usualScoreWordDto.getUsualScoreTargetSumWeight().divide(SystemConstant.PERCENT, 2, BigDecimal.ROUND_HALF_UP).multiply(courseWeightDetailDto.getWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// Double originalTargetScore = courseWeightDto.getTotalWeight().multiply(courseWeightDetailDto.getWeight()).divide(SystemConstant.PERCENT, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
// Double originalTargetScore = courseWeightDto.getTotalWeight().multiply(courseWeightDetailDto.getWeight()).divide(SystemConstant.PERCENT, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
- ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, 0.0d);
|
|
|
|
|
|
+ ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, new BigDecimal(0));
|
|
usualScoreTargetSumScore = usualScoreTargetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
usualScoreTargetSumScore = usualScoreTargetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
usualScoreDetailList.add(reportEvaluationDto);
|
|
usualScoreDetailList.add(reportEvaluationDto);
|
|
reportEvaluationDtoList.add(reportEvaluationDto);
|
|
reportEvaluationDtoList.add(reportEvaluationDto);
|
|
@@ -225,7 +225,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
List<TCFinalScoreDto> tcFinalScoreDtoList = GsonUtil.fromJson(finalScoreResult.getFinalScoreDetail(), new TypeToken<List<TCFinalScoreDto>>() {
|
|
List<TCFinalScoreDto> tcFinalScoreDtoList = GsonUtil.fromJson(finalScoreResult.getFinalScoreDetail(), new TypeToken<List<TCFinalScoreDto>>() {
|
|
}.getType());
|
|
}.getType());
|
|
for (TCFinalScoreDto t : tcFinalScoreDtoList) {
|
|
for (TCFinalScoreDto t : tcFinalScoreDtoList) {
|
|
- Double score = Objects.nonNull(t.getScore()) ? Double.parseDouble(t.getScore().toString()) : 0d;
|
|
|
|
|
|
+ BigDecimal score = Objects.nonNull(t.getScore()) ? new BigDecimal(t.getScore()) : new BigDecimal(0);
|
|
PaperStructDimensionResult paperStructDimensionResult = paperStructResultMap.get(t.getName().toString());
|
|
PaperStructDimensionResult paperStructDimensionResult = paperStructResultMap.get(t.getName().toString());
|
|
if (Objects.nonNull(paperStructDimensionResult)) {
|
|
if (Objects.nonNull(paperStructDimensionResult)) {
|
|
List<CourseTargetWebDto> courseTargetDtoList = paperStructDimensionResult.getTargetList();
|
|
List<CourseTargetWebDto> courseTargetDtoList = paperStructDimensionResult.getTargetList();
|
|
@@ -238,7 +238,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
// this.calculateFinalScoreByDimensionExamStudent(finalScoreExamStudentDimensionMap,
|
|
// this.calculateFinalScoreByDimensionExamStudent(finalScoreExamStudentDimensionMap,
|
|
// finalScoreResult, courseTargetDto, dimensionDto, score);
|
|
// finalScoreResult, courseTargetDto, dimensionDto, score);
|
|
if (i == 0) {//计算各知识点原始卷面分总和
|
|
if (i == 0) {//计算各知识点原始卷面分总和
|
|
- Double paperScore = paperStructDimensionResult.getScore();
|
|
|
|
|
|
+ BigDecimal paperScore = paperStructDimensionResult.getScore();
|
|
//目标-考生知识点去重
|
|
//目标-考生知识点去重
|
|
if (!targetDimensionMap.containsKey(courseTargetDto.getTargetId())) {
|
|
if (!targetDimensionMap.containsKey(courseTargetDto.getTargetId())) {
|
|
Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
|
|
Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
|
|
@@ -250,7 +250,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, paperScore));
|
|
dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, paperScore));
|
|
} else {
|
|
} else {
|
|
DimensionDto dimensionDtoTemp = dimensionMap.get(dimensionDto.getDimensionId());
|
|
DimensionDto dimensionDtoTemp = dimensionMap.get(dimensionDto.getDimensionId());
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, dimensionDtoTemp.getDimensionScore().doubleValue() + paperScore.doubleValue()));
|
|
|
|
|
|
+ dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, dimensionDtoTemp.getDimensionScore().add(paperScore)));
|
|
}
|
|
}
|
|
targetDimensionMap.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
targetDimensionMap.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
}
|
|
}
|
|
@@ -265,17 +265,17 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
targetDimensionMap.forEach((k, v) -> {
|
|
targetDimensionMap.forEach((k, v) -> {
|
|
List<DimensionDto> dimensionDtoList = new ArrayList<>(v.values());
|
|
List<DimensionDto> dimensionDtoList = new ArrayList<>(v.values());
|
|
Collections.sort(dimensionDtoList);
|
|
Collections.sort(dimensionDtoList);
|
|
- Double dimensionScoreSum = dimensionDtoList.stream().mapToDouble(DimensionDto::getDimensionScore).sum();
|
|
|
|
|
|
+ Double dimensionScoreSum = dimensionDtoList.stream().mapToDouble(s -> s.getDimensionScore().doubleValue()).sum();
|
|
List<String> dimensionDtoNameList = dimensionDtoList.stream().map(s -> s.getDimensionName()).collect(Collectors.toList());
|
|
List<String> dimensionDtoNameList = dimensionDtoList.stream().map(s -> s.getDimensionName()).collect(Collectors.toList());
|
|
if (finalTargetWordMap.containsKey(k)) {
|
|
if (finalTargetWordMap.containsKey(k)) {
|
|
if (Objects.nonNull(finalTargetWordMap.get(k).getFinalScoreDto())) {
|
|
if (Objects.nonNull(finalTargetWordMap.get(k).getFinalScoreDto())) {
|
|
finalTargetWordMap.get(k).getFinalScoreDto().setDimensionList(dimensionDtoList);
|
|
finalTargetWordMap.get(k).getFinalScoreDto().setDimensionList(dimensionDtoList);
|
|
}
|
|
}
|
|
- finalTargetWordMap.get(k).setDimensionScoreSum(dimensionScoreSum);
|
|
|
|
|
|
+ finalTargetWordMap.get(k).setDimensionScoreSum(new BigDecimal(dimensionScoreSum));
|
|
finalTargetWordMap.get(k).setDimensionPoint(String.join(",", dimensionDtoNameList));
|
|
finalTargetWordMap.get(k).setDimensionPoint(String.join(",", dimensionDtoNameList));
|
|
}
|
|
}
|
|
if (finalTargetWebMap.containsKey(k)) {
|
|
if (finalTargetWebMap.containsKey(k)) {
|
|
- finalTargetWebMap.get(k).setDimensionScoreSum(dimensionScoreSum);
|
|
|
|
|
|
+ finalTargetWebMap.get(k).setDimensionScoreSum(new BigDecimal(dimensionScoreSum));
|
|
finalTargetWebMap.get(k).setDimensionPoint(String.join(",", dimensionDtoNameList));
|
|
finalTargetWebMap.get(k).setDimensionPoint(String.join(",", dimensionDtoNameList));
|
|
}
|
|
}
|
|
// Map<Long, Map<Long, DimensionDto>> mapExamStudent1 = finalScoreExamStudentDimensionMap.get(finalScoreResult.getStudentCode());
|
|
// Map<Long, Map<Long, DimensionDto>> mapExamStudent1 = finalScoreExamStudentDimensionMap.get(finalScoreResult.getStudentCode());
|
|
@@ -285,8 +285,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
// Map<Long, Double> mapDimension = finalScoreResult.getFinalScoreDimension();
|
|
// Map<Long, Double> mapDimension = finalScoreResult.getFinalScoreDimension();
|
|
// mapDimension.put(k, score);
|
|
// mapDimension.put(k, score);
|
|
|
|
|
|
- Map<Long, Double> doubleMap = finalScoreExamStudentTargetMap.get(finalScoreResult.getStudentCode());
|
|
|
|
- Map<Long, Double> mapTarget = finalScoreResult.getFinalScoreTarget();
|
|
|
|
|
|
+ Map<Long, BigDecimal> doubleMap = finalScoreExamStudentTargetMap.get(finalScoreResult.getStudentCode());
|
|
|
|
+ Map<Long, BigDecimal> mapTarget = finalScoreResult.getFinalScoreTarget();
|
|
mapTarget.put(k, doubleMap.get(k));
|
|
mapTarget.put(k, doubleMap.get(k));
|
|
});
|
|
});
|
|
|
|
|
|
@@ -357,7 +357,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (ReportExamStudentTargetDto r : reportExamStudentTargetAvgDtoList) {
|
|
for (ReportExamStudentTargetDto r : reportExamStudentTargetAvgDtoList) {
|
|
- Double targetAvgSumScore = 0.0d;//平均分总和
|
|
|
|
|
|
+ BigDecimal targetAvgSumScore = new BigDecimal(0);//平均分总和
|
|
BigDecimal targetSumScore = new BigDecimal(0);//目标分总和
|
|
BigDecimal targetSumScore = new BigDecimal(0);//目标分总和
|
|
// BigDecimal targetEvaluationValue = new BigDecimal(0);
|
|
// BigDecimal targetEvaluationValue = new BigDecimal(0);
|
|
if (targetWebMap.containsKey(r.getTargetId())) {
|
|
if (targetWebMap.containsKey(r.getTargetId())) {
|
|
@@ -375,7 +375,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
if (Objects.nonNull(reportExamStudentFinalScoreDto)) {
|
|
if (Objects.nonNull(reportExamStudentFinalScoreDto)) {
|
|
reportEvaluationDto = reportEvaluationDtoMap.get(reportExamStudentFinalScoreDto.getEvaluationId());
|
|
reportEvaluationDto = reportEvaluationDtoMap.get(reportExamStudentFinalScoreDto.getEvaluationId());
|
|
reportEvaluationDto.setTargetAvgScore(reportExamStudentFinalScoreDto.getMatrixAvgScore());
|
|
reportEvaluationDto.setTargetAvgScore(reportExamStudentFinalScoreDto.getMatrixAvgScore());
|
|
- targetAvgSumScore = targetAvgSumScore + reportEvaluationDto.getTargetAvgScore();
|
|
|
|
|
|
+ targetAvgSumScore = targetAvgSumScore.add(reportEvaluationDto.getTargetAvgScore());
|
|
targetSumScore = targetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
targetSumScore = targetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
// BigDecimal bigDecimal = new BigDecimal(reportExamStudentFinalScoreDto.getTargetScoreSum()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal bigDecimal = new BigDecimal(reportExamStudentFinalScoreDto.getTargetScoreSum()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal targetEvaluationValueTemp = bigDecimal.divide(reportEvaluationDto.getTargetScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetWeight().divide(courseTargetWebDto.getTargetSumWeight(), 2, BigDecimal.ROUND_HALF_UP)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal targetEvaluationValueTemp = bigDecimal.divide(reportEvaluationDto.getTargetScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetWeight().divide(courseTargetWebDto.getTargetSumWeight(), 2, BigDecimal.ROUND_HALF_UP)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
@@ -388,7 +388,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
for (ReportExamStudentUsualScoreObjDto reportExamStudentUsualScoreObjDto : reportExamStudentUsualScoreObjDtoList) {
|
|
for (ReportExamStudentUsualScoreObjDto reportExamStudentUsualScoreObjDto : reportExamStudentUsualScoreObjDtoList) {
|
|
reportEvaluationDto = reportEvaluationDtoMap.get(reportExamStudentUsualScoreObjDto.getEvaluationId());
|
|
reportEvaluationDto = reportEvaluationDtoMap.get(reportExamStudentUsualScoreObjDto.getEvaluationId());
|
|
reportEvaluationDto.setTargetAvgScore(reportExamStudentUsualScoreObjDto.getMatrixAvgScore());
|
|
reportEvaluationDto.setTargetAvgScore(reportExamStudentUsualScoreObjDto.getMatrixAvgScore());
|
|
- targetAvgSumScore = targetAvgSumScore + reportEvaluationDto.getTargetAvgScore();
|
|
|
|
|
|
+ targetAvgSumScore = targetAvgSumScore.add(reportEvaluationDto.getTargetAvgScore());
|
|
targetSumScore = targetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
targetSumScore = targetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
// BigDecimal bigDecimal = new BigDecimal(reportExamStudentUsualScoreObjDto.getScore()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal bigDecimal = new BigDecimal(reportExamStudentUsualScoreObjDto.getScore()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal targetEvaluationValueTemp = bigDecimal.divide(reportEvaluationDto.getTargetScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetWeight().divide(courseTargetWebDto.getTargetSumWeight(), 2, BigDecimal.ROUND_HALF_UP)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal targetEvaluationValueTemp = bigDecimal.divide(reportEvaluationDto.getTargetScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetWeight().divide(courseTargetWebDto.getTargetSumWeight(), 2, BigDecimal.ROUND_HALF_UP)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
@@ -400,7 +400,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
//目标下各平均分总和/科目目标分
|
|
//目标下各平均分总和/科目目标分
|
|
BigDecimal targetEvaluationValue = new BigDecimal(0);
|
|
BigDecimal targetEvaluationValue = new BigDecimal(0);
|
|
if (targetEvaluationValueMap.containsKey(r.getTargetId())) {
|
|
if (targetEvaluationValueMap.containsKey(r.getTargetId())) {
|
|
- targetEvaluationValue = targetEvaluationValueMap.get(r.getTargetId()).divide(new BigDecimal(targetEvaluationValueSizeMap.get(r.getTargetId())), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ targetEvaluationValue = targetEvaluationValueMap.get(r.getTargetId()).divide(new BigDecimal(targetEvaluationValueSizeMap.get(r.getTargetId())), 4, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
}
|
|
}
|
|
// BigDecimal targetEvaluationValue = new BigDecimal(targetAvgSumScore).divide(targetSumScore, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal targetEvaluationValue = new BigDecimal(targetAvgSumScore).divide(targetSumScore, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
courseTargetWebDto.setEvaluationValue(targetEvaluationValue);
|
|
courseTargetWebDto.setEvaluationValue(targetEvaluationValue);
|
|
@@ -449,9 +449,9 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
Objects.requireNonNull(basicProfessional, "未找到专业信息");
|
|
Objects.requireNonNull(basicProfessional, "未找到专业信息");
|
|
Double expectValue = obeCourseWeightResult.getSubmitForm().get(0).getExpectValue();
|
|
Double expectValue = obeCourseWeightResult.getSubmitForm().get(0).getExpectValue();
|
|
if (Objects.isNull(trBasicInfo)) {
|
|
if (Objects.isNull(trBasicInfo)) {
|
|
- trBasicInfo = new TRBasicInfo(cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, userId, basicProfessional.getName(), Objects.nonNull(trBasicInfo) ? trBasicInfo.getFinishPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getRequirementPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseSuggest() : null, expectValue, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseEnName() : null);
|
|
|
|
|
|
+ trBasicInfo = new TRBasicInfo(cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, userId, basicProfessional.getName(), Objects.nonNull(trBasicInfo) ? trBasicInfo.getFinishPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getRequirementPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseSuggest() : null, new BigDecimal(expectValue), Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseEnName() : null);
|
|
} else {
|
|
} else {
|
|
- trBasicInfo.setBasicInfo(markPaper.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, cultureProgramId, courseId, expectValue, basicProfessional.getName(), trBasicInfo.getCourseEnName(), trBasicInfo.getCollege(), trBasicInfo.getFinishPoints(), trBasicInfo.getRequirementPoints(), trBasicInfo.getCourseSuggest());
|
|
|
|
|
|
+ trBasicInfo.setBasicInfo(markPaper.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, cultureProgramId, courseId, new BigDecimal(expectValue), basicProfessional.getName(), trBasicInfo.getCourseEnName(), trBasicInfo.getCollege(), trBasicInfo.getFinishPoints(), trBasicInfo.getRequirementPoints(), trBasicInfo.getCourseSuggest());
|
|
}
|
|
}
|
|
//课程基本情况
|
|
//课程基本情况
|
|
ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
|
|
ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
|
|
@@ -841,7 +841,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
examStudent_cells_2.add(Cells.of("综合成绩").center().create());
|
|
examStudent_cells_2.add(Cells.of("综合成绩").center().create());
|
|
}
|
|
}
|
|
|
|
|
|
- List<Double> scoreList = new ArrayList<>();
|
|
|
|
|
|
+ List<BigDecimal> scoreList = new ArrayList<>();
|
|
for (int i = 0; i < trExamStudentList.size(); i++) {
|
|
for (int i = 0; i < trExamStudentList.size(); i++) {
|
|
TRExamStudent trExamStudent = trExamStudentList.get(i);
|
|
TRExamStudent trExamStudent = trExamStudentList.get(i);
|
|
RowRenderData examStudent_row = new RowRenderData();
|
|
RowRenderData examStudent_row = new RowRenderData();
|
|
@@ -889,7 +889,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
// break;
|
|
// break;
|
|
case "平均分":
|
|
case "平均分":
|
|
examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentUsualScoreObjDto.getMatrixAvgScore())).create());
|
|
examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentUsualScoreObjDto.getMatrixAvgScore())).create());
|
|
- targetAvgScore = targetAvgScore.add(new BigDecimal(reportExamStudentUsualScoreObjDto.getMatrixAvgScore()));
|
|
|
|
|
|
+ targetAvgScore = targetAvgScore.add(reportExamStudentUsualScoreObjDto.getMatrixAvgScore());
|
|
break;
|
|
break;
|
|
case "各课程目标平均分":
|
|
case "各课程目标平均分":
|
|
examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
|
|
examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
|
|
@@ -911,7 +911,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
// break;
|
|
// break;
|
|
case "平均分":
|
|
case "平均分":
|
|
examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getMatrixAvgScore())).create());
|
|
examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getMatrixAvgScore())).create());
|
|
- targetAvgScore = targetAvgScore.add(new BigDecimal(reportExamStudentFinalScoreDto.getMatrixAvgScore()));
|
|
|
|
|
|
+ targetAvgScore = targetAvgScore.add(reportExamStudentFinalScoreDto.getMatrixAvgScore());
|
|
break;
|
|
break;
|
|
case "各课程目标平均分":
|
|
case "各课程目标平均分":
|
|
examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
|
|
examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
|
|
@@ -929,7 +929,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
// examStudent_cells.add(Cells.of(SystemConstant.df.format(targetSumScore.setScale(2, BigDecimal.ROUND_HALF_UP))).create());
|
|
// examStudent_cells.add(Cells.of(SystemConstant.df.format(targetSumScore.setScale(2, BigDecimal.ROUND_HALF_UP))).create());
|
|
// break;
|
|
// break;
|
|
case "平均分":
|
|
case "平均分":
|
|
- examStudent_cells.add(Cells.of(SystemConstant.df.format(targetAvgScore.setScale(1, BigDecimal.ROUND_DOWN))).create());
|
|
|
|
|
|
+ examStudent_cells.add(Cells.of(SystemConstant.df.format(targetAvgScore.setScale(2, BigDecimal.ROUND_HALF_UP))).create());
|
|
break;
|
|
break;
|
|
case "各课程目标平均分":
|
|
case "各课程目标平均分":
|
|
examStudent_cells.add(Cells.of("").create());
|
|
examStudent_cells.add(Cells.of("").create());
|
|
@@ -1000,10 +1000,10 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
Integer[] scoreSizes = new Integer[]{0, 0, 0, 0, 0};
|
|
Integer[] scoreSizes = new Integer[]{0, 0, 0, 0, 0};
|
|
BigDecimal[] scorePercent = new BigDecimal[]{new BigDecimal(0), new BigDecimal(0), new BigDecimal(0), new BigDecimal(0), new BigDecimal(0)};
|
|
BigDecimal[] scorePercent = new BigDecimal[]{new BigDecimal(0), new BigDecimal(0), new BigDecimal(0), new BigDecimal(0), new BigDecimal(0)};
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
- Double maxScore = scoreList.stream().mapToDouble(s -> s).max().orElse(0.0d);
|
|
|
|
- Double minScore = scoreList.stream().mapToDouble(s -> s).min().orElse(0.0d);
|
|
|
|
- Double avgScore = scoreList.stream().mapToDouble(s -> s).average().orElse(0.0d);
|
|
|
|
- for (Double d : scoreList) {
|
|
|
|
|
|
+ Double maxScore = scoreList.stream().mapToDouble(s -> s.doubleValue()).max().orElse(0.0d);
|
|
|
|
+ Double minScore = scoreList.stream().mapToDouble(s -> s.doubleValue()).min().orElse(0.0d);
|
|
|
|
+ Double avgScore = scoreList.stream().mapToDouble(s -> s.doubleValue()).average().orElse(0.0d);
|
|
|
|
+ for (BigDecimal d : scoreList) {
|
|
if (d.doubleValue() <= 100 && d.doubleValue() >= 90) {
|
|
if (d.doubleValue() <= 100 && d.doubleValue() >= 90) {
|
|
scoreSizes[0] = scoreSizes[0] + 1;
|
|
scoreSizes[0] = scoreSizes[0] + 1;
|
|
} else if (d.doubleValue() <= 89 && d.doubleValue() >= 80) {
|
|
} else if (d.doubleValue() <= 89 && d.doubleValue() >= 80) {
|
|
@@ -1017,7 +1017,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (int i = 0; i < scoreSizes.length; i++) {
|
|
for (int i = 0; i < scoreSizes.length; i++) {
|
|
- scorePercent[i] = new BigDecimal(scoreSizes[i]).divide(new BigDecimal(scoreList.size()), 2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.PERCENT).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ scorePercent[i] = new BigDecimal(scoreSizes[i]).divide(new BigDecimal(scoreList.size()), 4, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.PERCENT).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
}
|
|
}
|
|
map.put("scoreSizes", scoreSizes);
|
|
map.put("scoreSizes", scoreSizes);
|
|
map.put("scorePercent", scorePercent);
|
|
map.put("scorePercent", scorePercent);
|
|
@@ -1176,7 +1176,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
}.getType());
|
|
}.getType());
|
|
for (CourseWeightDto c : obeCourseWeightResult.getSubmitForm()) {
|
|
for (CourseWeightDto c : obeCourseWeightResult.getSubmitForm()) {
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName()))
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName()))
|
|
- .mapToDouble(PaperStructDimensionResult::getScore).sum();
|
|
|
|
|
|
+ .mapToDouble(s -> s.getScore().doubleValue()).sum();
|
|
Objects.requireNonNull(c.getTotalWeight(), "[" + c.getCourseTargetName() + "]未设置权重");
|
|
Objects.requireNonNull(c.getTotalWeight(), "[" + c.getCourseTargetName() + "]未设置权重");
|
|
//// Objects.requireNonNull(c.getTotalScore(), "[" + c.getCourseTargetName() + "]未设置目标分值");
|
|
//// Objects.requireNonNull(c.getTotalScore(), "[" + c.getCourseTargetName() + "]未设置目标分值");
|
|
// if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
// if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
@@ -1351,21 +1351,21 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
* @param courseTargetDto
|
|
* @param courseTargetDto
|
|
* @param score
|
|
* @param score
|
|
*/
|
|
*/
|
|
- protected void calculateFinalScoreByTargetExamStudent(Map<String, Map<Long, Double>> finalScoreExamStudentTargetMap,
|
|
|
|
|
|
+ protected void calculateFinalScoreByTargetExamStudent(Map<String, Map<Long, BigDecimal>> finalScoreExamStudentTargetMap,
|
|
FinalScoreResult finalScoreResult,
|
|
FinalScoreResult finalScoreResult,
|
|
CourseTargetWebDto courseTargetDto,
|
|
CourseTargetWebDto courseTargetDto,
|
|
- Double score) {
|
|
|
|
|
|
+ BigDecimal score) {
|
|
if (!finalScoreExamStudentTargetMap.containsKey(finalScoreResult.getStudentCode())) {
|
|
if (!finalScoreExamStudentTargetMap.containsKey(finalScoreResult.getStudentCode())) {
|
|
- Map<Long, Double> map = new LinkedHashMap<>();
|
|
|
|
|
|
+ Map<Long, BigDecimal> map = new LinkedHashMap<>();
|
|
map.put(courseTargetDto.getTargetId(), score);
|
|
map.put(courseTargetDto.getTargetId(), score);
|
|
finalScoreExamStudentTargetMap.put(finalScoreResult.getStudentCode(), map);
|
|
finalScoreExamStudentTargetMap.put(finalScoreResult.getStudentCode(), map);
|
|
} else {
|
|
} else {
|
|
- Map<Long, Double> map = finalScoreExamStudentTargetMap.get(finalScoreResult.getStudentCode());
|
|
|
|
|
|
+ Map<Long, BigDecimal> map = finalScoreExamStudentTargetMap.get(finalScoreResult.getStudentCode());
|
|
if (!map.containsKey(courseTargetDto.getTargetId())) {
|
|
if (!map.containsKey(courseTargetDto.getTargetId())) {
|
|
map.put(courseTargetDto.getTargetId(), score);
|
|
map.put(courseTargetDto.getTargetId(), score);
|
|
} else {
|
|
} else {
|
|
- Double scoreTemp = map.get(courseTargetDto.getTargetId());
|
|
|
|
- map.put(courseTargetDto.getTargetId(), scoreTemp.doubleValue() + score.doubleValue());
|
|
|
|
|
|
+ BigDecimal scoreTemp = map.get(courseTargetDto.getTargetId());
|
|
|
|
+ map.put(courseTargetDto.getTargetId(), scoreTemp.add(score));
|
|
}
|
|
}
|
|
finalScoreExamStudentTargetMap.put(finalScoreResult.getStudentCode(), map);
|
|
finalScoreExamStudentTargetMap.put(finalScoreResult.getStudentCode(), map);
|
|
}
|
|
}
|
|
@@ -1391,12 +1391,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
ReportEvaluationDto reportEvaluationDto = usualScoreMap.get(t.getName());
|
|
ReportEvaluationDto reportEvaluationDto = usualScoreMap.get(t.getName());
|
|
List<ReportExamStudentUsualScoreObjDto> reportExamStudentUsualScoreObjDtoList = !scoreListMap.containsKey(reportEvaluationDto.getTargetId()) ? new ArrayList<>() : scoreListMap.get(reportEvaluationDto.getTargetId());
|
|
List<ReportExamStudentUsualScoreObjDto> reportExamStudentUsualScoreObjDtoList = !scoreListMap.containsKey(reportEvaluationDto.getTargetId()) ? new ArrayList<>() : scoreListMap.get(reportEvaluationDto.getTargetId());
|
|
//计算平时作业转换
|
|
//计算平时作业转换
|
|
- Double score = Objects.nonNull(t.getScore()) ? Double.parseDouble(t.getScore()) : 0d;
|
|
|
|
|
|
+ BigDecimal score = Objects.nonNull(t.getScore()) ? new BigDecimal(t.getScore()) : new BigDecimal(0);
|
|
CourseTargetWordDto courseTargetWordDto = targetWordMap.get(reportEvaluationDto.getTargetId());
|
|
CourseTargetWordDto courseTargetWordDto = targetWordMap.get(reportEvaluationDto.getTargetId());
|
|
UsualScoreWordDto usualScoreWordDto = courseTargetWordDto.getUsualScoreDto();
|
|
UsualScoreWordDto usualScoreWordDto = courseTargetWordDto.getUsualScoreDto();
|
|
//old平时作业换算:分数/100*作业目标分
|
|
//old平时作业换算:分数/100*作业目标分
|
|
//new平时作业换算:分数/作业目标分
|
|
//new平时作业换算:分数/作业目标分
|
|
- Double matrixScore = new BigDecimal(score).divide(reportEvaluationDto.getTargetScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetWeight()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
|
|
+ BigDecimal matrixScore = score.divide(reportEvaluationDto.getTargetScore(), 4, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
reportExamStudentUsualScoreObjDtoList.add(new ReportExamStudentUsualScoreObjDto(reportEvaluationDto.getTargetId(), reportEvaluationDto, score, matrixScore, usualScoreWordDto.getUsualScoreTargetSumScore()));
|
|
reportExamStudentUsualScoreObjDtoList.add(new ReportExamStudentUsualScoreObjDto(reportEvaluationDto.getTargetId(), reportEvaluationDto, score, matrixScore, usualScoreWordDto.getUsualScoreTargetSumScore()));
|
|
scoreListMap.put(reportEvaluationDto.getTargetId(), reportExamStudentUsualScoreObjDtoList);
|
|
scoreListMap.put(reportEvaluationDto.getTargetId(), reportExamStudentUsualScoreObjDtoList);
|
|
}
|
|
}
|
|
@@ -1424,7 +1424,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
int count = tcFinalScoreService.getCountByScoreRange(examId, courseCode, paperNumber, cultureProgramId, courseId, start, end);
|
|
int count = tcFinalScoreService.getCountByScoreRange(examId, courseCode, paperNumber, cultureProgramId, courseId, start, end);
|
|
Double rate = null;
|
|
Double rate = null;
|
|
if (toltal != 0) {
|
|
if (toltal != 0) {
|
|
- rate = new BigDecimal(count).divide(new BigDecimal(toltal), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.PERCENT).doubleValue();
|
|
|
|
|
|
+ rate = new BigDecimal(count).divide(new BigDecimal(toltal), 4, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.PERCENT).doubleValue();
|
|
}
|
|
}
|
|
return new ScoreRangeVo(count, start, end, rate);
|
|
return new ScoreRangeVo(count, start, end, rate);
|
|
}
|
|
}
|