|
@@ -1,28 +1,44 @@
|
|
|
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.service.impl.ServiceImpl;
|
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.MusicFavoriteDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.entity.*;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.MusicFavorite;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.MusicTag;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.Subject;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.SysUser;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumMusic;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
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.cooleshow.biz.dal.mapper.TenantAlbumMusicMapper;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.MusicFavoriteService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.MusicTagService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SubjectService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumCategoryDetailService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumCategoryService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumMusicService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.UserTenantAlbumRecordService;
|
|
|
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
|
|
|
import com.yonge.toolset.base.exception.BizException;
|
|
|
import jodd.util.StringUtil;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.checkerframework.checker.units.qual.A;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
|
|
|
-import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumMusicMapper;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
@@ -64,6 +80,9 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TenantAlbumCategoryDetailService tenantAlbumCategoryDetailService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询详情
|
|
|
* @param id 详情ID
|
|
@@ -215,11 +234,31 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
|
|
|
}
|
|
|
|
|
|
// 类型
|
|
|
- List<String> types = list.stream().map(TenantAlbumMusic::getType).distinct().filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
|
|
- data.setTypes(types);
|
|
|
+ List<Long> typeIds =list.stream().map(TenantAlbumMusic::getType).distinct().filter(StringUtils::isNotBlank)
|
|
|
+ .filter(NumberUtil::isNumber).map(Long::valueOf).collect(Collectors.toList());
|
|
|
+ if (!typeIds.isEmpty()) {
|
|
|
+ List<TenantAlbumCategoryDetail> typeList = tenantAlbumCategoryDetailService.lambdaQuery()
|
|
|
+ .in(TenantAlbumCategoryDetail::getId, typeIds).list();
|
|
|
+ List<String> typeNameList = typeList.stream()
|
|
|
+ .map(TenantAlbumCategoryDetail::getValue).collect(Collectors.toList());
|
|
|
+ data.setTypes(typeNameList);
|
|
|
+ data.setTypeList(typeList);
|
|
|
+ } else {
|
|
|
+ data.setTypes(new ArrayList<>());
|
|
|
+ }
|
|
|
// 级别
|
|
|
- List<String> levels = list.stream().map(TenantAlbumMusic::getLevel).distinct().filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
|
|
- data.setLevels(levels);
|
|
|
+ List<Long> levelIds =list.stream().map(TenantAlbumMusic::getLevel).distinct().filter(StringUtils::isNotBlank)
|
|
|
+ .filter(NumberUtil::isNumber).map(Long::valueOf).collect(Collectors.toList());
|
|
|
+ if (!typeIds.isEmpty()) {
|
|
|
+ List<TenantAlbumCategoryDetail> levelList = tenantAlbumCategoryDetailService.lambdaQuery()
|
|
|
+ .in(TenantAlbumCategoryDetail::getId, levelIds).list();
|
|
|
+ List<String> levelNameList = levelList.stream()
|
|
|
+ .map(TenantAlbumCategoryDetail::getValue).collect(Collectors.toList());
|
|
|
+ data.setLevels(levelNameList);
|
|
|
+ data.setLevelList(levelList);
|
|
|
+ } else {
|
|
|
+ data.setLevels(new ArrayList<>());
|
|
|
+ }
|
|
|
|
|
|
// 声部
|
|
|
List<Long> subjectIds = musicSheets.stream()
|