|
@@ -1,20 +1,26 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.Subject;
|
|
|
import com.ym.mec.biz.dal.enums.ClientEnum;
|
|
|
import com.ym.mec.biz.dal.enums.ClientTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
|
|
|
import com.ym.mec.biz.dal.wrapper.MusicSheetWrapper;
|
|
|
+import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
|
|
|
import com.ym.mec.biz.service.SysMusicScoreService;
|
|
|
import com.ym.mec.biz.service.SysUserService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RequestMapping("${app-config.url.student:}/sysMusicScore")
|
|
|
@Api(tags = "曲库")
|
|
@@ -26,6 +32,8 @@ public class SysMusicScoreController extends BaseController {
|
|
|
|
|
|
@Resource
|
|
|
private SysUserService sysUserService;
|
|
|
+ @Resource
|
|
|
+ private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@GetMapping("/queryPage2")
|
|
|
public Object queryPage2(SysExamSongQueryInfo queryInfo) {
|
|
@@ -35,6 +43,23 @@ public class SysMusicScoreController extends BaseController {
|
|
|
queryInfo.setType("COMMON");
|
|
|
queryInfo.setClientFlag(true);
|
|
|
queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
|
|
|
+ if(queryInfo.getSubjectId() == null && StringUtils.isNotEmpty(queryInfo.getCategoriesId())){
|
|
|
+ List<Subject> subjects = sysMusicScoreAccompanimentService.querySubjectIds(Integer.parseInt(queryInfo.getCategoriesId()));
|
|
|
+ if(CollectionUtils.isNotEmpty(subjects)){
|
|
|
+ StringBuffer subjectIds = new StringBuffer();
|
|
|
+ for (Subject subject : subjects) {
|
|
|
+ if(subjectIds.length() > 0){
|
|
|
+ subjectIds.append(",");
|
|
|
+ }
|
|
|
+ if (subject.getId() == 5){
|
|
|
+ subjectIds.append("6");
|
|
|
+ }else if(queryInfo.getSubjectId() == 122){
|
|
|
+ subjectIds.append("122,121,113,23");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryInfo.setSubjectIds(subjectIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
return succeed(sysMusicScoreService.queryMusicScorePageInfo(queryInfo));
|
|
|
}
|
|
|
|