瀏覽代碼

新增课件搜索逻辑

zouxuan 3 月之前
父節點
當前提交
91124ae100

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

@@ -22,6 +22,7 @@ import com.ym.mec.common.page.PageUtil;
 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.*;
 
 import javax.annotation.Resource;
@@ -100,6 +101,9 @@ public class LessonCoursewareController extends BaseController {
 			for (CbsLessonCoursewareWrapper.CourseScheduleCoursewareDetail e : courseScheduleCoursewareDetails) {
 				lessonCoursewareService.setTreeResourceId(e.getKnowledgePointList(), query1, musicScoreMap);
 			}
+			if(StringUtils.isNotEmpty(search)){
+				courseScheduleCoursewareDetails.removeIf(courseScheduleCoursewareDetail -> !filterAndUpdateKnowledgePointList(courseScheduleCoursewareDetail, search));
+			}
 			String jsonString = JSONObject.toJSONString(courseScheduleCoursewareDetails);
 			List<LessonCoursewareWrapper.CourseScheduleCoursewareDetail> courseScheduleCoursewareDetailList =
 					JSONObject.parseArray(jsonString, LessonCoursewareWrapper.CourseScheduleCoursewareDetail.class);