刘俊驰 2 weeks ago
parent
commit
d0dae64f6a
17 changed files with 508 additions and 100 deletions
  1. 62 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/AlbumCategoryController.java
  2. 17 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/MusicAlbumController.java
  3. 1 0
      cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/ETenantAlbumCategoryType.java
  4. 6 22
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/MusicAlbumSheetSortDto.java
  5. 11 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MusicAlbumDetailSearch.java
  6. 3 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MusicSheetSearch.java
  7. 65 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/AlbumCategory.java
  8. 8 59
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/AlbumMusicRelate.java
  9. 24 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/AlbumCategoryMapper.java
  10. 37 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/AlbumCategoryService.java
  11. 58 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/AlbumCategoryServiceImpl.java
  12. 43 19
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicAlbumServiceImpl.java
  13. 1 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java
  14. 9 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/AlbumDetailVo.java
  15. 124 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/AlbumCategoryWrapper.java
  16. 36 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/AlbumCategoryMapper.xml
  17. 3 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

+ 62 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/AlbumCategoryController.java

@@ -0,0 +1,62 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.microsvc.toolkit.common.response.paging.PageInfo;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.common.response.template.R;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.service.AlbumCategoryService;
+import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
+import com.yonge.toolset.base.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/albumCategory")
+@Api(tags = "机构专辑分类")
+public class AlbumCategoryController {
+
+    @Autowired
+    private AlbumCategoryService albumCategoryService;
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    
+    @ApiOperation(value = "查询分页", notes = "机构专辑分类- 传入 AlbumCategoryWrapper.AlbumCategoryQuery")
+    @PostMapping("/page")
+    public R<PageInfo<AlbumCategoryWrapper.AlbumCategory>> page(@RequestBody AlbumCategoryWrapper.AlbumCategoryQuery query) {
+        
+        IPage<AlbumCategoryWrapper.AlbumCategory> pages = albumCategoryService.selectPage(QueryInfo.getPage(query), query);
+        
+        return R.from(QueryInfo.pageInfo(pages));
+	}
+    
+    @ApiOperation(value = "新增", notes = "机构专辑分类- 传入 AlbumCategoryWrapper.AlbumCategory")
+	@PostMapping("/save")
+	public R<JSONObject> add( @RequestBody @Validated AlbumCategoryWrapper.AddAlbumCategory albumCategory) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null  || sysUser.getId() == null) {
+            throw new BizException("用户信息获取失败");
+        }
+        albumCategory.setOperatorId(sysUser.getId());
+        // 新增数据
+        albumCategoryService.add(albumCategory);
+        
+        return R.defaultR();
+	}
+
+	@ApiOperation(value = "删除", notes = "机构专辑分类- 传入id")
+	@PostMapping("/remove")
+	public R<Boolean> remove(@RequestParam Long id) {
+    
+		return R.from(albumCategoryService.del(id));
+	}
+}

+ 17 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/MusicAlbumController.java

@@ -5,6 +5,7 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.search.MusicAlbumDetailSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.MusicAlbumSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.MusicSheetSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.StudentMusicAlbumSearch;
 import com.yonge.cooleshow.biz.dal.entity.Student;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
@@ -12,9 +13,11 @@ import com.yonge.cooleshow.biz.dal.enums.OrderStatusEnum;
 import com.yonge.cooleshow.biz.dal.enums.album.PurchaseRecordTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.AppVersionInfoService;
 import com.yonge.cooleshow.biz.dal.service.MusicAlbumService;
+import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
 import com.yonge.cooleshow.biz.dal.service.StudentService;
 import com.yonge.cooleshow.biz.dal.vo.AlbumDetailVo;
 import com.yonge.cooleshow.biz.dal.vo.MusicAlbumVo;
