he2802 3 éve
szülő
commit
9c7bb4c0a6
14 módosított fájl, 119 hozzáadás és 12 törlés
  1. 19 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonCourseController.java
  2. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseMenuExamAddBo.java
  3. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseMenuExam.java
  4. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java
  5. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java
  6. 0 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java
  7. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java
  8. 3 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseMenuExamVo.java
  9. 24 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserModuleChapterVo.java
  10. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsCourseTeacherItemBo.java
  11. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml
  12. 48 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml
  13. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsCourseMapper.xml
  14. 6 1
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsCourseTeacherMapper.xml

+ 19 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonCourseController.java

@@ -19,12 +19,16 @@ import com.zhongzheng.modules.course.service.ICourseMenuService;
 import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
 import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
+import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherQueryBo;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
+import com.zhongzheng.modules.goods.service.IGoodsCourseTeacherService;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
+import com.zhongzheng.modules.goods.vo.GoodsCourseTeacherVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -45,9 +49,13 @@ import java.util.List;
 public class CommonCourseController extends BaseController {
 
     private final ICourseModuleChapterService iCourseModuleChapterService;
+
     private final ICourseMenuService iCourseMenuService;
+
     private final ICourseChapterSectionService iCourseChapterSectionService;
 
+    private final IGoodsCourseTeacherService iGoodsCourseTeacherService;
+
 
 
     /**
@@ -80,5 +88,16 @@ public class CommonCourseController extends BaseController {
     }
 
 
+    /**
+     * 查询商品课程双师资绑定列表
+     */
+    @ApiOperation("查询商品课程双师资绑定列表")
+    @PreAuthorize("@ss.hasPermi('system:teacher:list')")
+    @GetMapping("/teacher/list")
+    public AjaxResult<List<GoodsCourseTeacherVo>> list(GoodsCourseTeacherQueryBo bo) {
+        bo.setStatus(1);
+        List<GoodsCourseTeacherVo> list = iGoodsCourseTeacherService.queryList(bo);
+        return AjaxResult.success(list);
+    }
 
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseMenuExamAddBo.java

@@ -30,8 +30,8 @@ public class CourseMenuExamAddBo {
     /** 节ID */
     @ApiModelProperty("节ID")
     private Long sectionId;
-    /** 题卷类型 1试卷 2章卷 3模块卷 */
-    @ApiModelProperty("题卷类型 1试卷 2章卷 3模块卷")
+    /** 题卷类型 1章卷 2节卷 3模块卷 */
+    @ApiModelProperty("题卷类型 1章卷 2节卷 3模块卷")
     private Integer type;
     /** 卷ID */
     @ApiModelProperty("卷ID")

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseMenuExam.java

@@ -34,7 +34,7 @@ private static final long serialVersionUID=1L;
     private Long chapterId;
     /** 节ID */
     private Long sectionId;
-    /** 题卷类型 1试卷 2章卷 3模块卷 */
+    /** 题卷类型 1章卷 2节卷 3模块卷 */
     private Integer type;
     /** 卷ID */
     private Long examId;

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java

@@ -5,6 +5,7 @@ import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.domain.CourseModuleChapter;
 import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
 import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
+import com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo;
 import com.zhongzheng.modules.course.vo.CourseUserModuleChapterVo;
 import org.apache.ibatis.annotations.Param;
 
@@ -22,4 +23,6 @@ public interface CourseModuleChapterMapper extends BaseMapper<CourseModuleChapte
     List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo);
 
     Integer rebuildChapterCheck(@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("gradeId") Long gradeId,@Param("userId") Long userId);
+
+    List<CourseUserModuleChapterVo> examList(CourseMenuQueryBo bo);
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -146,8 +146,8 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
         if (!CollectionUtils.isEmpty(courseUserChapterSectionVos)) {
             bo.setModuleId(courseUserChapterSectionVos.get(0).getModuleId());
             bo.setChapterId(courseUserChapterSectionVos.get(0).getChapterId());
+            courseUserChapterSectionVos.addAll(courseChapterSectionMapper.examList(bo));
         }
-        courseUserChapterSectionVos.addAll(courseChapterSectionMapper.examList(bo));
         if (bo.getUserId() != null) {
             for (CourseUserChapterSectionVo courseMenuVo : courseUserChapterSectionVos) {
                 if (courseMenuVo.getType().equals(1)) {

+ 0 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java

@@ -125,7 +125,6 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
                 Collection<CourseMenuExam> coll = new HashSet<>();
                 for(int i=0;i<bo.getMenuExamList().size();i++){
                     CourseMenuExam addItem = BeanUtil.toBean(bo.getMenuExamList().get(i), CourseMenuExam.class);
-                    addItem.setType(1);
                     addItem.setCourseId(bo.getCourseId());
                     addItem.setCreateTime(DateUtils.getNowTime());
                     addItem.setUpdateTime(DateUtils.getNowTime());
@@ -188,7 +187,6 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
             Collection<CourseMenuExam> coll = new HashSet<>();
             for(int i=0;i<bo.getMenuExamList().size();i++){
                 CourseMenuExam addItem = BeanUtil.toBean(bo.getMenuExamList().get(i), CourseMenuExam.class);
-                addItem.setType(1);
                 addItem.setCourseId(bo.getCourseId());
                 addItem.setCreateTime(DateUtils.getNowTime());
                 addItem.setUpdateTime(DateUtils.getNowTime());

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.CourseModuleChapter;
@@ -107,6 +108,10 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
     @Override
     public List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo) {
         List<CourseUserModuleChapterVo> courseUserModuleChapterVos = baseMapper.chapterList(bo);
+        if (!CollectionUtils.isEmpty(courseUserModuleChapterVos)) {
+            courseUserModuleChapterVos.addAll(baseMapper.examList(bo));
+        }
+
         //获得重修目录
         if (bo.getRebuild() != null && bo.getRebuild() == 1){
             for (CourseUserModuleChapterVo courseUserModuleChapterVo : courseUserModuleChapterVos) {

+ 3 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseMenuExamVo.java

@@ -40,9 +40,9 @@ public class CourseMenuExamVo {
 	@Excel(name = "节ID")
 	@ApiModelProperty("节ID")
 	private Long sectionId;
-	/** 题卷类型 1试卷 2章卷 3模块卷 */
-	@Excel(name = "题卷类型 1试卷 2章卷 3模块卷")
-	@ApiModelProperty("题卷类型 1试卷 2章卷 3模块卷")
+	/** 题卷类型 1章卷 2节卷 3模块卷 */
+	@Excel(name = "题卷类型 1章卷 2节卷 3模块卷")
+	@ApiModelProperty("题卷类型 1章卷 2节卷 3模块卷")
 	private Integer type;
 	/** 卷ID */
 	@Excel(name = "卷ID")

+ 24 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserModuleChapterVo.java

@@ -75,4 +75,28 @@ public class CourseUserModuleChapterVo {
 	@Excel(name = "章下面的节")
 	@ApiModelProperty("章下面的节")
 	private List<CourseChapterSectionVo> courseChapterSectionList;
+
+	/** 节id */
+	@Excel(name = "节id")
+	@ApiModelProperty("节id 试卷ID")
+	private Long typeId;
+
+	@Excel(name = "1 章 2试卷")
+	@ApiModelProperty("1 章 2试卷")
+	private Integer type;
+
+
+
+	@ApiModelProperty("做卷类型  1练习 2考试")
+	private Long doType;
+
+	@ApiModelProperty("分数")
+	private Long performance;
+
+	@ApiModelProperty("1及格 0不及格")
+	private Integer reportStatus;
+	@ApiModelProperty("回答次数")
+	private Long answerNum;
+	@ApiModelProperty("做次数")
+	private Long doNum;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsCourseTeacherItemBo.java

@@ -25,5 +25,10 @@ public class GoodsCourseTeacherItemBo {
     private String courseName;
     @ApiModelProperty("课程编码")
     private String code;
+    @ApiModelProperty("科目ID")
+    private Long subjectId;
+    /** 科目名称 */
+    @ApiModelProperty("科目名称")
+    private String subjectName;
 
 }

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -155,10 +155,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where 1=1
           and cme.chapter_id = #{chapterId}
           and cme.course_id = #{courseId}
+         and cme.type = 1
         <if test="moduleId == null ">
             and cme.module_id = #{moduleId}
         </if>
-
     </select>
 
     <select id="getListTotalTime" parameterType="Long"  resultType="java.lang.Long">

+ 48 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml

@@ -37,6 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="status" column="status"/>
         <result property="publishStatus" column="publish_status"/>
         <result property="courseId" column="course_id"/>
+
+        <result property="performance" column="performance"/>
+        <result property="reportStatus" column="report_status"/>
+        <result property="answerNum" column="answer_num"/>
+        <result property="doNum" column="do_num"/>
+        <result property="type" column="type"/>
+        <result property="typeId" column="type_id"/>
     </resultMap>
 
     <select id="getListById" parameterType="Long"  resultMap="CourseModuleChapterResultVo">
@@ -62,7 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             cmc.sort AS c_sort,
             cmc.id,
             cmc.module_id,
+            cmc.chapter_id as type_id,
             #{gradeId} as grade_id,
+            1 as type,
             #{courseId} as course_id
         FROM
             course_module_chapter cmc
@@ -74,6 +83,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             cmc.sort
     </select>
 
+    <select id="examList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseUserModuleChapterVo">
+        SELECT
+        e.*,
+        cme.course_id,
+        cme.module_id,
+        cme.chapter_id,
+        cme.section_id,
+        e.exam_name as name,
+        e.answer_num,
+        (SELECT
+        count(*)
+        FROM
+        user_bank_record ubr
+        WHERE
+        ubr.user_id = #{userId}
+        AND ubr.module_exam_id = e.exam_id
+        AND grade_id = #{gradeId}) do_num,
+        e.exam_id as type_id,
+        #{gradeId} as grade_id,
+        2 as type,
+        ubr1.report_status,
+        ubr1.performance
+        FROM
+        exam e
+        LEFT JOIN course_menu_exam cme ON cme.exam_id = e.exam_id
+        LEFT JOIN (SELECT
+        any_value ( ubr.report_status ) report_status,
+        any_value ( ubr.performance ) performance,
+        ubr.module_exam_id
+        FROM
+        ( SELECT record_id, report_status, module_exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} ORDER BY record_id DESC LIMIT 9999 ) ubr
+        GROUP BY
+        ubr.module_exam_id)ubr1 on e.exam_id = ubr1.module_exam_id
+        where 1=1
+        and cme.course_id = #{courseId}
+        and cme.type = 3
+        and cme.module_id = #{moduleId}
+    </select>
+
     <select id="rebuildChapterCheck" parameterType="map"  resultType="Integer">
         SELECT
             COUNT(up.id)

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsCourseMapper.xml

@@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         s.school_name,
         m.category_name,
         cs.subject_name,
-               gc.sort as g_sort,
+        gc.sort as g_sort,
         c.course_show,
         (SELECT count(*) from goods_course_teacher gct where gct.goods_id = gc.goods_id and  FIND_IN_SET(gc.course_id,gct.course_ids) and gct.status =1 ) bind_status
         FROM

+ 6 - 1
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsCourseTeacherMapper.xml

@@ -28,6 +28,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="courseName" column="course_name"/>
         <result property="aliasName" column="alias_name"/>
         <result property="code" column="code"/>
+        <result property="subjectId" column="subject_id"/>
+        <result property="subjectName" column="subject_name"/>
     </resultMap>
 
     <select id="findCourseList"  resultMap="GoodsCourseTeacherItemResult">
@@ -35,10 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             gc.course_id,
             gc.alias_name,
             c.course_name,
-            c.code
+            c.code,
+            cs.subject_name,
+            c.subject_id
         FROM
             goods_course gc
                 LEFT JOIN course c ON gc.course_id = c.course_id
+                LEFT JOIN course_subject cs ON cs.id = c.subject_id
         WHERE
             gc.goods_id = #{goodsId}
           AND FIND_IN_SET(