|
@@ -204,29 +204,26 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Object findDimensionInfo(Long examId, String courseCode, Long collegeId) {
|
|
|
- List<Map<String, Object>> dimensionAnalyzeList = new ArrayList<>();
|
|
|
+ public DimensionAnalyzeResult findDimensionInfo(Long examId, String courseCode, Long collegeId) {
|
|
|
//查找维度
|
|
|
List<CourseDimensionResult> dimensionInfoDatasource = tbDimensionService.findDimensionInfo(examId, courseCode, collegeId);
|
|
|
if (dimensionInfoDatasource.size() < 1) {
|
|
|
throw ExceptionResultEnum.DATA_ERROR.exception();
|
|
|
}
|
|
|
+ List<ModuleDimensionResult> dimensionAnalyzeList = new ArrayList<>();
|
|
|
Set<String> moduleSet = dimensionInfoDatasource.stream().map(e -> e.getModule()).collect(Collectors.toSet()); // 考察模块集合
|
|
|
for (String module : moduleSet) {
|
|
|
List<CourseDimensionResult> dimensionInfoList = dimensionInfoDatasource
|
|
|
.stream().filter(e -> module.equals(e.getModule())).collect(Collectors.toList());
|
|
|
|
|
|
-
|
|
|
List<DimensionInfoResult> dioList = new ArrayList<>();
|
|
|
List<DimensionInfoResult> batterThanAll = new ArrayList<>(); // 掌握较好
|
|
|
List<DimensionInfoResult> worseThanAll = new ArrayList<>(); // 掌握较差
|
|
|
for (CourseDimensionResult courseDimensionResult : dimensionInfoList) {
|
|
|
String dimensionCode = String.valueOf(courseDimensionResult.getDimensionCode());
|
|
|
String dimensionName = String.valueOf(courseDimensionResult.getDimensionName());
|
|
|
-
|
|
|
double schScoreRate = courseDimensionResult.getSchScoreRate();
|
|
|
double colScoreRate = courseDimensionResult.getColScoreRate();
|
|
|
-
|
|
|
if (colScoreRate >= schScoreRate) {
|
|
|
batterThanAll.add(new DimensionInfoResult(dimensionCode, dimensionName));
|
|
|
} else {
|
|
@@ -234,16 +231,8 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
|
}
|
|
|
dioList.add(new DimensionInfoResult(dimensionCode, dimensionName, String.valueOf(courseDimensionResult.getTotalCount()), String.valueOf(schScoreRate), String.valueOf(colScoreRate)));
|
|
|
}
|
|
|
- Map<String, Object> moduleMap = new HashMap<>();
|
|
|
- moduleMap.put("moduleName", module);
|
|
|
- moduleMap.put("dioList", dioList);
|
|
|
- moduleMap.put("batterThanAll", batterThanAll);
|
|
|
- moduleMap.put("worseThanAll", worseThanAll);
|
|
|
- dimensionAnalyzeList.add(moduleMap);
|
|
|
+ dimensionAnalyzeList.add(new ModuleDimensionResult(module, dioList, batterThanAll, worseThanAll));
|
|
|
}
|
|
|
-
|
|
|
- Map<String, Object> dimensionAnalyzeMap = new HashMap<>();
|
|
|
- dimensionAnalyzeMap.put("dimensionAnalyzeList", dimensionAnalyzeList);
|
|
|
- return dimensionAnalyzeMap;
|
|
|
+ return new DimensionAnalyzeResult(dimensionAnalyzeList);
|
|
|
}
|
|
|
}
|