Browse Source

Merge branch 'feature/0710-album' into online

liujc 1 year ago
parent
commit
54de274120

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

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.enums.MusicSheetTypeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -41,6 +42,17 @@ public class MusicAlbumDetailSearch extends MusicSheetSearch {
 
     private List<String> paymentTypes;
 
+    @ApiModelProperty(value = "曲谱类型(SINGLE:单曲,CONCERT:合奏)")
+    private MusicSheetTypeEnum musicSheetType;
+
+    public MusicSheetTypeEnum getMusicSheetType() {
+        return musicSheetType;
+    }
+
+    public void setMusicSheetType(MusicSheetTypeEnum musicSheetType) {
+        this.musicSheetType = musicSheetType;
+    }
+
     public Integer getRelatedNum() {
         return relatedNum;
     }

+ 16 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/MusicAlbum.java

@@ -3,6 +3,7 @@ package com.yonge.cooleshow.biz.dal.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.yonge.cooleshow.biz.dal.enums.MusicSheetTypeEnum;
 import com.yonge.cooleshow.common.entity.BaseEntity;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModel;
@@ -40,7 +41,7 @@ public class MusicAlbum extends BaseEntity {
     private String albumTag;  //专辑标签(多个标签以逗号分开)
 
 	@TableField("subject_id_")
-	@NotBlank(message = "专辑声部不能为空 ")
+//	@NotBlank(message = "专辑声部不能为空 ")
 	@ApiModelProperty(value = "专辑声部(多个标签以逗号分开)",required = true)
 	private String subjectId;  //专辑标签(多个标签以逗号分开)
 
@@ -104,8 +105,21 @@ public class MusicAlbum extends BaseEntity {
 	@ApiModelProperty("专辑价格 ")
 	private String paymentType;
 
+    //曲谱类型 SINGLE/CONCERT ,使用MusicSheetTypeEnum
+    @TableField("album_type_")
+    @ApiModelProperty(value = "曲谱类型(SINGLE:单曲,CONCERT:合奏)")
+    private MusicSheetTypeEnum albumType;
 
-	public Integer getVirtualNumber() {
+
+    public MusicSheetTypeEnum getAlbumType() {
+        return albumType;
+    }
+
+    public void setAlbumType(MusicSheetTypeEnum albumType) {
+        this.albumType = albumType;
+    }
+
+    public Integer getVirtualNumber() {
 		return virtualNumber;
 	}
 

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicAlbumServiceImpl.java

@@ -138,6 +138,8 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
         albumDetailVo.setPaymentType(musicAlbum.getPaymentType());
         albumDetailVo.setMusicTagNames(musicTagService.getMusicTagNames(StringUtil.toLongList(musicAlbum.getAlbumTag())));
         albumDetailVo.setAuditVersion(musicAlbum.getAuditVersion());
+        query.setMusicSheetType(musicAlbum.getAlbumType());
+
         // 新增专辑曲目查询条件
         if (query.getType() != null && query.getType() == 1) {
             query.setSubjectIds(musicAlbum.getSubjectId());

+ 12 - 4
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicAlbumMapper.xml

@@ -19,6 +19,7 @@
         <result column="create_by_" jdbcType="BIGINT" property="createBy"/>
         <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="update_by_" jdbcType="BIGINT" property="updateBy"/>
+        <result column="album_type_" jdbcType="BIGINT" property="albumType"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -39,7 +40,8 @@
         t.album_price_,
         t.payment_type_,
         t.update_time_,
-        t.update_by_
+        t.update_by_,
+        t.album_type_
     </sql>
 
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.MusicAlbumVo">
@@ -74,10 +76,12 @@
                 </foreach>
             </if>
             <if test="query.subjectIdList != null and query.subjectIdList.size() != 0">
-                and
+                and (
                 <foreach collection="query.subjectIdList"  open="(" close=")"  separator="or" item="item">
                     find_in_set(#{item},t.subject_id_)
                 </foreach>
+                    or t.subject_id_ is null or t.subject_id_ = ''
+                )
             </if>
             <if test="query.albumStatus != null">
                 and t.album_status_ = #{query.albumStatus}
@@ -151,10 +155,12 @@
                 </foreach>
             </if>
             <if test="query.subjectIdList != null and query.subjectIdList.size() != 0">
-                and
+                and (
                 <foreach collection="query.subjectIdList"  open="(" close=")"  separator="or" item="item">
                     find_in_set(#{item},t.subject_id_)
                 </foreach>
+                or t.subject_id_ is null or t.subject_id_ = ''
+                )
             </if>
             <if test="query.auditVersion != null">
                 and t.audit_version_ = #{query.auditVersion}
@@ -255,10 +261,12 @@
                 </foreach>
             </if>
             <if test="query.subjectIdList != null and query.subjectIdList.size() != 0">
-                and
+                and (
                 <foreach collection="query.subjectIdList"  open="(" close=")"  separator="or" item="item">
                     find_in_set(#{item},t.subject_id_)
                 </foreach>
+                or t.subject_id_ is null or t.subject_id_ = ''
+                )
             </if>
             <if test="query.albumStatus != null">
                 and t.album_status_ = #{query.albumStatus}

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

@@ -213,6 +213,9 @@
                     find_in_set(#{item},t.music_subject_)
                 </foreach>
             </if>
+            <if test="param.musicSheetType != null">
+                and t.music_sheet_type_ = #{param.musicSheetType}
+            </if>
             <if test="param.state != null">
                 and t.state_ = #{param.state}
             </if>