|
@@ -5,6 +5,7 @@ import com.google.gson.Gson;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.report.business.bean.result.*;
|
|
import com.qmth.teachcloud.report.business.bean.result.*;
|
|
import com.qmth.teachcloud.report.business.entity.TBCommonLevelConfig;
|
|
import com.qmth.teachcloud.report.business.entity.TBCommonLevelConfig;
|
|
|
|
+import com.qmth.teachcloud.report.business.entity.TBDimension;
|
|
import com.qmth.teachcloud.report.business.entity.TBPaper;
|
|
import com.qmth.teachcloud.report.business.entity.TBPaper;
|
|
import com.qmth.teachcloud.report.business.enums.GradeScopeEnum;
|
|
import com.qmth.teachcloud.report.business.enums.GradeScopeEnum;
|
|
import com.qmth.teachcloud.report.business.enums.PiecewiseScopeEnum;
|
|
import com.qmth.teachcloud.report.business.enums.PiecewiseScopeEnum;
|
|
@@ -16,10 +17,7 @@ import org.slf4j.LoggerFactory;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -54,6 +52,9 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
@Resource
|
|
@Resource
|
|
TBAnswerService tbAnswerService;
|
|
TBAnswerService tbAnswerService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ TAExamCourseCollegeTeacherService taExamCourseCollegeTeacherService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 学院学科报表查询科目信息
|
|
* 学院学科报表查询科目信息
|
|
*
|
|
*
|
|
@@ -255,18 +256,17 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
* @param examId
|
|
* @param examId
|
|
* @param courseCode
|
|
* @param courseCode
|
|
* @param collegeId
|
|
* @param collegeId
|
|
|
|
+ * @param questionDatasource
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public QuestionInfoResult findSituationOfQuestions(Long examId, String courseCode, Long collegeId) {
|
|
|
|
|
|
+ public QuestionInfoResult findSituationOfQuestions(Long examId, String courseCode, Long collegeId, List<TBPaperStructResult> questionDatasource) {
|
|
//查找难易度
|
|
//查找难易度
|
|
QueryWrapper<TBCommonLevelConfig> tbCommonLevelConfigQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<TBCommonLevelConfig> tbCommonLevelConfigQueryWrapper = new QueryWrapper<>();
|
|
tbCommonLevelConfigQueryWrapper.lambda().eq(TBCommonLevelConfig::getExamId, examId)
|
|
tbCommonLevelConfigQueryWrapper.lambda().eq(TBCommonLevelConfig::getExamId, examId)
|
|
.eq(TBCommonLevelConfig::getCourseCode, courseCode)
|
|
.eq(TBCommonLevelConfig::getCourseCode, courseCode)
|
|
.eq(TBCommonLevelConfig::getLevelType, "难度等级");
|
|
.eq(TBCommonLevelConfig::getLevelType, "难度等级");
|
|
List<TBCommonLevelConfig> configLevelDatasource = tbCommonLevelConfigService.list(tbCommonLevelConfigQueryWrapper);
|
|
List<TBCommonLevelConfig> configLevelDatasource = tbCommonLevelConfigService.list(tbCommonLevelConfigQueryWrapper);
|
|
- //查找试卷结构
|
|
|
|
- List<TBPaperStructResult> questionDatasource = tbPaperStructService.findQuestionInfo(examId, courseCode);
|
|
|
|
//查找答题记录
|
|
//查找答题记录
|
|
List<TBAnswerResult> answerDetailDatasource = tbAnswerService.findValidAnswerDetail(examId, courseCode);
|
|
List<TBAnswerResult> answerDetailDatasource = tbAnswerService.findValidAnswerDetail(examId, courseCode);
|
|
Set<String> paperTypeList = questionDatasource.stream().map(e -> e.getPaperType()).collect(Collectors.toSet());
|
|
Set<String> paperTypeList = questionDatasource.stream().map(e -> e.getPaperType()).collect(Collectors.toSet());
|
|
@@ -308,7 +308,73 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public Object findTeacherInfo(Long examId, String courseCode, Long collegeId) {
|
|
|
|
- return null;
|
|
|
|
|
|
+ public TeacherInfoListResult findTeacherInfo(Long examId, String courseCode, Long collegeId) {
|
|
|
|
+ //查找老师得分
|
|
|
|
+ List<TAExamCourseTeacherResult> taExamCourseTeacherResultList = taExamCourseCollegeTeacherService.findTeacherInfo(examId, courseCode, collegeId);
|
|
|
|
+ if (taExamCourseTeacherResultList.size() < 1) {
|
|
|
|
+ throw ExceptionResultEnum.DATA_ERROR.exception();
|
|
|
|
+ }
|
|
|
|
+ return new TeacherInfoListResult(taExamCourseTeacherResultList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查找题目信息
|
|
|
|
+ *
|
|
|
|
+ * @param examId
|
|
|
|
+ * @param courseCode
|
|
|
|
+ * @param collegeId
|
|
|
|
+ * @param questionDatasource
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public QuestionListResult findQuestionInfo(Long examId, String courseCode, Long collegeId, List<TBPaperStructResult> questionDatasource) {
|
|
|
|
+ //查找维度
|
|
|
|
+ QueryWrapper<TBDimension> tbDimensionQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tbDimensionQueryWrapper.lambda().eq(TBDimension::getExamId, examId)
|
|
|
|
+ .eq(TBDimension::getCourseCode, courseCode);
|
|
|
|
+ List<TBDimension> dimensionDataSource = tbDimensionService.list(tbDimensionQueryWrapper);
|
|
|
|
+
|
|
|
|
+ Set<String> paperTypeSet = questionDatasource.stream().map(e -> e.getPaperType()).collect(Collectors.toSet());
|
|
|
|
+ List<QuestionResult> questionList = new ArrayList<>();
|
|
|
|
+ for (String paperType : paperTypeSet) {
|
|
|
|
+ List<TBPaperStructResult> cellList = questionDatasource.stream()
|
|
|
|
+ .filter(e -> paperType.equals(e.getPaperType())).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ for (TBPaperStructResult cell : cellList) {
|
|
|
|
+ cell.setPaperType(null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Set<String> knowledgeDimensionSet = new HashSet<>();
|
|
|
|
+ for (TBPaperStructResult cell : cellList) {
|
|
|
|
+ String knowledgeDimension = cell.getKnowledgeDimension();
|
|
|
|
+ String[] arr = knowledgeDimension.split(",");
|
|
|
|
+ knowledgeDimensionSet.addAll(Arrays.asList(arr));
|
|
|
|
+ }
|
|
|
|
+ List<String> knowledgeDimensionSort = MathUtil.sortDimension(new ArrayList<>(knowledgeDimensionSet)); // 经过特殊排序的知识点集合
|
|
|
|
+
|
|
|
|
+ List<DimensionInfoResult> dimensionList = new ArrayList<>();
|
|
|
|
+ for (String dimensionCode : knowledgeDimensionSort) {
|
|
|
|
+ String dimensionName = "";
|
|
|
|
+ List<String> nameTwoList = dimensionDataSource.stream()
|
|
|
|
+ .filter(e -> dimensionCode.equals(e.getCodeSecond()))
|
|
|
|
+ .map(e -> e.getNameSecond()).collect(Collectors.toList());
|
|
|
|
+ if (nameTwoList.size() < 1) {
|
|
|
|
+ List<String> tmpList = dimensionDataSource.stream()
|
|
|
|
+ .filter(e -> dimensionCode.equals(e.getCodePrimary()))
|
|
|
|
+ .map(e -> e.getNamePrimary()).collect(Collectors.toList());
|
|
|
|
+ if (tmpList.size() == 0) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ dimensionName = tmpList.get(0);
|
|
|
|
+ } else {
|
|
|
|
+ dimensionName = nameTwoList.get(0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dimensionList.add(new DimensionInfoResult(dimensionCode, dimensionName));
|
|
|
|
+ }
|
|
|
|
+ questionList.add(new QuestionResult(paperType, cellList, dimensionList));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return new QuestionListResult(questionList);
|
|
}
|
|
}
|
|
}
|
|
}
|