know数据库 修正

新增针对分项目标知识点数据的查询
学生查看对应课程
master
Alan 7 months ago
parent ee4f81c4a8
commit 44d79e6e36
  1. 564
      sql/teaching_db2.0.sql
  2. 8
      src/main/java/com/teaching/backend/common/ErrorCode.java
  3. 4
      src/main/java/com/teaching/backend/controller/courses/CourseObjectivesController.java
  4. 16
      src/main/java/com/teaching/backend/controller/courses/CoursesController.java
  5. 47
      src/main/java/com/teaching/backend/controller/courses/ObjectiveContentKnowController.java
  6. 8
      src/main/java/com/teaching/backend/controller/courses/ObjectivesTypeController.java
  7. 49
      src/main/java/com/teaching/backend/controller/courses/StudentCoursesController.java
  8. 5
      src/main/java/com/teaching/backend/controller/favour/SeCourseFavourController.java
  9. 2
      src/main/java/com/teaching/backend/mapper/courses/CourseObjectivesMapper.java
  10. 16
      src/main/java/com/teaching/backend/mapper/courses/ObjectiveContentKnowMapper.java
  11. 16
      src/main/java/com/teaching/backend/mapper/courses/StudentCoursesMapper.java
  12. 2
      src/main/java/com/teaching/backend/model/dto/courses/CoursesDTO.java
  13. 26
      src/main/java/com/teaching/backend/model/dto/courses/ObjectiveContentKnowDTO.java
  14. 20
      src/main/java/com/teaching/backend/model/dto/courses/StudentCoursesDTO.java
  15. 41
      src/main/java/com/teaching/backend/model/entity/courses/ObjectiveContentKnow.java
  16. 41
      src/main/java/com/teaching/backend/model/entity/courses/StudentCourses.java
  17. 68
      src/main/java/com/teaching/backend/model/entity/know/Know.java
  18. 3
      src/main/java/com/teaching/backend/model/query/CourseQuery.java
  19. 6
      src/main/java/com/teaching/backend/model/vo/courses/CourseObjectivesTreeVO.java
  20. 2
      src/main/java/com/teaching/backend/model/vo/courses/CoursesVO.java
  21. 42
      src/main/java/com/teaching/backend/model/vo/courses/ObjectiveContentKnowVO.java
  22. 2
      src/main/java/com/teaching/backend/service/courses/ICourseObjectivesService.java
  23. 4
      src/main/java/com/teaching/backend/service/courses/ICoursesService.java
  24. 21
      src/main/java/com/teaching/backend/service/courses/IObjectiveContentKnowService.java
  25. 1
      src/main/java/com/teaching/backend/service/courses/IObjectiveContentsService.java
  26. 23
      src/main/java/com/teaching/backend/service/courses/IStudentCoursesService.java
  27. 6
      src/main/java/com/teaching/backend/service/impl/courses/CourseObjectivesServiceImpl.java
  28. 20
      src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java
  29. 169
      src/main/java/com/teaching/backend/service/impl/courses/ObjectiveContentKnowServiceImpl.java
  30. 124
      src/main/java/com/teaching/backend/service/impl/courses/StudentCoursesServiceImpl.java
  31. 7
      src/main/java/com/teaching/backend/service/impl/favour/SeCourseFavourServiceImpl.java
  32. 2
      src/main/java/com/teaching/backend/utils/CourseCode.java
  33. 5
      src/main/resources/application.yml
  34. 2
      src/main/resources/mapper/CourseObjectivesMapper.xml
  35. 5
      src/main/resources/mapper/ObjectiveContentKnowMapper.xml
  36. 5
      src/main/resources/mapper/StudentCoursesMapper.xml

