|
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.CourseWeightDetailDto;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.CourseWeightDto;
|
|
|
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.result.FinalScoreResult;
|
|
@@ -14,12 +16,14 @@ import com.qmth.distributed.print.business.entity.TRBasicInfo;
|
|
|
import com.qmth.distributed.print.business.mapper.TRBasicInfoMapper;
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
import com.qmth.teachcloud.common.entity.BasicSemester;
|
|
|
+import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.service.BasicSemesterService;
|
|
|
import com.qmth.teachcloud.common.util.GsonUtil;
|
|
|
import com.qmth.teachcloud.common.util.JacksonUtil;
|
|
|
+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.service.MarkStudentService;
|
|
|
import com.qmth.teachcloud.mark.utils.Calculator;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -28,7 +32,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -97,68 +100,133 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
*/
|
|
|
@Override
|
|
|
public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructResult> paperStructResultList) {
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
|
//查询考生数据
|
|
|
List<FinalScoreResult> finalScoreResultList = tcFinalScoreService.examStudentOverview(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), trBasicInfo.getPaperNumber());//考生成绩
|
|
|
- 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<Long, Map<Long, DimensionDto>> targetDimensionMap = new LinkedHashMap<>();//课程目标-知识点
|
|
|
+// 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<Long, Map<Long, DimensionDto>> targetDimensionMap = new LinkedHashMap<>();//课程目标-知识点-卷面分(word报表用)
|
|
|
|
|
|
List<ReportExamStudentDto> examStudentList = null;//考生集合
|
|
|
Map<String, FinalScoreResult> finalScoreResultMap = null;//考生成绩map
|
|
|
Map<String, PaperStructResult> paperStructResultMap = null;//试卷蓝图map
|
|
|
- Map<Long, CourseTargetValueDto> targetMap = null;
|
|
|
-
|
|
|
+ Map<Long, CourseTargetWordDto> targetWordMap = null;//word目标集合
|
|
|
+ Map<Long, CourseTargetWebDto> targetWebMap = null;//web目标集合
|
|
|
+ Map<String, ReportEvaluationDto> usualScoreMap = null;//平时作业集合
|
|
|
if (!CollectionUtils.isEmpty(finalScoreResultList)) {
|
|
|
+ targetWordMap = new LinkedHashMap<>();
|
|
|
+ targetWebMap = new LinkedHashMap<>();
|
|
|
+ usualScoreMap = new LinkedHashMap<>();
|
|
|
+ //TODO 获取曹子轩课程目标信息
|
|
|
+ List<CourseWeightDto> courseWeightDtoList = courseWeightService.findCourseWeight(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), sysUser.getId());
|
|
|
+ if (CollectionUtils.isEmpty(courseWeightDtoList)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("未设置课程目标平时作业1");
|
|
|
+ }
|
|
|
+
|
|
|
+ courseWeightDtoList.clear();
|
|
|
+ //测试数据,默认平时作业30%权重,期末考试70%权重
|
|
|
+ int f = 5, s = 6;
|
|
|
+ for (int i = 0; i < 2; i++) {
|
|
|
+ int y = i == 0 ? f : s;
|
|
|
+ List<CourseWeightDetailDto> courseWeightDetailDtoList = new ArrayList<>();
|
|
|
+ for (int k = 0; k < y; k++) {
|
|
|
+ if (y == 5) {
|
|
|
+ courseWeightDetailDtoList.add(new CourseWeightDetailDto("作业" + (i + 1) + "-" + (k + 1), new BigDecimal(20), new BigDecimal(2.4).setScale(2, BigDecimal.ROUND_HALF_UP)));
|
|
|
+ } else {
|
|
|
+ courseWeightDetailDtoList.add(new CourseWeightDetailDto("作业" + (i + 1) + "-" + (k + 1), new BigDecimal(16.66).setScale(2, BigDecimal.ROUND_HALF_UP), new BigDecimal(3)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (y == 5) {
|
|
|
+ courseWeightDetailDtoList.add(new CourseWeightDetailDto("期末考试", new BigDecimal(70), new BigDecimal(28)));
|
|
|
+ } else {
|
|
|
+ courseWeightDetailDtoList.add(new CourseWeightDetailDto("期末考试", new BigDecimal(70), new BigDecimal(42)));
|
|
|
+ }
|
|
|
+ courseWeightDtoList.add(new CourseWeightDto(Long.parseLong((i + 1) + ""), "课程目标" + (i + 1), "测试毕业要求" + (i + 1), new BigDecimal(50), new BigDecimal(50), courseWeightDetailDtoList));
|
|
|
+ }
|
|
|
+
|
|
|
+ for (CourseWeightDto courseWeightDto : courseWeightDtoList) {
|
|
|
+ List<CourseWeightDetailDto> courseWeightDetailDtoList = courseWeightDto.getEvaluationList();
|
|
|
+ CourseTargetWordDto courseTargetWordDto = new CourseTargetWordDto(courseWeightDto);
|
|
|
+ targetWordMap.put(courseWeightDto.getCourseTargetId(), courseTargetWordDto);//word模版
|
|
|
+
|
|
|
+ CourseTargetWebDto courseTargetWebDto = new CourseTargetWebDto(courseWeightDto);
|
|
|
+ targetWebMap.put(courseWeightDto.getCourseTargetId(), courseTargetWebDto);//web模版
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(courseWeightDetailDtoList)) {
|
|
|
+ List<ReportEvaluationDto> reportEvaluationDtoList = new ArrayList<>(courseWeightDetailDtoList.size());
|
|
|
+ List<ReportEvaluationDto> usualScoreDetailList = new ArrayList<>(courseWeightDetailDtoList.size());
|
|
|
+ UsualScoreWordDto usualScoreWordDto = new UsualScoreWordDto(new BigDecimal(30));
|
|
|
+ usualScoreWordDto.setUsualScoreDetailList(usualScoreDetailList);
|
|
|
+ BigDecimal usualScoreTargetSumScore = new BigDecimal(0);//平常作业目标总分
|
|
|
+ for (CourseWeightDetailDto courseWeightDetailDto : courseWeightDetailDtoList) {
|
|
|
+ //期末考试
|
|
|
+ if (courseWeightDetailDto.getEnable() && courseWeightDetailDto.getEvaluationName().startsWith("期末考试")) {
|
|
|
+ FinalScoreWordDto finalScoreWordDto = new FinalScoreWordDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto);
|
|
|
+ courseTargetWordDto.setFinalScoreDto(finalScoreWordDto);
|
|
|
+ ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto);
|
|
|
+ reportEvaluationDtoList.add(reportEvaluationDto);
|
|
|
+ }//非期末考试
|
|
|
+ else if (courseWeightDetailDto.getEnable() && !courseWeightDetailDto.getEvaluationName().startsWith("期末考试")) {
|
|
|
+ ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto);
|
|
|
+ usualScoreTargetSumScore = usualScoreTargetSumScore.add(reportEvaluationDto.getTargetScore());
|
|
|
+ usualScoreDetailList.add(reportEvaluationDto);
|
|
|
+ reportEvaluationDtoList.add(reportEvaluationDto);
|
|
|
+ usualScoreMap.put(courseWeightDetailDto.getEvaluationName(), reportEvaluationDto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ usualScoreWordDto.setUsualScoreTargetSumScore(usualScoreTargetSumScore);
|
|
|
+ Collections.sort(reportEvaluationDtoList);
|
|
|
+ courseTargetWebDto.setEvaluationList(reportEvaluationDtoList);
|
|
|
+
|
|
|
+ courseTargetWordDto.setUsualScoreDto(usualScoreWordDto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// List<CourseWeightFormDto> courseWeightFormDtoList = courseWeightService.findCourseWeightForm(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), sysUser.getId());
|
|
|
+// if (CollectionUtils.isEmpty(courseWeightFormDtoList)) {
|
|
|
+// throw ExceptionResultEnum.ERROR.exception("未设置课程目标平时作业2");
|
|
|
+// }
|
|
|
+
|
|
|
//期末成绩明细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());
|
|
|
- targetMap = new LinkedHashMap<>();
|
|
|
+ BigDecimal bigDecimal = new BigDecimal(100);
|
|
|
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 CourseTargetValueDto(courseTargetDto));
|
|
|
-
|
|
|
- //课程目标
|
|
|
- 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<CourseTargetWebDto> courseTargetDtoList = paperStructResult.getTargetList();
|
|
|
+ for (CourseTargetWebDto courseTargetDto : courseTargetDtoList) {
|
|
|
+ //知识点-期末考试明细分
|
|
|
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));
|
|
|
+ dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), 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));
|
|
|
+ dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), 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));
|
|
|
+ dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, score));
|
|
|
} else {
|
|
|
DimensionDto dimensionDtoTemp = dimensionMap.get(dimensionDto.getDimensionId());
|
|
|
dimensionDtoTemp.setDimensionScore(dimensionDtoTemp.getDimensionScore().doubleValue() + score.doubleValue());
|
|
@@ -168,20 +236,20 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
finalScoreExamStudentDimensionMap.put(finalScoreResult.getStudentCode(), map);
|
|
|
}
|
|
|
|
|
|
- //目标-考生知识点总分
|
|
|
+ //目标-考生知识点总分-期末考试总分
|
|
|
if (!finalScoreExamStudentDimensionSumMap.containsKey(courseTargetDto.getTargetId())) {
|
|
|
Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
+ dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, score));
|
|
|
Map<Long, DimensionDto> dimensionTempMap = new LinkedHashMap<>();
|
|
|
- dimensionTempMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
+ dimensionTempMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, score));
|
|
|
finalScoreExamStudentDimensionSumMap.put(courseTargetDto.getTargetId(), dimensionMap);
|
|
|
targetDimensionMap.put(courseTargetDto.getTargetId(), dimensionTempMap);
|
|
|
} else {
|
|
|
Map<Long, DimensionDto> dimensionMap = finalScoreExamStudentDimensionSumMap.get(courseTargetDto.getTargetId());
|
|
|
if (!dimensionMap.containsKey(dimensionDto.getDimensionId())) {
|
|
|
- dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
+ dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, score));
|
|
|
Map<Long, DimensionDto> dimensionTempMap = targetDimensionMap.get(courseTargetDto.getTargetId());
|
|
|
- dimensionTempMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
|
|
|
+ dimensionTempMap.put(dimensionDto.getDimensionId(), new DimensionDto(courseTargetDto.getTargetId(), dimensionDto, score));
|
|
|
targetDimensionMap.put(courseTargetDto.getTargetId(), dimensionTempMap);
|
|
|
} else {
|
|
|
DimensionDto dimensionDtoTemp = dimensionMap.get(dimensionDto.getDimensionId());
|
|
@@ -197,39 +265,48 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
|
|
|
//解析平时作业分数图
|
|
|
JSONArray usualScoreJsonArray = JSONArray.parseArray(finalScoreResult.getUsualScore());
|
|
|
- List<ReportExamStudentUsualScoreObjDto> scoreList = new ArrayList<>(usualScoreJsonArray.size());
|
|
|
+ Map<Long, List<ReportExamStudentUsualScoreObjDto>> scoreListMap = new LinkedHashMap<>();
|
|
|
+ ReportExamStudentUsualScoreDto reportExamStudentUsualScoreDto = new ReportExamStudentUsualScoreDto(scoreListMap);
|
|
|
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);
|
|
|
+ if (usualScoreMap.containsKey(jsonObject.get("name"))) {
|
|
|
+ ReportEvaluationDto reportEvaluationDto = usualScoreMap.get(jsonObject.get("name").toString());
|
|
|
+ List<ReportExamStudentUsualScoreObjDto> reportExamStudentUsualScoreObjDtoList = !scoreListMap.containsKey(reportEvaluationDto.getTargetId()) ? new ArrayList<>() : scoreListMap.get(reportEvaluationDto.getTargetId());
|
|
|
+ //计算平时作业转换
|
|
|
+ Double score = Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d;
|
|
|
+ CourseTargetWordDto courseTargetWordDto = targetWordMap.get(reportEvaluationDto.getTargetId());
|
|
|
+ UsualScoreWordDto usualScoreWordDto = courseTargetWordDto.getUsualScoreDto();
|
|
|
+ Double matrixScore = new BigDecimal(score).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetScore()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
+ reportExamStudentUsualScoreObjDtoList.add(new ReportExamStudentUsualScoreObjDto(reportEvaluationDto.getTargetId(), reportEvaluationDto, score, matrixScore, usualScoreWordDto.getUsualScoreTargetSumWeight(), usualScoreWordDto.getUsualScoreTargetSumScore()));
|
|
|
+ scoreListMap.put(reportEvaluationDto.getTargetId(), reportExamStudentUsualScoreObjDtoList);
|
|
|
}
|
|
|
- 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));
|
|
|
+ scoreListMap.forEach((k, v) -> {
|
|
|
+ Collections.sort(v);
|
|
|
+ });
|
|
|
+ finalScoreResult.setUsualScoreDto(reportExamStudentUsualScoreDto);
|
|
|
examStudentList.add(new ReportExamStudentDto(finalScoreResult));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Map<Long, CourseTargetValueDto> finalTargetMap = targetMap;
|
|
|
+ Map<Long, CourseTargetWordDto> finalTargetMap = targetWordMap;
|
|
|
targetDimensionMap.forEach((k, v) -> {
|
|
|
List<DimensionDto> dimensionDtoList = new ArrayList<>(v.values());
|
|
|
Collections.sort(dimensionDtoList);
|
|
|
- finalTargetMap.get(k).setDimensionList(dimensionDtoList);
|
|
|
+ if (finalTargetMap.containsKey(k)) {
|
|
|
+ finalTargetMap.get(k).getFinalScoreDto().setDimensionList(dimensionDtoList);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
paramsMap.put("finalScoreResultList", finalScoreResultList);
|
|
|
paramsMap.put("usualScoreMap", usualScoreMap);
|
|
|
- paramsMap.put("finalScoreTargetMap", finalScoreTargetMap);
|
|
|
paramsMap.put("finalScoreExamStudentDimensionMap", finalScoreExamStudentDimensionMap);
|
|
|
paramsMap.put("finalScoreExamStudentDimensionSumMap", finalScoreExamStudentDimensionSumMap);
|
|
|
paramsMap.put("examStudentList", examStudentList);
|
|
|
paramsMap.put("finalScoreResultMap", finalScoreResultMap);
|
|
|
paramsMap.put("paperStructResultMap", paperStructResultMap);
|
|
|
- paramsMap.put("targetMap", targetMap);
|
|
|
+ paramsMap.put("targetWordMap", targetWordMap);
|
|
|
+ paramsMap.put("targetWebMap", targetWebMap);
|
|
|
paramsMap.put("paperStructResultList", paperStructResultList);
|
|
|
return paramsMap;
|
|
|
}
|
|
@@ -246,27 +323,27 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
Map<Long, List<Double>> finalScoreTargetMap = (Map<Long, List<Double>>) paramsMap.get("finalScoreTargetMap");
|
|
|
List<FinalScoreResult> finalScoreResultList = (List<FinalScoreResult>) paramsMap.get("finalScoreResultList");
|
|
|
|
|
|
- Map<String, UsualScoreOverviewDto> usualScoreOverviewDtoMap = new LinkedHashMap<>();//整体平常成绩分数图
|
|
|
+ Map<String, ReportEvaluationDto> usualScoreOverviewDtoMap = new LinkedHashMap<>();//整体平常成绩分数图
|
|
|
Map<Long, FinalScoreOverviewDto> finalScoreOverviewDtoMap = new LinkedHashMap<>();//各课程目标期末考试分数图
|
|
|
|
|
|
- //计算平常成绩最高分,最低分,平均分
|
|
|
- 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);
|
|
|
+// //计算平常成绩最高分,最低分,平均分
|
|
|
+// 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();
|
|
|
- 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));
|
|
|
- });
|
|
|
+// 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));
|
|
|
+// });
|
|
|
|
|
|
paramsMap.put("usualScoreOverviewDtoMap", usualScoreOverviewDtoMap);
|
|
|
paramsMap.put("finalScoreOverviewDtoMap", finalScoreOverviewDtoMap);
|
|
@@ -283,22 +360,22 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
public ReportCourseEvaluationResultDto reportCalculateCourseEvaluationResult(Map<String, Object> paramsMap) {
|
|
|
ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = null;
|
|
|
List<PaperStructResult> paperStructResultList = (List<PaperStructResult>) paramsMap.get("paperStructResultList");
|
|
|
- Map<Long, CourseTargetValueDto> targetMap = (Map<Long, CourseTargetValueDto>) paramsMap.get("targetMap");
|
|
|
- Map<String, UsualScoreOverviewDto> usualScoreOverviewDtoMap = (Map<String, UsualScoreOverviewDto>) paramsMap.get("usualScoreOverviewDtoMap");
|
|
|
+ Map<Long, CourseTargetWordDto> targetMap = (Map<Long, CourseTargetWordDto>) paramsMap.get("targetMap");
|
|
|
+ Map<String, ReportEvaluationDto> usualScoreOverviewDtoMap = (Map<String, ReportEvaluationDto>) paramsMap.get("usualScoreOverviewDtoMap");
|
|
|
Map<Long, FinalScoreOverviewDto> finalScoreOverviewDtoMap = (Map<Long, FinalScoreOverviewDto>) paramsMap.get("finalScoreOverviewDtoMap");
|
|
|
|
|
|
//TODO 课程考核成绩评价结果-待曹子轩补充目标/评价方式数据,有测试数据
|
|
|
if (!CollectionUtils.isEmpty(paperStructResultList) && !CollectionUtils.isEmpty(targetMap)) {
|
|
|
- List<CourseTargetDto> targetList = new ArrayList<>(targetMap.size());
|
|
|
- AtomicReference<Double> targetValue = new AtomicReference<>(0.0d);
|
|
|
+ List<CourseTargetWebDto> targetList = new ArrayList<>(targetMap.size());
|
|
|
+ BigDecimal targetValue = new BigDecimal(0);
|
|
|
targetMap.forEach((k, v) -> {
|
|
|
Double evaluationAvg = 0.0d, evaluationScore = 0.0d;
|
|
|
BigDecimal evaluationWeight = new BigDecimal(0);
|
|
|
List<ReportEvaluationDto> reportEvaluationDtoList = new ArrayList<>();
|
|
|
if (!CollectionUtils.isEmpty(usualScoreOverviewDtoMap)) {
|
|
|
- UsualScoreOverviewDto usualScoreOverviewDto = usualScoreOverviewDtoMap.get("作业" + k);
|
|
|
- ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(usualScoreOverviewDto.getName(), new BigDecimal(30), 40d, usualScoreOverviewDto.getAvgScore());
|
|
|
- reportEvaluationDtoList.add(reportEvaluationDto);
|
|
|
+ ReportEvaluationDto reportEvaluationDto = usualScoreOverviewDtoMap.get("作业" + k);
|
|
|
+// ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(usualScoreOverviewDto.getEvaluationId(), usualScoreOverviewDto.getEvaluation(), usualScoreOverviewDto.getEvaluationDesc(), new BigDecimal(30), new BigDecimal(40), 0.0d);
|
|
|
+// reportEvaluationDtoList.add(reportEvaluationDto);
|
|
|
|
|
|
//课程目标-平时作业达成度计算
|
|
|
// if (Objects.nonNull(reportEvaluationDto.getWeight()) && reportEvaluationDto.getWeight().doubleValue() > 0d) {
|
|
@@ -313,8 +390,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(finalScoreOverviewDtoMap)) {
|
|
|
FinalScoreOverviewDto finalScoreOverviewDto = finalScoreOverviewDtoMap.get(k);
|
|
|
- ReportEvaluationDto reportEvaluationDto1 = new ReportEvaluationDto("期末考试", new BigDecimal(70), 60d, finalScoreOverviewDto.getAvgScore());
|
|
|
- reportEvaluationDtoList.add(reportEvaluationDto1);
|
|
|
+// ReportEvaluationDto reportEvaluationDto1 = new ReportEvaluationDto(finalScoreOverviewDto.getEvaluationId(), finalScoreOverviewDto.getEvaluation(), finalScoreOverviewDto.getEvaluationDesc(), new BigDecimal(70), new BigDecimal(60), 0.0d);
|
|
|
+// reportEvaluationDtoList.add(reportEvaluationDto1);
|
|
|
|
|
|
//课程目标-期末成绩达成度计算
|
|
|
// if (Objects.nonNull(reportEvaluationDto1.getWeight()) && reportEvaluationDto1.getWeight().doubleValue() > 0d) {
|
|
@@ -326,13 +403,13 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}
|
|
|
Double evaluationValue = new BigDecimal(evaluationAvg).add(new BigDecimal(evaluationScore)).divide(evaluationWeight, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
|
|
- CourseTargetDto courseTargetDto = new CourseTargetDto(k, v.getTargetName(), k, "评价方式" + k, "评价方式描述" + k, reportEvaluationDtoList, evaluationValue);
|
|
|
- targetList.add(courseTargetDto);
|
|
|
- v.updateInfo(courseTargetDto);
|
|
|
- targetValue.set(new BigDecimal(targetValue.get()).add(new BigDecimal(courseTargetDto.getEvaluationValue())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
+// CourseTargetDto courseTargetDto = new CourseTargetDto(k, v.getTargetName(), k, "评价方式" + k, "评价方式描述" + k, reportEvaluationDtoList, evaluationValue);
|
|
|
+// targetList.add(courseTargetDto);
|
|
|
+// v.updateInfo(courseTargetDto);
|
|
|
+// targetValue.set(new BigDecimal(targetValue.get()).add(new BigDecimal(courseTargetDto.getEvaluationValue())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
});
|
|
|
Collections.sort(targetList);
|
|
|
- reportCourseEvaluationResultDto = new ReportCourseEvaluationResultDto("测试课程总目标1", targetValue.get(), targetList);
|
|
|
+ reportCourseEvaluationResultDto = new ReportCourseEvaluationResultDto("测试课程总目标1", targetValue, targetList);
|
|
|
}
|
|
|
return reportCourseEvaluationResultDto;
|
|
|
}
|
|
@@ -378,23 +455,32 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
|
|
|
}
|
|
|
|
|
|
Map<String, Object> paramsMap = trBasicInfoService.getReportCalculateParams(trBasicInfo, paperStructResultList);
|
|
|
- paramsMap = trBasicInfoService.reportCalculateMaxMinAvgSumScore(paramsMap);
|
|
|
- ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = trBasicInfoService.reportCalculateCourseEvaluationResult(paramsMap);
|
|
|
- if (Objects.nonNull(reportCourseEvaluationResultDto)) {
|
|
|
- trBasicInfo.setCourseEvaluationResult(JacksonUtil.parseJson(reportCourseEvaluationResultDto));
|
|
|
- trBasicInfo.getReportResult().setCourseEvaluationResultInfo(reportCourseEvaluationResultDto);
|
|
|
- }
|
|
|
+// paramsMap = trBasicInfoService.reportCalculateMaxMinAvgSumScore(paramsMap);
|
|
|
+
|
|
|
+// ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = trBasicInfoService.reportCalculateCourseEvaluationResult(paramsMap);
|
|
|
+// if (Objects.nonNull(reportCourseEvaluationResultDto)) {
|
|
|
+// trBasicInfo.setCourseEvaluationResult(JacksonUtil.parseJson(reportCourseEvaluationResultDto));
|
|
|
+// trBasicInfo.getReportResult().setCourseEvaluationResultInfo(reportCourseEvaluationResultDto);
|
|
|
+// }
|
|
|
//课程目标达成评价明细结果-考生集合
|
|
|
List<ReportExamStudentDto> examStudentNewList = trExamStudentService.getExamStudentReportDetail(trBasicInfo, paramsMap);
|
|
|
ReportCourseEvaluationResultDetailDto reportCourseEvaluationResultDetailDto = new ReportCourseEvaluationResultDetailDto(examStudentNewList);
|
|
|
if (Objects.nonNull(reportCourseEvaluationResultDetailDto)) {
|
|
|
trBasicInfo.getReportResult().setCourseEvaluationResultDetailInfo(reportCourseEvaluationResultDetailDto);
|
|
|
}
|
|
|
- if (Objects.nonNull(paramsMap.get("targetMap"))) {
|
|
|
- Map<Long, CourseTargetValueDto> targetMap = (Map<Long, CourseTargetValueDto>) paramsMap.get("targetMap");
|
|
|
- List<CourseTargetValueDto> reportCourseTargetDtoList = new ArrayList<>(targetMap.values());
|
|
|
- Collections.sort(reportCourseTargetDtoList);
|
|
|
- trBasicInfo.setCourseEvaluationResultDetail(JacksonUtil.parseJson(reportCourseTargetDtoList));
|
|
|
+ if (Objects.nonNull(paramsMap.get("targetWordMap"))) {
|
|
|
+ Map<Long, CourseTargetWordDto> targetWordMap = (Map<Long, CourseTargetWordDto>) paramsMap.get("targetWordMap");
|
|
|
+ List<CourseTargetWordDto> courseTargetWordDtoList = new ArrayList<>(targetWordMap.values());
|
|
|
+ Collections.sort(courseTargetWordDtoList);
|
|
|
+
|
|
|
+ Map<Long, CourseTargetWebDto> targetWebMap = (Map<Long, CourseTargetWebDto>) paramsMap.get("targetWebMap");
|
|
|
+ List<CourseTargetWebDto> courseTargetWebDtoList = new ArrayList<>(targetWebMap.values());
|
|
|
+ Collections.sort(courseTargetWebDtoList);
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("targetWordMap", courseTargetWordDtoList);
|
|
|
+ jsonObject.put("targetWebMap", courseTargetWebDtoList);
|
|
|
+ trBasicInfo.setCourseEvaluationResultDetail(jsonObject.toJSONString());
|
|
|
}
|
|
|
// trBasicInfo.setCourseEvaluationResultDetail(JacksonUtil.parseJson(paramsMap));
|
|
|
|