Bladeren bron

班级成绩查看

dzx 10 maanden geleden
bovenliggende
commit
c37b4d676e

+ 1 - 1
src/main/java/com/xjrsoft/module/xycxedu/controller/ExamSubjectScoreController.java

@@ -94,7 +94,7 @@ public class ExamSubjectScoreController {
     @SaCheckPermission("examsubjectscore:detail")
     @XjrLog("查询考试成绩")
     public RT<PageOutput<ClassStudentScorePageVo>> classStudentScorePage(@Valid ClassStudentScorePageDto dto){
-        PageOutput<ClassStudentScorePageVo> pageOutput = scoreService.getClassStudentScorePage(dto);
+        scoreService.getClassStudentScorePage(dto)
         return RT.ok(pageOutput);
     }
 

+ 4 - 2
src/main/java/com/xjrsoft/module/xycxedu/service/impl/ExamSubjectScoreServiceImpl.java

@@ -129,8 +129,7 @@ public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectS
         Page<BaseStudentUserPageVo> studentPage = studentManagerService.getStudentPage(new Page<>(dto.getLimit(), dto.getSize()), studentDto);
 
         Set<Long> userIdSet = studentPage.getRecords().stream().map(x -> Long.parseLong(x.getId())).collect(Collectors.toSet());
-        ArrayList<Long> userIdList = new ArrayList<>(userIdSet);
-
+        dto.setUserIdList(new ArrayList<>(userIdSet));
         List<ExamSubjectScore> allScoreList = this.baseMapper.getClassStudentScoreList(dto);
         Map<Long, List<ExamSubjectScore>> listMap = allScoreList.stream().collect(Collectors.groupingBy(ExamSubjectScore::getUserId));
         PageOutput<ClassStudentScorePageVo> pageOutput = ConventPage.getPageOutput(studentPage, ClassStudentScorePageVo.class);
@@ -140,6 +139,9 @@ public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectS
             List<ClassStudentScoreTitleVo> scoreList = new ArrayList<>();
 
             List<ExamSubjectScore> scores = listMap.get(userId);
+            if(scores == null){
+                continue;
+            }
             for (ExamSubjectScore score : scores) {
                 scoreList.add(
                         new ClassStudentScoreTitleVo(){{

+ 6 - 0
src/main/resources/mapper/xycxedu/ExamSubjectScoreMappper.xml

@@ -63,6 +63,12 @@
         AND t1.semester_id = #{dto.semesterId}
         AND t2.id = #{dto.examPlanId}
         AND t3.class_id = #{dto.treeId}
+        <if test="dto.userIdList != null and dto.userIdList.size() > 0">
+            AND t1.user_id in
+            <foreach item="userId" index="index" collection="dto.userIdList" open="(" separator="," close=")">
+                #{userId}
+            </foreach>
+        </if>
         order by t4.name
     </select>
 </mapper>