Browse Source

fix 课件课时数字段

Eric 2 months ago
parent
commit
b5e644a47b

+ 3 - 5
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantAlbumMusicServiceImpl.java

@@ -11,7 +11,6 @@ import com.dayaedu.cbs.openfeign.client.CoursewareFeignService;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsCourseTypeWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareDetailWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareWrapper;
-import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsMaterialRefWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
 import com.microsvc.toolkit.common.response.paging.PageInfo;
 import com.yonge.cooleshow.biz.dal.entity.*;
@@ -19,7 +18,6 @@ import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
 import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumMusicMapper;
 import com.yonge.cooleshow.biz.dal.service.*;
-import com.yonge.cooleshow.biz.dal.service.cbs.CbsMusicScoreService;
 import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareDetailWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
@@ -105,7 +103,7 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
                 return page.setRecords(musicSheets);
             }
             CbsMusicSheetWrapper.MusicSheetApplicationQuery cbsQuery = musicSheetService.getMusicSheetApplicationQuery();
-            List<Long> cbsMusicSheetIds = musicSheets.stream().map(e -> e.getCbsMusicSheetId()).collect(Collectors.toList());
+            List<Long> cbsMusicSheetIds = musicSheets.stream().map(TenantAlbumMusicWrapper.StudentTenantAlbumMusic::getCbsMusicSheetId).collect(Collectors.toList());
             cbsQuery.setMusicSheetIds(cbsMusicSheetIds);
             cbsQuery.setRows(cbsMusicSheetIds.size());
             List<CbsMusicSheetWrapper.MusicSheetApplication> rows = musicSheetService.queryCbsMusicSheetApplication(cbsQuery);
@@ -191,7 +189,7 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
                     studentTenantAlbumMusic.setTitleImg(row.getCoverImg());
                     studentTenantAlbumMusic.setMusicSubject(row.getCourseTypeCode());
                     studentTenantAlbumMusic.setMusicSubjectName(ECourseType.valueOf(row.getCourseTypeCode()).getName());
-                    musicSheets.add(studentTenantAlbumMusic);
+                    musicSheets.add(studentTenantAlbumMusic.courseNum(row.getCourseNum()).unitTestNum(row.getUnitTestNum()));
 
                 }
 
@@ -412,7 +410,7 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
             } else {
                 List<Long> useAlbumIdsByUserId = userTenantAlbumRecordService.getUseAlbumIdsByUserId(query.getUserId(), query.getClient());
                 if (CollectionUtils.isNotEmpty(useAlbumIdsByUserId)) {
-                    List<Long> list = tenantAlbumMusicService.getTenantAlbumMusicIdsByIds(useAlbumIdsByUserId, Arrays.asList(SubjectTypeEnum.COURSEWARE));
+                    List<Long> list = tenantAlbumMusicService.getTenantAlbumMusicIdsByIds(useAlbumIdsByUserId, Collections.singletonList(SubjectTypeEnum.COURSEWARE));
                     if (list.contains(query.getLessonCoursewareId())) {
                         lessonCoursewareDto.setPlay(true);
                     }

+ 15 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumMusicWrapper.java

@@ -242,6 +242,12 @@ public class TenantAlbumMusicWrapper {
         @ApiModelProperty("声谱类型,SINGLE:单曲,CONCERT:合奏")
         private String musicSheetType;
 
+        @ApiModelProperty("课时数")
+        private Integer courseNum;
+
+        @ApiModelProperty("单元测验数量")
+        private Integer unitTestNum;
+
         public String jsonString() {
             return JSON.toJSONString(this);
         }
@@ -250,6 +256,15 @@ public class TenantAlbumMusicWrapper {
             return JSON.parseObject(json, TenantAlbumMusic.class);
         }
 
+        public StudentTenantAlbumMusic unitTestNum(Integer unitTestNum) {
+            this.unitTestNum = unitTestNum;
+            return this;
+        }
+
+        public StudentTenantAlbumMusic courseNum(Integer courseNum) {
+            this.courseNum = courseNum;
+            return this;
+        }
     }
 
 }