|
@@ -5,6 +5,7 @@ import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.StudentMusicSheetOrderSearch;
|
|
@@ -13,9 +14,11 @@ import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.*;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.album.PurchaseRecordTypeEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumWrapper;
|
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
|
import com.yonge.cooleshow.common.enums.ActivityShareEnum;
|
|
|
+import com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
|
|
|
import com.yonge.toolset.utils.obj.ObjectUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -84,6 +87,8 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
|
|
|
@Autowired
|
|
|
private TenantStaffService tenantStaffService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AlbumCategoryService albumCategoryService;
|
|
|
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
@@ -138,31 +143,49 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
|
|
|
query.setSubjectIds(musicAlbum.getSubjectId());
|
|
|
}
|
|
|
|
|
|
+ if (query.getQueryCategory() !=null && query.getQueryCategory()) {
|
|
|
+ // 查询专辑分类
|
|
|
+ AlbumCategoryWrapper.AlbumCategoryQuery albumCategoryQuery = new AlbumCategoryWrapper.AlbumCategoryQuery();
|
|
|
+ albumCategoryQuery.setAlbumId(query.getId());
|
|
|
+ IPage<AlbumCategoryWrapper.AlbumCategory> albumCategoryIPage = albumCategoryService.selectPage(new Page<>(1, -1), albumCategoryQuery);
|
|
|
+ List<AlbumCategoryWrapper.AlbumCategory> records = albumCategoryIPage.getRecords();
|
|
|
+ if (CollectionUtils.isNotEmpty(records)) {
|
|
|
+ albumDetailVo.setAlbumLevelList(records.stream().filter(o->o.getCategoryType().equals(ETenantAlbumCategoryType.CATEGORY_LEVEL.name())).collect(Collectors.toList()));
|
|
|
+ albumDetailVo.setAlbumTypeList(records.stream().filter(o->o.getCategoryType().equals(ETenantAlbumCategoryType.CATEGORY_TYPE.name())).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (sysUser != null) {
|
|
|
query.setStudentId(sysUser.getId());
|
|
|
}
|
|
|
query.setClientType(client);
|
|
|
- IPage<MusicSheetVo> musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(page,query);
|
|
|
|
|
|
- List<MusicSheetVo> records = musicSheetVoIPage.getRecords();
|
|
|
- if (CollectionUtils.isNotEmpty(records)) {
|
|
|
- // 专辑曲目付费方式
|
|
|
- List<String> paymentTypes = musicSheetVoIPage.getRecords().stream()
|
|
|
- .flatMap(x -> Arrays.stream(x.getPaymentType().split(","))).distinct().collect(Collectors.toList());
|
|
|
- albumDetailVo.setMusicPaymentTypes(paymentTypes);
|
|
|
+ IPage<MusicSheetVo> musicSheetVoIPage = null;
|
|
|
+ if (query.getQueryMusicSheet() !=null && query.getQueryMusicSheet()) {
|
|
|
+ musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(page, query);
|
|
|
|
|
|
- // 更新曲目专辑数量
|
|
|
- musicSheetService.updateMusicAlbumNumInfo(records);
|
|
|
- }
|
|
|
- //处理Long精度丢失问题
|
|
|
- List<MusicSheetVoResult> musicSheetVoResults = new ArrayList<>();
|
|
|
- for (MusicSheetVo row : records) {
|
|
|
- MusicSheetVoResult musicSheetVoResult = JSON.parseObject(JSON.toJSONString(row), MusicSheetVoResult.class);
|
|
|
- musicSheetVoResult.setCbsMusicSheetId(row.getCbsMusicSheetId().toString());
|
|
|
- musicSheetVoResults.add(musicSheetVoResult);
|
|
|
- }
|
|
|
- albumDetailVo.setMusicSheetList(PageUtil.pageInfo(com.yonge.cooleshow.biz.dal.dto.PageUtil.transPageInfo(musicSheetVoIPage, musicSheetVoResults)));
|
|
|
+ List<MusicSheetVo> records = musicSheetVoIPage.getRecords();
|
|
|
+ if (CollectionUtils.isNotEmpty(records)) {
|
|
|
+ // 专辑曲目付费方式
|
|
|
+ List<String> paymentTypes = musicSheetVoIPage.getRecords().stream()
|
|
|
+ .flatMap(x -> Arrays.stream(x.getPaymentType().split(","))).distinct().collect(Collectors.toList());
|
|
|
+ albumDetailVo.setMusicPaymentTypes(paymentTypes);
|
|
|
|
|
|
+ // 更新曲目专辑数量
|
|
|
+ musicSheetService.updateMusicAlbumNumInfo(records);
|
|
|
+ }
|
|
|
+ //处理Long精度丢失问题
|
|
|
+ List<MusicSheetVoResult> musicSheetVoResults = new ArrayList<>();
|
|
|
+ for (MusicSheetVo row : records) {
|
|
|
+ MusicSheetVoResult musicSheetVoResult = JSON.parseObject(JSON.toJSONString(row), MusicSheetVoResult.class);
|
|
|
+ musicSheetVoResult.setCbsMusicSheetId(row.getCbsMusicSheetId().toString());
|
|
|
+ musicSheetVoResults.add(musicSheetVoResult);
|
|
|
+ }
|
|
|
+ albumDetailVo.setMusicSheetList(PageUtil.pageInfo(com.yonge.cooleshow.biz.dal.dto.PageUtil.transPageInfo(musicSheetVoIPage, musicSheetVoResults)));
|
|
|
+
|
|
|
+ } else {
|
|
|
+ musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(new Page<>(1,1), query);
|
|
|
+ }
|
|
|
|
|
|
albumDetailVo.setMusicSheetCount((int) musicSheetVoIPage.getTotal());
|
|
|
|
|
@@ -384,9 +407,10 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
|
|
|
.eq(AlbumMusicRelate::getAlbumId,query.getAlbumId())
|
|
|
.eq(AlbumMusicRelate::getMusicSheetId,query.getMusicSheetId())
|
|
|
.set(AlbumMusicRelate::getSortNumber,query.getSortNumber())
|
|
|
+ .set(AlbumMusicRelate::getAlBumCategoryLevelId,query.getAlBumCategoryLevelId())
|
|
|
+ .set(AlbumMusicRelate::getAlBumCategoryTypeId,query.getAlBumCategoryTypeId())
|
|
|
.update();
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|