|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
|
|
|
import com.microsvc.toolkit.common.response.template.R;
|
|
|
import com.ym.mec.biz.dal.entity.Instrument;
|
|
|
+import com.ym.mec.biz.dal.entity.Student;
|
|
|
import com.ym.mec.biz.dal.entity.SysMusicScore;
|
|
|
import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import com.ym.mec.biz.dal.enums.ClientEnum;
|
|
@@ -12,6 +13,7 @@ import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
|
|
|
import com.ym.mec.biz.dal.wrapper.InstrumentWrapper;
|
|
|
import com.ym.mec.biz.dal.wrapper.MusicSheetWrapper;
|
|
|
import com.ym.mec.biz.service.InstrumentService;
|
|
|
+import com.ym.mec.biz.service.StudentService;
|
|
|
import com.ym.mec.biz.service.SysMusicScoreService;
|
|
|
import com.ym.mec.biz.service.SysUserService;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
@@ -51,6 +53,10 @@ public class MusicSheetController {
|
|
|
|
|
|
@Resource
|
|
|
private SysUserService sysUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StudentService studentService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询单条
|
|
|
*
|
|
@@ -103,6 +109,7 @@ public class MusicSheetController {
|
|
|
SysExamSongQueryInfo queryInfo = new SysExamSongQueryInfo();
|
|
|
|
|
|
Integer userId = sysUserService.getUserId();
|
|
|
+ Student student = studentService.get(userId);
|
|
|
if(query.getMusicSheetCategoriesId() != null) {
|
|
|
queryInfo.setCategoriesId(query.getMusicSheetCategoriesId().toString());
|
|
|
}
|
|
@@ -112,13 +119,15 @@ public class MusicSheetController {
|
|
|
if (instrument != null) {
|
|
|
queryInfo.setSubjectId(instrument.getSubjectId());
|
|
|
}
|
|
|
+ } else if (StringUtils.isNotBlank(student.getSubjectIdList())){
|
|
|
+ queryInfo.setSubjectId(Integer.parseInt(student.getSubjectIdList()));
|
|
|
}
|
|
|
queryInfo.setType("COMMON");
|
|
|
queryInfo.setClientFlag(true);
|
|
|
queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
|
|
|
-
|
|
|
+ queryInfo.setRecentFlag(query.getRecentFlag());
|
|
|
queryInfo.setUserId(userId);
|
|
|
- queryInfo.setClientId(ClientEnum.TEACHER.getCode().toLowerCase());
|
|
|
+ queryInfo.setClientId(ClientEnum.STUDENT.getCode().toLowerCase());
|
|
|
PageInfo<SysMusicScore> sysMusicScorePageInfo1 = musicSheetService.queryMusicScorePageInfo(queryInfo);
|
|
|
PageInfo<MusicSheetWrapper.MusicSheet> convert = sysMusicScorePageInfo1.convert(o -> {
|
|
|
MusicSheetWrapper.MusicSheet musicSheet = new MusicSheetWrapper.MusicSheet();
|