Browse Source

去掉曲目分类

zouxuan 8 months ago
parent
commit
e56b70cd77

+ 4 - 1
mec-application/src/main/java/com/ym/mec/student/controller/LessonCoursewareController.java

@@ -72,7 +72,10 @@ public class LessonCoursewareController extends BaseController {
 	@ApiOperation(value = "获取课程详情")
 	@GetMapping("/getLessonCourseDetail/{id}")
 	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") Long id){
-		return succeed(lessonCoursewareService.getLessonCourseDetail(id));
+		SysUser sysUser = sysUserService.getUser();
+		String teachingMaterialIds = organizationService.getTeachingMaterialIds(sysUser.getOrganId().toString(),sysUser.getTenantId());
+		List<Integer> categoryIdList = cbsMusicScoreCategoriesService.getAllCategoryIdList(teachingMaterialIds);
+		return succeed(lessonCoursewareService.getLessonCourseDetail(id,categoryIdList));
 	}
 
 	@ApiOperation(value = "获取课件关联的声部列表")

+ 4 - 1
mec-application/src/main/java/com/ym/mec/teacher/controller/LessonCoursewareController.java

@@ -72,7 +72,10 @@ public class LessonCoursewareController extends BaseController {
 	@ApiOperation(value = "获取课程详情")
 	@GetMapping("/getLessonCourseDetail/{id}")
 	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") Long id){
-		return succeed(lessonCoursewareService.getLessonCourseDetail(id));
+		SysUser sysUser = sysUserService.getUser();
+		String teachingMaterialIds = organizationService.getTeachingMaterialIds(sysUser.getOrganId().toString(),sysUser.getTenantId());
+		List<Integer> categoryIdList = cbsMusicScoreCategoriesService.getAllCategoryIdList(teachingMaterialIds);
+		return succeed(lessonCoursewareService.getLessonCourseDetail(id,categoryIdList));
 	}
 
 	@ApiOperation(value = "获取课件关联的声部列表")

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/LessonCoursewareService.java

@@ -22,6 +22,6 @@ public interface LessonCoursewareService extends IService<LessonCourseware> {
     //获取课件适用范围
     LessonCoursewareWrapper.UpdateRangeDetail getRangeType(Integer lessonCoursewareId);
 
-    CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail getLessonCourseDetail(Long id);
+    CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail getLessonCourseDetail(Long id,List<Integer> categoryIdList);
 }
 

+ 8 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/LessonCoursewareServiceImpl.java

@@ -191,31 +191,31 @@ public class LessonCoursewareServiceImpl extends ServiceImpl<LessonCoursewareMap
     }
 
     @Override
-    public CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail getLessonCourseDetail(Long id) {
+    public CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail getLessonCourseDetail(Long id,List<Integer> categoryIdList) {
         CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail detail = coursewareFeignService.lessonCoursewareDetailDetail(id).feignData();
         if (detail == null) {
             return null;
         }
         //获取知识点下的素材列表、下面关联的资源列表,如果applicationIdList是空的,那么把他剔除掉
-        this.setTreeResourceId(detail.getKnowledgePointList());
+        this.setTreeResourceId(detail.getKnowledgePointList(),categoryIdList);
         return detail;
     }
 
     //递归处理CbsLessonCoursewareDetailWrapper.KnowledgePointSmall
-    private void setTreeResourceId(List<CbsLessonCoursewareDetailWrapper.KnowledgePointSmall> knowledgePointList){
+    private void setTreeResourceId(List<CbsLessonCoursewareDetailWrapper.KnowledgePointSmall> knowledgePointList,List<Integer> categoryIdList){
         if(CollectionUtils.isNotEmpty(knowledgePointList)){
             knowledgePointList.forEach(knowledgePointSmall -> {
-                this.setResourceId(knowledgePointSmall);
+                this.setResourceId(knowledgePointSmall,categoryIdList);
                 List<CbsLessonCoursewareDetailWrapper.KnowledgePointSmall> children = knowledgePointSmall.getChildren();
                 if(CollectionUtils.isNotEmpty(children)){
-                    this.setTreeResourceId(children);
+                    this.setTreeResourceId(children,categoryIdList);
                 }
             });
         }
     }
 
 
-    private void setResourceId(CbsLessonCoursewareDetailWrapper.KnowledgePointSmall knowledgePointSmall){
+    private void setResourceId(CbsLessonCoursewareDetailWrapper.KnowledgePointSmall knowledgePointSmall,List<Integer> categoryIdList){
         List<CbsLessonCoursewareDetailWrapper.MaterialSmall> materialList = knowledgePointSmall.getMaterialList();
         if(CollectionUtils.isNotEmpty(materialList)){
             for (CbsLessonCoursewareDetailWrapper.MaterialSmall materialSmall : materialList) {
@@ -236,7 +236,8 @@ public class LessonCoursewareServiceImpl extends ServiceImpl<LessonCoursewareMap
                         if(relateMaterialInfo != null && StringUtils.equals(relateMaterialInfo.getType(),"SONG")
                                 && CollectionUtils.isNotEmpty(relateMaterialInfo.getApplicationIdList())){
                             SysMusicScore musicScore = sysMusicScoreService.getDao().getCbsId(relateMaterialInfo.getId());
-                            if(musicScore != null && musicScore.getShowFlag() == 1 && musicScore.getClientShowFlag() == 1) {
+                            if(musicScore != null && musicScore.getShowFlag() == 1 && musicScore.getClientShowFlag() == 1
+                                    && categoryIdList.contains(musicScore.getCbsMusicCategoriesId())) {
                                 materialRef.setResourceIdStr(musicScore.getId().toString());
                             }
                         }