|
@@ -1,17 +1,13 @@
|
|
|
package com.yonge.cooleshow.teacher.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.dayaedu.cbs.common.enums.music.EMusicSourceType;
|
|
|
-import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
|
|
|
-import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.AppMusicSheetVo;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.MusicSheetRenderDto;
|
|
|
-import com.yonge.cooleshow.biz.dal.dto.ReasonDto;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.MusicSheetRelatedQueryInfo;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.StudentMusicSheetSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
|
|
|
-import com.yonge.cooleshow.biz.dal.entity.MusicSheetAuthRecord;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.Student;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.Teacher;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
@@ -19,7 +15,6 @@ import com.yonge.cooleshow.biz.dal.enums.MusicSortType;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.SourceTypeEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.album.PurchaseRecordTypeEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.cbs.CbsMusicScoreService;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.MusicSheetDetailVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.MusicSheetShareVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.MusicSheetVo;
|
|
@@ -35,19 +30,15 @@ import com.yonge.toolset.mybatis.support.PageUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
-import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 曲谱表 web 控制层
|
|
@@ -70,6 +61,9 @@ public class MusicSheetController extends BaseController {
|
|
|
@Resource
|
|
|
private TeacherService teacherService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StudentService studentService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询单条
|
|
|
*/
|
|
@@ -233,9 +227,14 @@ public class MusicSheetController extends BaseController {
|
|
|
public HttpResponseResult<PageInfo<MusicSheetVo>> favoriteMusic(QueryInfo query) {
|
|
|
SysUser sysUser = sysUserService.getUser();
|
|
|
StudentMusicSheetSearch search = new StudentMusicSheetSearch();
|
|
|
+ Teacher teacher = teacherService.getById(sysUser.getId());
|
|
|
+ if (teacher.getTenantId() !=null && teacher.getTenantId() >0) {
|
|
|
+ search.setTenantId(teacher.getTenantId());
|
|
|
+ }
|
|
|
search.setStudentId(sysUser.getId());
|
|
|
search.setState(YesOrNoEnum.YES);
|
|
|
search.setAuditStatus(null);
|
|
|
+ search.setProviderType(null);
|
|
|
IPage<MusicSheetVo> sheetVoIPage = musicSheetService.favoriteMusic(PageUtil.getPage(query),search, ClientEnum.TEACHER);
|
|
|
return succeed(PageUtil.pageInfo(sheetVoIPage));
|
|
|
}
|
|
@@ -323,9 +322,15 @@ public class MusicSheetController extends BaseController {
|
|
|
}
|
|
|
StudentMusicSheetSearch search = new StudentMusicSheetSearch();
|
|
|
search.setStudentId(userId);
|
|
|
+ search.setClientType(ClientEnum.STUDENT);
|
|
|
search.setState(YesOrNoEnum.YES);
|
|
|
search.setAuditStatus(null);
|
|
|
search.setRows(3);
|
|
|
+ // 查询学生时机构还是平台
|
|
|
+ Student student = studentService.getById(search.getStudentId());
|
|
|
+ if (student != null && student.getTenantId() != null && student.getTenantId()>0) {
|
|
|
+ search.setProviderType(SourceTypeEnum.TENANT);
|
|
|
+ }
|
|
|
IPage<MusicSheetVo> sheetVoIPage = musicSheetService.practiceMusic(PageUtil.getPage(search),search);
|
|
|
return succeed(PageUtil.pageInfo(sheetVoIPage));
|
|
|
}
|