Przeglądaj źródła

add 订单修改班级

he2802 3 lat temu
rodzic
commit
78831d9590

+ 16 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseModuleController.java

@@ -6,6 +6,9 @@ import java.util.Arrays;
 import com.zhongzheng.modules.course.bo.CourseModuleAddBo;
 import com.zhongzheng.modules.course.bo.CourseModuleEditBo;
 import com.zhongzheng.modules.course.bo.CourseModuleQueryBo;
+import com.zhongzheng.modules.course.domain.CourseChapterBusiness;
+import com.zhongzheng.modules.course.domain.CourseModuleBusiness;
+import com.zhongzheng.modules.course.service.ICourseModuleBusinessService;
 import com.zhongzheng.modules.course.service.ICourseModuleService;
 import com.zhongzheng.modules.course.vo.CourseModuleVo;
 import lombok.RequiredArgsConstructor;
@@ -42,6 +45,8 @@ public class CourseModuleController extends BaseController {
 
     private final ICourseModuleService iCourseModuleService;
 
+    private final ICourseModuleBusinessService iCourseModuleBusinessService;
+
     /**
      * 查询课程模块列表
      */
@@ -109,4 +114,15 @@ public class CourseModuleController extends BaseController {
     public AjaxResult<Void> remove(@PathVariable Long[] moduleIds) {
         return toAjax(iCourseModuleService.deleteWithValidByIds(Arrays.asList(moduleIds), true) ? 1 : 0);
     }*/
+
+    /**
+     * 获取课程小节业务层次列表
+     */
+    @ApiOperation("获取课程模块业务层次列表")
+    @PreAuthorize("@ss.hasPermi('system:section:query')")
+    @GetMapping("/business/{moduleId}")
+    public AjaxResult<List<CourseModuleBusiness>> getBusinessList(@PathVariable("moduleId" ) Long moduleId) {
+        List<CourseModuleBusiness> list = iCourseModuleBusinessService.getListById(moduleId);
+        return AjaxResult.success(list);
+    }
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleBusinessMapper.java

@@ -3,6 +3,8 @@ package com.zhongzheng.modules.course.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.domain.CourseModuleBusiness;
 
+import java.util.List;
+
 /**
  * 课程模块适用业务关系Mapper接口
  *
@@ -10,5 +12,5 @@ import com.zhongzheng.modules.course.domain.CourseModuleBusiness;
  * @date 2021-10-09
  */
 public interface CourseModuleBusinessMapper extends BaseMapper<CourseModuleBusiness> {
-
+    List<CourseModuleBusiness> getListById(Long moduleId);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseModuleBusinessService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.course.bo.CourseModuleBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseModuleBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseModuleBusinessQueryBo;
+import com.zhongzheng.modules.course.domain.CourseChapterBusiness;
 import com.zhongzheng.modules.course.domain.CourseModuleBusiness;
 import com.zhongzheng.modules.course.vo.CourseModuleBusinessVo;
 
@@ -23,6 +24,8 @@ public interface ICourseModuleBusinessService extends IService<CourseModuleBusin
 	 */
 	CourseModuleBusinessVo queryById(Long id);
 
+	List<CourseModuleBusiness> getListById(Long moduleId);
+
 	/**
 	 * 查询列表
 	 */

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleBusinessServiceImpl.java

@@ -10,6 +10,8 @@ import com.zhongzheng.modules.course.domain.CourseModuleBusiness;
 import com.zhongzheng.modules.course.mapper.CourseModuleBusinessMapper;
 import com.zhongzheng.modules.course.service.ICourseModuleBusinessService;
 import com.zhongzheng.modules.course.vo.CourseModuleBusinessVo;
+import com.zhongzheng.modules.grade.service.IClassGradeUserService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -29,12 +31,20 @@ import java.util.stream.Collectors;
 @Service
 public class CourseModuleBusinessServiceImpl extends ServiceImpl<CourseModuleBusinessMapper, CourseModuleBusiness> implements ICourseModuleBusinessService {
 
+    @Autowired
+    private CourseModuleBusinessMapper courseModuleBusinessMapper;
+
     @Override
     public CourseModuleBusinessVo queryById(Long id){
         CourseModuleBusiness db = this.baseMapper.selectById(id);
         return BeanUtil.toBean(db, CourseModuleBusinessVo.class);
     }
 
+    @Override
+    public List<CourseModuleBusiness> getListById(Long moduleId) {
+        return courseModuleBusinessMapper.getListById(moduleId);
+    }
+
     @Override
     public List<CourseModuleBusinessVo> queryList(CourseModuleBusinessQueryBo bo) {
         LambdaQueryWrapper<CourseModuleBusiness> lqw = Wrappers.lambdaQuery();

+ 23 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleBusinessMapper.xml

@@ -11,7 +11,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="businessId" column="business_id"/>
         <result property="subjectId" column="subject_id"/>
         <result property="projectId" column="project_id"/>
+
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+        <result property="subjectName" column="subject_name"/>
     </resultMap>
 
 
+
+    <select id="getListById" parameterType="Long"  resultMap="CourseModuleBusinessResult">
+        SELECT
+            cmb.*,
+            cet.education_name,
+            cpt.project_name,
+            cb.business_name,
+            cs.subject_name
+        FROM
+            course_module_business cmb
+                LEFT JOIN course_education_type cet ON cmb.education_type_id = cet.id
+                LEFT JOIN course_project_type cpt ON cmb.project_id = cpt.id
+                LEFT JOIN course_business cb ON cmb.business_id = cb.id
+                LEFT JOIN course_subject cs ON cmb.subject_id = cs.id
+        WHERE
+            cmb.module_id =#{module_id}
+    </select>
+
 </mapper>