|
|
@@ -1,14 +1,17 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.Student;
|
|
|
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.StudentService;
|
|
|
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.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -26,6 +29,8 @@ public class SysMusicScoreController extends BaseController {
|
|
|
|
|
|
@Resource
|
|
|
private SysUserService sysUserService;
|
|
|
+ @Resource
|
|
|
+ private StudentService studentService;
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@GetMapping("/queryPage2")
|
|
|
public Object queryPage2(SysExamSongQueryInfo queryInfo) {
|
|
|
@@ -35,6 +40,41 @@ public class SysMusicScoreController extends BaseController {
|
|
|
queryInfo.setType("COMMON");
|
|
|
queryInfo.setClientFlag(true);
|
|
|
queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
|
|
|
+ if(queryInfo.getSubjectId() == null && !StringUtils.equals(queryInfo.getCategoriesId(),"43")){
|
|
|
+ Student student = studentService.get(userId);
|
|
|
+ StringBuffer subjectIds = new StringBuffer();
|
|
|
+ if(StringUtils.isNotEmpty(student.getSubjectIdList())){
|
|
|
+ String[] split = student.getSubjectIdList().split(",");
|
|
|
+ for (String s : split) {
|
|
|
+ if(subjectIds.length() > 0){
|
|
|
+ subjectIds.append(",");
|
|
|
+ }
|
|
|
+ if (s.equals("5")){
|
|
|
+ subjectIds.append("6");
|
|
|
+ }else if(s.equals("122")){
|
|
|
+ subjectIds.append("122,121,113,23");
|
|
|
+ }else {
|
|
|
+ subjectIds.append(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(student.getExtSubjectIds())){
|
|
|
+ String[] split = student.getExtSubjectIds().split(",");
|
|
|
+ for (String s : split) {
|
|
|
+ if(subjectIds.length() > 0){
|
|
|
+ subjectIds.append(",");
|
|
|
+ }
|
|
|
+ if (s.equals("5")){
|
|
|
+ subjectIds.append("6");
|
|
|
+ }else if(s.equals("122")){
|
|
|
+ subjectIds.append("122,121,113,23");
|
|
|
+ }else {
|
|
|
+ subjectIds.append(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryInfo.setSubjectIds(subjectIds.toString());
|
|
|
+ }
|
|
|
return succeed(sysMusicScoreService.queryMusicScorePageInfo(queryInfo));
|
|
|
}
|
|
|
|