|
@@ -495,7 +495,16 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
|
|
|
|
|
|
List<MusicSheetAccompaniment> background = detail.getBackground();
|
|
|
if (CollectionUtils.isNotEmpty(background)) {
|
|
|
- background.sort(Comparator.comparing(MusicSheetAccompaniment::getSortNumber));
|
|
|
+
|
|
|
+ long count = background.stream().map(MusicSheetAccompaniment::getSortNumber)
|
|
|
+ .filter(x -> Objects.nonNull(x) && x <= 0).count();
|
|
|
+ if (count == background.size()) {
|
|
|
+
|
|
|
+ background.sort(Comparator.comparing(MusicSheetAccompaniment::getId));
|
|
|
+ } else {
|
|
|
+
|
|
|
+ background.sort(Comparator.comparing(MusicSheetAccompaniment::getSortNumber));
|
|
|
+ }
|
|
|
}
|
|
|
return detail;
|
|
|
}
|