|
|
@ -115,15 +115,26 @@ public class JournalSongService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public JournalSong findByJournalNoSongId(String id) {
|
|
|
|
public JournalSong findByJournalNoSongId(String id) {
|
|
|
|
return (JournalSong) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE, id, key -> journalSongDao.findByJournalNoSongId(id) , true).getValue() ;
|
|
|
|
return (JournalSong) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE, id, key -> journalSongDao.findByJournalNoSongId(id) , false).getValue() ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<SongRespDTO> findByJournalNo(String journalNo) {
|
|
|
|
public List<SongRespDTO> findByJournalNo(String journalNo) {
|
|
|
|
return (List<SongRespDTO>) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_SONG_LIST, journalNo, key -> getSongRespDTO(journalNo) , true).getValue() ;
|
|
|
|
return (List<SongRespDTO>) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_SONG_LIST, journalNo, key -> getSongRespDTOByJournalNo(journalNo) , false).getValue() ;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<SongRespDTO> getSongRespDTO(String journalNo) {
|
|
|
|
public List<SongRespDTO> findByJournalId(String journalId) {
|
|
|
|
|
|
|
|
return (List<SongRespDTO>) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_SONG_LIST, journalId, key -> getSongRespDTOByJournalId(journalId) , false).getValue();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<SongRespDTO> getSongRespDTOByJournalId(String journalId) {
|
|
|
|
|
|
|
|
List<JournalSong> songs = journalSongDao.findByJournalId(journalId);
|
|
|
|
|
|
|
|
List<SongRespDTO> results= songs.stream().map(s -> SongMapper.getSongRespDTO(s))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
return results.isEmpty()?null:results;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<SongRespDTO> getSongRespDTOByJournalNo(String journalNo) {
|
|
|
|
List<JournalSong> songs = findByVolid(journalNo);
|
|
|
|
List<JournalSong> songs = findByVolid(journalNo);
|
|
|
|
return songs.stream().map(s -> SongMapper.getSongRespDTO(s))
|
|
|
|
return songs.stream().map(s -> SongMapper.getSongRespDTO(s))
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
@ -155,4 +166,6 @@ public class JournalSongService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|