|
@@ -1,14 +1,11 @@
|
|
package com.qmth.distributed.print.api;
|
|
package com.qmth.distributed.print.api;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
-import com.qmth.distributed.print.business.bean.dto.FinalScoreDto;
|
|
|
|
import com.qmth.distributed.print.business.bean.dto.report.*;
|
|
import com.qmth.distributed.print.business.bean.dto.report.*;
|
|
-import com.qmth.distributed.print.business.bean.result.FinalScoreResult;
|
|
|
|
import com.qmth.distributed.print.business.bean.result.ScoreResult;
|
|
import com.qmth.distributed.print.business.bean.result.ScoreResult;
|
|
import com.qmth.distributed.print.business.bean.result.report.PaperStructResult;
|
|
import com.qmth.distributed.print.business.bean.result.report.PaperStructResult;
|
|
import com.qmth.distributed.print.business.bean.result.report.ReportResult;
|
|
import com.qmth.distributed.print.business.bean.result.report.ReportResult;
|
|
@@ -27,10 +24,8 @@ import com.qmth.teachcloud.common.util.GsonUtil;
|
|
import com.qmth.teachcloud.common.util.JacksonUtil;
|
|
import com.qmth.teachcloud.common.util.JacksonUtil;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
-import com.qmth.teachcloud.mark.bean.archivescore.ScoreRangeVo;
|
|
|
|
import com.qmth.teachcloud.mark.entity.MarkPaper;
|
|
import com.qmth.teachcloud.mark.entity.MarkPaper;
|
|
import com.qmth.teachcloud.mark.service.MarkPaperService;
|
|
import com.qmth.teachcloud.mark.service.MarkPaperService;
|
|
-import com.qmth.teachcloud.mark.utils.Calculator;
|
|
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -42,12 +37,10 @@ import javax.validation.Valid;
|
|
import javax.validation.constraints.Max;
|
|
import javax.validation.constraints.Max;
|
|
import javax.validation.constraints.Min;
|
|
import javax.validation.constraints.Min;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.math.BigDecimal;
|
|
|
|
-import java.util.*;
|
|
|
|
-import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
-import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
-import java.util.function.Function;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -80,9 +73,6 @@ public class TRBasicInfoController {
|
|
@Resource
|
|
@Resource
|
|
TCPaperStructService tcPaperStructService;
|
|
TCPaperStructService tcPaperStructService;
|
|
|
|
|
|
- @Resource
|
|
|
|
- TCFinalScoreService tcFinalScoreService;
|
|
|
|
-
|
|
|
|
@Resource
|
|
@Resource
|
|
TRExamStudentService trExamStudentService;
|
|
TRExamStudentService trExamStudentService;
|
|
|
|
|
|
@@ -136,201 +126,19 @@ public class TRBasicInfoController {
|
|
List<PaperStructResult> paperStructResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructResult>>() {
|
|
List<PaperStructResult> paperStructResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructResult>>() {
|
|
}.getType());
|
|
}.getType());
|
|
|
|
|
|
- Map<Long, CourseTargetWeightDto> targetMap = new LinkedHashMap<>();//课程目标map
|
|
|
|
reportCourseEvaluationSpreadDto = new ReportCourseEvaluationSpreadDto(paperStructResultList);
|
|
reportCourseEvaluationSpreadDto = new ReportCourseEvaluationSpreadDto(paperStructResultList);
|
|
|
|
|
|
//课程目标考核分布-分数图
|
|
//课程目标考核分布-分数图
|
|
- FinalScoreDto finalScoreDto = tcFinalScoreService.finalScoreScoreOverView(examId, courseCode, paperNumber);
|
|
|
|
- Objects.requireNonNull(finalScoreDto, "未找到期末成绩分数信息");
|
|
|
|
-
|
|
|
|
- fillScoreRange(finalScoreDto, examId, paperNumber, markPaper);
|
|
|
|
- List<ScoreRangeVo> scoreRangeVoList = finalScoreDto.getScoreRange();
|
|
|
|
- if (!CollectionUtils.isEmpty(scoreRangeVoList)) {
|
|
|
|
- Integer failCount = scoreRangeVoList.get(0).getStudentCount();//第一行数据默认为不及格
|
|
|
|
- Double failRate = scoreRangeVoList.get(0).getRate();
|
|
|
|
-
|
|
|
|
- scoreRangeVoList.remove(0);
|
|
|
|
- List<ReportScoreRangeViewDto> scoreRangeViewDtoList = GsonUtil.fromJson(JacksonUtil.parseJson(scoreRangeVoList), new TypeToken<List<ReportScoreRangeViewDto>>() {
|
|
|
|
- }.getType());
|
|
|
|
- ReportScoreViewDto reportScoreViewDto = new ReportScoreViewDto(failCount, failRate, scoreRangeViewDtoList);
|
|
|
|
- reportCourseEvaluationSpreadDto.setScoreList(reportScoreViewDto);
|
|
|
|
- }
|
|
|
|
|
|
+ reportCourseEvaluationSpreadDto.setScoreList(trBasicInfoService.getScoreList(trBasicInfo, markPaper));
|
|
trBasicInfo.setCourseEvaluationSpread(JacksonUtil.parseJson(reportCourseEvaluationSpreadDto));
|
|
trBasicInfo.setCourseEvaluationSpread(JacksonUtil.parseJson(reportCourseEvaluationSpreadDto));
|
|
|
|
|
|
- //查询考生数据
|
|
|
|
- List<FinalScoreResult> finalScoreResultList = tcFinalScoreService.examStudentOverview(examId, courseCode, paperNumber);//考生成绩
|
|
|
|
- Map<String, List<Double>> usualScoreMap = new LinkedHashMap<>();//汇总平常成绩分数(用来算最高分,最低分,平均分)
|
|
|
|
- Map<Long, List<Double>> finalScoreTargetMap = new LinkedHashMap<>();//汇总各课程目标期末考试分数(用来算最高分,最低分,平均分)
|
|
|
|
- Map<String, Map<Long, Map<Long, DimensionDto>>> finalScoreExamStudentDimensionMap = new LinkedHashMap<>();//汇总考生课程目标-知识点
|
|
|
|
- Map<Long, Map<Long, DimensionDto>> finalScoreExamStudentDimensionSumMap = new LinkedHashMap<>();//汇总考生课程目标-知识点总分
|
|
|
|
-
|
|
|
|
- Map<String, UsualScoreOverviewDto> usualScoreOverviewDtoMap = new LinkedHashMap<>();//整体平常成绩分数图
|
|
|
|
- Map<Long, FinalScoreOverviewDto> finalScoreOverviewDtoMap = new LinkedHashMap<>();//各课程目标期末考试分数图
|
|
|
|
- List<ReportExamStudentDto> examStudentList = null;//考生集合
|
|
|
|
- Map<String, FinalScoreResult> finalScoreResultMap = null;//考生成绩map
|
|
|
|
- Map<String, PaperStructResult> paperStructResultMap = null;//试卷蓝图map
|
|
|
|
- if (!CollectionUtils.isEmpty(finalScoreResultList)) {
|
|
|
|
- //期末成绩明细map
|
|
|
|
- paperStructResultMap = paperStructResultList.stream().collect(Collectors.toMap(k -> k.getMainNumber() + "-" + k.getSubNumber(), Function.identity(), (dto1, dto2) -> dto1));
|
|
|
|
- finalScoreResultMap = finalScoreResultList.stream().collect(Collectors.toMap(FinalScoreResult::getStudentCode, Function.identity(), (dto1, dto2) -> dto1));
|
|
|
|
-
|
|
|
|
- examStudentList = new ArrayList<>(finalScoreResultList.size());
|
|
|
|
- for (FinalScoreResult finalScoreResult : finalScoreResultList) {
|
|
|
|
- //解析期末成绩知识点
|
|
|
|
- JSONArray finalScoreDetailJsonArray = JSONArray.parseArray(finalScoreResult.getFinalScoreDetail());
|
|
|
|
- for (int i = 0; i < finalScoreDetailJsonArray.size(); i++) {
|
|
|
|
- JSONObject jsonObject = finalScoreDetailJsonArray.getJSONObject(i);
|
|
|
|
- Double score = Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d;
|
|
|
|
- PaperStructResult paperStructResult = paperStructResultMap.get(jsonObject.get("name").toString());
|
|
|
|
- if (Objects.nonNull(paperStructResult)) {
|
|
|
|
- List<CourseTargetDto> courseTargetDtoList = paperStructResult.getTargetList();
|
|
|
|
-
|
|
|
|
- for (CourseTargetDto courseTargetDto : courseTargetDtoList) {
|
|
|
|
- targetMap.put(courseTargetDto.getTargetId(), new CourseTargetWeightDto(courseTargetDto.getTargetId(), courseTargetDto.getTargetName()));
|
|
|
|
-
|
|
|
|
- //课程目标
|
|
|
|
- if (!finalScoreTargetMap.containsKey(courseTargetDto.getTargetId())) {
|
|
|
|
- finalScoreTargetMap.put(courseTargetDto.getTargetId(), new ArrayList<>(Arrays.asList(score)));
|
|
|
|
- } else {
|
|
|
|
- List<Double> list = finalScoreTargetMap.get(courseTargetDto.getTargetId());
|
|
|
|
- list.add(score);
|
|
|
|
- finalScoreTargetMap.put(courseTargetDto.getTargetId(), list);
|
|
|
|
- }
|
|
|
|
- //知识点
|
|
|
|
- List<DimensionDto> dimensionDtoList = courseTargetDto.getDimensionList();
|
|
|
|
- for (DimensionDto dimensionDto : dimensionDtoList) {
|
|
|
|
- //考生知识点
|
|
|
|
- if (!finalScoreExamStudentDimensionMap.containsKey(finalScoreResult.getStudentCode())) {
|
|
|
|
- Map<Long, Map<Long, DimensionDto>> map = new LinkedHashMap<>();
|
|
|
|
- Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
|
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
|
- map.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
|
|
- finalScoreExamStudentDimensionMap.put(finalScoreResult.getStudentCode(), map);
|
|
|
|
- } else {
|
|
|
|
- Map<Long, Map<Long, DimensionDto>> map = finalScoreExamStudentDimensionMap.get(finalScoreResult.getStudentCode());
|
|
|
|
- if (!map.containsKey(courseTargetDto.getTargetId())) {
|
|
|
|
- Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
|
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
|
- map.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
|
|
- } else {
|
|
|
|
- Map<Long, DimensionDto> dimensionMap = map.get(courseTargetDto.getTargetId());
|
|
|
|
- if (!dimensionMap.containsKey(dimensionDto.getDimensionId())) {
|
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
|
- } else {
|
|
|
|
- DimensionDto dimensionDtoTemp = dimensionMap.get(dimensionDto.getDimensionId());
|
|
|
|
- dimensionDtoTemp.setDimensionScore(dimensionDtoTemp.getDimensionScore().doubleValue() + score.doubleValue());
|
|
|
|
- }
|
|
|
|
- map.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
|
|
- }
|
|
|
|
- finalScoreExamStudentDimensionMap.put(finalScoreResult.getStudentCode(), map);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //目标-考生知识点总分
|
|
|
|
- if (!finalScoreExamStudentDimensionSumMap.containsKey(courseTargetDto.getTargetId())) {
|
|
|
|
- Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
|
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
|
- finalScoreExamStudentDimensionSumMap.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
|
|
- } else {
|
|
|
|
- Map<Long, DimensionDto> dimensionMap = finalScoreExamStudentDimensionSumMap.get(courseTargetDto.getTargetId());
|
|
|
|
- if (!dimensionMap.containsKey(dimensionDto.getDimensionId())) {
|
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
|
- } else {
|
|
|
|
- DimensionDto dimensionDtoTemp = dimensionMap.get(dimensionDto.getDimensionId());
|
|
|
|
- dimensionDtoTemp.setDimensionScore(dimensionDtoTemp.getDimensionScore().doubleValue() + score.doubleValue());
|
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), dimensionDtoTemp);
|
|
|
|
- }
|
|
|
|
- finalScoreExamStudentDimensionSumMap.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //解析平时作业分数图
|
|
|
|
- JSONArray usualScoreJsonArray = JSONArray.parseArray(finalScoreResult.getUsualScore());
|
|
|
|
- List<ReportExamStudentUsualScoreObjDto> scoreList = new ArrayList<>(usualScoreJsonArray.size());
|
|
|
|
- for (int i = 0; i < usualScoreJsonArray.size(); i++) {
|
|
|
|
- JSONObject jsonObject = usualScoreJsonArray.getJSONObject(i);
|
|
|
|
- if (!usualScoreMap.containsKey(jsonObject.get("name"))) {
|
|
|
|
- usualScoreMap.put(jsonObject.get("name").toString(), new ArrayList<>(Arrays.asList(Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d)));
|
|
|
|
- } else {
|
|
|
|
- List<Double> list = usualScoreMap.get(jsonObject.get("name").toString());
|
|
|
|
- list.add(Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d);
|
|
|
|
- usualScoreMap.put(jsonObject.get("name").toString(), list);
|
|
|
|
- }
|
|
|
|
- scoreList.add(new ReportExamStudentUsualScoreObjDto(jsonObject.get("name").toString(), Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d));
|
|
|
|
- }
|
|
|
|
- finalScoreResult.setUsualScoreDto(new ReportExamStudentUsualScoreDto(scoreList));
|
|
|
|
- examStudentList.add(new ReportExamStudentDto(finalScoreResult));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //计算平常成绩最高分,最低分,平均分
|
|
|
|
- usualScoreMap.forEach((k, v) -> {
|
|
|
|
- Double maxScore = v.stream().mapToDouble(Double::doubleValue).max().orElse(0d);
|
|
|
|
- Double minScore = v.stream().mapToDouble(Double::doubleValue).min().orElse(0d);
|
|
|
|
- Double avgScore = new BigDecimal(v.stream().mapToDouble(Double::doubleValue).average().orElse(0d)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- Double sumScore = v.stream().mapToDouble(Double::doubleValue).sum();
|
|
|
|
- usualScoreOverviewDtoMap.put(k, new UsualScoreOverviewDto(k, maxScore, minScore, avgScore, sumScore));
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- //计算各课程目标期末考试最高分,最低分,平均分
|
|
|
|
- finalScoreTargetMap.forEach((k, v) -> {
|
|
|
|
- Double maxScore = v.stream().mapToDouble(Double::doubleValue).max().orElse(0d);
|
|
|
|
- Double minScore = v.stream().mapToDouble(Double::doubleValue).min().orElse(0d);
|
|
|
|
-// Double avgScore = new BigDecimal(v.stream().mapToDouble(Double::doubleValue).average().orElse(0d)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- Double sumScore = v.stream().mapToDouble(Double::doubleValue).sum();
|
|
|
|
- Double avgScore = new BigDecimal(sumScore).divide(new BigDecimal(finalScoreResultList.size()), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- finalScoreOverviewDtoMap.put(k, new FinalScoreOverviewDto(k, maxScore, minScore, avgScore, sumScore));
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- //TODO 课程考核成绩评价结果-待曹子轩补充目标/评价方式数据,有测试数据
|
|
|
|
- if (!CollectionUtils.isEmpty(paperStructResultList)) {
|
|
|
|
- List<CourseTargetDto> targetList = new ArrayList<>(targetMap.size());
|
|
|
|
- AtomicInteger sequenceId = new AtomicInteger(1);//流程连接id
|
|
|
|
- AtomicReference<Double> targetValue = new AtomicReference<>(0.0d);
|
|
|
|
- targetMap.forEach((k, v) -> {
|
|
|
|
- Double evaluationValue = 0.0d;
|
|
|
|
- List<ReportEvaluationDto> reportEvaluationDtoList = new ArrayList<>();
|
|
|
|
- UsualScoreOverviewDto usualScoreOverviewDto = usualScoreOverviewDtoMap.get("作业" + sequenceId.get());
|
|
|
|
- FinalScoreOverviewDto finalScoreOverviewDto = finalScoreOverviewDtoMap.get(k);
|
|
|
|
-
|
|
|
|
- ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(usualScoreOverviewDto.getName(), new BigDecimal(30), 40d, usualScoreOverviewDto.getAvgScore());
|
|
|
|
- reportEvaluationDtoList.add(reportEvaluationDto);
|
|
|
|
-
|
|
|
|
- //课程目标-平时作业达成度计算
|
|
|
|
- if (Objects.nonNull(reportEvaluationDto.getWeight()) && reportEvaluationDto.getWeight().doubleValue() > 0d) {
|
|
|
|
- Double evaluationValueTemp = new BigDecimal(reportEvaluationDto.getAvg().doubleValue() + reportEvaluationDto.getScore().doubleValue()).divide(reportEvaluationDto.getWeight(), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- evaluationValue = evaluationValue.doubleValue() + evaluationValueTemp.doubleValue();
|
|
|
|
- Map<String, BigDecimal> usualScoreWeight = v.getUsualScoreWeight();
|
|
|
|
- usualScoreWeight = CollectionUtils.isEmpty(usualScoreWeight) ? new LinkedHashMap<>() : usualScoreWeight;
|
|
|
|
- usualScoreWeight.put(reportEvaluationDto.getName(), reportEvaluationDto.getWeight().add(new BigDecimal(new Random().nextInt(10))));
|
|
|
|
- v.setUsualScoreWeight(usualScoreWeight);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- ReportEvaluationDto reportEvaluationDto1 = new ReportEvaluationDto("期末考试", new BigDecimal(70), 60d, finalScoreOverviewDto.getAvgScore());
|
|
|
|
- reportEvaluationDtoList.add(reportEvaluationDto1);
|
|
|
|
-
|
|
|
|
- //课程目标-期末成绩达成度计算
|
|
|
|
- if (Objects.nonNull(reportEvaluationDto1.getWeight()) && reportEvaluationDto1.getWeight().doubleValue() > 0d) {
|
|
|
|
- Double evaluationValueTemp = new BigDecimal(reportEvaluationDto1.getAvg().doubleValue() + reportEvaluationDto1.getScore().doubleValue()).divide(reportEvaluationDto1.getWeight(), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- evaluationValue = evaluationValue.doubleValue() + evaluationValueTemp.doubleValue();
|
|
|
|
- v.setFinalScoreWeight(reportEvaluationDto1.getWeight().subtract(new BigDecimal(new Random().nextInt(10))));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- CourseTargetDto courseTargetDto = new CourseTargetDto(k, v.getTargetName(), Long.parseLong(String.valueOf(sequenceId.get())), "评价方式" + sequenceId.get(), "评价方式描述" + sequenceId.get(), reportEvaluationDtoList, evaluationValue);
|
|
|
|
- targetList.add(courseTargetDto);
|
|
|
|
- targetValue.set(targetValue.get().doubleValue() + courseTargetDto.getEvaluationValue().doubleValue());
|
|
|
|
- sequenceId.incrementAndGet();
|
|
|
|
- });
|
|
|
|
- reportCourseEvaluationResultDto = new ReportCourseEvaluationResultDto("测试课程总目标1", targetValue.get(), targetList);
|
|
|
|
- trBasicInfo.setCourseEvaluationResult(JacksonUtil.parseJson(reportCourseEvaluationResultDto));
|
|
|
|
- }
|
|
|
|
|
|
+ Map<String, Object> paramsMap = trBasicInfoService.getReportCalculateParams(trBasicInfo, paperStructResultList);
|
|
|
|
+ paramsMap = trBasicInfoService.reportCalculateMaxMinAvgSumScore(paramsMap);
|
|
|
|
+ reportCourseEvaluationResultDto = trBasicInfoService.reportCalculateCourseEvaluationResult(paramsMap);
|
|
|
|
|
|
|
|
+ trBasicInfo.setCourseEvaluationResult(JacksonUtil.parseJson(reportCourseEvaluationResultDto));
|
|
//课程目标达成评价明细结果-考生集合
|
|
//课程目标达成评价明细结果-考生集合
|
|
- List<ReportExamStudentDto> examStudentNewList = trExamStudentService.getExamStudentReportDetail(trBasicInfo, examStudentList, finalScoreExamStudentDimensionMap,
|
|
|
|
- finalScoreResultMap, paperStructResultMap, targetMap, finalScoreExamStudentDimensionSumMap,
|
|
|
|
- usualScoreOverviewDtoMap);
|
|
|
|
|
|
+ List<ReportExamStudentDto> examStudentNewList = trExamStudentService.getExamStudentReportDetail(trBasicInfo, paramsMap);
|
|
reportCourseEvaluationResultDetailDto = new ReportCourseEvaluationResultDetailDto(examStudentNewList);
|
|
reportCourseEvaluationResultDetailDto = new ReportCourseEvaluationResultDetailDto(examStudentNewList);
|
|
} else {
|
|
} else {
|
|
reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
|
|
reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
|
|
@@ -384,65 +192,4 @@ public class TRBasicInfoController {
|
|
TRBasicInfo trBasicInfo = trBasicInfoService.getOne(new QueryWrapper<TRBasicInfo>().lambda().eq(TRBasicInfo::getExamId, examId).eq(TRBasicInfo::getCourseCode, courseCode).eq(TRBasicInfo::getPaperNumber, paperNumber));
|
|
TRBasicInfo trBasicInfo = trBasicInfoService.getOne(new QueryWrapper<TRBasicInfo>().lambda().eq(TRBasicInfo::getExamId, examId).eq(TRBasicInfo::getCourseCode, courseCode).eq(TRBasicInfo::getPaperNumber, paperNumber));
|
|
Objects.requireNonNull(trBasicInfo, "没有报告信息");
|
|
Objects.requireNonNull(trBasicInfo, "没有报告信息");
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 计算分数范围
|
|
|
|
- *
|
|
|
|
- * @param finalScoreDto
|
|
|
|
- * @param examId
|
|
|
|
- * @param paperNumber
|
|
|
|
- * @param markPaper
|
|
|
|
- */
|
|
|
|
- protected void fillScoreRange(FinalScoreDto finalScoreDto, Long examId, String paperNumber, MarkPaper markPaper) {
|
|
|
|
- //分数区间
|
|
|
|
- Double passScore = markPaper.getPassScore();//及格分
|
|
|
|
- Objects.requireNonNull(passScore, "及格分为空");
|
|
|
|
-
|
|
|
|
- Double totalScore = markPaper.getTotalScore();
|
|
|
|
- Objects.requireNonNull(totalScore, "试卷满分为空");
|
|
|
|
-
|
|
|
|
- List<ScoreRangeVo> scoreRange = new ArrayList<>();
|
|
|
|
- finalScoreDto.setScoreRange(scoreRange);
|
|
|
|
-
|
|
|
|
- //开始、结束分数区间
|
|
|
|
- Double startInterval = 0.5d, endInterval = 9.5d, increaseStartScore = passScore - startInterval,
|
|
|
|
- increaseEndScore = increaseStartScore + startInterval + endInterval;
|
|
|
|
- scoreRange.add(getScoreRangeVo(finalScoreDto.getStudentCount(), examId, markPaper.getCourseCode(), paperNumber, 1.0d, increaseStartScore));
|
|
|
|
- increaseStartScore = increaseStartScore + startInterval;
|
|
|
|
- increaseEndScore = increaseStartScore + endInterval;
|
|
|
|
- if (totalScore.doubleValue() - increaseEndScore.doubleValue() == startInterval || increaseEndScore.doubleValue() >= totalScore.doubleValue()) {
|
|
|
|
- increaseEndScore = totalScore;
|
|
|
|
- scoreRange.add(getScoreRangeVo(finalScoreDto.getStudentCount(), examId, markPaper.getCourseCode(), paperNumber, increaseStartScore, increaseEndScore));
|
|
|
|
- } else {
|
|
|
|
- while (increaseEndScore.doubleValue() < totalScore.doubleValue()) {
|
|
|
|
- scoreRange.add(getScoreRangeVo(finalScoreDto.getStudentCount(), examId, markPaper.getCourseCode(), paperNumber, increaseStartScore, increaseEndScore));
|
|
|
|
- increaseStartScore = increaseEndScore + startInterval;
|
|
|
|
- increaseEndScore = increaseStartScore + endInterval;
|
|
|
|
- if (totalScore.doubleValue() - increaseEndScore.doubleValue() == startInterval || increaseEndScore.doubleValue() >= totalScore.doubleValue()) {
|
|
|
|
- increaseEndScore = totalScore;
|
|
|
|
- scoreRange.add(getScoreRangeVo(finalScoreDto.getStudentCount(), examId, markPaper.getCourseCode(), paperNumber, increaseStartScore, increaseEndScore));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 计算分数比率
|
|
|
|
- *
|
|
|
|
- * @param toltal
|
|
|
|
- * @param examId
|
|
|
|
- * @param courseCode
|
|
|
|
- * @param paperNumber
|
|
|
|
- * @param start
|
|
|
|
- * @param end
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- protected ScoreRangeVo getScoreRangeVo(int toltal, Long examId, String courseCode, String paperNumber, Double start, Double end) {
|
|
|
|
- int count = tcFinalScoreService.getCountByScoreRange(examId, courseCode, paperNumber, start, end);
|
|
|
|
- Double rate = null;
|
|
|
|
- if (toltal != 0) {
|
|
|
|
- rate = Calculator.multiply(count, toltal, 2);
|
|
|
|
- }
|
|
|
|
- return new ScoreRangeVo(count, start, end, rate);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|