zouxuan преди 3 месеца
родител
ревизия
1ea5243b94

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VideoLessonGroupServiceImpl.java

@@ -795,10 +795,14 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
                                                         .stream()
                                                         .collect(Collectors.toMap(VideoLessonGroup::getId,
                                                                                   VideoLessonGroup::getVirtualNumber));
+        //获取直播课关联的曲目数量
+        List<Mapper> musicNum = this.baseMapper.countMusicAlbum(idList);
+        Map<Long,Long> map = musicNum.stream().collect(Collectors.toMap(e->Long.parseLong(e.getKey().toString()), e->Long.parseLong(e.getValue().toString())));
         for (LessonGroupVo videoLessonGroupVo : lessonGroupVos) {
             if (videoLessonGroupVo.getLessonPrice().compareTo(BigDecimal.ZERO) == 0) {
                 videoLessonGroupVo.setCountStudent(videoLessonGroupVo.getCountStudent() + idMap.get(videoLessonGroupVo.getId()));
             }
+            videoLessonGroupVo.setMusicNum(map.get(videoLessonGroupVo.getId()));
         }
         return page.setRecords(lessonGroupVos);
     }