ソースを参照

fix 双师资

he2802 3 年 前
コミット
499b1a2622

+ 9 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -119,6 +119,15 @@ public class CourseController extends BaseController {
         return AjaxResult.success(list);
     }
 
+    @ApiOperation("查询章下的节卷列表")
+    @GetMapping("/sectionExamList")
+    public AjaxResult<List<CourseUserChapterSectionVo>> sectionExamList(CourseMenuQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        List<CourseUserChapterSectionVo> list = iCourseChapterSectionService.sectionExamList(bo);
+        return AjaxResult.success(list);
+    }
+
     /**
      * 获取课程小节观看权限
      */

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java

@@ -26,6 +26,8 @@ public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSect
 
     List<CourseUserChapterSectionVo> examList(CourseMenuQueryBo bo);
 
+    List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo);
+
     Integer rebuildCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
                          @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
 

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

@@ -58,4 +58,6 @@ public interface ICourseChapterSectionService extends IService<CourseChapterSect
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
     List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo);
+
+	List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo);
 }

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

@@ -189,4 +189,9 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
         }
         return courseUserChapterSectionVos;
     }
+
+    @Override
+    public List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo) {
+        return baseMapper.sectionExamList(bo);
+    }
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -324,6 +324,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         update.setUpdateTime(DateUtils.getNowTime());
         //课程列表
         if(bo.getCourseList()!=null){
+            GoodsCourseQueryBo courseQueryBo = new GoodsCourseQueryBo();
+            courseQueryBo.setGoodsId(bo.getGoodsId());
+            List<GoodsCourseVo> courseVoList = iGoodsCourseService.queryList(courseQueryBo);
             iGoodsCourseService.remove(new LambdaQueryWrapper<GoodsCourse>().eq(GoodsCourse::getGoodsId, bo.getGoodsId()));
             Collection<GoodsCourse> coll = new HashSet<>();
             for(int i=0;i<bo.getCourseList().size();i++){
@@ -332,6 +335,10 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 addItem.setGoodsId(update.getGoodsId());
                 addItem.setCourseId(item.getCourseId());
                 addItem.setSort(item.getSort());
+                Optional<GoodsCourseVo> first = courseVoList.stream().filter(course -> Objects.equals(course.getCourseId(),item.getCourseId())).findFirst();
+                if (first.isPresent()) {
+                    addItem.setAliasName(first.get().getAliasName());
+                }
                 coll.add(addItem);
             }
             iGoodsCourseService.saveBatch(coll);

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserBankRecordAddBo.java

@@ -69,4 +69,8 @@ public class UserBankRecordAddBo {
     /** 准确率 */
     @ApiModelProperty("准确率")
     private BigDecimal rightRate;
+    /** 题卷类型 1章卷 2节卷 3模块卷 */
+    @ApiModelProperty("题卷类型 1章卷 2节卷 3模块卷")
+    private Integer type;
+
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserBankRecordEditBo.java

@@ -72,4 +72,8 @@ public class UserBankRecordEditBo {
     /** 准确率 */
     @ApiModelProperty("准确率")
     private BigDecimal rightRate;
+    /** 题卷类型 1章卷 2节卷 3模块卷 */
+    @ApiModelProperty("题卷类型 1章卷 2节卷 3模块卷")
+    private Integer type;
+
 }

+ 4 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserBankRecordQueryBo.java

@@ -35,9 +35,9 @@ public class UserBankRecordQueryBo extends BaseEntity {
 	private String isAsc;
 
 
-	/** 1真题模拟考试 2试卷练习 3真题练习 */
-	@ApiModelProperty("1真题模拟考试 2试卷练习 3真题练习")
-	private Long type;
+	/** 题卷类型 1章卷 2节卷 3模块卷 */
+	@ApiModelProperty("题卷类型 1章卷 2节卷 3模块卷")
+	private Integer type;
 	/** 真题模拟ID */
 	@ApiModelProperty("真题模拟ID")
 	private Long simulateId;
@@ -79,4 +79,5 @@ public class UserBankRecordQueryBo extends BaseEntity {
 	private Long gradeId;
 	private Integer currentStatus;
 
+
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserBankRecord.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.user.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -62,4 +63,7 @@ private static final long serialVersionUID=1L;
     private Integer currentStatus;
     /** 准确率 */
     private BigDecimal rightRate;
+
+    /** 题卷类型 1章卷 2节卷 3模块卷 */
+    private Integer type;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserBankRecordVo.java

@@ -89,4 +89,8 @@ public class UserBankRecordVo {
 	@Excel(name = "当前状态 1 当前状态 0过往状态")
 	@ApiModelProperty("当前状态 1 当前状态 0过往状态")
 	private Integer currentStatus;
+	/** 题卷类型 1章卷 2节卷 3模块卷 */
+	@ApiModelProperty("题卷类型 1章卷 2节卷 3模块卷")
+	private Integer type;
+
 }

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

@@ -135,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 WHERE
                     ubr.user_id = #{userId}
                   AND ubr.exam_id = e.exam_id
-                  AND grade_id = #{gradeId}) do_num,
+                  AND grade_id = #{gradeId} and `type` = 1) do_num,
             e.exam_id as type_id,
             #{gradeId} as grade_id,
             2 as type,
@@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                                any_value ( ubr.performance ) performance,
                                ubr.exam_id
                            FROM
-                               ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} ORDER BY record_id DESC LIMIT 9999 ) ubr
+                               ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} and `type` = 1 ORDER BY record_id DESC LIMIT 9999 ) ubr
                            GROUP BY
                                ubr.exam_id)ubr1 on e.exam_id = ubr1.exam_id
         where 1=1
