Commit 5433376a authored by liqin's avatar liqin 💬

bug fixed

parent 58a5a42c
......@@ -381,31 +381,25 @@ public class LearningContentController extends BaseController {
learningContent.setLearningProjectName(learningProject.getName());
}
final LambdaQueryWrapper<LearningContentBoardCat> queryWrapper = Wrappers.<LearningContentBoardCat>lambdaQuery().eq(LearningContentBoardCat::getLearningContentId, id);
queryWrapper.select(LearningContentBoardCat::getExhibitionBoardCatId);
final List<String> exhibitionBoardCatIdList = this.learningContentBoardCatService.listObjs(queryWrapper, Object::toString);
if (!exhibitionBoardCatIdList.isEmpty()) {
final List<ExhibitionBoardCat> exhibitionBoardCats = this.exhibitionBoardCatService.listByIds(exhibitionBoardCatIdList);
learningContent.setExhibitionBoardCatIdList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getId).collect(Collectors.toList()));
learningContent.setExhibitionBoardCatNameList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getName).collect(Collectors.toList()));
}
final LambdaQueryWrapper<LearningContentCopyrightOwner> learningContentCopyrightOwnerLambdaQueryWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaQuery().eq(LearningContentCopyrightOwner::getLearningContentId, id);
learningContentCopyrightOwnerLambdaQueryWrapper.select(LearningContentCopyrightOwner::getCopyrightOwnerId);
final List<String> copyrightOwnerIdList = this.learningContentCopyrightOwnerService.listObjs(learningContentCopyrightOwnerLambdaQueryWrapper, Object::toString);
if (!copyrightOwnerIdList.isEmpty()) {
final List<String> copyrightOwnerIdList = learningContent.getCopyrightOwnerIdList();
if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) {
final List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(copyrightOwnerIdList);
learningContent.setCopyrightOwnerIdList(copyrightOwnerList.stream().map(CopyrightOwner::getId).collect(Collectors.toList()));
learningContent.setCopyrightOwnerIdList(copyrightOwnerIdList);
learningContent.setCopyrightOwnerNameList(copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.toList()));
}
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().eq(LearningContentBoard::getLearningContentId, id);
learningContentBoardLambdaQueryWrapper.select(LearningContentBoard::getExhibitionBoardId);
final List<String> exhibitionBoardIdList = this.learningContentBoardService.listObjs(learningContentBoardLambdaQueryWrapper, Object::toString);
if (!exhibitionBoardIdList.isEmpty()) {
final List<String> exhibitionBoardCatIdList = learningContent.getExhibitionBoardCatIdList();
if (exhibitionBoardCatIdList != null && !exhibitionBoardCatIdList.isEmpty()) {
final List<ExhibitionBoardCat> exhibitionBoardCats = this.exhibitionBoardCatService.listByIds(exhibitionBoardCatIdList);
learningContent.setExhibitionBoardCatIdList(exhibitionBoardCatIdList);
learningContent.setExhibitionBoardCatNameList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getName).collect(Collectors.toList()));
}
final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList();
if (exhibitionBoardIdList!= null && !exhibitionBoardIdList.isEmpty()) {
final List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.listByIds(exhibitionBoardIdList);
if (!exhibitionBoardList.isEmpty()) {
learningContent.setExhibitionBoardIdList(exhibitionBoardList.stream().map(ExhibitionBoard::getId).collect(Collectors.toList()));
learningContent.setExhibitionBoardIdList(exhibitionBoardIdList);
learningContent.setExhibitionBoardNameList(exhibitionBoardList.stream().map(ExhibitionBoard::getName).collect(Collectors.toList()));
}
......@@ -427,14 +421,14 @@ public class LearningContentController extends BaseController {
}
LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
assetQueryWrapper.eq(Asset::getPublished, false);
assetQueryWrapper.eq(Asset::getPublished, true);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
final List<Asset> audioList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setAudioList(audioList);
assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
assetQueryWrapper.eq(Asset::getPublished, false);
assetQueryWrapper.eq(Asset::getPublished, true);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
final List<Asset> datumList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setDatumList(datumList);
......@@ -445,7 +439,7 @@ public class LearningContentController extends BaseController {
if (videoContent != null) {
assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
assetQueryWrapper.eq(Asset::getPublished, false);
assetQueryWrapper.eq(Asset::getPublished, true);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
final List<Asset> videoList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setVideoList(videoList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment