Browse Source

Merge branch 'online' of http://git.dayaedu.com/yonge/cooleshow into zx_online_cbs

# Conflicts:
#	cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml
zouxuan 1 year ago
parent
commit
89ca179dd6

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MusicSheetSearch.java

@@ -103,6 +103,9 @@ public class MusicSheetSearch  extends QueryInfo{
     @ApiModelProperty(value = "曲谱类型(SINGLE:单曲,CONCERT:合奏)")
     @ApiModelProperty(value = "曲谱类型(SINGLE:单曲,CONCERT:合奏)")
     private MusicSheetTypeEnum musicSheetType;
     private MusicSheetTypeEnum musicSheetType;
 
 
+    @ApiModelProperty("指定关联专辑的曲目排在最后")
+    private Long sortByAlbumIdDesc;
+
     public SourceTypeEnum getProviderType() {
     public SourceTypeEnum getProviderType() {
         return providerType;
         return providerType;
     }
     }
@@ -313,4 +316,12 @@ public class MusicSheetSearch  extends QueryInfo{
     public void setDataCorrect(Boolean dataCorrect) {
     public void setDataCorrect(Boolean dataCorrect) {
         DataCorrect = dataCorrect;
         DataCorrect = dataCorrect;
     }
     }
+
+    public Long getSortByAlbumIdDesc() {
+        return sortByAlbumIdDesc;
+    }
+
+    public void setSortByAlbumIdDesc(Long sortByAlbumIdDesc) {
+        this.sortByAlbumIdDesc = sortByAlbumIdDesc;
+    }
 }
 }

+ 10 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java

@@ -702,7 +702,16 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
 
 
         List<MusicSheetAccompaniment> background = detail.getBackground();
         List<MusicSheetAccompaniment> background = detail.getBackground();
         if (CollectionUtils.isNotEmpty(background)) {
         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;
         return detail;
     }
     }

+ 7 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -136,6 +136,10 @@
         ,(select group_concat(s.name_) from subject s
         ,(select group_concat(s.name_) from subject s
             where find_in_set(s.id_,t.music_subject_) and s.del_flag_ = 0 ) as subjectNames
             where find_in_set(s.id_,t.music_subject_) and s.del_flag_ = 0 ) as subjectNames
         from music_sheet t
         from music_sheet t
+        left join sys_user su on t.create_by_ = su.id_
+        <if test="param.sortByAlbumIdDesc != null">
+            left join tenant_album_music tam on tam.music_sheet_id_ = t.id_ and tam.tenant_album_id_ = #{param.sortByAlbumIdDesc} and tam.del_flag_=0
+        </if>
         <where>
         <where>
             t.cbs_music_sheet_id_ IS NOT NULL
             t.cbs_music_sheet_id_ IS NOT NULL
             <include refid="QueryInfo"/>
             <include refid="QueryInfo"/>
@@ -147,6 +151,9 @@
             </if>
             </if>
         </where>
         </where>
         order by
         order by
+        <if test="param.sortByAlbumIdDesc != null">
+            if(isnull(tam.id_),0,1),
+        </if>
         <if test="param.myself == null or param.myself == false ">
         <if test="param.myself == null or param.myself == false ">
             t.top_flag_ desc,t.sort_number_ desc,
             t.top_flag_ desc,t.sort_number_ desc,
         </if>
         </if>