|
|
|
@ -30,6 +30,7 @@ import java.io.IOException;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -80,7 +81,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<TeaTrainingInfoDTO> getTrainingInfoDTOSNew(String schoolId, String systemOwner) {
|
|
|
|
|
private List<TeaTrainingInfoDTO> getTrainingInfoDTOSNew(String schoolId, String systemOwner) throws IOException {
|
|
|
|
|
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOSNew(schoolId, systemOwner);
|
|
|
|
|
assert !Objects.requireNonNull(list).isEmpty();
|
|
|
|
|
list.sort(new TotalScoreComparator());
|
|
|
|
@ -93,7 +94,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<TeaTrainingInfoDTO> getTeaTrainingInfoDTOSNew(String schoolId, String systemOwner) {
|
|
|
|
|
private List<TeaTrainingInfoDTO> getTeaTrainingInfoDTOSNew(String schoolId, String systemOwner) throws IOException {
|
|
|
|
|
StuUserExample example1 = new StuUserExample();
|
|
|
|
|
example1.createCriteria().andSchoolIdEqualTo(schoolId).andSystemOnwerEqualTo(systemOwner).andRoleIdEqualTo(4);
|
|
|
|
|
List<StuUser> stuUsers = userMapper.selectByExample(example1);
|
|
|
|
@ -124,8 +125,6 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
}
|
|
|
|
|
// 实训记录按用户ID分组
|
|
|
|
|
Map<String, List<StuTrainingWithBLOBs>> userIdToTrainingsMap = stuTrainingsWithBLOBs.stream().collect(Collectors.groupingBy(StuTrainingWithBLOBs::getUserId));
|
|
|
|
|
List<String> chapterIdList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SysTwoCatalog> sysTwoCatalogs = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
@ -134,15 +133,9 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (SysTwoCatalog sysTwoCatalog : sysTwoCatalogs) {
|
|
|
|
|
try {
|
|
|
|
|
List<SysThreeCatalog> sysThreeCatalogs = CourseAPI.selectThreeCatalogListByTwoId(sysTwoCatalog.getTwoId(), schoolId);
|
|
|
|
|
List<String> threeCatalogs = sysThreeCatalogs.stream().map(SysThreeCatalog::getThreeId).collect(Collectors.toList());
|
|
|
|
|
chapterIdList.addAll(threeCatalogs);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<String> towIds = sysTwoCatalogs.stream().map(SysTwoCatalog::getTwoId).collect(Collectors.toList());
|
|
|
|
|
List<SysThreeCatalog> sysThreeCatalogs = CourseAPI.callSelectThreeCatalogList(towIds, schoolId);
|
|
|
|
|
List<String> chapterIdList = sysThreeCatalogs.stream().map(SysThreeCatalog::getThreeId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
//一次性取到所有案例题步骤,给实验实训算分用
|
|
|
|
|
List<TestTestSysCaseQuestionStepWithBLOBs> stepList = new ArrayList<>();
|
|
|
|
@ -215,7 +208,10 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
sysWeightExample.createCriteria().andSchoolIdEqualTo(schoolId);
|
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
|
SysWeight sysWeight = sysWeights.get(0);
|
|
|
|
|
|
|
|
|
|
BigDecimal knowledgeSummaryWeight = sysWeight.getKnowledgeSummaryWeight();
|
|
|
|
|
BigDecimal resourceLearningWeight = sysWeight.getResourceLearningWeight();
|
|
|
|
|
BigDecimal learningEvalWeight = sysWeight.getLearningEvalWeight();
|
|
|
|
|
BigDecimal expTrainingWeight = sysWeight.getExpTrainingWeight();
|
|
|
|
|
// 遍历用户,计算分数并封装DTO
|
|
|
|
|
List<TeaTrainingInfoDTO> list = new ArrayList<>();
|
|
|
|
|
for (StuUser stuUser : stuUsers) {
|
|
|
|
@ -241,7 +237,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
totalScore = totalScore.add(reportScore);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BigDecimal moduleScore = getModuleScore(training, sysWeight, map, map1, resultMap);
|
|
|
|
|
BigDecimal moduleScore = getModuleScore(training, knowledgeSummaryWeight, resourceLearningWeight, learningEvalWeight, expTrainingWeight, map, map1, resultMap);
|
|
|
|
|
totalScore = moduleScore.add(totalScore).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
}
|
|
|
|
|
//综合得分
|
|
|
|
@ -393,15 +389,57 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<StuTrainingDto> getTrainingDetailsInfo(String userId, String schoolId, String systemOwner) {
|
|
|
|
|
public List<StuTrainingDto> getTrainingDetailsInfo(String userId, String schoolId, String systemOwner) throws IOException {
|
|
|
|
|
List<StuTrainingDto> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<SysTwoCatalog> sysTwoCatalogs = null;
|
|
|
|
|
try {
|
|
|
|
|
sysTwoCatalogs = CourseAPI.selectCourseList(systemOwner, schoolId);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StuTrainingExample stuTrainingExample = new StuTrainingExample();
|
|
|
|
|
stuTrainingExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
|
List<StuTrainingWithBLOBs> stuTrainings = stuTrainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
|
|
|
|
|
|
|
|
|
|
Map<String, SysThreeCatalog> chapterMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
List<String> reportIds = stuTrainings.stream().map(StuTraining::getReportId).collect(Collectors.toList());
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andReportIdIn(reportIds);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
|
|
|
|
|
|
|
|
|
|
//提前查出所有report对象
|
|
|
|
|
Map<String, TrainingReport> trainingReportMap = trainingReports.stream()
|
|
|
|
|
.collect(Collectors.toMap(TrainingReport::getReportId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
List<String> twoIds = sysTwoCatalogs.stream().map(SysTwoCatalog::getTwoId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
//提前查出权重
|
|
|
|
|
SysWeightExample sysWeightExample = new SysWeightExample();
|
|
|
|
|
sysWeightExample.createCriteria().andCourseIdIn(twoIds)
|
|
|
|
|
.andSchoolIdEqualTo(schoolId)
|
|
|
|
|
.andSystemOwnerEqualTo(systemOwner);
|
|
|
|
|
|
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
|
Map<String, SysWeight> weightMap = sysWeights.stream().collect(Collectors.toMap(SysWeight::getCourseId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
//一次查出所有章节下的案例步骤
|
|
|
|
|
List<SysThreeCatalog> allChapterId = CourseAPI.callSelectThreeCatalogList(twoIds, schoolId);
|
|
|
|
|
List<String> ids = allChapterId.stream().map(SysThreeCatalog::getThreeId).collect(Collectors.toList());
|
|
|
|
|
List<TestTestSysCaseQuestionStepWithBLOBs> stepList = CaseApi.selectCaseStepByThreeIds(ids);
|
|
|
|
|
Map<String, List<TestTestSysCaseQuestionStepWithBLOBs>> groupedIds = stepList.stream()
|
|
|
|
|
.filter(step -> step.getThreeId() != null) // 过滤掉 threeId 为 null 的对象
|
|
|
|
|
.collect(Collectors.groupingBy(TestTestSysCaseQuestionStepWithBLOBs::getThreeId)); // 按 threeId 分组
|
|
|
|
|
|
|
|
|
|
//一次查出所有的记录表
|
|
|
|
|
StuTrainingStepRecordExample example = new StuTrainingStepRecordExample();
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(userId); // 批量查询用户记录
|
|
|
|
|
List<StuTrainingStepRecord> allRecords = trainingStepRecordMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
Map<String, List<StuTrainingStepRecord>> allRecordsMap = allRecords.stream()
|
|
|
|
|
.collect(Collectors.groupingBy(StuTrainingStepRecord::getUserId)); // 按 threeId 分组
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
for (StuTrainingWithBLOBs stuTraining : stuTrainings) {
|
|
|
|
|
String chapterId = stuTraining.getChapterId();
|
|
|
|
@ -412,7 +450,8 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
}
|
|
|
|
|
StuTrainingDto stuTrainingDto = new StuTrainingDto();
|
|
|
|
|
stuTrainingDto.setTaskModule(sysCourseChapter.getThreeName());
|
|
|
|
|
list.add(stuScoreService.getScoreByChapterId(schoolId, systemOwner, stuTraining, stuTrainingDto, sysCourseChapter));
|
|
|
|
|
list.add(stuScoreService.getScoreByChapterId(schoolId, systemOwner, stuTraining, stuTrainingDto, sysCourseChapter,
|
|
|
|
|
trainingReportMap, weightMap, groupedIds, allRecordsMap));
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -421,13 +460,9 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//计算模块得分 章节下所有的案例步骤得分之和 / 章节下所有的案例步骤满分
|
|
|
|
|
private BigDecimal getModuleScore(StuTrainingWithBLOBs stuTrainingWithBLOB, SysWeight sysWeight,
|
|
|
|
|
private BigDecimal getModuleScore(StuTrainingWithBLOBs stuTrainingWithBLOB, BigDecimal knowledgeSummaryWeight, BigDecimal resourceLearningWeight,
|
|
|
|
|
BigDecimal learningEvalWeight, BigDecimal expTrainingWeight,
|
|
|
|
|
Map<String, List<String>> map, Map<String, List<BigDecimal>> map1, Map<String, Map<String, BigDecimal>> resultMap) {
|
|
|
|
|
BigDecimal knowledgeSummaryWeight = sysWeight.getKnowledgeSummaryWeight();
|
|
|
|
|
BigDecimal resourceLearningWeight = sysWeight.getResourceLearningWeight();
|
|
|
|
|
BigDecimal learningEvalWeight = sysWeight.getLearningEvalWeight();
|
|
|
|
|
BigDecimal expTrainingWeight = sysWeight.getExpTrainingWeight();
|
|
|
|
|
|
|
|
|
|
BigDecimal knowledgeSummaryScore = Optional.ofNullable(stuTrainingWithBLOB.getKnowledgeSummaryScore()).orElse(BigDecimal.ZERO);
|
|
|
|
|
BigDecimal resourceLearningScore = Optional.ofNullable(stuTrainingWithBLOB.getResourceLearningScore()).orElse(BigDecimal.ZERO);
|
|
|
|
|
BigDecimal learningEvalScore = Optional.ofNullable(stuTrainingWithBLOB.getLearningEvalScore()).orElse(BigDecimal.ZERO);
|
|
|
|
@ -585,14 +620,72 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
public void exportAllStuTrainingInfo(HttpServletResponse response, String schoolId, String systemOwner) throws IOException {
|
|
|
|
|
List<TeaTrainingInfoDTO> trainingInfoDTOSNew = getTrainingInfoDTOSNew(schoolId, systemOwner);
|
|
|
|
|
List<SysTwoCatalog> sysTwoCatalogs = CourseAPI.selectCourseList(systemOwner, schoolId);
|
|
|
|
|
List<SysThreeCatalog> allChapterId = new ArrayList<>();
|
|
|
|
|
for (SysTwoCatalog sysTwoCatalog : sysTwoCatalogs) {
|
|
|
|
|
List<SysThreeCatalog> sysThreeCatalogs = CourseAPI.selectThreeCatalogListByTwoId(sysTwoCatalog.getTwoId(), schoolId);
|
|
|
|
|
allChapterId.addAll(sysThreeCatalogs);
|
|
|
|
|
}
|
|
|
|
|
List<String> twoIds = sysTwoCatalogs.stream().map(SysTwoCatalog::getTwoId).collect(Collectors.toList());
|
|
|
|
|
List<SysThreeCatalog> allChapterId = CourseAPI.callSelectThreeCatalogList(twoIds, schoolId);
|
|
|
|
|
|
|
|
|
|
Map<String, SysThreeCatalog> chapterIds = allChapterId.stream().collect(Collectors.toMap(SysThreeCatalog::getThreeId, sysThreeCatalog -> sysThreeCatalog));
|
|
|
|
|
List<ExcelDto> excelDtos = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
// 1. 提取所有的 userId
|
|
|
|
|
Set<String> userIds = trainingInfoDTOSNew.stream()
|
|
|
|
|
.map(TeaTrainingInfoDTO::getUserId)
|
|
|
|
|
.collect(Collectors.toSet());
|
|
|
|
|
|
|
|
|
|
// 2. 基于 userId 查询所有的 StuTrainingWithBLOBs
|
|
|
|
|
StuTrainingExample stuTrainingExample = new StuTrainingExample();
|
|
|
|
|
stuTrainingExample.createCriteria().andUserIdIn(new ArrayList<>(userIds));
|
|
|
|
|
List<StuTrainingWithBLOBs> stuTrainingsByUser = stuTrainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
|
|
|
|
|
|
|
|
|
|
// 3. 将 stuTrainings 按照 userId 分组
|
|
|
|
|
Map<String, List<StuTrainingWithBLOBs>> trainingsByUserId = stuTrainingsByUser.stream()
|
|
|
|
|
.collect(Collectors.groupingBy(StuTrainingWithBLOBs::getUserId));
|
|
|
|
|
|
|
|
|
|
//提前查出权重
|
|
|
|
|
|
|
|
|
|
SysWeightExample sysWeightExample = new SysWeightExample();
|
|
|
|
|
sysWeightExample.createCriteria().andCourseIdIn(twoIds)
|
|
|
|
|
.andSchoolIdEqualTo(schoolId)
|
|
|
|
|
.andSystemOwnerEqualTo(systemOwner);
|
|
|
|
|
|
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
|
Map<String, SysWeight> weightMap = sysWeights.stream().collect(Collectors.toMap(SysWeight::getCourseId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 4. 提前收集所有的 reportId
|
|
|
|
|
Set<String> allReportIds = new HashSet<>();
|
|
|
|
|
for (List<StuTrainingWithBLOBs> stuTrainings : trainingsByUserId.values()) {
|
|
|
|
|
List<String> reportIds = stuTrainings.stream().map(StuTraining::getReportId).collect(Collectors.toList());
|
|
|
|
|
allReportIds.addAll(reportIds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 5. 基于 reportId 查询所有的 TrainingReport
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andReportIdIn(new ArrayList<>(allReportIds));
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
|
|
|
|
|
|
|
|
|
|
// 6. 将 trainingReports 按照 reportId 分组
|
|
|
|
|
Map<String, TrainingReport> trainingReportMap = trainingReports.stream()
|
|
|
|
|
.collect(Collectors.toMap(TrainingReport::getReportId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//一次查出所有三级目录
|
|
|
|
|
List<String> ids = allChapterId.stream().map(SysThreeCatalog::getThreeId).collect(Collectors.toList());
|
|
|
|
|
List<SysThreeCatalog> sysThreeCatalogs = CourseAPI.selectChapterByIdList(ids);
|
|
|
|
|
Map<String, SysThreeCatalog> sysThreeCatalogsMap = sysThreeCatalogs.stream().collect(Collectors.toMap(SysThreeCatalog::getThreeId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
//一次查出所有章节下的案例步骤
|
|
|
|
|
List<TestTestSysCaseQuestionStepWithBLOBs> list = CaseApi.selectCaseStepByThreeIds(ids);
|
|
|
|
|
Map<String, List<TestTestSysCaseQuestionStepWithBLOBs>> groupedIds = list.stream()
|
|
|
|
|
.filter(step -> step.getThreeId() != null) // 过滤掉 threeId 为 null 的对象
|
|
|
|
|
.collect(Collectors.groupingBy(TestTestSysCaseQuestionStepWithBLOBs::getThreeId)); // 按 threeId 分组
|
|
|
|
|
|
|
|
|
|
//一次查出所有的记录表
|
|
|
|
|
StuTrainingStepRecordExample example = new StuTrainingStepRecordExample();
|
|
|
|
|
example.createCriteria().andUserIdIn(new ArrayList<>(userIds)); // 批量查询用户记录
|
|
|
|
|
List<StuTrainingStepRecord> allRecords = trainingStepRecordMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
Map<String, List<StuTrainingStepRecord>> allRecordsMap = allRecords.stream()
|
|
|
|
|
.collect(Collectors.groupingBy(StuTrainingStepRecord::getUserId)); // 按 threeId 分组
|
|
|
|
|
|
|
|
|
|
for (TeaTrainingInfoDTO teaTrainingInfoDTO : trainingInfoDTOSNew) {
|
|
|
|
|
ExcelDto excelDto = new ExcelDto();
|
|
|
|
|
excelDto.setProgress(teaTrainingInfoDTO.getProgress());
|
|
|
|
@ -602,25 +695,19 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
excelDto.setTotalScore(teaTrainingInfoDTO.getTotalScore());
|
|
|
|
|
|
|
|
|
|
String userId = teaTrainingInfoDTO.getUserId();
|
|
|
|
|
StuTrainingExample stuTrainingExample = new StuTrainingExample();
|
|
|
|
|
stuTrainingExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
|
List<StuTrainingWithBLOBs> stuTrainings = stuTrainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
|
|
|
|
|
// 根据 userId 获取对应的 StuTrainingWithBLOBs 列表
|
|
|
|
|
List<StuTrainingWithBLOBs> stuTrainings = trainingsByUserId.get(userId);
|
|
|
|
|
|
|
|
|
|
LinkedHashMap<String, BigDecimal> map = new LinkedHashMap<>();
|
|
|
|
|
LinkedHashMap<String, SysThreeCatalog> chapterMap = new LinkedHashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (StuTrainingWithBLOBs stuTraining : stuTrainings) {
|
|
|
|
|
String chapterId = stuTraining.getChapterId();
|
|
|
|
|
SysThreeCatalog sysCourseChapter = chapterMap.get(chapterId);
|
|
|
|
|
if (sysCourseChapter == null) {
|
|
|
|
|
sysCourseChapter = CourseAPI.selectChapterByChapterId(chapterId);
|
|
|
|
|
chapterMap.put(chapterId, sysCourseChapter);
|
|
|
|
|
}
|
|
|
|
|
SysThreeCatalog sysThreeCatalog = sysThreeCatalogsMap.get(chapterId);
|
|
|
|
|
StuTrainingDto stuTrainingDto = new StuTrainingDto();
|
|
|
|
|
stuTrainingDto.setTaskModule(sysCourseChapter.getThreeName());
|
|
|
|
|
stuTrainingDto.setTaskModule(sysThreeCatalog.getThreeName());
|
|
|
|
|
|
|
|
|
|
StuTrainingDto scoreByChapterId = stuScoreService.getScoreByChapterId(schoolId, systemOwner, stuTraining, stuTrainingDto, sysCourseChapter);
|
|
|
|
|
StuTrainingDto scoreByChapterId = stuScoreService.getScoreByChapterId(schoolId, systemOwner, stuTraining,
|
|
|
|
|
stuTrainingDto, sysThreeCatalog, trainingReportMap, weightMap, groupedIds, allRecordsMap);
|
|
|
|
|
|
|
|
|
|
BigDecimal moduleScore = scoreByChapterId.getModuleScore();
|
|
|
|
|
String taskModule = scoreByChapterId.getTaskModule();
|
|
|
|
@ -693,15 +780,14 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (SysTwoCatalog sysTwoCatalog : sysTwoCatalogs) {
|
|
|
|
|
List<String> twoIds = sysTwoCatalogs.stream().map(SysTwoCatalog::getTwoId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
List<SysThreeCatalog> sysThreeCatalogs = CourseAPI.selectThreeCatalogListByTwoId(sysTwoCatalog.getTwoId(), schoolId);
|
|
|
|
|
List<String> threeCatalogs = sysThreeCatalogs.stream().map(SysThreeCatalog::getThreeId).collect(Collectors.toList());
|
|
|
|
|
chapterIdList.addAll(threeCatalogs);
|
|
|
|
|
List<SysThreeCatalog> sysThreeCatalogs = CourseAPI.callSelectThreeCatalogList(twoIds, schoolId);
|
|
|
|
|
chapterIdList = sysThreeCatalogs.stream().map(SysThreeCatalog::getThreeId).collect(Collectors.toList());
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//一次性取到所有案例题步骤,给实验实训算分用
|
|
|
|
|
List<TestTestSysCaseQuestionStepWithBLOBs> stepList = new ArrayList<>();
|
|
|
|
@ -775,6 +861,11 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
|
SysWeight sysWeight = sysWeights.get(0);
|
|
|
|
|
|
|
|
|
|
BigDecimal knowledgeSummaryWeight = sysWeight.getKnowledgeSummaryWeight();
|
|
|
|
|
BigDecimal resourceLearningWeight = sysWeight.getResourceLearningWeight();
|
|
|
|
|
BigDecimal learningEvalWeight = sysWeight.getLearningEvalWeight();
|
|
|
|
|
BigDecimal expTrainingWeight = sysWeight.getExpTrainingWeight();
|
|
|
|
|
|
|
|
|
|
// 遍历用户,计算分数并封装DTO
|
|
|
|
|
List<TeaTrainingInfoDTO> list = new ArrayList<>();
|
|
|
|
|
for (StuUser stuUser : stuUsers) {
|
|
|
|
@ -800,7 +891,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
totalScore = totalScore.add(reportScore);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BigDecimal moduleScore = getModuleScore(training, sysWeight, map, map1, resultMap);
|
|
|
|
|
BigDecimal moduleScore = getModuleScore(training, knowledgeSummaryWeight, resourceLearningWeight, learningEvalWeight, expTrainingWeight, map, map1, resultMap);
|
|
|
|
|
totalScore = moduleScore.add(totalScore).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
}
|
|
|
|
|
//综合得分
|
|
|
|
|