|
@@ -126,7 +126,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
List<ScoreRangeVo> scoreRangeVoList = finalScoreDto.getScoreRange();
|
|
|
if (!CollectionUtils.isEmpty(scoreRangeVoList)) {
|
|
|
Integer failCount = scoreRangeVoList.get(0).getStudentCount();
|
|
|
- Double failRate = scoreRangeVoList.get(0).getRate();
|
|
|
+ BigDecimal failRate = new BigDecimal(scoreRangeVoList.get(0).getRate());
|
|
|
|
|
|
scoreRangeVoList.remove(0);
|
|
|
List<ReportScoreRangeViewDto> scoreRangeViewDtoList = GsonUtil.fromJson(JacksonUtil.parseJson(scoreRangeVoList), new TypeToken<List<ReportScoreRangeViewDto>>() {
|
|
@@ -153,8 +153,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
throw ExceptionResultEnum.ERROR.exception("成绩数据异常,平时成绩与期末成绩里考生名单不一致,请检查");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- Map<String, Map<Long, Double>> finalScoreExamStudentTargetMap = new LinkedHashMap<>();
|
|
|
+ Map<String, Map<Long, BigDecimal>> finalScoreExamStudentTargetMap = new LinkedHashMap<>();
|
|
|
Map<Long, Map<Long, DimensionDto>> targetDimensionMap = new LinkedHashMap<>();
|
|
|
|
|
|
List<ReportExamStudentDto> examStudentList = null;
|
|
@@ -184,7 +183,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
if (!CollectionUtils.isEmpty(courseWeightDetailDtoList)) {
|
|
|
List<ReportEvaluationDto> reportEvaluationDtoList = new ArrayList<>(courseWeightDetailDtoList.size());
|
|
|
List<ReportEvaluationDto> usualScoreDetailList = new ArrayList<>(courseWeightDetailDtoList.size());
|
|
|
-
|
|
|
UsualScoreWordDto usualScoreWordDto = new UsualScoreWordDto();
|
|
|
usualScoreWordDto.setUsualScoreDetailList(usualScoreDetailList);
|
|
|
BigDecimal usualScoreTargetSumScore = new BigDecimal(0);
|
|
@@ -193,13 +191,11 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
if (courseWeightDetailDto.getEnable() && Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
|
|
|
FinalScoreWordDto finalScoreWordDto = new FinalScoreWordDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto);
|
|
|
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);
|
|
|
}
|
|
|
else if (courseWeightDetailDto.getEnable() && !Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
|
|
|
-
|
|
|
-
|
|
|
- ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, 0.0d);
|
|
|
+ ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, new BigDecimal(0));
|
|
|
usualScoreTargetSumScore = usualScoreTargetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
|
usualScoreDetailList.add(reportEvaluationDto);
|
|
|
reportEvaluationDtoList.add(reportEvaluationDto);
|
|
@@ -225,7 +221,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
List<TCFinalScoreDto> tcFinalScoreDtoList = GsonUtil.fromJson(finalScoreResult.getFinalScoreDetail(), new TypeToken<List<TCFinalScoreDto>>() {
|
|
|
}.getType());
|
|
|
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());
|
|
|
if (Objects.nonNull(paperStructDimensionResult)) {
|
|
|
List<CourseTargetWebDto> courseTargetDtoList = paperStructDimensionResult.getTargetList();
|
|
@@ -234,11 +230,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
|
|
|
List<DimensionDto> dimensionDtoList = courseTargetDto.getDimensionList();
|
|
|
for (DimensionDto dimensionDto : dimensionDtoList) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if (i == 0) {
|
|
|
- Double paperScore = paperStructDimensionResult.getScore();
|
|
|
+ BigDecimal paperScore = paperStructDimensionResult.getScore();
|
|
|
|
|
|
if (!targetDimensionMap.containsKey(courseTargetDto.getTargetId())) {
|
|
|
Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
|
|
@@ -250,7 +243,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, paperScore));
|
|
|
} else {
|
|
|
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);
|
|
|
}
|
|
@@ -265,28 +258,21 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
targetDimensionMap.forEach((k, v) -> {
|
|
|
List<DimensionDto> dimensionDtoList = new ArrayList<>(v.values());
|
|
|
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());
|
|
|
if (finalTargetWordMap.containsKey(k)) {
|
|
|
if (Objects.nonNull(finalTargetWordMap.get(k).getFinalScoreDto())) {
|
|
|
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));
|
|
|
}
|
|
|
if (finalTargetWebMap.containsKey(k)) {
|
|
|
- finalTargetWebMap.get(k).setDimensionScoreSum(dimensionScoreSum);
|
|
|
+ finalTargetWebMap.get(k).setDimensionScoreSum(new BigDecimal(dimensionScoreSum));
|
|
|
finalTargetWebMap.get(k).setDimensionPoint(String.join(",", dimensionDtoNameList));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- 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));
|
|
|
});
|
|
|
|
|
@@ -299,7 +285,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
|
|
|
paramsMap.put("finalScoreResultList", finalScoreResultList);
|
|
|
paramsMap.put("usualScoreMap", usualScoreMap);
|
|
|
-
|
|
|
paramsMap.put("finalScoreExamStudentTargetMap", finalScoreExamStudentTargetMap);
|
|
|
paramsMap.put("examStudentList", examStudentList);
|
|
|
paramsMap.put("finalScoreResultMap", finalScoreResultMap);
|
|
@@ -357,9 +342,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}
|
|
|
}
|
|
|
for (ReportExamStudentTargetDto r : reportExamStudentTargetAvgDtoList) {
|
|
|
- Double targetAvgSumScore = 0.0d;
|
|
|
+ BigDecimal targetAvgSumScore = new BigDecimal(0);
|
|
|
BigDecimal targetSumScore = new BigDecimal(0);
|
|
|
-
|
|
|
if (targetWebMap.containsKey(r.getTargetId())) {
|
|
|
CourseTargetWebDto courseTargetWebDto = targetWebMap.get(r.getTargetId());
|
|
|
CourseTargetWordDto courseTargetWordDto = targetWordMap.get(r.getTargetId());
|
|
@@ -375,11 +359,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
if (Objects.nonNull(reportExamStudentFinalScoreDto)) {
|
|
|
reportEvaluationDto = reportEvaluationDtoMap.get(reportExamStudentFinalScoreDto.getEvaluationId());
|
|
|
reportEvaluationDto.setTargetAvgScore(reportExamStudentFinalScoreDto.getMatrixAvgScore());
|
|
|
- targetAvgSumScore = targetAvgSumScore + reportEvaluationDto.getTargetAvgScore();
|
|
|
+ targetAvgSumScore = targetAvgSumScore.add(reportEvaluationDto.getTargetAvgScore());
|
|
|
targetSumScore = targetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -388,11 +369,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
for (ReportExamStudentUsualScoreObjDto reportExamStudentUsualScoreObjDto : reportExamStudentUsualScoreObjDtoList) {
|
|
|
reportEvaluationDto = reportEvaluationDtoMap.get(reportExamStudentUsualScoreObjDto.getEvaluationId());
|
|
|
reportEvaluationDto.setTargetAvgScore(reportExamStudentUsualScoreObjDto.getMatrixAvgScore());
|
|
|
- targetAvgSumScore = targetAvgSumScore + reportEvaluationDto.getTargetAvgScore();
|
|
|
+ targetAvgSumScore = targetAvgSumScore.add(reportEvaluationDto.getTargetAvgScore());
|
|
|
targetSumScore = targetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -400,9 +378,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
|
|
|
BigDecimal targetEvaluationValue = new BigDecimal(0);
|
|
|
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);
|
|
|
}
|
|
|
-
|
|
|
courseTargetWebDto.setEvaluationValue(targetEvaluationValue);
|
|
|
if (targetEvaluationSumValue.compareTo(new BigDecimal(0)) == 0 || targetEvaluationSumValue.compareTo(targetEvaluationValue) == 1) {
|
|
|
targetEvaluationSumValue = targetEvaluationValue;
|
|
@@ -449,9 +426,9 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
Objects.requireNonNull(basicProfessional, "未找到专业信息");
|
|
|
Double expectValue = obeCourseWeightResult.getSubmitForm().get(0).getExpectValue();
|
|
|
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 {
|
|
|
- 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);
|
|
@@ -660,102 +637,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
return tableBuilder2.mergeRule(mergeCellRule2).left().create();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
* 构建word动态表格5
|
|
|
*
|
|
@@ -767,9 +648,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
public TableRenderData buildWordTable5(TRBasicInfo trBasicInfo, CourseReportBean courseReportBean) {
|
|
|
TableRenderData tableRenderDataExamStudent = null;
|
|
|
List<TRExamStudent> trExamStudentList = trExamStudentService.list(new QueryWrapper<TRExamStudent>().lambda()
|
|
|
- .eq(TRExamStudent::getrBasicInfoId, trBasicInfo.getId()).and(w -> w.ne(TRExamStudent::getStudentCode, "目标分")
|
|
|
-
|
|
|
- ));
|
|
|
+ .eq(TRExamStudent::getrBasicInfoId, trBasicInfo.getId()).and(w -> w.ne(TRExamStudent::getStudentCode, "目标分")));
|
|
|
if (!CollectionUtils.isEmpty(trExamStudentList)) {
|
|
|
List<CellRenderData> examStudent_cells_1 = new ArrayList<>(), examStudent_cells_2 = new ArrayList<>();
|
|
|
examStudent_cells_1.add(Cells.of("序号").center().create());
|
|
@@ -841,17 +720,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
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++) {
|
|
|
TRExamStudent trExamStudent = trExamStudentList.get(i);
|
|
|
RowRenderData examStudent_row = new RowRenderData();
|
|
|
List<CellRenderData> examStudent_cells = new ArrayList<>();
|
|
|
switch (trExamStudent.getName()) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
case "平均分":
|
|
|
examStudent_cells.add(Cells.of("平均分").create());
|
|
|
examStudent_cells.add(Cells.of("平均分").create());
|
|
@@ -870,7 +744,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}
|
|
|
examStudent_cells.add(Cells.of(trExamStudent.getAdministrativeClass()).create());
|
|
|
|
|
|
-
|
|
|
BigDecimal targetAvgScore = new BigDecimal(0);
|
|
|
if (Objects.nonNull(trExamStudent.getResultDetail())) {
|
|
|
List<ReportExamStudentTargetDto> reportExamStudentTargetDtoList = JSONArray.parseArray(trExamStudent.getResultDetail(), ReportExamStudentTargetDto.class);
|
|
@@ -879,17 +752,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
ReportExamStudentUsualScoreDto reportExamStudentUsualScoreDto = reportExamStudentTargetDto.getUsualScore();
|
|
|
|
|
|
if (Objects.nonNull(reportExamStudentUsualScoreDto) && !CollectionUtils.isEmpty(reportExamStudentUsualScoreDto.getScoreList())) {
|
|
|
-
|
|
|
List<ReportExamStudentUsualScoreObjDto> reportExamStudentUsualScoreObjDtoList = reportExamStudentUsualScoreDto.getScoreList();
|
|
|
for (ReportExamStudentUsualScoreObjDto reportExamStudentUsualScoreObjDto : reportExamStudentUsualScoreObjDtoList) {
|
|
|
switch (trExamStudent.getName()) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
case "平均分":
|
|
|
examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentUsualScoreObjDto.getMatrixAvgScore())).create());
|
|
|
- targetAvgScore = targetAvgScore.add(new BigDecimal(reportExamStudentUsualScoreObjDto.getMatrixAvgScore()));
|
|
|
+ targetAvgScore = targetAvgScore.add(reportExamStudentUsualScoreObjDto.getMatrixAvgScore());
|
|
|
break;
|
|
|
case "各课程目标平均分":
|
|
|
examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
|
|
@@ -905,13 +773,9 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
if (Objects.nonNull(reportExamStudentFinalScoreDto) && Objects.equals(reportExamStudentFinalScoreDto.getEvaluation(), SystemConstant.FINAL_SCORE_STR)) {
|
|
|
courseReportBean.getCourseBasicBean().setFinalScoreWeight(reportExamStudentFinalScoreDto.getTargetWeight());
|
|
|
switch (trExamStudent.getName()) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
case "平均分":
|
|
|
examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getMatrixAvgScore())).create());
|
|
|
- targetAvgScore = targetAvgScore.add(new BigDecimal(reportExamStudentFinalScoreDto.getMatrixAvgScore()));
|
|
|
+ targetAvgScore = targetAvgScore.add(reportExamStudentFinalScoreDto.getMatrixAvgScore());
|
|
|
break;
|
|
|
case "各课程目标平均分":
|
|
|
examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
|
|
@@ -925,11 +789,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}
|
|
|
}
|
|
|
switch (trExamStudent.getName()) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
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;
|
|
|
case "各课程目标平均分":
|
|
|
examStudent_cells.add(Cells.of("").create());
|
|
@@ -958,13 +819,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
examStudent_last_row.setRowStyle(this.getRowStyle());
|
|
|
rowRenderDataExamStudent[rowRenderDataExamStudent.length - 1] = examStudent_last_row;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
MergeCellRule mergeCellRuleExamStudent = MergeCellRule.builder().build();
|
|
|
mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(1, 0)));
|
|
@@ -989,7 +843,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 1, 4), MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 1, cellSize - 1)));
|
|
|
mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(0, rowRenderDataExamStudent[rowRenderDataExamStudent.length - 1].getCells().size() - 1), MergeCellRule.Grid.of(1, rowRenderDataExamStudent[rowRenderDataExamStudent.length - 1].getCells().size() - 1)));
|
|
|
|
|
|
-
|
|
|
Tables.TableBuilder tableBuilderExamStudent = Tables.ofPercentWidth(tbPercentWidth);
|
|
|
for (int i = 0; i < rowRenderDataExamStudent.length; i++) {
|
|
|
tableBuilderExamStudent.addRow(rowRenderDataExamStudent[i]);
|
|
@@ -1000,10 +853,10 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
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)};
|
|
|
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) {
|
|
|
scoreSizes[0] = scoreSizes[0] + 1;
|
|
|
} else if (d.doubleValue() <= 89 && d.doubleValue() >= 80) {
|
|
@@ -1017,7 +870,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}
|
|
|
}
|
|
|
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("scorePercent", scorePercent);
|
|
@@ -1159,9 +1012,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
public ObeCourseWeightResult findCourseWeightResultRmi(Long obeCourseOutlineId) {
|
|
|
ObeCourseWeightResult obeCourseWeightResult = obeCourseWeightService.findCourseWeight(obeCourseOutlineId);
|
|
|
Objects.requireNonNull(obeCourseWeightResult, "未设置课程目标数据");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
Objects.requireNonNull(obeCourseWeightResult.getWeightSettingSign(), "课程权重变化id为空");
|
|
|
Objects.requireNonNull(obeCourseWeightResult.getDimensionSign(), "知识点变化id为空");
|
|
|
List<CourseWeightDto> courseWeightDtoList = obeCourseWeightResult.getSubmitForm();
|
|
@@ -1176,13 +1026,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}.getType());
|
|
|
for (CourseWeightDto c : obeCourseWeightResult.getSubmitForm()) {
|
|
|
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() + "]未设置权重");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
List<CourseWeightDetailDto> courseWeightDetailDtoList = c.getEvaluationList();
|
|
|
for (CourseWeightDetailDto courseWeightDetailDto : courseWeightDetailDtoList) {
|
|
|
if (Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
|
|
@@ -1351,21 +1196,21 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
* @param courseTargetDto
|
|
|
* @param score
|
|
|
*/
|
|
|
- protected void calculateFinalScoreByTargetExamStudent(Map<String, Map<Long, Double>> finalScoreExamStudentTargetMap,
|
|
|
+ protected void calculateFinalScoreByTargetExamStudent(Map<String, Map<Long, BigDecimal>> finalScoreExamStudentTargetMap,
|
|
|
FinalScoreResult finalScoreResult,
|
|
|
CourseTargetWebDto courseTargetDto,
|
|
|
- Double score) {
|
|
|
+ BigDecimal score) {
|
|
|
if (!finalScoreExamStudentTargetMap.containsKey(finalScoreResult.getStudentCode())) {
|
|
|
- Map<Long, Double> map = new LinkedHashMap<>();
|
|
|
+ Map<Long, BigDecimal> map = new LinkedHashMap<>();
|
|
|
map.put(courseTargetDto.getTargetId(), score);
|
|
|
finalScoreExamStudentTargetMap.put(finalScoreResult.getStudentCode(), map);
|
|
|
} else {
|
|
|
- Map<Long, Double> map = finalScoreExamStudentTargetMap.get(finalScoreResult.getStudentCode());
|
|
|
+ Map<Long, BigDecimal> map = finalScoreExamStudentTargetMap.get(finalScoreResult.getStudentCode());
|
|
|
if (!map.containsKey(courseTargetDto.getTargetId())) {
|
|
|
map.put(courseTargetDto.getTargetId(), score);
|
|
|
} 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);
|
|
|
}
|
|
@@ -1391,12 +1236,11 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
ReportEvaluationDto reportEvaluationDto = usualScoreMap.get(t.getName());
|
|
|
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());
|
|
|
UsualScoreWordDto usualScoreWordDto = courseTargetWordDto.getUsualScoreDto();
|
|
|
-
|
|
|
-
|
|
|
- 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()));
|
|
|
scoreListMap.put(reportEvaluationDto.getTargetId(), reportExamStudentUsualScoreObjDtoList);
|
|
|
}
|
|
@@ -1424,7 +1268,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
int count = tcFinalScoreService.getCountByScoreRange(examId, courseCode, paperNumber, cultureProgramId, courseId, start, end);
|
|
|
Double rate = null;
|
|
|
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);
|
|
|
}
|