@ -1,564 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80037
Source Host : localhost:3306
Source Schema : teaching_db
Target Server Type : MySQL
Target Server Version : 80037
File Encoding : 65001
Date: 12/06/2024 15:31:07
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for course_objectives
-- ----------------------------
DROP TABLE IF EXISTS `course_objectives`;
CREATE TABLE `course_objectives` (
`id` varchar(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '内部编号',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
`pid` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '0' COMMENT '父级节点 默认0没有',
`has_child` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '0' COMMENT '是否有子节点 添加子节点变1,默认0没有',
`name` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '目标名称',
`type` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '目标类型',
`course_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '课程id',
`requireid` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '毕业要求id',
`temp` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '毕业要求',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of course_objectives
-- ----------------------------
INSERT INTO `course_objectives` VALUES ('3e42492c201d2a9378be5af2edc92b47', '2024-06-06 16:17:39', NULL, '0', '0', '近代史纲要课程总体目标', NULL, 'd8d7bb93f100164659cac44ef2c4f55a', NULL, NULL);
INSERT INTO `course_objectives` VALUES ('43f2c4b4a10a47784e50e772b9d10457', '2024-05-31 17:39:13', NULL, '0', '0', '测试课程课程总体目标', NULL, '6f5de6dd8c8d5d9d02a63c8444b9d5bb', NULL, NULL);
INSERT INTO `course_objectives` VALUES ('503dc084653ffd003cb404b62266dc7c', '2024-06-06 15:58:43', NULL, 'da6e7283befa8965dae0f0f39ea7f24e', '0', '知识目标', 'c126ef1a66733ab7a4ba12aba0eb7f82', NULL, NULL, NULL);
INSERT INTO `course_objectives` VALUES ('53b27c94fe8af02ac8b23d9be9a2e329', '2024-06-03 11:32:19', NULL, 'da6e7283befa8965dae0f0f39ea7f24e', '0', '思政目标', '71f73bd999f678bcbbdb101e23277feb', NULL, NULL, NULL);
INSERT INTO `course_objectives` VALUES ('7a302cd72d653647778840b42f4e076a', '2024-06-03 10:43:13', NULL, '0', '0', '软件构造课程总体目标', NULL, 'ee2447b4463a5ad3f47e1744d912a824', NULL, NULL);
INSERT INTO `course_objectives` VALUES ('aa839ff1345a04f95b4efcca02494cab', '2024-06-06 16:45:22', NULL, '0', '0', '毛概课程总体目标', NULL, '72e1ad71bb855ba328f8c17964697354', NULL, NULL);
INSERT INTO `course_objectives` VALUES ('b41fa8332f39cca11d35635bd9fac720', '2024-05-31 11:24:33', NULL, '0', '0', '计算机导论课程总体目标', NULL, '2fa0fd63262230639d2c45a3acd9045c', NULL, NULL);
INSERT INTO `course_objectives` VALUES ('c84dc451086f7938c28a4f757957f415', '2024-06-06 15:58:19', NULL, 'da6e7283befa8965dae0f0f39ea7f24e', '0', '价值目标', '410fc58cd757cd248941af1bea6888e5', NULL, NULL, NULL);
INSERT INTO `course_objectives` VALUES ('d452f583115465d067a1719458690b95', '2024-05-31 11:16:37', NULL, '0', '0', '计算机组成原理总体目标', NULL, '36c34a4225526dd20ee3840da61d3701', NULL, NULL);
INSERT INTO `course_objectives` VALUES ('da6e7283befa8965dae0f0f39ea7f24e', '2024-05-31 20:49:52', '2024-06-06 15:58:43', '0', '1', '离散数学及其应用课程总体目标', NULL, 'de3100cad98f76be3176dd39aa748a9e', NULL, NULL);
-- ----------------------------
-- Table structure for courses
-- ----------------------------
DROP TABLE IF EXISTS `courses`;
CREATE TABLE `courses` (
`id` varchar(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '内部编号',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
`img` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '课程封面',
`category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '课程类别',
`nature` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '课程性质',
`name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '课程名称',
`code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '课程编码',
`semester` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '开课学期',
`credit` decimal(5, 2) NULL DEFAULT NULL COMMENT '课程学分',
`classhours` int NULL DEFAULT NULL COMMENT '课程学时',
`theoryhours` int NULL DEFAULT NULL COMMENT '理论学时',
`practicehours` int NULL DEFAULT NULL COMMENT '实践学时',
`experimenthours` int NULL DEFAULT NULL COMMENT '实验学时',
`otherhours` int NULL DEFAULT NULL COMMENT '其他学时',
`weeks` int NULL DEFAULT NULL COMMENT '上课周数',
`assessmenttype` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '考核类型',
`assessmentway` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '考核方式',
`teacher` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '负责教师',
`teachermethod` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '教学方法',
`teacherway` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '教学方式',
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '课程简介',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of courses
-- ----------------------------
INSERT INTO `courses` VALUES ('2fa0fd63262230639d2c45a3acd9045c', '2024-05-30 20:58:34', NULL, '', '1', '1', '计算机导论12', '111007', NULL, 4.50, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110339', '暂定', '线下授课', NULL);
INSERT INTO `courses` VALUES ('36c34a4225526dd20ee3840da61d3701', '2024-05-28 20:58:36', NULL, '', '1', '1', '计算机组成原理', '111006', NULL, 4.00, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110339', '暂定', '线下授课', NULL);
INSERT INTO `courses` VALUES ('6f5de6dd8c8d5d9d02a63c8444b9d5bb', '2024-05-26 20:58:40', NULL, '', '1', '1', '测试课程', '111008', NULL, 4.00, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110339', '暂定', '线下授课', NULL);
INSERT INTO `courses` VALUES ('72e1ad71bb855ba328f8c17964697354', '2024-06-06 16:45:22', NULL, 'http://teaching-edu123.oss-cn-beijing.aliyuncs.com/KdxGCt8rKbruw3zEDTdkA.jpg', '1', '1', '毛概', '111012', NULL, 3.60, 48, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334', '暂定', '线下授课', NULL);
INSERT INTO `courses` VALUES ('8721e6864387eb99b04692f125ac0a9f', '2024-05-27 20:58:43', NULL, '', '1', '1', 'SQLServer数据库教程', '111004', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定111', '线下机房授课', NULL);
INSERT INTO `courses` VALUES ('90ce365ae4e362f616776550e04ae0b4', '2024-05-24 20:58:48', NULL, '', '1', '1', 'JavaEE', '111002', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定', '线下机房授课', NULL);
INSERT INTO `courses` VALUES ('a2ba84374d86e85208c5906a96ea8205', '2024-05-24 20:58:48', NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '1', '1', 'JavaWeb', '111003', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定', '线下机房授课', NULL);
INSERT INTO `courses` VALUES ('d511d26df8de551bc85ce765089771b4', '2024-05-24 20:58:48', NULL, '', '1', '1', '高级编程', '111001', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定', '线下机房授课', NULL);
INSERT INTO `courses` VALUES ('d8d7bb93f100164659cac44ef2c4f55a', '2024-06-06 16:17:39', NULL, '', '1', '1', '近代史纲要', '111011', NULL, 2.60, 48, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334', '暂定', '线下授课', NULL);
INSERT INTO `courses` VALUES ('de3100cad98f76be3176dd39aa748a9e', '2024-05-31 20:49:52', NULL, 'http://teaching-edu123.oss-cn-beijing.aliyuncs.com/E96JlmbPeqvzVcPvg43Lb.jpg', '1', '1', '离散数学及其应用', '111009', NULL, 2.00, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334', '暂定', '线下授课', NULL);
-- ----------------------------
-- Table structure for know
-- ----------------------------
DROP TABLE IF EXISTS `know`;
CREATE TABLE `know` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'id',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点名称',
`info` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '简介',
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点内容',
`img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点图片',
`hour` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点学时',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of know
-- ----------------------------
-- ----------------------------
-- Table structure for know_relationship
-- ----------------------------
DROP TABLE IF EXISTS `know_relationship`;
CREATE TABLE `know_relationship` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键id',
`chapterId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '章节id',
`courseId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '课程id',
`knowId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of know_relationship
-- ----------------------------
-- ----------------------------
-- Table structure for learning_records
-- ----------------------------
DROP TABLE IF EXISTS `learning_records`;
CREATE TABLE `learning_records` (
`id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT '学习记录id',
`user_id` varchar(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '用户id',
`courses_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '课程id',
`chapter_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '章节id',
`knowledge_point_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '知识点id',
`resource_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '资源id',
`access_time` datetime NULL DEFAULT NULL COMMENT '访问时间',
`learning_method1` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT '0' COMMENT '学习方式:打开; 1,打开过,2未打开',
`learning_method2` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT '0' COMMENT '学习方式:下载; 1下载过, 2未下载',
`video_duration` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '视频学习时长',
`is_completed` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '是否完成观看:1,已完成,0未完成',
`content` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '记录封面图片',
`address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '资源地址',
`status` varchar(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT '1' COMMENT '是否存在: 1存在;0不存在;',
`parent_node` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '父节点',
`type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT NULL COMMENT '类型, 如:1,课程; 2,章节; 3,知识点; 4,学习资源',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_unicode_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of learning_records
-- ----------------------------
INSERT INTO `learning_records` VALUES ('1', '1', '290bf0217c6a1569abf225289c7e11ea', NULL, NULL, NULL, '2024-05-31 21:35:11', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('2', '2', 'd511d26df8de551bc85ce765089771b4', NULL, NULL, NULL, '2024-05-31 00:00:00', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('3', '1', 'd511d26df8de551bc85ce765089771b4', NULL, NULL, NULL, '2024-05-31 00:00:00', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('4', '1', '1', '', '', '', '2024-06-07 10:49:42', '1', '0', '', '', 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '0', '', '2');
INSERT INTO `learning_records` VALUES ('5', '1', '2', NULL, NULL, NULL, '2024-05-02 00:00:00', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('6', '1', '3', NULL, NULL, NULL, '2024-06-04 10:10:49', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('7', '1', '4', NULL, NULL, NULL, '2024-06-04 10:12:01', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '0', NULL, '1');
INSERT INTO `learning_records` VALUES ('96', '1', '5', NULL, NULL, NULL, '2024-05-30 20:46:21', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('8', '2', '3', NULL, NULL, NULL, '2024-06-04 10:15:01', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.taobao.com/', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('75', '2', '4', NULL, NULL, NULL, '2024-06-04 10:17:16', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.taobao.com/', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('71', '2', '5', NULL, NULL, NULL, '2024-06-04 12:01:48', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.taobao.com/', '1', NULL, '1');
INSERT INTO `learning_records` VALUES ('1797841286352658434', '3', '5', '', '', '', '2024-06-06 16:59:38', '1', '1', '', '', '', '/portal', '1', '', '1');
INSERT INTO `learning_records` VALUES ('1798911495222161409', '1', '1', '', '', '', '2024-06-07 10:54:57', '1', '0', '', '', 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '0', '', '1');
INSERT INTO `learning_records` VALUES ('1797984330104299521', '3', '1', NULL, NULL, NULL, '2024-06-04 21:30:44', NULL, '1', '1', '1', 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.baidu.com/', '1', NULL, '1');
-- ----------------------------
-- Table structure for objective_contents
-- ----------------------------
DROP TABLE IF EXISTS `objective_contents`;
CREATE TABLE `objective_contents` (
`id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`objective_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '对应的目标id',
`content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '内容',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of objective_contents
-- ----------------------------
INSERT INTO `objective_contents` VALUES ('3f85eb79c29be4a15c729d98b17676a5', 'c84dc451086f7938c28a4f757957f415', '价值目标3');
INSERT INTO `objective_contents` VALUES ('406c85c99bd2d4b9f624ca3a67c3ce66', '53b27c94fe8af02ac8b23d9be9a2e329', '思政目标2');
INSERT INTO `objective_contents` VALUES ('4ad5a1f0f584e35e7af6ef5142773990', '503dc084653ffd003cb404b62266dc7c', '知识目标1');
INSERT INTO `objective_contents` VALUES ('4b4458cd64b0a1e21b54191a89e9f83d', 'c84dc451086f7938c28a4f757957f415', '价值目标2');
INSERT INTO `objective_contents` VALUES ('53d9d78b41051696314c0b1c0efa5313', '503dc084653ffd003cb404b62266dc7c', '知识目标3');
INSERT INTO `objective_contents` VALUES ('6689ed187bcbd36309510a21ea492225', 'da6e7283befa8965dae0f0f39ea7f24e', '总目标3');
INSERT INTO `objective_contents` VALUES ('979e59083e81f28145e1162069ffebb8', 'c84dc451086f7938c28a4f757957f415', '价值目标1');
INSERT INTO `objective_contents` VALUES ('9efcc83089e6de9945499876d1a6235a', 'da6e7283befa8965dae0f0f39ea7f24e', '总目标1');
INSERT INTO `objective_contents` VALUES ('c6b3fc522a5479e28cd3f0c9b971a871', '53b27c94fe8af02ac8b23d9be9a2e329', '思政目标3');
INSERT INTO `objective_contents` VALUES ('dc31075d57f371970c5af09fd534a9af', 'da6e7283befa8965dae0f0f39ea7f24e', '总目标2');
INSERT INTO `objective_contents` VALUES ('eca937e6f047e3b6b06d67c5b4a9beff', '53b27c94fe8af02ac8b23d9be9a2e329', '思政目标1');
INSERT INTO `objective_contents` VALUES ('ffde482fac55e6dec5b60f6c6208d42c', '503dc084653ffd003cb404b62266dc7c', '知识目标2');
-- ----------------------------
-- Table structure for objectives_type
-- ----------------------------
DROP TABLE IF EXISTS `objectives_type`;
CREATE TABLE `objectives_type` (
`id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`type_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '类型名称',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `type_name`(`type_name` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of objectives_type
-- ----------------------------
INSERT INTO `objectives_type` VALUES ('410fc58cd757cd248941af1bea6888e5', '价值目标');
INSERT INTO `objectives_type` VALUES ('71f73bd999f678bcbbdb101e23277feb', '思政目标');
INSERT INTO `objectives_type` VALUES ('c126ef1a66733ab7a4ba12aba0eb7f82', '知识目标');
INSERT INTO `objectives_type` VALUES ('2350f69ef928cd2949e7fc05b05bd0c3', '素质目标');
-- ----------------------------
-- Table structure for resource
-- ----------------------------
DROP TABLE IF EXISTS `resource`;
CREATE TABLE `resource` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源名称',
`type` int NULL DEFAULT NULL COMMENT '资源类型',
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源路径',
`status` int NULL DEFAULT NULL COMMENT '资源状态',
`tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '标签',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of resource
-- ----------------------------
-- ----------------------------
-- Table structure for resource_relationship
-- ----------------------------
DROP TABLE IF EXISTS `resource_relationship`;
CREATE TABLE `resource_relationship` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
`courseId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '课程id',
`chapterId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '章节id',
`knowId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点id',
`resourceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of resource_relationship
-- ----------------------------
-- ----------------------------
-- Table structure for se_course_favour
-- ----------------------------
DROP TABLE IF EXISTS `se_course_favour`;
CREATE TABLE `se_course_favour` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'id',
`course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '课程id',
`user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of se_course_favour
-- ----------------------------
INSERT INTO `se_course_favour` VALUES ('1796378327262564353', 'a2ba84374d86e85208c5906a96ea8205', '2');
INSERT INTO `se_course_favour` VALUES ('1796454599099658242', '36c34a4225526dd20ee3840da61d3701', '2');
INSERT INTO `se_course_favour` VALUES ('1796789887730647041', '2fa0fd63262230639d2c45a3acd9045c', '2');
INSERT INTO `se_course_favour` VALUES ('1797497056650289154', 'd511d26df8de551bc85ce765089771b4', '1');
INSERT INTO `se_course_favour` VALUES ('1797499380101767170', 'd511d26df8de551bc85ce765089771b4', '2');
INSERT INTO `se_course_favour` VALUES ('1798221492412149761', 'd511d26df8de551bc85ce765089771b4', '5');
INSERT INTO `se_course_favour` VALUES ('1798621775654993922', 'd511d26df8de551bc85ce765089771b4', '8');
INSERT INTO `se_course_favour` VALUES ('1798632199670714369', 'de3100cad98f76be3176dd39aa748a9e', '2');
-- ----------------------------
-- Table structure for se_course_thumb
-- ----------------------------
DROP TABLE IF EXISTS `se_course_thumb`;
CREATE TABLE `se_course_thumb` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of se_course_thumb
-- ----------------------------
INSERT INTO `se_course_thumb` VALUES ('1796343958854623233', '2', '1');
INSERT INTO `se_course_thumb` VALUES ('1796344002215337985', '2', '2');
INSERT INTO `se_course_thumb` VALUES ('1796362250491191298', '1', '2');
INSERT INTO `se_course_thumb` VALUES ('1796437673614974977', '6', '2');
INSERT INTO `se_course_thumb` VALUES ('1796445964822847489', '7', '4');
-- ----------------------------
-- Table structure for se_know_favour
-- ----------------------------
DROP TABLE IF EXISTS `se_know_favour`;
CREATE TABLE `se_know_favour` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`know_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of se_know_favour
-- ----------------------------
INSERT INTO `se_know_favour` VALUES ('1796378889450295297', '1', '2', '3');
-- ----------------------------
-- Table structure for se_know_thumb
-- ----------------------------
DROP TABLE IF EXISTS `se_know_thumb`;
CREATE TABLE `se_know_thumb` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`know_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of se_know_thumb
-- ----------------------------
INSERT INTO `se_know_thumb` VALUES ('1796347057337982977', '1', '2', '2');
INSERT INTO `se_know_thumb` VALUES ('1796347303317135361', '2', '2', '3');
INSERT INTO `se_know_thumb` VALUES ('1796347343968329730', '2', '3', '3');
INSERT INTO `se_know_thumb` VALUES ('1796347380697849857', '1', '3', '3');
-- ----------------------------
-- Table structure for se_resource_favour
-- ----------------------------
DROP TABLE IF EXISTS `se_resource_favour`;
CREATE TABLE `se_resource_favour` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`resource_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of se_resource_favour
-- ----------------------------
INSERT INTO `se_resource_favour` VALUES ('1796379012112715778', '1', '2', '3');
-- ----------------------------
-- Table structure for se_resource_thumb
-- ----------------------------
DROP TABLE IF EXISTS `se_resource_thumb`;
CREATE TABLE `se_resource_thumb` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`resource_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of se_resource_thumb
-- ----------------------------
INSERT INTO `se_resource_thumb` VALUES ('1796366535710904322', '2', '1', '1');
-- ----------------------------
-- Table structure for ums_admin
-- ----------------------------
DROP TABLE IF EXISTS `ums_admin`;
CREATE TABLE `ums_admin` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户名',
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '密码',
`phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
`nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '昵称',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '头像',
`create_time` datetime NULL DEFAULT NULL COMMENT '注册时间',
`status` int NULL DEFAULT 1 COMMENT '帐号启用状态:0->禁用;1->启用',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_admin
-- ----------------------------
INSERT INTO `ums_admin` VALUES (1, 'xiao1111', '', '', '', '1111', '2024-06-03 13:30:29', 0);
INSERT INTO `ums_admin` VALUES (2, '123', '$2a$10$ACn80kN2ZEREGH3yOce9mui/KoWQllCHjNVXzXzrTI3gKJi/LB/YK', '123456789', '', '', '2024-06-05 23:23:45', 1);
INSERT INTO `ums_admin` VALUES (3, 'youhang', '$2a$10$TYJcMWBdDmmYfV/Kxi771ee7krjYJCLzI8O6MyjCofty9Y0OPLEna', '13547534472', 'yy', '', '2024-06-12 15:09:10', 1);
-- ----------------------------
-- Table structure for ums_admin_role_relation
-- ----------------------------
DROP TABLE IF EXISTS `ums_admin_role_relation`;
CREATE TABLE `ums_admin_role_relation` (
`id` int NOT NULL AUTO_INCREMENT,
`admin_id` int NULL DEFAULT NULL,
`role_id` int NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_admin_role_relation
-- ----------------------------
INSERT INTO `ums_admin_role_relation` VALUES (1, 1, 2);
-- ----------------------------
-- Table structure for ums_menu
-- ----------------------------
DROP TABLE IF EXISTS `ums_menu`;
CREATE TABLE `ums_menu` (
`id` int NOT NULL AUTO_INCREMENT,
`parent_id` int NULL DEFAULT NULL COMMENT '父级ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单名称',
`level` int NULL DEFAULT NULL COMMENT '菜单级数',
`sort` int NULL DEFAULT NULL COMMENT '菜单排序',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '前端名称',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '前端图标',
`hidden` int NULL DEFAULT NULL COMMENT '前端隐藏',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_menu
-- ----------------------------
-- ----------------------------
-- Table structure for ums_resource
-- ----------------------------
DROP TABLE IF EXISTS `ums_resource`;
CREATE TABLE `ums_resource` (
`id` int NOT NULL AUTO_INCREMENT,
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源名称',
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源URL',
`description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
`category_id` int NULL DEFAULT NULL COMMENT '资源分类ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_resource
-- ----------------------------
INSERT INTO `ums_resource` VALUES (1, '2024-06-04 09:56:19', '首页', '/home/advertise/**', NULL, 1);
-- ----------------------------
-- Table structure for ums_resource_category
-- ----------------------------
DROP TABLE IF EXISTS `ums_resource_category`;
CREATE TABLE `ums_resource_category` (
`id` int NOT NULL AUTO_INCREMENT,
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分类名称',
`sort` int NULL DEFAULT NULL COMMENT '排序',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_resource_category
-- ----------------------------
INSERT INTO `ums_resource_category` VALUES (1, '2024-06-04 09:57:23', '首页模块', 0);
-- ----------------------------
-- Table structure for ums_role
-- ----------------------------
DROP TABLE IF EXISTS `ums_role`;
CREATE TABLE `ums_role` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
`description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
`admin_count` int NULL DEFAULT NULL COMMENT '后台用户数量',
`create_time` datetime NOT NULL COMMENT '创建时间',
`status` int NULL DEFAULT 1 COMMENT '启用状态:0->禁用;1->启用',
`sort` int NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_role
-- ----------------------------
INSERT INTO `ums_role` VALUES (1, '老师', '能查看自己和所有学生的信息', 0, '2024-06-04 09:59:47', 1, 0);
INSERT INTO `ums_role` VALUES (2, '学生', '只能查看自己信息', 0, '2024-06-04 10:02:15', 1, 0);
-- ----------------------------
-- Table structure for ums_role_menu_relation
-- ----------------------------
DROP TABLE IF EXISTS `ums_role_menu_relation`;
CREATE TABLE `ums_role_menu_relation` (
`id` int NOT NULL AUTO_INCREMENT,
`role_id` int NULL DEFAULT NULL COMMENT '角色ID',
`menu_id` int NULL DEFAULT NULL COMMENT '菜单ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_role_menu_relation
-- ----------------------------
-- ----------------------------
-- Table structure for ums_role_resource_relation
-- ----------------------------
DROP TABLE IF EXISTS `ums_role_resource_relation`;
CREATE TABLE `ums_role_resource_relation` (
`id` int NOT NULL AUTO_INCREMENT,
`role_id` int NULL DEFAULT NULL COMMENT '角色ID',
`resource_id` int NULL DEFAULT NULL COMMENT '资源ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_role_resource_relation
-- ----------------------------
INSERT INTO `ums_role_resource_relation` VALUES (1, 1, 1);
INSERT INTO `ums_role_resource_relation` VALUES (2, 2, 1);
-- ----------------------------
-- Table structure for ums_student
-- ----------------------------
DROP TABLE IF EXISTS `ums_student`;
CREATE TABLE `ums_student` (
`id` int NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名',
`sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别',
`nationality` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '民族',
`number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学号',
`birthday` datetime NULL DEFAULT NULL COMMENT '生日',
`phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
`faculty` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '院系',
`major` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业',
`year` date NULL DEFAULT NULL COMMENT '入学年份',
`class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '班级',
`user_id` int NULL DEFAULT NULL COMMENT 'user_id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_student
-- ----------------------------
-- ----------------------------
-- Table structure for ums_teacher
-- ----------------------------
DROP TABLE IF EXISTS `ums_teacher`;
CREATE TABLE `ums_teacher` (
`id` int NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名',
`sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别',
`nationality` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '民族',
`profession` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业',
`education` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学历',
`degree` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学位',
`professional_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '职称',
`emergency_contact` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
`join_work_time` datetime NULL DEFAULT NULL COMMENT '参加工作时间',
`political_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '政治面貌',
`user_id` int NULL DEFAULT NULL COMMENT 'user_id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of ums_teacher
-- ----------------------------
SET FOREIGN_KEY_CHECKS = 1;

@ -10,6 +10,14 @@ public enum ErrorCode {
SUCCESS(200, "ok"), SUCCESS(200, "ok"),
PARAMS_ERROR(40000, "请求参数错误"), PARAMS_ERROR(40000, "请求参数错误"),
OBJECTIVE_OR_CONTENT_NOT_EXIT(40001, "目标或内容id不存在"),
KONWID_NOT_EXIT(40002, "没有选择知识点"),
OBJECTIVE_OR_CONTENT_EXIT(40003, "该记录已存在"),
KNOW_NOT_EXIT(40004, "知识点不存在"),
TEACHER_NOT_EXIT(40005, "缺少教师信息"),
STUDENT_NOT_EXIT(40006, "缺少学生信息"),
COURSES_NOT_EXIT(40007, "缺少课程信息"),
NOT_LOGIN_ERROR(40100, "未登录"), NOT_LOGIN_ERROR(40100, "未登录"),
NO_AUTH_ERROR(40101, "无权限"), NO_AUTH_ERROR(40101, "无权限"),
NOT_FOUND_ERROR(40400, "请求数据不存在"), NOT_FOUND_ERROR(40400, "请求数据不存在"),

@ -7,7 +7,7 @@ import com.teaching.backend.common.ResultUtils;
import com.teaching.backend.mapper.courses.CourseObjectivesMapper; import com.teaching.backend.mapper.courses.CourseObjectivesMapper;
import com.teaching.backend.model.dto.courses.CourseObjectivesDTO; import com.teaching.backend.model.dto.courses.CourseObjectivesDTO;
import com.teaching.backend.model.entity.courses.CourseObjectives; import com.teaching.backend.model.entity.courses.CourseObjectives;
import com.teaching.backend.model.vo.CourseObjectivesTreeVO; import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO;
import com.teaching.backend.service.courses.ICourseObjectivesService; import com.teaching.backend.service.courses.ICourseObjectivesService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -43,7 +43,7 @@ public class CourseObjectivesController {
return ResultUtils.success(data); return ResultUtils.success(data);
} }
@ApiOperation("删除分项目标-只能最后一个删除思政目标") @ApiOperation("删除分项目标-只能最后一个删除思政目标-总目标只需删除关联的内容")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public BaseResponse<String> deleteCourseObjectivesByIds(@PathVariable String id){ public BaseResponse<String> deleteCourseObjectivesByIds(@PathVariable String id){
String data = courseObjectivesService.deleteObjectives(id); String data = courseObjectivesService.deleteObjectives(id);

@ -1,17 +1,17 @@
package com.teaching.backend.controller.courses; package com.teaching.backend.controller.courses;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.teaching.backend.common.BaseResponse; import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.ErrorCode;
import com.teaching.backend.common.ResultUtils; import com.teaching.backend.common.ResultUtils;
import com.teaching.backend.exception.BusinessException;
import com.teaching.backend.mapper.UserMapper; import com.teaching.backend.mapper.UserMapper;
import com.teaching.backend.model.dto.courses.CoursesDTO; import com.teaching.backend.model.dto.courses.CoursesDTO;
import com.teaching.backend.model.dto.courses.PageDTO; import com.teaching.backend.model.dto.courses.PageDTO;
import com.teaching.backend.model.entity.courses.Courses; import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.query.CourseQuery; import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.CoursesVO; import com.teaching.backend.model.vo.courses.CoursesVO;
import com.teaching.backend.service.courses.ICoursesService; import com.teaching.backend.service.courses.ICoursesService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -63,16 +63,20 @@ public class CoursesController {
} }
//TODO:此处需要调整前端的接口
@ApiOperation("查询课程列表") @ApiOperation("查询课程列表")
@GetMapping("/page") @GetMapping("/page")
public BaseResponse<PageDTO<CoursesVO>> getCourses(CourseQuery courseQuery, @RequestParam String teacherId){ public BaseResponse<PageDTO<CoursesVO>> getCourses(CourseQuery courseQuery){
PageDTO<CoursesVO> coursesList = coursesService.queryCourses(courseQuery,teacherId); PageDTO<CoursesVO> coursesList = coursesService.queryCourses(courseQuery);
return ResultUtils.success(coursesList); return ResultUtils.success(coursesList);
} }
@ApiOperation("根据id查询课程") @ApiOperation("根据id查询课程")
@GetMapping("/{id}") @GetMapping("/{id}")
public BaseResponse<CoursesDTO> getByIdCourse(@PathVariable String id){ public BaseResponse<CoursesDTO> getByIdCourse(@PathVariable String id){
if(id==null){
throw new BusinessException(ErrorCode.PARAMS_ERROR,"课程id为空");
}
Courses course = coursesService.getById(id); Courses course = coursesService.getById(id);
CoursesDTO coursesDTO = new CoursesDTO(); CoursesDTO coursesDTO = new CoursesDTO();
BeanUtils.copyProperties(course,coursesDTO); BeanUtils.copyProperties(course,coursesDTO);
@ -90,7 +94,7 @@ public class CoursesController {
@ApiOperation("根据id删除课程") @ApiOperation("根据id删除课程")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public BaseResponse deleteCourses(@PathVariable String id){ public BaseResponse deleteCourses(@PathVariable String id){
System.out.println(id);
coursesService.deleteBatchByIds(id); coursesService.deleteBatchByIds(id);
// coursesService.removeBatchByIds(ids); // coursesService.removeBatchByIds(ids);
return ResultUtils.success("删除成功"); return ResultUtils.success("删除成功");

@ -0,0 +1,47 @@
package com.teaching.backend.controller.courses;
import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.ResultUtils;
import com.teaching.backend.model.dto.courses.CoursesDTO;
import com.teaching.backend.model.dto.courses.ObjectiveContentKnowDTO;
import com.teaching.backend.model.vo.courses.ObjectiveContentKnowVO;
import com.teaching.backend.service.courses.IObjectiveContentKnowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
/**
* <p>
* 前端控制器
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Api(tags = "目标-内容 关联的知识点接口")
@RestController
@RequestMapping("/objective_content_know")
public class ObjectiveContentKnowController {
@Autowired
IObjectiveContentKnowService objectiveContentKnowService;
@ApiOperation("给分项目标或者是内容添加知识点")
@PostMapping("/addknows")
public BaseResponse<String> saveKnowsWithObjectiveOrContent(@RequestBody ObjectiveContentKnowDTO objectiveContentKnowDTO){
String data = objectiveContentKnowService.saveKnowsWithObjectiveOrContent(objectiveContentKnowDTO);
return ResultUtils.success(data);
}
@ApiOperation("针对分项目标统计,支撑分项目标知识点的个数、学时合计、占比")
@GetMapping("/{objectiveId}")
public BaseResponse<ObjectiveContentKnowVO> getCountData(@PathVariable String objectiveId){
ObjectiveContentKnowVO objectiveContentKnowVO= objectiveContentKnowService.getCountData(objectiveId);
return ResultUtils.success(objectiveContentKnowVO);
}
}

@ -1,20 +1,12 @@
package com.teaching.backend.controller.courses; package com.teaching.backend.controller.courses;
import cn.hutool.core.bean.BeanUtil;
import com.teaching.backend.common.BaseResponse; import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.ResultUtils; import com.teaching.backend.common.ResultUtils;
import com.teaching.backend.model.dto.courses.CoursesDTO;
import com.teaching.backend.model.dto.courses.PageDTO;
import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.entity.courses.ObjectivesType; import com.teaching.backend.model.entity.courses.ObjectivesType;
import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.CoursesVO;
import com.teaching.backend.service.courses.ICoursesService;
import com.teaching.backend.service.courses.IObjectivesTypeService; import com.teaching.backend.service.courses.IObjectivesTypeService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

@ -0,0 +1,49 @@
package com.teaching.backend.controller.courses;
import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.ResultUtils;
import com.teaching.backend.model.dto.courses.ObjectiveContentKnowDTO;
import com.teaching.backend.model.dto.courses.PageDTO;
import com.teaching.backend.model.dto.courses.StudentCoursesDTO;
import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.courses.CoursesVO;
import com.teaching.backend.service.courses.IStudentCoursesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
/**
* <p>
* 前端控制器
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Api(tags = "学生课程接口")
@RestController
@RequestMapping("/student_courses")
public class StudentCoursesController {
@Autowired
IStudentCoursesService studentCoursesService;
@ApiOperation("给学生添加课程")
@PostMapping("/addcoursess")
public BaseResponse<String> saveCoursesToStudents(@RequestBody StudentCoursesDTO studentCoursesDTO){
String data = studentCoursesService.saveCoursesToStudents(studentCoursesDTO);
return ResultUtils.success(data);
}
@ApiOperation("查询课程列表")
@GetMapping("/page")
public BaseResponse<PageDTO<CoursesVO>> getCourses(CourseQuery courseQuery){
PageDTO<CoursesVO> coursesList = studentCoursesService.queryCourses(courseQuery);
return ResultUtils.success(coursesList);
}
}

@ -13,15 +13,10 @@ import com.teaching.backend.model.dto.favour.courseFavour.CourseFavourAllRequest
import com.teaching.backend.model.dto.favour.courseFavour.CourseFavourListRequest; import com.teaching.backend.model.dto.favour.courseFavour.CourseFavourListRequest;
import com.teaching.backend.model.dto.favour.courseFavour.CourseFavourQueryRequest; import com.teaching.backend.model.dto.favour.courseFavour.CourseFavourQueryRequest;
import com.teaching.backend.model.entity.courses.Courses; import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.entity.favour.SeCourseFavour;
import com.teaching.backend.model.vo.CoursesVO;
import com.teaching.backend.model.vo.favour.CourseFavourDetailVO; import com.teaching.backend.model.vo.favour.CourseFavourDetailVO;
import com.teaching.backend.service.courses.ICoursesService;
import com.teaching.backend.service.favour.SeCourseFavourService; import com.teaching.backend.service.favour.SeCourseFavourService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;

@ -2,7 +2,7 @@ package com.teaching.backend.mapper.courses;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teaching.backend.model.entity.courses.CourseObjectives; import com.teaching.backend.model.entity.courses.CourseObjectives;
import com.teaching.backend.model.vo.CourseObjectivesTreeVO; import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO;
import java.util.List; import java.util.List;

@ -0,0 +1,16 @@
package com.teaching.backend.mapper.courses;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teaching.backend.model.entity.courses.ObjectiveContentKnow;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zjh
* @since 2024-06-13
*/
public interface ObjectiveContentKnowMapper extends BaseMapper<ObjectiveContentKnow> {
}

@ -0,0 +1,16 @@
package com.teaching.backend.mapper.courses;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teaching.backend.model.entity.courses.StudentCourses;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zjh
* @since 2024-06-13
*/
public interface StudentCoursesMapper extends BaseMapper<StudentCourses> {
}

@ -18,7 +18,7 @@ public class CoursesDTO {
/** /**
* 创建人 教师id * 创建人 教师id
*/ */
@ApiModelProperty("负责教师") @ApiModelProperty(value = "负责教师",required = true)
private String teacher; private String teacher;
/** /**
* 创建日期 * 创建日期

@ -0,0 +1,26 @@
package com.teaching.backend.model.dto.courses;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.teaching.backend.model.entity.courses.ObjectiveContentKnow;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Data
@ApiModel(description = "分项目标或内容添加知识点")
public class ObjectiveContentKnowDTO extends ObjectiveContentKnow {
}

@ -0,0 +1,20 @@
package com.teaching.backend.model.dto.courses;
import com.teaching.backend.model.entity.courses.ObjectiveContentKnow;
import com.teaching.backend.model.entity.courses.StudentCourses;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Data
@ApiModel(description = "学生课程")
public class StudentCoursesDTO extends StudentCourses {
}

@ -0,0 +1,41 @@
package com.teaching.backend.model.entity.courses;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("objective_content_know")
public class ObjectiveContentKnow implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
/**
* 分项目标或内容 id
*/
private String objectiveOrContent;
/**
* 关联的知识点
*/
private String know;
}

@ -0,0 +1,41 @@
package com.teaching.backend.model.entity.courses;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("student_courses")
public class StudentCourses implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
/**
* 学生的username
*/
private String student;
/**
* 课程id
*/
private String course;
}

@ -1,48 +1,64 @@
package com.teaching.backend.model.entity.know; package com.teaching.backend.model.entity.know;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Data @Data
public class Know { @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("know")
//内部编号 public class Know implements Serializable {
private Long id ;
private static final long serialVersionUID = 1L;
//知识点名称
/**
* id
*/
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
/**
* 知识点名称
*/
private String name; private String name;
//知识点代码 /**
private String code; * 简介
*/
//简介
private String info; private String info;
//定义 /**
private String miaoshu; * 知识点内容
*/
//添加人真实姓名 private String content;
private String inrealname;
//创建人 /**
private String createBy; * 知识点图片
*/
private String img;
//创建时间 /**
private LocalDateTime createTime; * 知识点学时
*/
private BigDecimal hour;
//修改人 /**
private String updateBy; * 知识点类型
*/
private String type;
//修改时间
private LocalDateTime updateTime;
//所属部门
private String sysOrgCode;
} }

@ -11,4 +11,7 @@ import lombok.EqualsAndHashCode;
public class CourseQuery extends PageQuery { public class CourseQuery extends PageQuery {
@ApiModelProperty("课程名称关键字") @ApiModelProperty("课程名称关键字")
private String name; private String name;
@ApiModelProperty(value = "用户的username",required = true)
private String username;
} }

@ -1,8 +1,5 @@
package com.teaching.backend.model.vo; package com.teaching.backend.model.vo.courses;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.teaching.backend.model.dto.courses.CourseObjectivesDTO;
import com.teaching.backend.model.entity.courses.CourseObjectives; import com.teaching.backend.model.entity.courses.CourseObjectives;
import com.teaching.backend.model.entity.courses.ObjectiveContents; import com.teaching.backend.model.entity.courses.ObjectiveContents;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
@ -10,7 +7,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@Data @Data

@ -1,4 +1,4 @@
package com.teaching.backend.model.vo; package com.teaching.backend.model.vo.courses;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;

@ -0,0 +1,42 @@
package com.teaching.backend.model.vo.courses;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
@ApiModel(description = "分项目标,内容关联的知识点VO实体")
public class ObjectiveContentKnowVO {
/**
* 分项目标或内容 id
*/
private String objectiveOrContent;
/**
* 关联的知识点个数
*/
@ApiModelProperty(value = "关联的知识点个数")
private Integer knowsNumber;
/**
* 关联的知识点学时合计
*/
@ApiModelProperty(value = "关联的知识点学时合计")
private BigDecimal knowsTime;
/**
* 关联的知识点学时占比
*/
@ApiModelProperty(value = "关联的知识点学时占比")
private String persent;
/**
* 分项目标下面的内容对应的知识点数据
*/
List<ObjectiveContentKnowVO> contentKnowsData;
}

@ -3,7 +3,7 @@ package com.teaching.backend.service.courses;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.teaching.backend.model.dto.courses.CourseObjectivesDTO; import com.teaching.backend.model.dto.courses.CourseObjectivesDTO;
import com.teaching.backend.model.entity.courses.CourseObjectives; import com.teaching.backend.model.entity.courses.CourseObjectives;
import com.teaching.backend.model.vo.CourseObjectivesTreeVO; import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO;
import java.util.List; import java.util.List;

@ -6,7 +6,7 @@ import com.teaching.backend.model.dto.courses.CoursesDTO;
import com.teaching.backend.model.dto.courses.PageDTO; import com.teaching.backend.model.dto.courses.PageDTO;
import com.teaching.backend.model.entity.courses.Courses; import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.query.CourseQuery; import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.CoursesVO; import com.teaching.backend.model.vo.courses.CoursesVO;
import java.util.List; import java.util.List;
@ -23,7 +23,7 @@ public interface ICoursesService extends IService<Courses> {
String saveCourseWithObjective(CoursesDTO coursesDTO); String saveCourseWithObjective(CoursesDTO coursesDTO);
PageDTO<CoursesVO> queryCourses(CourseQuery courseQuery, String teacherId); PageDTO<CoursesVO> queryCourses(CourseQuery courseQuery);
void deleteBatchByIds(String id); void deleteBatchByIds(String id);

@ -0,0 +1,21 @@
package com.teaching.backend.service.courses;
import com.baomidou.mybatisplus.extension.service.IService;
import com.teaching.backend.model.dto.courses.ObjectiveContentKnowDTO;
import com.teaching.backend.model.entity.courses.ObjectiveContentKnow;
import com.teaching.backend.model.vo.courses.ObjectiveContentKnowVO;
/**
* <p>
* 服务类
* </p>
*
* @author zjh
* @since 2024-06-13
*/
public interface IObjectiveContentKnowService extends IService<ObjectiveContentKnow> {
String saveKnowsWithObjectiveOrContent(ObjectiveContentKnowDTO objectiveContentKnowDTO);
ObjectiveContentKnowVO getCountData(String objectiveId);
}

@ -3,7 +3,6 @@ package com.teaching.backend.service.courses;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.teaching.backend.model.entity.courses.ObjectiveContents; import com.teaching.backend.model.entity.courses.ObjectiveContents;
import com.teaching.backend.model.vo.CourseObjectivesTreeVO;
/** /**
* <p> * <p>

@ -0,0 +1,23 @@
package com.teaching.backend.service.courses;
import com.baomidou.mybatisplus.extension.service.IService;
import com.teaching.backend.model.dto.courses.PageDTO;
import com.teaching.backend.model.dto.courses.StudentCoursesDTO;
import com.teaching.backend.model.entity.courses.StudentCourses;
import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.courses.CoursesVO;
/**
* <p>
* 服务类
* </p>
*
* @author zjh
* @since 2024-06-13
*/
public interface IStudentCoursesService extends IService<StudentCourses> {
String saveCoursesToStudents(StudentCoursesDTO studentCoursesDTO);
PageDTO<CoursesVO> queryCourses(CourseQuery courseQuery);
}

@ -10,15 +10,13 @@ import com.teaching.backend.mapper.courses.ObjectiveContentsMapper;
import com.teaching.backend.model.dto.courses.CourseObjectivesDTO; import com.teaching.backend.model.dto.courses.CourseObjectivesDTO;
import com.teaching.backend.model.entity.courses.CourseObjectives; import com.teaching.backend.model.entity.courses.CourseObjectives;
import com.teaching.backend.model.entity.courses.ObjectiveContents; import com.teaching.backend.model.entity.courses.ObjectiveContents;
import com.teaching.backend.model.vo.CourseObjectivesTreeVO; import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO;
import com.teaching.backend.service.courses.ICourseObjectivesService; import com.teaching.backend.service.courses.ICourseObjectivesService;
import com.teaching.backend.utils.CourseCode; import com.teaching.backend.utils.CourseCode;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -101,7 +99,7 @@ public class CourseObjectivesServiceImpl extends ServiceImpl<CourseObjectivesMap
throw new BusinessException(ErrorCode.NOT_FOUND_ERROR); throw new BusinessException(ErrorCode.NOT_FOUND_ERROR);
} }
Integer type = courseObjectives.getType(); Integer type = courseObjectives.getType();
if (type == null){ if (type == CourseCode.Total_EXIT.getValue()){
throw new BusinessException(ErrorCode.OPERATION_ERROR,"课程总目标只需清除所列内容即可!"); throw new BusinessException(ErrorCode.OPERATION_ERROR,"课程总目标只需清除所列内容即可!");
} }
String pid = courseObjectives.getPid(); String pid = courseObjectives.getPid();

@ -23,8 +23,8 @@ import com.teaching.backend.model.entity.courses.ObjectivesType;
import com.teaching.backend.model.entity.umsAdmin.UmsAdmin; import com.teaching.backend.model.entity.umsAdmin.UmsAdmin;
import com.teaching.backend.model.entity.umsAdmin.UmsTeacher; import com.teaching.backend.model.entity.umsAdmin.UmsTeacher;
import com.teaching.backend.model.query.CourseQuery; import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.CourseObjectivesTreeVO; import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO;
import com.teaching.backend.model.vo.CoursesVO; import com.teaching.backend.model.vo.courses.CoursesVO;
import com.teaching.backend.service.courses.ICoursesService; import com.teaching.backend.service.courses.ICoursesService;
import com.teaching.backend.utils.CourseCode; import com.teaching.backend.utils.CourseCode;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -35,7 +35,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -68,6 +67,10 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
@Override @Override
@Transactional @Transactional
public String saveCourseWithObjective(CoursesDTO coursesDTO) { public String saveCourseWithObjective(CoursesDTO coursesDTO) {
String teacher = coursesDTO.getTeacher();
if (teacher == null || teacher.equals("")) {
throw new BusinessException(ErrorCode.TEACHER_NOT_EXIT);
}
Courses courses = new Courses(); Courses courses = new Courses();
CourseObjectives courseObjectives = new CourseObjectives(); CourseObjectives courseObjectives = new CourseObjectives();
BeanUtils.copyProperties(coursesDTO, courses); BeanUtils.copyProperties(coursesDTO, courses);
@ -109,7 +112,11 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
} }
@Override @Override
public PageDTO<CoursesVO> queryCourses(CourseQuery courseQuery, String teacherId) { public PageDTO<CoursesVO> queryCourses(CourseQuery courseQuery) {
String username = courseQuery.getUsername();
if (username==null || username.equals("")){
throw new BusinessException(ErrorCode.TEACHER_NOT_EXIT);
}
//要搜索的课程名字 //要搜索的课程名字
String name = courseQuery.getName(); String name = courseQuery.getName();
// 1.1构建分页条件 // 1.1构建分页条件
@ -119,7 +126,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
.like(name != null, Courses::getName, name) .like(name != null, Courses::getName, name)
// .eq(Courses::getTeacher,teacherId) // .eq(Courses::getTeacher,teacherId)
// .apply("JSON_CONTAINS(teacher, JSON_QUOTE({0}))", teacherId) // .apply("JSON_CONTAINS(teacher, JSON_QUOTE({0}))", teacherId)
.apply("FIND_IN_SET({0}, teacher)", teacherId) .apply("FIND_IN_SET({0}, teacher)", username)
.page(page); .page(page);
PageDTO<CoursesVO> coursesVOPageDTO = PageDTO.of(p, CoursesVO.class); PageDTO<CoursesVO> coursesVOPageDTO = PageDTO.of(p, CoursesVO.class);
List<CoursesVO> pageDTOList = coursesVOPageDTO.getList(); List<CoursesVO> pageDTOList = coursesVOPageDTO.getList();
@ -147,6 +154,9 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
@Override @Override
public void deleteBatchByIds(String id) { public void deleteBatchByIds(String id) {
if(id==null){
throw new BusinessException(ErrorCode.PARAMS_ERROR,"课程id为空");
}
CourseObjectives courseObjectives= courseObjectivesMapper.selectOne CourseObjectives courseObjectives= courseObjectivesMapper.selectOne
(new LambdaQueryWrapper<CourseObjectives>().eq(CourseObjectives::getCourseId, id)); (new LambdaQueryWrapper<CourseObjectives>().eq(CourseObjectives::getCourseId, id));
if(courseObjectives == null){ if(courseObjectives == null){

@ -0,0 +1,169 @@
package com.teaching.backend.service.impl.courses;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.teaching.backend.common.ErrorCode;
import com.teaching.backend.exception.BusinessException;
import com.teaching.backend.mapper.courses.CourseObjectivesMapper;
import com.teaching.backend.mapper.courses.CoursesMapper;
import com.teaching.backend.mapper.courses.ObjectiveContentKnowMapper;
import com.teaching.backend.mapper.courses.ObjectiveContentsMapper;
import com.teaching.backend.mapper.know.KnowMapper;
import com.teaching.backend.model.dto.courses.ObjectiveContentKnowDTO;
import com.teaching.backend.model.entity.courses.CourseObjectives;
import com.teaching.backend.model.entity.courses.ObjectiveContentKnow;
import com.teaching.backend.model.entity.courses.ObjectiveContents;
import com.teaching.backend.model.entity.know.Know;
import com.teaching.backend.model.vo.courses.ObjectiveContentKnowVO;
import com.teaching.backend.service.courses.IObjectiveContentKnowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 服务实现类
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Service
public class ObjectiveContentKnowServiceImpl extends ServiceImpl<ObjectiveContentKnowMapper, ObjectiveContentKnow> implements IObjectiveContentKnowService {
@Autowired
ObjectiveContentKnowMapper objectiveContentKnowMapper;
@Autowired
KnowMapper knowMapper;
@Autowired
CourseObjectivesMapper courseObjectivesMapper;
@Autowired
CoursesMapper coursesMapper;
@Autowired
ObjectiveContentsMapper objectiveContentsMapper;
@Override
@Transactional
public String saveKnowsWithObjectiveOrContent(ObjectiveContentKnowDTO objectiveContentKnowDTO) {
String objectiveOrContent = objectiveContentKnowDTO.getObjectiveOrContent();
if (objectiveOrContent == null || objectiveOrContent.equals("")){
throw new BusinessException(ErrorCode.OBJECTIVE_OR_CONTENT_NOT_EXIT);
}
//暂时约定前端传过来的的knows是“1,2,3” 用 , 隔开的
String knows = objectiveContentKnowDTO.getKnow();
if (knows == null || knows.equals("")){
throw new BusinessException(ErrorCode.KONWID_NOT_EXIT);
}
List<String> knowIds = new ArrayList<>(Arrays.asList(knows.split(",")));
ObjectiveContentKnow objectiveContentKnow = null;
try {
for (String knowId : knowIds) {
objectiveContentKnow = new ObjectiveContentKnow();
objectiveContentKnow.setObjectiveOrContent(objectiveOrContent);
objectiveContentKnow.setKnow(knowId);
objectiveContentKnowMapper.insert(objectiveContentKnow);
}
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(ErrorCode.OBJECTIVE_OR_CONTENT_EXIT);
}
return "添加成功";
}
@Override
public ObjectiveContentKnowVO getCountData(String objectiveOrContentId) {
// 检查objectiveOrContentId是否为空,如果为空则抛出异常
if (objectiveOrContentId == null) {
throw new BusinessException(ErrorCode.OBJECTIVE_OR_CONTENT_NOT_EXIT);
}
// 查询分项目标关联的知识点数据
List<ObjectiveContentKnow> objectiveContentKnows = objectiveContentKnowMapper.selectList(
new LambdaQueryWrapper<ObjectiveContentKnow>()
.eq(ObjectiveContentKnow::getObjectiveOrContent, objectiveOrContentId));
// 创建ObjectiveContentKnowVO对象,并计算相关数据
ObjectiveContentKnowVO objectiveContentKnowVO = createObjectiveContentKnowVO(objectiveOrContentId, objectiveContentKnows);
// 根据分项目标找到课程id
String pid = courseObjectivesMapper.selectOne(new LambdaQueryWrapper<CourseObjectives>()
.eq(CourseObjectives::getId, objectiveOrContentId)).getPid();
String courseId = courseObjectivesMapper.selectOne(new LambdaQueryWrapper<CourseObjectives>()
.eq(CourseObjectives::getId, pid)).getCourseId();
Integer classhours = coursesMapper.selectById(courseId).getClasshours();
// 计算并设置比例(百分比)
BigDecimal percentage = calculatePercentage(objectiveContentKnowVO.getKnowsTime(), classhours);
objectiveContentKnowVO.setPersent(percentage + "%");
// 查找分项目标下的内容
List<ObjectiveContents> objectiveContents = objectiveContentsMapper.selectList(
new LambdaQueryWrapper<ObjectiveContents>()
.eq(ObjectiveContents::getObjectiveId, objectiveOrContentId));
// 如果存在分项目标内容,处理并计算每个内容的相关数据
if (objectiveContents != null && !objectiveContents.isEmpty()) {
List<ObjectiveContentKnowVO> contentKnowVOs = objectiveContents.stream()
.map(content -> createObjectiveContentKnowVO(content.getId(), objectiveContentKnowMapper.selectList(
new LambdaQueryWrapper<ObjectiveContentKnow>()
.eq(ObjectiveContentKnow::getObjectiveOrContent, content.getId())
)))
.collect(Collectors.toList());
// 计算每个内容的比例(百分比)
contentKnowVOs.forEach(contentKnowVO -> {
BigDecimal contentPercentage = calculatePercentage(contentKnowVO.getKnowsTime(), classhours);
contentKnowVO.setPersent(contentPercentage + "%");
});
// 设置内容的知识点数据
objectiveContentKnowVO.setContentKnowsData(contentKnowVOs);
}
// 返回计算结果
return objectiveContentKnowVO;
}
// 创建ObjectiveContentKnowVO对象,并计算知识点数量和总时间
private ObjectiveContentKnowVO createObjectiveContentKnowVO(String objectiveOrContentId, List<ObjectiveContentKnow> objectiveContentKnows) {
ObjectiveContentKnowVO vo = new ObjectiveContentKnowVO();
vo.setObjectiveOrContent(objectiveOrContentId);
vo.setKnowsNumber(objectiveContentKnows.size());
// 计算知识点的总时间
BigDecimal knowsTime = objectiveContentKnows.stream()
.map(contentKnow -> {
Know know = knowMapper.selectOne(new LambdaQueryWrapper<Know>()
.eq(Know::getId, contentKnow.getKnow()));
if (know == null) {
throw new BusinessException(ErrorCode.KNOW_NOT_EXIT);
}
return know.getHour();
})
.reduce(BigDecimal.ZERO, BigDecimal::add);
vo.setKnowsTime(knowsTime);
return vo;
}
// 计算知识点时间占总学时的比例,并转换为百分比
private BigDecimal calculatePercentage(BigDecimal knowsTime, Integer classhours) {
if (classhours == null || classhours == 0) {
return BigDecimal.ZERO;
}
// 将classhours转换为BigDecimal类型,以便进行精确计算
BigDecimal classHoursBigDecimal = new BigDecimal(classhours);
// 计算knowsTime占classhours的比例,保留两位小数,并四舍五入
return knowsTime.divide(classHoursBigDecimal, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
}
}

@ -0,0 +1,124 @@
package com.teaching.backend.service.impl.courses;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.teaching.backend.common.ErrorCode;
import com.teaching.backend.exception.BusinessException;
import com.teaching.backend.mapper.courses.CoursesMapper;
import com.teaching.backend.mapper.courses.StudentCoursesMapper;
import com.teaching.backend.mapper.umsAdmin.UmsAdminMapper;
import com.teaching.backend.mapper.umsAdmin.UmsTeacherMapper;
import com.teaching.backend.model.dto.courses.ObjectiveContentKnowDTO;
import com.teaching.backend.model.dto.courses.PageDTO;
import com.teaching.backend.model.dto.courses.StudentCoursesDTO;
import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.entity.courses.ObjectiveContentKnow;
import com.teaching.backend.model.entity.courses.StudentCourses;
import com.teaching.backend.model.entity.umsAdmin.UmsAdmin;
import com.teaching.backend.model.entity.umsAdmin.UmsTeacher;
import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.courses.CoursesVO;
import com.teaching.backend.service.courses.IStudentCoursesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 服务实现类
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Service
public class StudentCoursesServiceImpl extends ServiceImpl<StudentCoursesMapper, StudentCourses> implements IStudentCoursesService {
@Autowired
StudentCoursesMapper studentCoursesMapper;
@Autowired
UmsAdminMapper umsAdminMapper;
@Autowired
UmsTeacherMapper umsTeacherMapper;
@Autowired
CoursesMapper coursesMapper;
@Override
public String saveCoursesToStudents(StudentCoursesDTO studentCoursesDTO) {
String studentId = studentCoursesDTO.getStudent();
if (studentId == null || studentId.equals("")) {
throw new BusinessException(ErrorCode.STUDENT_NOT_EXIT);
}
//暂时约定前端传过来的的knows是“1,2,3” 用 , 隔开的
String courses = studentCoursesDTO.getCourse();
if (courses == null || courses.equals("")) {
throw new BusinessException(ErrorCode.COURSES_NOT_EXIT);
}
List<String> coursesIds = new ArrayList<>(Arrays.asList(courses.split(",")));
StudentCourses studentCourses = null;
try {
for (String course : coursesIds) {
studentCourses = new StudentCourses();
studentCourses.setStudent(studentId);
studentCourses.setCourse(course);
studentCoursesMapper.insert(studentCourses);
}
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(ErrorCode.OBJECTIVE_OR_CONTENT_EXIT);
}
return "添加成功";
}
@Override
public PageDTO<CoursesVO> queryCourses(CourseQuery courseQuery) {
String username = courseQuery.getUsername();
if (username==null || username.equals("")){
throw new BusinessException(ErrorCode.STUDENT_NOT_EXIT);
}
List<StudentCourses> studentCourses = studentCoursesMapper.selectList(new LambdaQueryWrapper<StudentCourses>()
.eq(StudentCourses::getStudent, username));
List<String> coursesList = studentCourses.stream()
.map(StudentCourses::getCourse)
.collect(Collectors.toList());
//要搜索的课程名字
String name = courseQuery.getName();
// 1.1构建分页条件
Page<Courses> page = courseQuery.toMpPageDefaultSortByCreateTime();
// 2.分页查询
LambdaQueryWrapper<Courses> queryWrapper = new LambdaQueryWrapper<Courses>()
.like(name != null, Courses::getName, name)
.in(Courses::getId, coursesList);
// 3. 执行分页查询
Page<Courses> p = this.coursesMapper.selectPage(page, queryWrapper);
PageDTO<CoursesVO> coursesVOPageDTO = PageDTO.of(p, CoursesVO.class);
List<CoursesVO> pageDTOList = coursesVOPageDTO.getList();
List<String> teachers = null;
for (CoursesVO coursesVO : pageDTOList) {
List<String> teacherNameList = new ArrayList<>();
String teacherIds = coursesVO.getTeacher();
teachers = new ArrayList<>(Arrays.asList(teacherIds.split(",")));
for (String teacher : teachers) {
UmsAdmin umsAdmin = umsAdminMapper.selectOne(new LambdaQueryWrapper<UmsAdmin>().
eq(UmsAdmin::getUsername, teacher));
if (umsAdmin==null){
throw new BusinessException(ErrorCode.OPERATION_ERROR);
}
Long adminId = umsAdmin.getId();
UmsTeacher umsTeacher = umsTeacherMapper.selectOne(new LambdaQueryWrapper<UmsTeacher>()
.eq(UmsTeacher::getUserId, adminId));
teacherNameList.add(umsTeacher.getName());
}
coursesVO.setTeacher(String.join(",", teacherNameList));
}
return coursesVOPageDTO;
}
}

@ -3,21 +3,16 @@ package com.teaching.backend.service.impl.favour;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.ErrorCode; import com.teaching.backend.common.ErrorCode;
import com.teaching.backend.common.ResultUtils;
import com.teaching.backend.exception.BusinessException; import com.teaching.backend.exception.BusinessException;
import com.teaching.backend.mapper.favour.SeCourseFavourMapper; import com.teaching.backend.mapper.favour.SeCourseFavourMapper;
import com.teaching.backend.model.dto.favour.courseFavour.CourseFavourQueryRequest;
import com.teaching.backend.model.entity.courses.Courses; import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.entity.favour.SeCourseFavour; import com.teaching.backend.model.entity.favour.SeCourseFavour;
import com.teaching.backend.model.entity.favour.SeKnowFavour; import com.teaching.backend.model.entity.favour.SeKnowFavour;
import com.teaching.backend.model.entity.favour.SeResourceFavour; import com.teaching.backend.model.entity.favour.SeResourceFavour;
import com.teaching.backend.model.vo.CoursesVO;
import com.teaching.backend.model.vo.favour.CourseFavourDetailVO; import com.teaching.backend.model.vo.favour.CourseFavourDetailVO;
import com.teaching.backend.service.courses.ICoursesService; import com.teaching.backend.service.courses.ICoursesService;
import com.teaching.backend.service.favour.SeCourseFavourService; import com.teaching.backend.service.favour.SeCourseFavourService;
@ -27,8 +22,6 @@ import com.teaching.backend.service.favour.SeResourceFavourService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;

@ -7,6 +7,8 @@ public enum CourseCode {
CONTENT_EXIT(1, "存在内容"), CONTENT_EXIT(1, "存在内容"),
SI_ZHENG_TYPE(1, "思政目标类型"), SI_ZHENG_TYPE(1, "思政目标类型"),
SI_ZHENG_EXIT(1, "思政目标存在"), SI_ZHENG_EXIT(1, "思政目标存在"),
Total_EXIT(0, "课程总目标"),
COURSE_UODATING(1, "课程正在修改中"); COURSE_UODATING(1, "课程正在修改中");

@ -8,9 +8,10 @@ spring:
matching-strategy: ant_path_matcher matching-strategy: ant_path_matcher
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/teaching_db url: jdbc:mysql://127.0.0.1:3306/teaching_db
# url: jdbc:mysql://39.106.16.162:3306/teaching_db
username: root username: root
password: 1234567788 password: root
mybatis: mybatis:
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.teaching.backend.mapper.courses.CourseObjectivesMapper"> <mapper namespace="com.teaching.backend.mapper.courses.CourseObjectivesMapper">
<select id="selectTreeNodes" resultType="com.teaching.backend.model.vo.CourseObjectivesTreeVO" <select id="selectTreeNodes" resultType="com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO"
parameterType="string"> parameterType="string">
with recursive t1 as ( with recursive t1 as (
select * from course_objectives where id=#{courseObjectivesId} select * from course_objectives where id=#{courseObjectivesId}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.teaching.backend.mapper.courses.ObjectiveContentKnowMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.teaching.backend.mapper.courses.StudentCoursesMapper">
</mapper>
Loading…
Cancel
Save