diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hezhi/controller/TbCourseController.java b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/controller/TbCourseController.java index 87d508b5cd6252818518849da63c3396c2935698..5e266d52b2c2b1f2836b135c5d33c13f8386f862 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/hezhi/controller/TbCourseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/controller/TbCourseController.java @@ -114,6 +114,22 @@ public class TbCourseController extends BaseController return AjaxResult.success(); } + /** + * 新增课程 + */ + @PreAuthorize("@ss.hasPermi('hezhi:course:add')") + @Log(title = "课程-专业介绍", businessType = BusinessType.INSERT) + @PostMapping("/addCourseMajor") + public AjaxResult addCourseMajor(@RequestBody TbCourse tbCourse) + { + TbCourse course = tbCourseService.selectTbCourseByCourseId(tbCourse.getCourseId()); + if (null == course) { + return AjaxResult.error("课程不存在,请检查后重试"); + } + tbCourseService.updateTbCourseById(tbCourse); + return AjaxResult.success(); + } + /** * 修改课程 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbCourse.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbCourse.java index c503eef765a63b7f32df81a65591c0c75c0924a3..820516967d60fd1d753f0b492e247d282e71c369 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbCourse.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbCourse.java @@ -174,4 +174,22 @@ public class TbCourse extends BaseEntity @Excel(name = "参考资料") private String courseInformation; + /** 专业介绍 */ + private String majorDetails; + + /** 研究方向 */ + private String majorOverview; + + /** 实践环节 */ + private String majorSyllabus; + + /** 就业方向 */ + private String majorKnowledge; + + /** 政策支持 */ + private String majorCertificate; + + /** 证书样本 */ + private String majorInformation; + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbMajorClass.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbMajorClass.java index 348489465751b4542c0246017cff41f194876414..fdab18fd47d24cfcc840b97a3e31961fc867b644 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbMajorClass.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbMajorClass.java @@ -83,24 +83,6 @@ public class TbMajorClass extends TreeEntity /** 删除标记(0-正常,1-删除) */ private Integer delFlag; - /** 专业详情 */ - private String majorDetails; - - /** 专业概述 */ - private String majorOverview; - - /** 专业大纲 */ - private String majorSyllabus; - - /** 预备知识 */ - private String majorKnowledge; - - /** 证书要求 */ - private String majorCertificate; - - /** 参考资料 */ - private String majorInformation; - private List childrenList; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/ITbCourseService.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/ITbCourseService.java index ecf1e29fb3682dd9ab97804be19b5d3ee281631c..3fe795dd9dbce86c72145f2150657467fd847576 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/ITbCourseService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/ITbCourseService.java @@ -56,6 +56,14 @@ public interface ITbCourseService */ public int updateTbCourse(TbCourse tbCourse); + /** + * 修改课程 + * + * @param tbCourse 课程 + * @return 结果 + */ + public int updateTbCourseById(TbCourse tbCourse); + /** * 批量删除课程 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbCourseServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbCourseServiceImpl.java index 2d6765d0ed730784895ee05e1b04917f26cd6834..7feea3855f48c67c4ba779c973a7373d7908b1d9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbCourseServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbCourseServiceImpl.java @@ -133,6 +133,20 @@ public class TbCourseServiceImpl implements ITbCourseService return tbCourseMapper.updateTbCourse(tbCourse); } + + /** + * 修改课程 + * + * @param tbCourse 课程 + * @return 结果 + */ + @Override + public int updateTbCourseById(TbCourse tbCourse) + { + tbCourse.setUpdateTime(DateUtils.getNowDate()); + return tbCourseMapper.updateTbCourse(tbCourse); + } + /** * 批量删除课程 * diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbCourseMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbCourseMapper.xml index 7ebbd6def738fdb5a489d9b472e53566ff1a8cca..80a4e2f5dde6f6c1a6fa91444998bd7a385ed781 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbCourseMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbCourseMapper.xml @@ -45,6 +45,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + @@ -56,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tc.course_arrange, tc.participate_num, tc.course_details, tc.course_overview, tc.course_syllabus, tc.course_knowledge, tc.course_team, tc.tag_name, tc.teacher_ids, tc.remarks, tc.sort, tc.status, tc.publication_time, tc.publisher, tc.create_time, tc.create_by, tc.update_time, tc.update_by, tc.delete_time, tc.delete_by, tc.del_flag, + tc.major_details, tc.major_overview, tc.major_syllabus, tc.major_knowledge, tc.major_certificate, tc.major_information, ( select GROUP_CONCAT(tct.type_name SEPARATOR '、') from tb_type_course ttc @@ -242,6 +249,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_recommend = #{isRecommend}, course_certificate = #{courseCertificate}, course_information = #{courseInformation}, + major_details = #{majorDetails}, + major_overview = #{majorOverview}, + major_syllabus = #{majorSyllabus}, + major_knowledge = #{majorKnowledge}, + major_certificate = #{majorCertificate}, + major_information = #{majorInformation}, where course_id = #{courseId} diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml index 1103208c93f0ff2c4d3f10c8fec24bb21d8d1117..9af4c2621bea7c6728a64082dc40a33c19b066f9 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml @@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select major_id, pid, level, type, major_name, major_logo_one, major_logo_two, is_recommend, remarks, sort, status, publication_time, publisher, create_time, create_by, update_time, update_by, delete_time, delete_by, del_flag, major_details, major_overview, major_syllabus, major_knowledge, major_certificate, major_information from tb_major_class + select major_id, pid, level, type, major_name, major_logo_one, major_logo_two, is_recommend, remarks, sort, status, publication_time, publisher, create_time, create_by, update_time, update_by, delete_time, delete_by, del_flag from tb_major_class