Browse Source

Merge branch 'feature/1219_opt' into develop-new

刘俊驰 1 ngày trước cách đây
mục cha
commit
01bbbf2cdf
29 tập tin đã thay đổi với 688 bổ sung181 xóa
  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. 19 28
      cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherHomeController.java
  4. 1 0
      cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/ETenantAlbumCategoryType.java
  5. 4 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/HomeDao.java
  6. 9 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/MusicAlbumSheetDto.java
  7. 6 22
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/MusicAlbumSheetSortDto.java
  8. 16 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MusicAlbumDetailSearch.java
  9. 3 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MusicSheetSearch.java
  10. 66 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/AlbumCategory.java
  11. 8 59
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/AlbumMusicRelate.java
  12. 24 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/AlbumCategoryMapper.java
  13. 37 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/AlbumCategoryService.java
  14. 5 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/HomeService.java
  15. 68 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/AlbumCategoryServiceImpl.java
  16. 2 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/AlbumMusicRelateServiceImpl.java
  17. 1 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ExposureRecordServiceImpl.java
  18. 60 38
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/HomeServiceImpl.java
  19. 43 19
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicAlbumServiceImpl.java
  20. 1 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java
  21. 3 3
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderServiceImpl.java
  22. 9 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/AlbumDetailVo.java
  23. 125 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/AlbumCategoryWrapper.java
  24. 31 7
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TeacherIndexWrapper.java
  25. 39 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/AlbumCategoryMapper.xml
  26. 4 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/ExposureRecordDao.xml
  27. 12 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml
  28. 9 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml
  29. 4 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/UserOrderDetailMapper.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));
+    }
+
+
     /**
      * 专辑详情
      */

+ 19 - 28
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherHomeController.java

@@ -1,6 +1,5 @@
 package com.yonge.cooleshow.teacher.controller;
 
-import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.vo.PianoRoomTimeVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherHomeStatisticalVo;
@@ -8,12 +7,15 @@ import com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.mybatis.support.PageUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -37,8 +39,6 @@ public class TeacherHomeController extends BaseController {
     @Resource
     private UserAccountRecordService userAccountRecordService;
     @Resource
-    private SysMusicCompareRecordService sysMusicCompareRecordService;
-    @Resource
     private HomeService homeService;
 
     @ApiOperation(value = "首页统计数据")
@@ -96,12 +96,7 @@ public class TeacherHomeController extends BaseController {
     @ApiOperation(value = "课程统计")
     @PostMapping("/totalCourse")
     public HttpResponseResult<List<TeacherHomeWrapper.TeacherTotalCourse>> totalCourse(@RequestBody TeacherHomeWrapper.TeacherTotalCourseQuery query) {
-        SysUser sysUser = sysUserService.getUser();
-        if (sysUser == null  || sysUser.getId() == null) {
-
-            return failed("用户信息获取失败");
-        }
-        query.setTeacherId(sysUser.getId());
+        query.setTeacherId(sysUserService.getUserId());
 
         return succeed(homeService.teacherTotalCourse(query));
     }
@@ -110,39 +105,35 @@ public class TeacherHomeController extends BaseController {
     @ApiOperation(value = "我的乐谱统计")
     @GetMapping("/musicSheetTotal")
     public HttpResponseResult<TeacherHomeWrapper.MusicSheetTotal> musicSheetTotal() {
-        SysUser sysUser = sysUserService.getUser();
-        if (sysUser == null  || sysUser.getId() == null) {
-
-            return failed("用户信息获取失败");
-        }
-
-        return succeed(homeService.musicSheetTotal(sysUser.getId()));
+        return succeed(homeService.musicSheetTotal(sysUserService.getUserId()));
     }
 
     @ApiOperation(value = "我的乐谱分页")
     @PostMapping("/musicSheetPage")
     public HttpResponseResult<List<TeacherHomeWrapper.MusicSheetTotal>> musicSheetPage(@RequestBody TeacherHomeWrapper.MusicSheetQuery query) {
-        SysUser sysUser = sysUserService.getUser();
-        if (sysUser == null  || sysUser.getId() == null) {
-
-            return failed("用户信息获取失败");
-        }
-        query.setTeacherId(sysUser.getId());
-
+        query.setTeacherId(sysUserService.getUserId());
         return succeed(homeService.musicSheetPage(query));
     }
 
 
 
-    @ApiOperation(value = "课程曝光/购买")
+    @ApiOperation(value = "课程浏览/购买")
     @PostMapping("/courseExposure")
     public HttpResponseResult<Map<String, List<TeacherIndexWrapper.CourseExposureTotal>>> courseExposure(@RequestBody TeacherIndexWrapper.CourseExposureSearch query) {
-        //获取购买的统计数据
         query.setTeacherId(sysUserService.getUserId());
-        Map<String, List<TeacherIndexWrapper.CourseExposureTotal>> stringListMap = homeService.courseBuyTotal(query);
+        Map<String, List<TeacherIndexWrapper.CourseExposureTotal>> result = new HashMap<>(2);
+        //获取购买的统计数据
+        result.put("buy", homeService.courseBuyTotal(query));
         //获取曝光的统计数据
-        stringListMap.putAll(homeService.courseExposureTotal(query));
-        return succeed(stringListMap);
+        result.put("exposure", homeService.courseExposureTotal(query));
+        return succeed(result);
+    }
+
+    @ApiOperation(value = "老师首页预计收入列表")
+    @PostMapping("/teacherIncomeList")
+    public HttpResponseResult<PageInfo<TeacherIndexWrapper.TeacherIncome>> teacherIncomeList(@RequestBody TeacherIndexWrapper.CourseExposureSearch query) {
+        query.setTeacherId(sysUserService.getUserId());
+        return succeed(homeService.teacherIncomeList(PageUtil.getPage(query),query));
     }
 
 }

+ 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("级别"),
     ;

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/HomeDao.java

@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.vo.TagTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
+import com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -74,4 +75,7 @@ public interface HomeDao {
      * @return TeacherHomeWrapper.TeacherTotalCourse
      */
     List<TeacherHomeWrapper.TeacherTotalCourse> teacherTotalCourse(@Param("param") TeacherHomeWrapper.TeacherTotalCourseQuery query);
+
+    IPage<TeacherIndexWrapper.TeacherIncome> teacherIncomeList(@Param("page") IPage<TeacherIndexWrapper.TeacherIncome> page,
+                                                              @Param("param") TeacherIndexWrapper.CourseExposureSearch query);
 }

+ 9 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/MusicAlbumSheetDto.java

@@ -1,7 +1,9 @@
 package com.yonge.cooleshow.biz.dal.dto;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.util.List;
 
@@ -48,6 +50,7 @@ public class MusicAlbumSheetDto {
         this.albumMusicList = albumMusicList;
     }
 
+    @Data
     public static class AlbumMusic{
         @ApiModelProperty("曲目id")
         private Long musicSheetId;
@@ -55,6 +58,12 @@ public class MusicAlbumSheetDto {
         @ApiModelProperty("排序")
         private Integer sortNumber;
 
+        @ApiModelProperty(value = "级别")
+        private Long alBumCategoryLevelId;
+
+        @ApiModelProperty(value = "类型")
+        private Long alBumCategoryTypeId;
+
         public Long getMusicSheetId() {
             return musicSheetId;
         }

+ 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;
 }

+ 16 - 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,20 @@ public class MusicAlbumDetailSearch extends MusicSheetSearch {
     @ApiModelProperty(value = "登录学生id",hidden = true)
     private Long studentId;
 
+
+    @ApiModelProperty("专辑分类级别ID")
+    private Long albumCategoryLevelId;
+
+    @ApiModelProperty("专辑分类类型ID")
+    private Long albumCategoryTypeId;
+
+    @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;
 

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

@@ -0,0 +1,66 @@
+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 com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
+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_", type = IdType.AUTO)
+	    private Long id;
+
+    @ApiModelProperty("专辑ID") 
+	@TableField(value = "album_id_")
+    private Long albumId;
+
+    @ApiModelProperty("专辑分类类别 类型 CATEGORY_TYPE 级别 CATEGORY_LEVEL") 
+	@TableField(value = "category_type_")
+    private ETenantAlbumCategoryType 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);
+}

+ 5 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/HomeService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.biz.dal.dto.SubjectHomeSearch;
 import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
 import com.yonge.cooleshow.biz.dal.vo.CourseHomeVo;
+import com.yonge.cooleshow.biz.dal.vo.StudentVo;
 import com.yonge.cooleshow.biz.dal.vo.SubjectHomeVo;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
@@ -87,7 +88,9 @@ public interface HomeService {
 
     List<TeacherIndexWrapper.StudentPracticeSummaryDto> getTeacherHomeStudent(TeacherIndexWrapper.StudentSearch studentSearch);
 
-    Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> courseExposureTotal(TeacherIndexWrapper.CourseExposureSearch query);
+    List<TeacherIndexWrapper.CourseExposureTotal> courseExposureTotal(TeacherIndexWrapper.CourseExposureSearch query);
 
-    Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> courseBuyTotal(TeacherIndexWrapper.CourseExposureSearch query);
+    List<TeacherIndexWrapper.CourseExposureTotal> courseBuyTotal(TeacherIndexWrapper.CourseExposureSearch query);
+
+    PageInfo<TeacherIndexWrapper.TeacherIncome> teacherIncomeList(IPage<TeacherIndexWrapper.TeacherIncome> page,TeacherIndexWrapper.CourseExposureSearch query);
 }

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

@@ -0,0 +1,68 @@
+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 com.yonge.cooleshow.biz.dal.entity.MusicAlbum;
+import com.yonge.cooleshow.biz.dal.service.MusicAlbumService;
+import com.yonge.toolset.base.exception.BizException;
+import org.springframework.beans.factory.annotation.Autowired;
+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 {
+
+    @Autowired
+    private MusicAlbumService musicAlbumService;
+
+    
+    /**
+     * 分页查询
+     * @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) {
+        MusicAlbum musicAlbum = musicAlbumService.getById(albumCategory.getAlbumId());
+        if (musicAlbum == null) {
+            throw new BizException("专辑不存在");
+        }
+        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();
+
+    }
+
+}

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

@@ -68,6 +68,8 @@ public class AlbumMusicRelateServiceImpl extends ServiceImpl<AlbumMusicRelateDao
             albumMusicRelate.setAlbumId(albumId);
             albumMusicRelate.setMusicSheetId(albumMusic.getMusicSheetId());
             albumMusicRelate.setSortNumber(albumMusic.getSortNumber());
+            albumMusicRelate.setAlBumCategoryLevelId(albumMusic.getAlBumCategoryLevelId());
+            albumMusicRelate.setAlBumCategoryTypeId(albumMusic.getAlBumCategoryTypeId());
             albumMusicRelate.setCreateTime(new Date());
             albumMusicRelate.setCreateBy(userId);
             return albumMusicRelate;

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

@@ -49,7 +49,7 @@ public class ExposureRecordServiceImpl extends ServiceImpl<ExposureRecordDao, Ex
             //按对象id分组,并获取集合数量
             Map<Long, Integer> exposureNumMap = saveExposureReportDtos.stream().collect(Collectors.groupingBy(ExposureRecordWrapper.SaveExposureRecordDto::getObjectId, Collectors.summingInt(e -> 1)));
             exposureNumMap.forEach((objectId,exposureNum)-> {
-                if ("LIVE".equals(k)) {
+                if ("LIVE".equals(k) || "VIP_COURSE".equals(k) || "PRACTICE".equals(k) || "GROUP".equals(k)) {
                     courseGroupService.getDao().updateExposureNum(objectId, exposureNum);
                 } else if ("VIDEO".equals(k)) {
                     videoLessonGroupService.getDao().updateExposureNum(objectId, exposureNum);

+ 60 - 38
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/HomeServiceImpl.java

@@ -7,6 +7,7 @@ import com.yonge.cooleshow.biz.dal.dao.MusicSheetDao;
 import com.yonge.cooleshow.biz.dal.dao.UserAccountRecordDao;
 import com.yonge.cooleshow.biz.dal.dto.SubjectHomeSearch;
 import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
+import com.yonge.cooleshow.biz.dal.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.enums.GoodTypeEnum;
 import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
@@ -58,6 +59,10 @@ public class HomeServiceImpl implements HomeService {
     private SysMusicCompareRecordService sysMusicCompareRecordService;
     @Resource
     private UserOrderDetailService userOrderDetailService;
+    @Resource
+    private SysUserService sysUserService;
+    @Resource
+    private StudentService studentService;
 
     @Override
     public HomeUserToDoNum getUserToDoNum() {
@@ -453,30 +458,20 @@ public class HomeServiceImpl implements HomeService {
 
     //数据补全,按时间顺序
     private List<TeacherIndexWrapper.CourseExposureTotal> exposureFillData(List<TeacherIndexWrapper.CourseExposureTotal> exposureTotals,
-                                                                           List<String> dateList,
-                                                                           String[] typeArr) {
-        if(exposureTotals == null){
-            exposureTotals = new ArrayList<>();
-        }
-        //按类型分组
-        Map<String, List<TeacherIndexWrapper.CourseExposureTotal>> typeMap = exposureTotals.stream()
-                .collect(Collectors.groupingBy(TeacherIndexWrapper.CourseExposureTotal::getType));
+                                                                           List<String> dateList) {
         List<TeacherIndexWrapper.CourseExposureTotal> result = new ArrayList<>();
         //按时间段补全数据
         for (String s : dateList) {
-            for (String type : typeArr) {
-                List<TeacherIndexWrapper.CourseExposureTotal> dateMap = typeMap.get(type);
-                if(CollectionUtils.isEmpty(dateMap)){
-                    result.add(new TeacherIndexWrapper.CourseExposureTotal(s,type,0));
+            if(CollectionUtils.isEmpty(exposureTotals)){
+                result.add(new TeacherIndexWrapper.CourseExposureTotal(s,0));
+            }else {
+                Map<String, TeacherIndexWrapper.CourseExposureTotal> dateMapGroup = exposureTotals.stream()
+                        .collect(Collectors.toMap(TeacherIndexWrapper.CourseExposureTotal::getDate, o -> o));
+                TeacherIndexWrapper.CourseExposureTotal courseExposureTotal = dateMapGroup.get(s);
+                if(Objects.nonNull(courseExposureTotal)){
+                    result.add(courseExposureTotal);
                 }else {
-                    Map<String, TeacherIndexWrapper.CourseExposureTotal> dateMapGroup = dateMap.stream()
-                            .collect(Collectors.toMap(TeacherIndexWrapper.CourseExposureTotal::getDate, o -> o));
-                    TeacherIndexWrapper.CourseExposureTotal courseExposureTotal = dateMapGroup.get(s);
-                    if(Objects.nonNull(courseExposureTotal)){
-                        result.add(courseExposureTotal);
-                    }else {
-                        result.add(new TeacherIndexWrapper.CourseExposureTotal(s,type,0));
-                    }
+                    result.add(new TeacherIndexWrapper.CourseExposureTotal(s,0));
                 }
             }
         }
@@ -496,7 +491,7 @@ public class HomeServiceImpl implements HomeService {
 
 
     @Override
-    public Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> courseExposureTotal(TeacherIndexWrapper.CourseExposureSearch search) {
+    public List<TeacherIndexWrapper.CourseExposureTotal> courseExposureTotal(TeacherIndexWrapper.CourseExposureSearch search) {
         String groupBy;
         List<String> dateList;
         Date startDate = DateUtil.strToDate(search.getStartTime(), DateUtil.DEFAULT_PATTERN);
@@ -511,19 +506,11 @@ public class HomeServiceImpl implements HomeService {
             groupBy = "%Y";
             dateList = DateUtil.getYearList(startDate,endDate);
         }
-        List<TeacherIndexWrapper.CourseExposureTotal> courseExposureTotals = exposureRecordService.getDao().courseExposureTotal(search, groupBy);
-        //按分类分组
-        Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> typeMap = courseExposureTotals.stream()
-                .collect(Collectors.groupingBy(TeacherIndexWrapper.CourseExposureTotal::getType));
-        Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> result = new HashMap<>();
-        result.put("EXPOSURE_LIVE",exposureFillData(typeMap.get(GoodTypeEnum.LIVE.getCode()),dateList,new String[]{GoodTypeEnum.LIVE.getCode()}));
-        result.put("EXPOSURE_VIDEO",exposureFillData(typeMap.get(GoodTypeEnum.VIDEO.getCode()),dateList,new String[]{GoodTypeEnum.VIDEO.getCode()}));
-        result.put("EXPOSURE_MUSIC",exposureFillData(typeMap.get(GoodTypeEnum.MUSIC.getCode()),dateList,new String[]{GoodTypeEnum.MUSIC.getCode()}));
-        return result;
+        return exposureFillData(exposureRecordService.getDao().courseExposureTotal(search, groupBy),dateList);
     }
 
     @Override
-    public Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> courseBuyTotal(TeacherIndexWrapper.CourseExposureSearch search) {
+    public List<TeacherIndexWrapper.CourseExposureTotal> courseBuyTotal(TeacherIndexWrapper.CourseExposureSearch search) {
         //获取学员练习时长
         //获取分组条件,如果所选时间段只有一天,则按小时分组,超过一个月按天分组,超过一年按月分组
         String groupBy;
@@ -541,21 +528,56 @@ public class HomeServiceImpl implements HomeService {
             dateList = DateUtil.getYearList(startDate,endDate);
         }
         Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> result = new HashMap<>();
-        //直播
+        //课
         List<TeacherIndexWrapper.CourseExposureTotal> liveSummer = userOrderDetailService.getDao().liveBuyTotal(search,groupBy);
-        result.put(GoodTypeEnum.LIVE.getCode(),exposureFillData(liveSummer,dateList,new String[]{GoodTypeEnum.LIVE.getCode()}));
-        //视频课
-        List<TeacherIndexWrapper.CourseExposureTotal> videoSummer = userOrderDetailService.getDao().videoBuyTotal(search,groupBy);
-        result.put(GoodTypeEnum.VIDEO.getCode(),exposureFillData(videoSummer,dateList,new String[]{GoodTypeEnum.VIDEO.getCode()}));
+        result.put("COURSE",exposureFillData(liveSummer,dateList));
         //获取老师关联的学员
         List<Long> studentIds = teacherService.getDao().getStudentIds(search.getTeacherId(),null);
         if(CollectionUtils.isNotEmpty(studentIds)){
             //曲谱
             search.setStudentIds(studentIds);
             List<TeacherIndexWrapper.CourseExposureTotal> musicSheetSummer = userOrderDetailService.getDao().musicSheetBuyTotal(search,groupBy);
-            result.put(GoodTypeEnum.MUSIC.getCode(),exposureFillData(musicSheetSummer,dateList,new String[]{GoodTypeEnum.MUSIC.getCode()}));
+            result.put(GoodTypeEnum.MUSIC.getCode(),exposureFillData(musicSheetSummer,dateList));
         }
-        return result;
+        //将数据合并,map中所有的数据按时间,将list中的数据相加
+        List<TeacherIndexWrapper.CourseExposureTotal> finalResult = new ArrayList<>();
+        for (String s : dateList) {
+            TeacherIndexWrapper.CourseExposureTotal courseExposureTotal = new TeacherIndexWrapper.CourseExposureTotal();
+            courseExposureTotal.setDate(s);
+            courseExposureTotal.setExposureNum(0);
+            for (Map.Entry<String, List<TeacherIndexWrapper.CourseExposureTotal>> entry : result.entrySet()) {
+                List<TeacherIndexWrapper.CourseExposureTotal> value = entry.getValue();
+                Map<String, TeacherIndexWrapper.CourseExposureTotal> collect = value.stream()
+                        .collect(Collectors.toMap(TeacherIndexWrapper.CourseExposureTotal::getDate, o -> o));
+                TeacherIndexWrapper.CourseExposureTotal exposureTotal = collect.get(s);
+                if(Objects.nonNull(exposureTotal)){
+                    courseExposureTotal.setExposureNum(courseExposureTotal.getExposureNum() + exposureTotal.getExposureNum());
+                }
+            }
+            finalResult.add(courseExposureTotal);
+        }
+        return finalResult;
+    }
+
+    @Override
+    public PageInfo<TeacherIndexWrapper.TeacherIncome> teacherIncomeList(IPage<TeacherIndexWrapper.TeacherIncome> page,TeacherIndexWrapper.CourseExposureSearch query) {
+        IPage<TeacherIndexWrapper.TeacherIncome> record = baserMapper.teacherIncomeList(page,query);
+        List<TeacherIndexWrapper.TeacherIncome> records = record.getRecords();
+        if (CollectionUtils.isNotEmpty(records)) {
+            List<Long> userIds = records.stream().map(TeacherIndexWrapper.TeacherIncome::getUserId).collect(Collectors.toList());
+            //获取用户声部信息
+//            studentService.querySubject()
+            List<SysUser> sysUsers = sysUserService.getDao().selectBatchIds(userIds);
+            Map<Long, SysUser> sysUserMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getId, Function.identity()));
+            for (TeacherIndexWrapper.TeacherIncome teacherIncome : records) {
+                SysUser sysUser = sysUserMap.get(teacherIncome.getUserId());
+                if (sysUser != null) {
+                    teacherIncome.setUserName(sysUser.getUsername());
+                    teacherIncome.setUserAvatar(sysUser.getAvatar());
+                }
+            }
+        }
+        return PageUtil.pageInfo(record);
     }
 
 }

+ 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

@@ -364,6 +364,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)) {

+ 3 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderServiceImpl.java

@@ -242,12 +242,12 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
             Map<String,BigDecimal> orderDiscount = new HashMap<>();
             orderDetilListByOrderNo.forEach(o -> {
                 if (StringUtils.isNotBlank(o.getDiscountJson())) {
-                    Map<String,BigDecimal> decimalMap = JSON.parseObject(o.getDiscountJson(), Map.class);
+                    Map<String,String> decimalMap = JSON.parseObject(o.getDiscountJson(), Map.class);
                    decimalMap.forEach((k,v) -> {
                        if (orderDiscount.containsKey(k)) {
-                           orderDiscount.put(k,orderDiscount.get(k).add(v));
+                           orderDiscount.put(k,orderDiscount.get(k).add(new BigDecimal(v)));
                        } else {
-                           orderDiscount.put(k,v);
+                           orderDiscount.put(k,new BigDecimal(v));
                        }
                    });
                 }

+ 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;
     }

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

@@ -0,0 +1,125 @@
+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 com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
+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 ETenantAlbumCategoryType 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);
+        }
+    }
+}

+ 31 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TeacherIndexWrapper.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.biz.dal.wrapper;
 
+import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -126,7 +127,6 @@ public class TeacherIndexWrapper {
     @Data
     @Builder
     @NoArgsConstructor
-    @AllArgsConstructor
     public static class CourseExposureTotal{
 
         @ApiModelProperty("日期")
@@ -135,21 +135,45 @@ public class TeacherIndexWrapper {
         @ApiModelProperty("曝光数")
         private Integer exposureNum;
 
-        @ApiModelProperty("类型")
-        private String type;
-
-        public CourseExposureTotal(String date, String type, Integer exposureNum) {
+        public CourseExposureTotal(String date, Integer exposureNum) {
             this.date = date;
-            this.type = type;
             this.exposureNum = exposureNum;
         }
     }
 
     @Data
+    public static class TeacherIncome{
+
+        @ApiModelProperty("下单时间")
+        private Date orderTime;
+
+        @ApiModelProperty("学员姓名")
+        private String userName;
+
+        @ApiModelProperty("学员头像")
+        private String userAvatar;
+
+        @ApiModelProperty("学员编号")
+        private Long userId;
+
+        @ApiModelProperty("声部")
+        private String subjectName;
+
+        @ApiModelProperty("数量")
+        private Integer bizQuantity;
+
+        @ApiModelProperty("业务名称")
+        private String bizName;
+
+        @ApiModelProperty("金额")
+        private BigDecimal amount;
+    }
+
+    @Data
     @Builder
     @NoArgsConstructor
     @AllArgsConstructor
-    public static class CourseExposureSearch{
+    public static class CourseExposureSearch extends QueryInfo {
 
         @ApiModelProperty("开始时间")
         private String startTime;

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

@@ -0,0 +1,39 @@
+<?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>
+            <if test="param.keyword != null and param.keyword != ''">
+                and t.name_ like concat('%',#{param.keyword},'%')
+            </if>
+        </where>
+        order by t.sort_ ,t.id_ desc
+	</select>
+    
+</mapper>

+ 4 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/ExposureRecordDao.xml

@@ -17,7 +17,10 @@
 		select DATE_FORMAT(er.exposure_time_, #{groupBy}) 'date',er.object_type_ as type,
 		       SUM(er.exposure_num_) exposureNum from exposure_record er
 		where er.exposure_time_ BETWEEN #{param.startTime} AND #{param.endTime}
+		<if test="param.type != null and param.type != ''">
+			and er.object_type_ = #{param.type}
+		</if>
 		group by er.object_type_,DATE_FORMAT(er.exposure_time_, #{groupBy})
-		ORDER BY type,'date'
+		ORDER BY 'date'
 	</select>
 </mapper>

+ 12 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml

@@ -526,4 +526,16 @@
 		</where>
 		group by t.good_type_
 	</select>
+	<select id="teacherIncomeList"
+			resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$TeacherIncome">
+		select uo.user_id_ userId,cg.course_num_ bizQuantity,ttar.trans_amount_ amount,uo.create_time_ orderTime
+		from tenant_teacher_account_record ttar
+		left join user_order uo ON uo.order_no_ = ttar.order_no_
+		left join user_order_detail uod ON uod.order_no_ = uo.order_no_
+		left join course_group cg ON cg.id_ = ttar.biz_id_
+		where uo.status_ = 'PAID' AND ttar.biz_type_ = uod.good_type_ AND ttar.in_or_out_ = 'IN'
+		AND uo.create_time_ BETWEEN #{param.startTime} AND #{param.endTime} AND ttar.teacher_id_ = #{param.teacherId}
+		AND ttar.biz_type_ = #{param.type}
+		order by uo.create_time_ desc
+	</select>
 </mapper>

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

@@ -342,6 +342,15 @@
                 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.albumCategoryLevelId != null">
+                and amr.album_category_level_id_ = #{param.albumCategoryLevelId}
+            </if>
+            <if test="param2.albumCategoryTypeId != null">
+                and amr.album_category_type_id_ = #{param2.albumCategoryTypeId}
+            </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},'%'))

+ 4 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserOrderDetailMapper.xml

@@ -156,8 +156,11 @@
                DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
         left join user_order uo ON uo.order_no_ = uod.order_no_
         left join course_group cg On cg.id_ = uod.biz_id_
-        where uod.good_type_ = 'LIVE' AND cg.teacher_id_ = #{param.teacherId} AND uo.status_ = 'PAID'
+        where cg.teacher_id_ = #{param.teacherId} AND uo.status_ = 'PAID'
         AND DATE_FORMAT(uod.create_time_, '%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime}
+        <if test="param.type != null and param.type != ''">
+            and uod.good_type_ = #{param.type}
+        </if>
         group by 'date' order by 'date'
     </select>
     <select id="videoBuyTotal"