浏览代码

管乐迷课件

zouxuan 1 年之前
父节点
当前提交
0274443dc1

+ 13 - 7
mec-application/src/main/java/com/ym/mec/student/controller/LessonCoursewareController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.student.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.dayaedu.cbs.openfeign.client.CoursewareFeignService;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareDetailWrapper;
@@ -14,6 +15,7 @@ import com.ym.mec.common.page.PageInfo;
 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.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 @RequestMapping("${app-config.url.student:}/lessonCourseware")
@@ -51,17 +54,20 @@ public class LessonCoursewareController extends BaseController {
 
 	@ApiOperation(value = "获取课件关联的课程列表")
 	@GetMapping("/getLessonCoursewareCourseList/{id}")
-	public HttpResponseResult<List<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail>> getLessonCoursewareCourseList(@PathVariable("id") Long id){
-		CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail cbsQuery =
-				new CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail();
-		cbsQuery.setLessonCoursewareId(id);
-		return succeed(coursewareFeignService.lessonCoursewareDetailList(cbsQuery).feignData());
+	public HttpResponseResult<List<LessonCoursewareWrapper.CourseScheduleCoursewareDetail>> getLessonCoursewareCourseList(@PathVariable("id") Long id){
+		List<CbsLessonCoursewareWrapper.CourseScheduleCoursewareDetail> courseScheduleCoursewareDetails = coursewareFeignService.coursewareDetail(id).feignData();
+		if (CollectionUtils.isNotEmpty(courseScheduleCoursewareDetails)) {
+			String jsonString = JSONObject.toJSONString(courseScheduleCoursewareDetails);
+			List<LessonCoursewareWrapper.CourseScheduleCoursewareDetail> courseScheduleCoursewareDetailList = JSONObject.parseArray(jsonString, LessonCoursewareWrapper.CourseScheduleCoursewareDetail.class);
+			return succeed(courseScheduleCoursewareDetailList);
+		}
+		return succeed(new ArrayList<>());
 	}
 
 	@ApiOperation(value = "获取课程详情")
 	@GetMapping("/getLessonCourseDetail/{id}")
-	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") Long id){
-		return succeed(coursewareFeignService.lessonCoursewareDetailDetail(id).feignData());
+	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") String id){
+		return succeed(coursewareFeignService.lessonCoursewareDetailDetail(Long.parseLong(id)).feignData());
 	}
 
 	@ApiOperation(value = "获取课件关联的声部列表")

+ 34 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/LessonCoursewareWrapper.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.wrapper;
 
+import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareDetailWrapper;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,6 +9,8 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
+import java.util.List;
+
 /**
  * 课件教材
  */
@@ -58,4 +61,35 @@ public class LessonCoursewareWrapper {
         private Integer subjectId;
     }
 
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel("CourseScheduleCoursewareDetail-课程计划课件详情")
+    public static class CourseScheduleCoursewareDetail {
+
+        // 课程计划编号
+        @ApiModelProperty("课程计划编号")
+        private Long lessonCoursewareId;
+
+        // 课程计划编号
+        @ApiModelProperty("课程计划详情编号")
+        private Long lessonCoursewareDetailId;
+
+        @ApiModelProperty("课程计划详情编号")
+        private String coursewareDetailId;
+
+        // 课件名称
+        @ApiModelProperty("课件详情名称")
+        private String coursewareDetailName;
+
+        @ApiModelProperty("知识点")
+        private List<CbsLessonCoursewareDetailWrapper.KnowledgePointSmall> knowledgePointList;
+
+        private void setLessonCoursewareDetailId(Long lessonCoursewareDetailId) {
+        	this.lessonCoursewareDetailId = lessonCoursewareDetailId;
+            this.coursewareDetailId = String.valueOf(lessonCoursewareDetailId);
+        }
+    }
+
 }