|  | @@ -1,17 +1,16 @@
 | 
											
												
													
														|  |  package com.ym.mec.student.controller;
 |  |  package com.ym.mec.student.controller;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -import com.ym.mec.biz.dal.entity.Subject;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.biz.dal.entity.Student;
 | 
											
												
													
														|  |  import com.ym.mec.biz.dal.enums.ClientEnum;
 |  |  import com.ym.mec.biz.dal.enums.ClientEnum;
 | 
											
												
													
														|  |  import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 |  |  import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 | 
											
												
													
														|  |  import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 |  |  import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 | 
											
												
													
														|  |  import com.ym.mec.biz.dal.wrapper.MusicSheetWrapper;
 |  |  import com.ym.mec.biz.dal.wrapper.MusicSheetWrapper;
 | 
											
												
													
														|  | -import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.biz.service.StudentService;
 | 
											
												
													
														|  |  import com.ym.mec.biz.service.SysMusicScoreService;
 |  |  import com.ym.mec.biz.service.SysMusicScoreService;
 | 
											
												
													
														|  |  import com.ym.mec.biz.service.SysUserService;
 |  |  import com.ym.mec.biz.service.SysUserService;
 | 
											
												
													
														|  |  import com.ym.mec.common.controller.BaseController;
 |  |  import com.ym.mec.common.controller.BaseController;
 | 
											
												
													
														|  |  import io.swagger.annotations.Api;
 |  |  import io.swagger.annotations.Api;
 | 
											
												
													
														|  |  import io.swagger.annotations.ApiOperation;
 |  |  import io.swagger.annotations.ApiOperation;
 | 
											
												
													
														|  | -import org.apache.commons.collections.CollectionUtils;
 |  | 
 | 
											
												
													
														|  |  import org.apache.commons.lang3.StringUtils;
 |  |  import org.apache.commons.lang3.StringUtils;
 | 
											
												
													
														|  |  import org.springframework.web.bind.annotation.GetMapping;
 |  |  import org.springframework.web.bind.annotation.GetMapping;
 | 
											
												
													
														|  |  import org.springframework.web.bind.annotation.PathVariable;
 |  |  import org.springframework.web.bind.annotation.PathVariable;
 | 
											
										
											
												
													
														|  | @@ -19,8 +18,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 | 
											
												
													
														|  |  import org.springframework.web.bind.annotation.RestController;
 |  |  import org.springframework.web.bind.annotation.RestController;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import javax.annotation.Resource;
 |  |  import javax.annotation.Resource;
 | 
											
												
													
														|  | -import java.util.List;
 |  | 
 | 
											
												
													
														|  | -import java.util.stream.Collectors;
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  @RequestMapping("${app-config.url.student:}/sysMusicScore")
 |  |  @RequestMapping("${app-config.url.student:}/sysMusicScore")
 | 
											
												
													
														|  |  @Api(tags = "曲库")
 |  |  @Api(tags = "曲库")
 | 
											
										
											
												
													
														|  | @@ -33,7 +30,7 @@ public class SysMusicScoreController extends BaseController {
 | 
											
												
													
														|  |      @Resource
 |  |      @Resource
 | 
											
												
													
														|  |      private SysUserService sysUserService;
 |  |      private SysUserService sysUserService;
 | 
											
												
													
														|  |      @Resource
 |  |      @Resource
 | 
											
												
													
														|  | -    private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
 |  | 
 | 
											
												
													
														|  | 
 |  | +    private StudentService studentService;
 | 
											
												
													
														|  |      @ApiOperation(value = "分页查询")
 |  |      @ApiOperation(value = "分页查询")
 | 
											
												
													
														|  |      @GetMapping("/queryPage2")
 |  |      @GetMapping("/queryPage2")
 | 
											
												
													
														|  |      public Object queryPage2(SysExamSongQueryInfo queryInfo) {
 |  |      public Object queryPage2(SysExamSongQueryInfo queryInfo) {
 | 
											
										
											
												
													
														|  | @@ -43,22 +40,40 @@ public class SysMusicScoreController extends BaseController {
 | 
											
												
													
														|  |          queryInfo.setType("COMMON");
 |  |          queryInfo.setType("COMMON");
 | 
											
												
													
														|  |          queryInfo.setClientFlag(true);
 |  |          queryInfo.setClientFlag(true);
 | 
											
												
													
														|  |          queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
 |  |          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(queryInfo.getSubjectId() == null){
 | 
											
												
													
														|  | 
 |  | +            Student student = studentService.get(userId);
 | 
											
												
													
														|  | 
 |  | +            StringBuffer subjectIds = new StringBuffer();
 | 
											
												
													
														|  | 
 |  | +            if(StringUtils.isNotEmpty(student.getSubjectId())){
 | 
											
												
													
														|  | 
 |  | +                String[] split = student.getSubjectId().split(",");
 | 
											
												
													
														|  | 
 |  | +                for (String s : split) {
 | 
											
												
													
														|  |                      if(subjectIds.length() > 0){
 |  |                      if(subjectIds.length() > 0){
 | 
											
												
													
														|  |                          subjectIds.append(",");
 |  |                          subjectIds.append(",");
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  | -                    if (subject.getId() == 5){
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    if (s.equals("5")){
 | 
											
												
													
														|  |                          subjectIds.append("6");
 |  |                          subjectIds.append("6");
 | 
											
												
													
														|  | -                    }else if(subject.getId() == 122){
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    }else if(s.equals("122")){
 | 
											
												
													
														|  |                          subjectIds.append("122,121,113,23");
 |  |                          subjectIds.append("122,121,113,23");
 | 
											
												
													
														|  | 
 |  | +                    }else {
 | 
											
												
													
														|  | 
 |  | +                        subjectIds.append(s);
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  | -                queryInfo.setSubjectIds(subjectIds.toString());
 |  | 
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | 
 |  | +            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));
 |  |          return succeed(sysMusicScoreService.queryMusicScorePageInfo(queryInfo));
 | 
											
												
													
														|  |      }
 |  |      }
 |