|
|
@ -19,6 +19,7 @@ import enums.AlbumStateEnum;
|
|
|
|
import enums.SongInfoStateEnum;
|
|
|
|
import enums.SongInfoStateEnum;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
@ -85,6 +86,9 @@ public class AlbumService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
result = albumPage.getContent();
|
|
|
|
result = albumPage.getContent();
|
|
|
|
|
|
|
|
for (ArtistAlbum artistAlbum : result) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
long totalElements = albumPage.getTotalElements();
|
|
|
|
long totalElements = albumPage.getTotalElements();
|
|
|
|
|
|
|
|
|
|
|
@ -137,17 +141,17 @@ public class AlbumService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(param.getName())) {
|
|
|
|
if (StringUtils.isNotBlank(param.getName())) {
|
|
|
|
// 专辑名称
|
|
|
|
// 专辑名称
|
|
|
|
String likeExpression = "%" + param.getName() + "%";
|
|
|
|
String likeExpression = "%" + param.getName() + "%";
|
|
|
|
predicateList.add(builder.and(builder.like(root.get("name"), likeExpression)));
|
|
|
|
predicateList.add(builder.and(builder.like(root.get("name"), likeExpression)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(param.getStartTime() != null) {
|
|
|
|
if (param.getStartTime() != null) {
|
|
|
|
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), param.getStartTime()));
|
|
|
|
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), param.getStartTime()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(param.getEndTime() != null) {
|
|
|
|
if (param.getEndTime() != null) {
|
|
|
|
predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime()));
|
|
|
|
predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime()));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -201,7 +205,6 @@ public class AlbumService {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (AlbumSongAddDTO albumSongAddDTO : songAddList) {
|
|
|
|
for (AlbumSongAddDTO albumSongAddDTO : songAddList) {
|
|
|
|
addSongForAlbum(albumSongAddDTO, user, artistAlbum);
|
|
|
|
addSongForAlbum(albumSongAddDTO, user, artistAlbum);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -321,12 +324,24 @@ public class AlbumService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 专辑-音乐绑定
|
|
|
|
// 专辑-音乐绑定
|
|
|
|
ArtistAlbumSong artistAlbumSong = ArtistAlbumSong.builder()
|
|
|
|
String albumStr = albumSongAddDTO.getAlbumStr();
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
String[] albumArr = albumStr.split(",");
|
|
|
|
.songId(id)
|
|
|
|
List<ArtistAlbumSong> artistAlbumSongList = new ArrayList<>();
|
|
|
|
.albumId(artistAlbum.getId())
|
|
|
|
for (String s : albumArr) {
|
|
|
|
.build();
|
|
|
|
if (StringUtils.isNotBlank(s)) {
|
|
|
|
artistAlbumSongDao.save(artistAlbumSong);
|
|
|
|
ArtistAlbumSong artistAlbumSong = ArtistAlbumSong.builder()
|
|
|
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
|
|
|
.songId(id)
|
|
|
|
|
|
|
|
.albumId(artistAlbum.getId())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
artistAlbumSongList.add(artistAlbumSong);
|
|
|
|
|
|
|
|
if (ObjectUtils.notEqual(user.getUserId(), s)) {
|
|
|
|
|
|
|
|
// todo 如果当前用户不是选定的歌手,需要发送站内消息
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
artistAlbumSongDao.saveAll(artistAlbumSongList);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|