|
@@ -110,28 +110,38 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
|
|
|
|
|
|
@Override
|
|
|
public PageInfo<SysMusicScoreAccompaniment> queryScorePage(SysExamSongQueryInfo queryInfo) {
|
|
|
- if(queryInfo.getCategoriesId() != null){
|
|
|
+ if(queryInfo.getCategoriesIds() != null){
|
|
|
List<Integer> categoriesIdList = new ArrayList<>();
|
|
|
- MusicScoreQueryInfo musicScoreQueryInfo = new MusicScoreQueryInfo();
|
|
|
- Integer categoriesId = null;
|
|
|
- if(StringUtils.isNotEmpty(queryInfo.getCategoriesId())){
|
|
|
- categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
|
|
|
+ String[] categoriesIds = queryInfo.getCategoriesIds().split(",");
|
|
|
+
|
|
|
+ for(String fc : categoriesIds){
|
|
|
+ SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(Integer.parseInt(fc));
|
|
|
+
|
|
|
+ if(sysMusicScoreCategories == null){
|
|
|
+ throw new BizException("分类找不到");
|
|
|
+ }
|
|
|
+ categoriesIdList.add(Integer.parseInt(fc));
|
|
|
+ sysMusicScoreCategories = sysMusicScoreCategoriesService.getChildTree(sysMusicScoreCategories);
|
|
|
+ getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
|
|
|
}
|
|
|
- musicScoreQueryInfo.setParentId(categoriesId);
|
|
|
- musicScoreQueryInfo.setOrganId(queryInfo.getOrganId());
|
|
|
- musicScoreQueryInfo.setEnable(queryInfo.getEnable());
|
|
|
- //List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesService.queryTree(musicScoreQueryInfo);
|
|
|
-
|
|
|
- SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(categoriesId);
|
|
|
+ queryInfo.setCategoriesIds(categoriesIdList.stream().map(String :: valueOf).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getFilterCategoriesIds())){
|
|
|
+ String[] filterCategoriesIds = queryInfo.getFilterCategoriesIds().split(",");
|
|
|
+
|
|
|
+ List<Integer> filterCategoriesIdList = new ArrayList<>();
|
|
|
|
|
|
- if(sysMusicScoreCategories == null){
|
|
|
- throw new BizException("分类找不到");
|
|
|
+ for(String fc : filterCategoriesIds){
|
|
|
+ SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(Integer.parseInt(fc));
|
|
|
+
|
|
|
+ if(sysMusicScoreCategories == null){
|
|
|
+ throw new BizException("分类找不到");
|
|
|
+ }
|
|
|
+ filterCategoriesIdList.add(Integer.parseInt(fc));
|
|
|
+ sysMusicScoreCategories = sysMusicScoreCategoriesService.getChildTree(sysMusicScoreCategories);
|
|
|
+ getAllCategoryIdList(filterCategoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
|
|
|
}
|
|
|
- categoriesIdList.add(categoriesId);
|
|
|
- sysMusicScoreCategories = sysMusicScoreCategoriesService.getChildTree(sysMusicScoreCategories);
|
|
|
- getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
|
|
|
-
|
|
|
- queryInfo.setCategoriesIdList(categoriesIdList);
|
|
|
+ queryInfo.setFilterCategoriesIds(filterCategoriesIdList.stream().map(String :: valueOf).collect(Collectors.joining(",")));
|
|
|
}
|
|
|
return this.queryPage(queryInfo);
|
|
|
}
|