|
|
@ -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 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 专辑-音乐绑定
|
|
|
|
// 专辑-音乐绑定
|
|
|
|
|
|
|
|
String albumStr = albumSongAddDTO.getAlbumStr();
|
|
|
|
|
|
|
|
String[] albumArr = albumStr.split(",");
|
|
|
|
|
|
|
|
List<ArtistAlbumSong> artistAlbumSongList = new ArrayList<>();
|
|
|
|
|
|
|
|
for (String s : albumArr) {
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(s)) {
|
|
|
|
ArtistAlbumSong artistAlbumSong = ArtistAlbumSong.builder()
|
|
|
|
ArtistAlbumSong artistAlbumSong = ArtistAlbumSong.builder()
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
.songId(id)
|
|
|
|
.songId(id)
|
|
|
|
.albumId(artistAlbum.getId())
|
|
|
|
.albumId(artistAlbum.getId())
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
artistAlbumSongDao.save(artistAlbumSong);
|
|
|
|
artistAlbumSongList.add(artistAlbumSong);
|
|
|
|
|
|
|
|
if (ObjectUtils.notEqual(user.getUserId(), s)) {
|
|
|
|
|
|
|
|
// todo 如果当前用户不是选定的歌手,需要发送站内消息
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
artistAlbumSongDao.saveAll(artistAlbumSongList);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|