From 2174b22bbbb45284765a23b8189df59583c65d29 Mon Sep 17 00:00:00 2001 From: 胡仁荣 <897853850@qq.com> Date: 星期五, 04 八月 2023 14:33:47 +0800 Subject: [PATCH] 统计人数 --- src/main/java/com/qxueyou/scc/controller/CoursewareController.java | 155 ++++++++++++++++++++++++++------------------------- 1 files changed, 78 insertions(+), 77 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/controller/CoursewareController.java b/src/main/java/com/qxueyou/scc/controller/CoursewareController.java index 0e80ceb..e2ad52f 100644 --- a/src/main/java/com/qxueyou/scc/controller/CoursewareController.java +++ b/src/main/java/com/qxueyou/scc/controller/CoursewareController.java @@ -4,13 +4,12 @@ import java.util.List; import java.util.Map; +import com.qxueyou.scc.admin.classes.model.ClsClassReSubject; import com.qxueyou.scc.admin.classes.service.IClassLectureService; +import com.qxueyou.scc.teach.subject.model.Subject; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.qxueyou.scc.admin.progress.model.Progress; import com.qxueyou.scc.admin.progress.service.IProgressService; @@ -31,13 +30,14 @@ import io.swagger.annotations.ApiOperation; /** - * 课件控制器 + * 璇句欢鎺у埗鍣� * * @author chenjunliang * */ -@Api(tags = "课件管理-管理员端") +@Api(tags = "璇句欢绠$悊-绠$悊鍛樼") @RestController +@CrossOrigin(origins="*",maxAge=3600) @RequestMapping(value = "teach/courseware") public class CoursewareController { @@ -54,10 +54,10 @@ IProgressService progressService; /** - * 加载课件tree + * 鍔犺浇璇句欢tree * * @param parentId - * 父节点id + * 鐖惰妭鐐筰d */ @GetMapping(value = "categoryTree") public Result categoryTree(String subjectId, String parentId) { @@ -69,19 +69,19 @@ } /** - * 获取课件列表 + * 鑾峰彇璇句欢鍒楄〃 * * @param chapterId - * 章节id + * 绔犺妭id * @param type - * 课件类型 + * 璇句欢绫诲瀷 * @param keyword - * 搜索关键字 + * 鎼滅储鍏抽敭瀛� * @param limit - * 每页显示几条 + * 姣忛〉鏄剧ず鍑犳潯 * @param pageNum - * 页码 - * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) + * 椤电爜 + * @return 鐘舵�佽鏄�(0,瑙嗛銆�1,闊抽銆�2,鏂囨。銆�3,缁冧範銆�) */ @GetMapping(value = "coursewareList") public Result coursewareList(String chapterId, String type, String keyword, Integer limit, Integer pageNum) { @@ -93,24 +93,24 @@ return new Result(true, "success", CollectionUtils.newObjectMap("coursewareLst", QBeanUtils.listBean2ListMap(lectures, - CollectionUtils.newStringMap("name", "name", "lectureId", "id", "lectureType", "type", + CollectionUtils.newStringMap("lectureId","lectureId","name", "name", "resItemId", "id", "lectureType", "type", "chapterId", "chapterId", "status", "status", "updateTime", "updateTime")), "count", lectureCount)); } /** - * 查看课件 + * 鏌ョ湅璇句欢 * * @param id - * 课件id + * 璇句欢id * @param attribute - * 扩展属性 video:"mp4:HD","m3u8:SD" 可不用传 audio:可不用传 doc:可不用传 + * 鎵╁睍灞炴�� video:"mp4:HD","m3u8:SD" 鍙笉鐢ㄤ紶 audio:鍙笉鐢ㄤ紶 doc:鍙笉鐢ㄤ紶 */ - @ApiOperation(value = "查看课件", notes = "") + @ApiOperation(value = "鏌ョ湅璇句欢", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "课件id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "attribute", value = "扩展属性 video:\"mp4:HD\",\"m3u8:SD\" 可不用传 audio:可不用传 doc:可不用传", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "id", value = "璇句欢id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "attribute", value = "鎵╁睍灞炴�� video:\"mp4:HD\",\"m3u8:SD\" 鍙笉鐢ㄤ紶 audio:鍙笉鐢ㄤ紶 doc:鍙笉鐢ㄤ紶", required = false, paramType="query", dataType = "String"), }) @GetMapping(value = "showCourseware") public Result showCourseware(String id, String attribute) { @@ -125,33 +125,35 @@ } /** - * 删除课件 + * 鍒犻櫎璇句欢 * * @param id - * 课件ids + * 璇句欢ids */ @GetMapping(value = "deleteCourseware") public Result deleteCourseware(String id) { - return lectureService.deleteLecture(id.split(",")); + Result result = lectureService.deleteLecture(id.split(",")); +// lectureService.deleteLectureLoad(id.split(",")); + return result; } /** - * 课件的复制 + * 璇句欢鐨勫鍒� * * @param id - * 课件id + * 璇句欢id * @param type - * 课件类型 + * 璇句欢绫诲瀷 * @param chapterId - * 章Id + * 绔營d * @param sectionId - * 节id + * 鑺俰d * @param smallSectionId - * 小节id + * 灏忚妭id * @param name - * 课件名称 + * 璇句欢鍚嶇О */ @GetMapping(value = "copy") public Result copy(String id, String type, String subjectId, String chapterId, String name) { @@ -159,18 +161,18 @@ } /** - * 课件的移动 + * 璇句欢鐨勭Щ鍔� * * @param id - * 课件id + * 璇句欢id * @param type - * 课件类型 + * 璇句欢绫诲瀷 * @param chapterId - * 章Id + * 绔營d * @param sectionId - * 节id + * 鑺俰d * @param smallSectionId - * 小节id + * 灏忚妭id */ @GetMapping(value = "move") public Result moveCourseware(String id, String type, String subjectId, String chapterId, String name) { @@ -178,18 +180,18 @@ } /** - * 课件管理 新增下级,同级 + * 璇句欢绠$悊 鏂板涓嬬骇锛屽悓绾� * * @param type - * (add:新增,edit :编辑) + * (add:鏂板,edit :缂栬緫) * @param chapterId - * 章节id + * 绔犺妭id * @param subjectId - * 课程id + * 璇剧▼id * @param name - * 名称 + * 鍚嶇О * @param childFlag - * 是否操作下级 + * 鏄惁鎿嶄綔涓嬬骇 * */ @PostMapping(value = "addOrUpdateChapter") @@ -207,10 +209,10 @@ } /** - * 课件管理 目录删除 + * 璇句欢绠$悊 鐩綍鍒犻櫎 * * @param chapterId - * 目录id + * 鐩綍id */ @GetMapping(value = "deleteChapter") public Result deleteChapter(String chapterId) { @@ -218,24 +220,24 @@ } /** - * 添加/更新(视频,讲义,音频) + * 娣诲姞/鏇存柊(瑙嗛锛岃涔夛紝闊抽) * * @param name - * 名称 + * 鍚嶇О * @param coverUrl - * 封面Url + * 灏侀潰Url * @param remark: * <p> - * 视频啊啊啊 + * 瑙嗛鍟婂晩鍟� * </p> - * 介绍 + * 浠嬬粛 * * @param id - * 课件id + * 璇句欢id * @param sectionId - * 小节Id + * 灏忚妭Id * @param type - * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) + * @return 鐘舵�佽鏄�(0,瑙嗛銆�1,闊抽銆�2,鏂囨。銆�3,缁冧範銆�) */ @PostMapping(value = "addOrUpdate") public Result addOrUpdate(String id, String remark, String name, String coverUrl, String type, String fileId, @@ -259,10 +261,10 @@ } /** - * 编辑 获取内容 + * 缂栬緫 鑾峰彇鍐呭 * * @param id - * 课件id + * 璇句欢id */ @GetMapping(value = "getCoursewareDetail") public Result getCoursewareDetail(String id) { @@ -278,15 +280,15 @@ } /** - * 课件获取资源列表 + * 璇句欢鑾峰彇璧勬簮鍒楄〃 * * @param dirId - * 目录Id + * 鐩綍Id * @param limit - * 每页显示几条 + * 姣忛〉鏄剧ず鍑犳潯 * @param pageNum - * 页码 - * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) + * 椤电爜 + * @return 鐘舵�佽鏄�(0,瑙嗛銆�1,闊抽銆�2,鏂囨。銆�3,缁冧範銆�) */ @GetMapping(value = "getResLst") public Result getResLst(String dirId, Integer limit, Integer pageNum, String keyword) { @@ -301,12 +303,12 @@ } /** - * 课件从资源选择后保存 + * 璇句欢浠庤祫婧愰�夋嫨鍚庝繚瀛� * * @param resId - * 资源文件id + * 璧勬簮鏂囦欢id * @param sectionId - * 小节id + * 灏忚妭id * */ @GetMapping(value = "saveCourseware4Res") @@ -319,32 +321,31 @@ result = lectureService.addLecture(sectionId, resId_); successCount = result.isSuccess() ? 1 : 0; } - return new Result(true, null, successCount); } /** - * 获取练习成绩列表 + * 鑾峰彇缁冧範鎴愮哗鍒楄〃 * * @param subjectId - * 课程id + * 璇剧▼id * @param exerciseId - * 练习id + * 缁冧範id * @param pageSize - * 每页显示几条 + * 姣忛〉鏄剧ず鍑犳潯 * @param pageNum - * 页码 + * 椤电爜 * */ @GetMapping(value = "lstExerciseScore") public Result lstExerciseScore(String subjectId, String exerciseId, Integer pageSize, Integer pageNum) { Map<String, Object> lstExerciseGradeOne = CollectionUtils.newObjectMap("studentNumber", 201342, "studentName", - "李刚1", "className", "catti", "mockTime", new Date(), "status", 1, "score", 60, // status 0 表示未提交,1是已提交 - "passingFlag", 1);// passingFlag 1,true,0 false + "鏉庡垰1", "className", "catti", "mockTime", new Date(), "status", 1, "score", 60, // status 0 琛ㄧず鏈彁浜わ紝1鏄凡鎻愪氦 + "passingFlag", 1);// passingFlag 1锛宼rue,0 false Map<String, Object> lstExerciseGradeTwo = CollectionUtils.newObjectMap("studentNumber", 201342, "studentName", - "李刚2", "className", "catti", "mockTime", new Date(), "status", 0, "score", 70, "passingFlag", 0); + "鏉庡垰2", "className", "catti", "mockTime", new Date(), "status", 0, "score", 70, "passingFlag", 0); Map<String, Object> lstExerciseGradeThree = CollectionUtils.newObjectMap("studentNumber", 201342, "studentName", - "李刚3", "className", "catti", "mockTime", new Date(), "status", 1, "score", 80, "passingFlag", 1); + "鏉庡垰3", "className", "catti", "mockTime", new Date(), "status", 1, "score", 80, "passingFlag", 1); return new Result(true, "success", CollectionUtils.newObjectMap("scoreLst", CollectionUtils.newList(lstExerciseGradeOne, lstExerciseGradeTwo, lstExerciseGradeThree), @@ -352,11 +353,11 @@ } /** - * 练习成绩的导出 + * 缁冧範鎴愮哗鐨勫鍑� * * @param subjectId - * 课程id - * @param exerciseId练习id + * 璇剧▼id + * @param exerciseId缁冧範id */ @GetMapping(value = "exportScore") public Result exportScore(String subjectId, String exerciseId) { -- Gitblit v1.8.0