|
@@ -3,6 +3,7 @@ package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.beust.jcommander.internal.Lists;
|
|
|
import com.dayaedu.cbs.common.enums.school.ECourseType;
|
|
@@ -20,12 +21,14 @@ import com.yonge.cooleshow.biz.dal.entity.*;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.SourceTypeEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumMusicMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.UserTenantAlbumRecordMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareDetailWrapper;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareWrapper;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
|
|
|
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumWrapper;
|
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
|
import com.yonge.cooleshow.common.enums.YesOrNoEnum;
|
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
@@ -85,6 +88,9 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
|
|
|
@Autowired
|
|
|
private CoursewareFeignService coursewareFeignService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TenantAlbumMapper tenantAlbumMapper;
|
|
|
+
|
|
|
@Value("${openfeign-client.app-id:1745637981387108354}")
|
|
|
public Long applicationId;
|
|
|
|
|
@@ -529,11 +535,22 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
|
|
|
if (query.getTenantId() == null) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
+ // 查询机构可用专辑
|
|
|
+ TenantAlbumWrapper.TenantAlbumQuery build = TenantAlbumWrapper.TenantAlbumQuery.builder()
|
|
|
+ .status(true)
|
|
|
+ .tenantId(query.getTenantId())
|
|
|
+ .build();
|
|
|
+ List<TenantAlbumWrapper.TenantAlbum> tenantAlbums = tenantAlbumMapper.selectPage(new Page<>(1, -1), build);
|
|
|
+ if (CollectionUtils.isEmpty(tenantAlbums)) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ List<String> tenantAlbumIds = tenantAlbums.stream().map(TenantAlbumWrapper.TenantAlbum::getId).collect(Collectors.toList());
|
|
|
|
|
|
List<LessonCoursewareDetailWrapper.RefLevelDetailInfo> result = new ArrayList<>();
|
|
|
// 查询出机构下的所有可用教材
|
|
|
List<TenantAlbumMusic> detail = tenantAlbumMusicService.lambdaQuery()
|
|
|
.eq(TenantAlbumMusic::getTenantId, query.getTenantId())
|
|
|
+ .in(TenantAlbumMusic::getTenantAlbumId, tenantAlbumIds)
|
|
|
.eq(TenantAlbumMusic::getSubjectType, SubjectTypeEnum.COURSEWARE)
|
|
|
.eq(TenantAlbumMusic::getDelFlag, false)
|
|
|
.list();
|