he2802 3 år sedan
förälder
incheckning
20f5336bdb

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -15,10 +15,13 @@ import com.zhongzheng.modules.base.service.ICertificateTpService;
 import com.zhongzheng.modules.base.vo.CertificatePhotoVo;
 import com.zhongzheng.modules.base.vo.CertificateTpVo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
+import com.zhongzheng.modules.course.vo.CourseChapterVo;
+import com.zhongzheng.modules.course.vo.CourseUserEducationTypeVo;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
+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;
@@ -49,6 +52,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
 
     @Autowired
     private IGoodsService iGoodsService;
+    @Autowired
+    private IClassGradeUserService iClassGradeUserService;
 
     @Override
     public CertificateTpVo queryById(Long tpId){
@@ -113,6 +118,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
     @Override
     public String makeCertificatePhoto(ClassGradeUserQueryBo bo) {
         GoodsVo goodsVo = iGoodsService.selectDetail(bo.getGoodsId());
+        List<CourseChapterVo> chapterList =  iClassGradeUserService.findChapterList(bo);
         if(Validator.isNotEmpty(goodsVo.getCertificateIds())){
             String[] s = goodsVo.getCertificateIds().split(",");
             List<Long> tpIds = new ArrayList<>();

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.grade.mapper;
 
+import com.zhongzheng.modules.course.vo.CourseChapterVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -53,4 +54,6 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     List<ClassGradeUserGoodsVo> sendFiveClassGradeUser();
 
     Long selectUserCount(User bo);
+
+    List<CourseChapterVo> findChapterList(ClassGradeUserQueryBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.grade.service;
 
 import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
 import com.zhongzheng.modules.base.vo.UserProfileExportGaiVo;
+import com.zhongzheng.modules.course.vo.CourseChapterVo;
 import com.zhongzheng.modules.grade.bo.*;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.grade.vo.*;
@@ -86,4 +87,6 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 	List<ClassGradeUserGoodsVo> sendFiveClassGradeUser();
 
 	Long selectList(User bo);
+
+	List<CourseChapterVo> findChapterList(ClassGradeUserQueryBo bo);
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -15,6 +15,7 @@ import com.zhongzheng.common.utils.AES;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.common.utils.polyv.PolyvUtils;
+import com.zhongzheng.modules.course.vo.CourseChapterVo;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.*;
@@ -1281,6 +1282,11 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return baseMapper.selectUserCount(bo);
     }
 
+    @Override
+    public List<CourseChapterVo> findChapterList(ClassGradeUserQueryBo bo) {
+        return baseMapper.findChapterList(bo);
+    }
+
     /**
      * 实体类转化成视图对象
      *

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/base/CertificateTpMapper.xml

@@ -51,4 +51,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+
 </mapper>

+ 29 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -149,6 +149,11 @@
         <result property="auditNum" column="audit_num"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseChapterVo" id="CourseChapterResultVo">
+        <result property="chapterId" column="chapter_id"/>
+        <result property="name" column="name"/>
+    </resultMap>
+
     <select id="selectUser" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
             resultMap="ClassGradeUserVoResult">
         SELECT
@@ -898,4 +903,28 @@
             resultMap="ClassGradeUserVoResult">
 
     </select>
+
+    <select id="findChapterList" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultMap="CourseChapterResultVo">
+        SELECT
+            cc.chapter_id,
+            cc.`name`
+        FROM
+            course_module_chapter p
+                LEFT JOIN course_chapter cc ON p.chapter_id = cc.chapter_id
+                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 = #{goodsId}
+          AND m.type IN ( 1 ) UNION
+        SELECT
+            cc.chapter_id,
+            cc.`name`
+        FROM
+            course_menu m
+                LEFT JOIN course_chapter cc ON m.menu_id = cc.chapter_id
+                LEFT JOIN goods_course gc ON gc.course_id = m.course_id
+        WHERE
+            gc.goods_id = #{goodsId}
+          AND m.type IN ( 2 )
+    </select>
 </mapper>