@@ -161,6 +161,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+    <select id="sectionExamList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseUserChapterSectionVo">
+        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.exam_id = e.exam_id
+        AND grade_id = #{gradeId} and `type` = 2) 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.exam_id
+        FROM
+        ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} and `type` = 2 ORDER BY record_id DESC LIMIT 9999 ) ubr
+        GROUP BY
+        ubr.exam_id)ubr1 on e.exam_id = ubr1.exam_id
+        where 1=1
+        and cme.chapter_id = #{chapterId}
+        and cme.course_id = #{courseId}
+        and cme.type = 2
+        <if test="moduleId == null ">
+            and cme.module_id = #{moduleId}
+        </if>
+    </select>
+
     <select id="getListTotalTime" parameterType="Long"  resultType="java.lang.Long">
         SELECT
             IFNULL(sum( cs.duration_time ),0) AS duration_time

+ 6 - 5
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="sort" column="c_sort"/>
         <result property="id" column="id"/>
         <result property="gradeId" column="grade_id"/>
+        <result property="moduleId" column="module_id"/>
 
         <result property="code" column="code"/>
         <result property="name" column="name"/>
@@ -98,8 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         user_bank_record ubr
         WHERE
         ubr.user_id = #{userId}
-        AND ubr.module_exam_id = e.exam_id
-        AND grade_id = #{gradeId}) do_num,
+        AND ubr.exam_id = e.exam_id
+        AND grade_id = #{gradeId} and `type` = 3) do_num,
         e.exam_id as type_id,
         #{gradeId} as grade_id,
         2 as type,
@@ -111,11 +112,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN (SELECT
         any_value ( ubr.report_status ) report_status,
         any_value ( ubr.performance ) performance,
-        ubr.module_exam_id
+        ubr.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
+        ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} and `type` = 3 ORDER BY record_id DESC LIMIT 9999 ) ubr
         GROUP BY
-        ubr.module_exam_id)ubr1 on e.exam_id = ubr1.module_exam_id
+        ubr.exam_id)ubr1 on e.exam_id = ubr1.exam_id
         where 1=1
         and cme.course_id = #{courseId}
         and cme.type = 3

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

@@ -164,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ,(SELECT COUNT(m.id)+(SELECT COUNT(p.id) FROM course_module_chapter p LEFT JOIN course_menu m on m.menu_id = p.module_id LEFT JOIN goods_course gc on gc.course_id = m.course_id  where gc.goods_id =  g.goods_id and m.type in(1))+(SELECT COUNT(cmc.id) FROM course_module_chapter cmc  LEFT JOIN course_menu m on m.menu_id = cmc.module_id LEFT JOIN goods_course gc on gc.course_id = m.course_id where gc.goods_id =  g.goods_id and m.type in(2)) FROM course_menu m LEFT JOIN goods_course gc on gc.course_id = m.course_id  where gc.goods_id =  g.goods_id  and m.type in(3)) as chapter_num
         </if>
         <if test="goodsType ==1">
-        , (SELECT count(*) FROM goods_course where goods_id =g.goods_id ) as course_num
+        , (SELECT count(*) FROM goods_course where goods_id =g.goods_id  and course_show=1) as course_num
         , (SELECT count(*) FROM class_grade cg  LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id where  cgg.goods_id = g.goods_id and cg.`status` = 1 ) as grade_num
         </if>
         <if test="goodsType ==2">