+import com.yonge.cooleshow.biz.dal.vo.MusicSheetVo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
@@ -60,6 +63,9 @@ public class MusicAlbumController extends BaseController {
     @Autowired
     private AppVersionInfoService appVersionInfoService;
 
+    @Autowired
+    private MusicSheetService musicSheetService;
+
     @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
     @PostMapping(value="/list", consumes="application/json", produces="application/json")
     public HttpResponseResult<PageInfo<MusicAlbumVo>> list(@RequestBody MusicAlbumSearch query) {
@@ -97,6 +103,17 @@ public class MusicAlbumController extends BaseController {
     }
 
 
+    @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
+    @PostMapping(value="/musicPage", consumes="application/json", produces="application/json")
+    public HttpResponseResult<PageInfo<MusicSheetVo>> musicPage(@RequestBody MusicAlbumDetailSearch query) {
+
+        query.setType(2);
+        query.setState(YesOrNoEnum.YES);
+        IPage<MusicSheetVo> musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(musicSheetVoIPage));
+    }
+
+
     /**
      * 专辑详情
      */

+ 1 - 0
cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/ETenantAlbumCategoryType.java

@@ -5,6 +5,7 @@ import com.yonge.toolset.base.enums.BaseEnum;
 
 public enum ETenantAlbumCategoryType implements BaseEnum<String, ETenantAlbumCategoryType> {
 
+    // 类型 CATEGORY_TYPE 级别 CATEGORY_LEVEL
     CATEGORY_TYPE("类型"),
     CATEGORY_LEVEL("级别"),
     ;

+ 6 - 22
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/MusicAlbumSheetSortDto.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 /**
  * Description
@@ -9,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
  * @author liujunchi
  * @date 2022-08-08
  */
+@Data
 @ApiModel("设置专辑中曲目的排序值")
 public class MusicAlbumSheetSortDto {
 
@@ -21,28 +23,10 @@ public class MusicAlbumSheetSortDto {
     @ApiModelProperty("排序值")
     private Integer sortNumber;
 
+    @ApiModelProperty(value = "级别")
+    private Long alBumCategoryLevelId;
 
-    public Long getAlbumId() {
-        return albumId;
-    }
 
-    public void setAlbumId(Long albumId) {
-        this.albumId = albumId;
-    }
-
-    public Long getMusicSheetId() {
-        return musicSheetId;
-    }
-
-    public void setMusicSheetId(Long musicSheetId) {
-        this.musicSheetId = musicSheetId;
-    }
-
-    public Integer getSortNumber() {
-        return sortNumber;
-    }
-
-    public void setSortNumber(Integer sortNumber) {
-        this.sortNumber = sortNumber;
-    }
+    @ApiModelProperty(value = "类型")
+    private Long alBumCategoryTypeId;
 }

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

@@ -4,6 +4,7 @@ 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;
+import lombok.Data;
 
 import javax.validation.constraints.NotNull;
 import java.util.List;
@@ -15,6 +16,7 @@ import java.util.Optional;
  * @author liujunchi
  * @date 2022-03-31
  */
+@Data
 @ApiModel(value = "MusicAlbumDetailSearch", description = "专辑详情查询")
 public class MusicAlbumDetailSearch extends MusicSheetSearch {
 
@@ -45,6 +47,15 @@ public class MusicAlbumDetailSearch extends MusicSheetSearch {
     @ApiModelProperty(value = "登录学生id",hidden = true)
     private Long studentId;
 
+
+
+    @ApiModelProperty("是否查询分类信息")
+    private Boolean queryCategory = false;
+
+
+    @ApiModelProperty("是否查询曲目信息")
+    private Boolean queryMusicSheet = true;
+
     public Long getStudentId() {
         return studentId;
     }

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

@@ -39,6 +39,9 @@ public class MusicSheetSearch  extends QueryInfo{
     @ApiModelProperty("曲目编号/名称")
     private String idAndName;
 
+    @ApiModelProperty("曲目名称")
+    private String musicSheetName;
+
     @ApiModelProperty("标签id(多个逗号隔开)")
     private String musicTagIds;
 

+ 65 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/AlbumCategory.java

@@ -0,0 +1,65 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import lombok.Data;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 机构专辑分类
+ * 2024-12-19 16:57:26
+ */
+@Data
+@ApiModel(" AlbumCategory-机构专辑分类")
+@TableName("album_category")
+public class AlbumCategory implements Serializable {
+
+    @ApiModelProperty("主键ID") 
+	    @TableId(value = "id_")
+	    private Long id;
+
+    @ApiModelProperty("专辑ID") 
+	@TableField(value = "album_id_")
+    private Long albumId;
+
+    @ApiModelProperty("专辑分类类别 类型 CATEGORY_TYPE 级别 CATEGORY_LEVEL") 
+	@TableField(value = "category_type_")
+    private String categoryType;
+
+    @ApiModelProperty("专辑分类名称") 
+	@TableField(value = "name_")
+    private String name;
+
+    @ApiModelProperty("排序") 
+	@TableField(value = "sort_")
+    private Integer sort;
+
+    @ApiModelProperty("删除标记") 
+	@TableField(value = "del_flag_")
+    private Boolean delFlag;
+
+    @ApiModelProperty("创建人") 
+	@TableField(value = "create_by_")
+    private Long createBy;
+
+    @ApiModelProperty("创建时间") 
+	@TableField(value = "create_time_")
+    private Date createTime;
+
+    @ApiModelProperty("修改人") 
+	@TableField(value = "update_by_")
+    private Long updateBy;
+
+    @ApiModelProperty("更新时间") 
+	@TableField(value = "update_time_")
+    private Date updateTime;
+
+}

+ 8 - 59
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/AlbumMusicRelate.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import java.util.Date;
 
@@ -15,6 +16,7 @@ import java.util.Date;
  * @date 2022-03-25 23:46:28
  * @version v1.0
  **/
+@Data
 @ApiModel(value = "album_music_relate-专辑曲谱关联表")
 public class AlbumMusicRelate extends BaseEntity {
 
@@ -42,65 +44,12 @@ public class AlbumMusicRelate extends BaseEntity {
     @ApiModelProperty(value = "添加人")
     private Long createBy;  //添加人
 
+	@TableField("album_category_level_id_")
+	@ApiModelProperty(value = "级别")
+	private Long alBumCategoryLevelId;
 
-	public AlbumMusicRelate setId(Long id) {
-	    this.id = id;
-	    return this;
-	}
-
-	public Long getId() {
-	    return this.id;
-	}
-
-	public AlbumMusicRelate setAlbumId(Long albumId) {
-	    this.albumId = albumId;
-	    return this;
-	}
-
-	public Long getAlbumId() {
-	    return this.albumId;
-	}
-
-	public AlbumMusicRelate setMusicSheetId(Long musicSheetId) {
-	    this.musicSheetId = musicSheetId;
-	    return this;
-	}
-
-	public Long getMusicSheetId() {
-	    return this.musicSheetId;
-	}
-
-	public AlbumMusicRelate setSortNumber(Integer sortNumber) {
-	    this.sortNumber = sortNumber;
-	    return this;
-	}
-
-	public Integer getSortNumber() {
-	    return this.sortNumber;
-	}
-
-	public AlbumMusicRelate setCreateTime(java.util.Date createTime) {
-	    this.createTime = createTime;
-	    return this;
-	}
-
-	public java.util.Date getCreateTime() {
-	    return this.createTime;
-	}
-
-	public AlbumMusicRelate setCreateBy(Long createBy) {
-	    this.createBy = createBy;
-	    return this;
-	}
-
-	public Long getCreateBy() {
-	    return this.createBy;
-	}
-
-
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
+	@TableField("album_category_type_id_")
+	@ApiModelProperty(value = "类型")
+	private Long alBumCategoryTypeId;
 
 }

+ 24 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/AlbumCategoryMapper.java

@@ -0,0 +1,24 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.yonge.cooleshow.biz.dal.entity.AlbumCategory;
+import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
+
+/**
+ * 机构专辑分类
+ * 2024-12-19 16:57:26
+ */
+@Repository
+public interface AlbumCategoryMapper extends BaseMapper<AlbumCategory> {
+
+	/**
+	 * 分页查询
+	 */
+	List<AlbumCategoryWrapper.AlbumCategory> selectPage(@Param("page") IPage<AlbumCategoryWrapper.AlbumCategory> page, @Param("param") AlbumCategoryWrapper.AlbumCategoryQuery param);
+	
+}

+ 37 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/AlbumCategoryService.java

@@ -0,0 +1,37 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
+import com.yonge.cooleshow.biz.dal.entity.AlbumCategory;
+
+/**
+ * 机构专辑分类
+ * 2024-12-19 16:57:26
+ */
+public interface AlbumCategoryService extends IService<AlbumCategory>  {
+
+
+    /**
+     * 分页查询
+     * @param page IPage<AlbumCategory>
+     * @param query AlbumCategoryWrapper.AlbumCategoryQuery
+     * @return IPage<AlbumCategory>
+     */
+    IPage<AlbumCategoryWrapper.AlbumCategory> selectPage(IPage<AlbumCategoryWrapper.AlbumCategory> page, AlbumCategoryWrapper.AlbumCategoryQuery query);
+
+
+    /**
+     * 新增/修改
+     * @param albumCategory
+     */
+    void add(AlbumCategoryWrapper.AddAlbumCategory albumCategory);
+
+    /**
+     * 删除
+     *
+     * @param id
+     *
+     */
+    Boolean del(Long id);
+}

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

@@ -0,0 +1,58 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.BeanUtils;
+import lombok.extern.slf4j.Slf4j;
+import com.yonge.cooleshow.biz.dal.entity.AlbumCategory;
+import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
+import com.yonge.cooleshow.biz.dal.mapper.AlbumCategoryMapper;
+import com.yonge.cooleshow.biz.dal.service.AlbumCategoryService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 机构专辑分类
+ * 2024-12-19 16:57:26
+ */
+@Slf4j
+@Service
+public class AlbumCategoryServiceImpl extends ServiceImpl<AlbumCategoryMapper, AlbumCategory> implements AlbumCategoryService {
+
+
+    
+    /**
+     * 分页查询
+     * @param page IPage<AlbumCategory>
+     * @param query AlbumCategoryWrapper.AlbumCategoryQuery
+     * @return IPage<AlbumCategory>
+     */
+    @Override
+    public IPage<AlbumCategoryWrapper.AlbumCategory> selectPage(IPage<AlbumCategoryWrapper.AlbumCategory> page, AlbumCategoryWrapper.AlbumCategoryQuery query) {
+        
+        return page.setRecords(baseMapper.selectPage(page, query));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void add(AlbumCategoryWrapper.AddAlbumCategory albumCategory) {
+        AlbumCategory entity = JSON.parseObject(albumCategory.jsonString(), AlbumCategory.class);
+        entity.setUpdateBy(albumCategory.getOperatorId());
+        if (entity.getId() == null) {
+            entity.setCreateBy(albumCategory.getOperatorId());
+        }
+        this.saveOrUpdate(entity);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean del(Long id) {
+        return this.lambdaUpdate()
+                .eq(AlbumCategory::getId, id)
+                .set(AlbumCategory::getDelFlag, 1)
+                .update();
+
+    }
+
+}

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

@@ -5,6 +5,7 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.search.StudentMusicSheetOrderSearch;
@@ -13,9 +14,11 @@ import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.vo.*;
 import com.yonge.cooleshow.biz.dal.enums.album.PurchaseRecordTypeEnum;
+import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumWrapper;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.cooleshow.common.enums.ActivityShareEnum;
+import com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
 import com.yonge.toolset.utils.obj.ObjectUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -84,6 +87,8 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
     @Autowired
     private TenantStaffService tenantStaffService;
 
+    @Autowired
+    private AlbumCategoryService albumCategoryService;
 
     @Autowired
     private SysUserFeignService sysUserFeignService;
@@ -138,31 +143,49 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
             query.setSubjectIds(musicAlbum.getSubjectId());
         }
 
+        if (query.getQueryCategory() !=null && query.getQueryCategory()) {
+            // 查询专辑分类
+            AlbumCategoryWrapper.AlbumCategoryQuery albumCategoryQuery = new AlbumCategoryWrapper.AlbumCategoryQuery();
+            albumCategoryQuery.setAlbumId(query.getId());
+            IPage<AlbumCategoryWrapper.AlbumCategory> albumCategoryIPage = albumCategoryService.selectPage(new Page<>(1, -1), albumCategoryQuery);
+            List<AlbumCategoryWrapper.AlbumCategory> records = albumCategoryIPage.getRecords();
+            if (CollectionUtils.isNotEmpty(records)) {
+                albumDetailVo.setAlbumLevelList(records.stream().filter(o->o.getCategoryType().equals(ETenantAlbumCategoryType.CATEGORY_LEVEL.name())).collect(Collectors.toList()));
+                albumDetailVo.setAlbumTypeList(records.stream().filter(o->o.getCategoryType().equals(ETenantAlbumCategoryType.CATEGORY_TYPE.name())).collect(Collectors.toList()));
+            }
+        }
+
         if (sysUser != null) {
             query.setStudentId(sysUser.getId());
         }
         query.setClientType(client);
-        IPage<MusicSheetVo> musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(page,query);
 
-        List<MusicSheetVo> records = musicSheetVoIPage.getRecords();
-        if (CollectionUtils.isNotEmpty(records)) {
-            // 专辑曲目付费方式
-            List<String> paymentTypes = musicSheetVoIPage.getRecords().stream()
-                    .flatMap(x -> Arrays.stream(x.getPaymentType().split(","))).distinct().collect(Collectors.toList());
-            albumDetailVo.setMusicPaymentTypes(paymentTypes);
+        IPage<MusicSheetVo> musicSheetVoIPage = null;
+        if (query.getQueryMusicSheet() !=null && query.getQueryMusicSheet()) {
+            musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(page, query);
 
-            // 更新曲目专辑数量
-            musicSheetService.updateMusicAlbumNumInfo(records);
-        }
-        //处理Long精度丢失问题
-        List<MusicSheetVoResult> musicSheetVoResults = new ArrayList<>();
-        for (MusicSheetVo row : records) {
-            MusicSheetVoResult musicSheetVoResult = JSON.parseObject(JSON.toJSONString(row), MusicSheetVoResult.class);
-            musicSheetVoResult.setCbsMusicSheetId(row.getCbsMusicSheetId().toString());
-            musicSheetVoResults.add(musicSheetVoResult);
-        }
-        albumDetailVo.setMusicSheetList(PageUtil.pageInfo(com.yonge.cooleshow.biz.dal.dto.PageUtil.transPageInfo(musicSheetVoIPage, musicSheetVoResults)));
+            List<MusicSheetVo> records = musicSheetVoIPage.getRecords();
+            if (CollectionUtils.isNotEmpty(records)) {
+                // 专辑曲目付费方式
+                List<String> paymentTypes = musicSheetVoIPage.getRecords().stream()
+                        .flatMap(x -> Arrays.stream(x.getPaymentType().split(","))).distinct().collect(Collectors.toList());
+                albumDetailVo.setMusicPaymentTypes(paymentTypes);
 
+                // 更新曲目专辑数量
+                musicSheetService.updateMusicAlbumNumInfo(records);
+            }
+            //处理Long精度丢失问题
+            List<MusicSheetVoResult> musicSheetVoResults = new ArrayList<>();
+            for (MusicSheetVo row : records) {
+                MusicSheetVoResult musicSheetVoResult = JSON.parseObject(JSON.toJSONString(row), MusicSheetVoResult.class);
+                musicSheetVoResult.setCbsMusicSheetId(row.getCbsMusicSheetId().toString());
+                musicSheetVoResults.add(musicSheetVoResult);
+            }
+            albumDetailVo.setMusicSheetList(PageUtil.pageInfo(com.yonge.cooleshow.biz.dal.dto.PageUtil.transPageInfo(musicSheetVoIPage, musicSheetVoResults)));
+
+        } else {
+            musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(new Page<>(1,1), query);
+        }
 
         albumDetailVo.setMusicSheetCount((int) musicSheetVoIPage.getTotal());
 
@@ -384,9 +407,10 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
                 .eq(AlbumMusicRelate::getAlbumId,query.getAlbumId())
                 .eq(AlbumMusicRelate::getMusicSheetId,query.getMusicSheetId())
                 .set(AlbumMusicRelate::getSortNumber,query.getSortNumber())
+                .set(AlbumMusicRelate::getAlBumCategoryLevelId,query.getAlBumCategoryLevelId())
+                .set(AlbumMusicRelate::getAlBumCategoryTypeId,query.getAlBumCategoryTypeId())
                 .update();
 
-
     }
 
     @Override

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

@@ -355,6 +355,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             List<MusicFavorite> musicFavoriteList = musicFavoriteService.lambdaQuery()
                     .eq(MusicFavorite::getUserId, query.getStudentId())
                     .eq(MusicFavorite::getClientType, query.getClientType())
+                    .eq(MusicFavorite::getProviderType, SourceTypeEnum.PLATFORM.name())
                     .in(MusicFavorite::getMusicSheetId, musicIdList)
                     .list();
             if (CollectionUtils.isNotEmpty(musicFavoriteList)) {

+ 9 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/AlbumDetailVo.java

@@ -2,9 +2,11 @@ package com.yonge.cooleshow.biz.dal.vo;
 
 import com.yonge.cooleshow.biz.dal.enums.MusicSheetTypeEnum;
 import com.yonge.cooleshow.biz.dal.enums.OrderStatusEnum;
+import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.toolset.base.page.PageInfo;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.util.List;
 
@@ -14,6 +16,7 @@ import java.util.List;
  * @author: liujunchi
  * @date: 2022-03-31
  */
+@Data
 public class AlbumDetailVo {
 
     @ApiModelProperty(value = "是否审核时可见 (0:否  1:是)")
@@ -80,6 +83,12 @@ public class AlbumDetailVo {
     @ApiModelProperty(value = "曲谱类型(SINGLE:单曲,CONCERT:合奏)")
     private MusicSheetTypeEnum albumType;
 
+    @ApiModelProperty("专辑级别")
+    private List<AlbumCategoryWrapper.AlbumCategory> albumLevelList;
+
+    @ApiModelProperty("专辑类型")
+    private List<AlbumCategoryWrapper.AlbumCategory> albumTypeList;
+
     public YesOrNoEnum getAuditVersion() {
         return auditVersion;
     }

+ 124 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/AlbumCategoryWrapper.java

@@ -0,0 +1,124 @@
+package com.yonge.cooleshow.biz.dal.wrapper;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Optional;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 机构专辑分类
+ * 2024-12-19 16:57:26
+ */
+@ApiModel(value = "AlbumCategoryWrapper对象", description = "机构专辑分类查询对象")
+public class AlbumCategoryWrapper {
+
+    @Data
+	@Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" AlbumCategoryQuery-机构专辑分类")
+    public static class AlbumCategoryQuery implements QueryInfo {
+    
+    	@ApiModelProperty("当前页")
+        private Integer page;
+        
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+		private String keyword;
+
+        @ApiModelProperty("专辑ID")
+        private Long albumId;
+
+        @ApiModelProperty("专辑分类类别 类型 CATEGORY_TYPE 级别 CATEGORY_LEVEL")
+        private String categoryType;
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+        
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static AlbumCategoryQuery from(String json) {
+            return JSON.parseObject(json, AlbumCategoryQuery.class);
+        }
+    }  
+
+    @Data
+	@ApiModel(" AlbumCategory-机构专辑分类")
+    public static class AlbumCategory {
+
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+        @ApiModelProperty("专辑ID")
+        private Long albumId;
+
+        @ApiModelProperty("专辑分类类别 类型 CATEGORY_TYPE 级别 CATEGORY_LEVEL")
+        private String categoryType;
+
+        @ApiModelProperty("专辑分类名称")
+        private String name;
+
+        @ApiModelProperty("排序")
+        private Integer sort;
+
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static AlbumCategory from(String json) {
+            return JSON.parseObject(json, AlbumCategory.class);
+        }
+	}
+
+
+
+    @Data
+    @ApiModel(" AddAlbumCategory")
+    public static class AddAlbumCategory {
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+        @ApiModelProperty("专辑ID")
+        @NotNull(message = "专辑ID不能为空")
+        private Long albumId;
+
+        @ApiModelProperty("专辑分类类别 类型 CATEGORY_TYPE 级别 CATEGORY_LEVEL")
+        @NotNull(message = "专辑分类类别不能为空")
+        private String categoryType;
+
+        @ApiModelProperty("专辑分类名称")
+        @NotNull(message = "名称不能为空")
+        private String name;
+
+        @ApiModelProperty("排序")
+        @NotNull(message = "排序不能为空")
+        private Integer sort;
+
+
+        @ApiModelProperty(value = "创建人",hidden = true)
+        private Long operatorId;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+    }
+}

+ 36 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/AlbumCategoryMapper.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.biz.dal.mapper.AlbumCategoryMapper">
+
+	 
+    
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+         t.id_ AS id
+        , t.album_id_ AS albumId
+        , t.category_type_ AS categoryType
+        , t.name_ AS name
+        , t.sort_ AS sort
+        , t.del_flag_ AS delFlag
+        , t.create_by_ AS createBy
+        , t.create_time_ AS createTime
+        , t.update_by_ AS updateBy
+        , t.update_time_ AS updateTime
+        </sql> 
+    
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper$AlbumCategory">
+		SELECT         
+        	<include refid="baseColumns" />
+		FROM album_category t
+        <where>
+            <if test="param.albumId != null">
+                and t.album_id_ = #{param.albumId}
+            </if>
+            <if test="param.categoryType != null and param.categoryType != ''">
+                and t.category_type_ = #{param.categoryType}
+            </if>
+        </where>
+        order by t.sort_ ,t.id_ desc
+	</select>
+    
+</mapper>

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

@@ -342,6 +342,9 @@
                 and (t.id_ like concat('%',#{param.idAndName},'%') or
                 t.music_sheet_name_ like concat('%',#{param.idAndName},'%'))
             </if>
+            <if test="param.musicSheetName != null and param.musicSheetName != ''">
+                and t.music_sheet_name_ like concat('%',#{param.musicSheetName},'%')
+            </if>
             <if test="param.search != null and param.search != ''">
                 and (t.cbs_music_sheet_id_ like concat('%',#{param.search},'%') or
                 t.music_sheet_name_ like concat('%',#{param.search},'%'))