Browse Source

新增训练说明

zouxuan 5 months ago
parent
commit
fb85dcb27b

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentLessonExaminationServiceImpl.java

@@ -112,7 +112,7 @@ public class StudentLessonExaminationServiceImpl extends ServiceImpl<StudentLess
                             eq(StudentLessonExaminationDetail::getLessonExaminationId, queryInfo.getLessonExaminationId()).list();
                     String musicScoreIds = list.stream().map(e->e.getMusicScoreId().toString()).collect(Collectors.joining(","));
                     Map<Integer, SysMusicScore> musicScoreMap = new HashMap<>();
-                    if (StringUtils.isEmpty(musicScoreIds)) {
+                    if (StringUtils.isNotEmpty(musicScoreIds)) {
                         List<SysMusicScore> musicScores = sysMusicScoreDao.findByIds(musicScoreIds);
                         if (CollectionUtils.isNotEmpty(musicScores)) {
                             musicScoreMap = musicScores.stream().collect(Collectors.toMap(SysMusicScore::getId, e -> e));
@@ -126,7 +126,9 @@ public class StudentLessonExaminationServiceImpl extends ServiceImpl<StudentLess
                             StudentLessonExaminationDetailDto detailDto = JSON.parseObject(JSON.toJSONString(detail), StudentLessonExaminationDetailDto.class);
                             if(detail.getMusicScoreId() != null){
                                 SysMusicScore musicScore = musicScoreMap.get(detail.getMusicScoreId().intValue());
-                                detailDto.setMusicScoreName(musicScore.getName());
+                                if (musicScore != null){
+                                    detailDto.setMusicScoreName(musicScore.getName());
+                                }
                             }
                             dto.setStudentLessonExaminationDetail(detailDto);
                         }