|
@@ -9,6 +9,7 @@ import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
import com.yonge.toolset.base.exception.BizException;
|
|
|
+import jodd.util.StringUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -49,6 +50,11 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
|
|
|
@Autowired
|
|
|
private SysUserMapper sysUserMapper;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TenantAlbumMusicService tenantAlbumMusicService;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 查询详情
|
|
|
* @param id 详情ID
|
|
@@ -68,16 +74,25 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
|
|
|
*/
|
|
|
@Override
|
|
|
public IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> selectPage(IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page, TenantAlbumMusicWrapper.StudentTenantAlbumMusicQuery query) {
|
|
|
- List<Long> albumIds = query.getAlbumIds();
|
|
|
- if (CollectionUtils.isEmpty(albumIds)){
|
|
|
- throw new BizException("该机构未绑定相关专辑");
|
|
|
+
|
|
|
+ String albumId = query.getAlbumId();
|
|
|
+ if (StringUtil.isEmpty(albumId)){
|
|
|
+ Long tenantId = query.getTenantId();
|
|
|
+ //查询机构专辑Id
|
|
|
+ List<TenantAlbumMusic> list = tenantAlbumMusicService.lambdaQuery().eq(TenantAlbumMusic::getTenantId, tenantId).list();
|
|
|
+ if (CollectionUtils.isNotEmpty(list)){
|
|
|
+ TenantAlbumMusic albumMusic = list.get(0);
|
|
|
+ albumId = albumMusic.getTenantAlbumId().toString();
|
|
|
+ } else {
|
|
|
+ throw new BizException("该机构未绑定相关专辑");
|
|
|
+ }
|
|
|
}
|
|
|
SubjectTypeEnum subjectType = query.getSubjectType();
|
|
|
String s = subjectType.toString();
|
|
|
String type = query.getType();
|
|
|
String level = query.getLevel();
|
|
|
|
|
|
- List<Long> musicSheetIds = tenantAlbumMusicMapper.selectMusicSheetIds(albumIds, s, type, level);
|
|
|
+ List<Long> musicSheetIds = tenantAlbumMusicMapper.selectMusicSheetIds(albumId, s, type, level);
|
|
|
|
|
|
TenantAlbumMusicWrapper.StudentMusicSheetQuery musicSheetQuery = new TenantAlbumMusicWrapper.StudentMusicSheetQuery();
|
|
|
musicSheetQuery.setMusicSheetIds(musicSheetIds);
|