feat: 期刊

desc: 期刊保存时歌曲顺序未保存问题
main
zhangjiabao 10 months ago
parent ae20662de9
commit 05b92c5565

@ -441,8 +441,16 @@ public class CMSJournalService {
Map<String,String> songId2JournalSongIdMap=journalSongs.stream().collect(Collectors.toMap(JournalSong::getSongId, JournalSong::getId)); Map<String,String> songId2JournalSongIdMap=journalSongs.stream().collect(Collectors.toMap(JournalSong::getSongId, JournalSong::getId));
List<JournalSong> updatedJournalSong = new ArrayList<>(); List<JournalSong> updatedJournalSong = new ArrayList<>();
for (int i = 0; i < songList.size(); i++) { // for (int i = 0; i < songList.size(); i++) { update: zjb from:gary 歌曲保存顺序问题
SongInfo song = songList.get(i); // SongInfo song = songList.get(i);
for (int i = 0; i < param.getSongs().size(); i++) {
int finalI = i;
SongInfo song = songList.stream()
.filter(e -> e.getId().equals(param.getSongs().get(finalI)))
.findFirst().orElse(null);
if(null == song){
continue;
}
JournalSong journalSong = new JournalSong(); JournalSong journalSong = new JournalSong();
journalSong.setId(songId2JournalSongIdMap.getOrDefault(song.getId(), String.valueOf(idWorker.nextId()))); journalSong.setId(songId2JournalSongIdMap.getOrDefault(song.getId(), String.valueOf(idWorker.nextId())));

Loading…
Cancel
Save