he2802 преди 3 години
родител
ревизия
a0ddf27a15
променени са 36 файла, в които са добавени 330 реда и са изтрити 52 реда
  1. 10 5
      zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/ExamController.java
  2. 6 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/exam/ExamPaperController.java
  3. 11 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserExamRecordController.java
  4. 9 1
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java
  5. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamMapper.java
  6. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamService.java
  7. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java
  8. 0 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  9. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseMenuQueryBo.java
  10. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java
  11. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java
  12. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java
  13. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java
  14. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserChapterSectionVo.java
  15. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserMenuVo.java
  16. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserModuleChapterVo.java
  17. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamPaperQueryBo.java
  18. 4 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamPaperMapper.java
  19. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamPaperService.java
  20. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamPaperServiceImpl.java
  21. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java
  22. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  23. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserExamRecordMapper.java
  24. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java
  25. 46 39
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserExamRecordService.java
  26. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java
  27. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserExamRecordServiceImpl.java
  28. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  29. 48 0
      zhongzheng-system/src/main/resources/mapper/modules/bank/ExamMapper.xml
  30. 19 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml
  31. 3 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  32. 26 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml
  33. 47 0
      zhongzheng-system/src/main/resources/mapper/modules/exam/ExamPaperMapper.xml
  34. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  35. 13 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml
  36. 12 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

+ 10 - 5
zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/ExamController.java

@@ -15,6 +15,7 @@ import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
 import com.zhongzheng.modules.bank.vo.ExamVo;
+import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -46,10 +47,6 @@ public class ExamController extends BaseController {
     private final IQuestionChapterExamService iQuestionChapterExamService;
 
 
-
-
-
-
     private final WxTokenService wxTokenService;
 
     /**
@@ -57,7 +54,7 @@ public class ExamController extends BaseController {
      */
     @ApiOperation("获取试卷详细信息")
     @GetMapping("/{examId}")
-    public AjaxResult<ExamVo> getInfo(@PathVariable("examId" ) Long examId) {
+    public AjaxResult<ExamVo> getInfo(@PathVariable("examId") Long examId) {
         return AjaxResult.success(iExamService.queryById(examId));
     }
 
@@ -82,4 +79,12 @@ public class ExamController extends BaseController {
         return AjaxResult.success(iExamService.getNextExam(bo));
     }
 
+
+    @ApiOperation("通过试卷类型获取商品试卷列表")
+    @GetMapping("/getPaperExamList")
+    public AjaxResult<List<ExamVo>> getPaperExamList(ExamPaperQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iExamService.getPaperExamList(bo));
+    }
 }

+ 6 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/exam/ExamPaperController.java

@@ -47,5 +47,11 @@ public class ExamPaperController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("查询商品试卷类型列表")
+    @GetMapping("/goodsExamPaper/{goodsId}")
+    public AjaxResult<List<ExamPaperVo>> goodsExamPaper(@PathVariable("goodsId" ) Long goodsId) {
+        List<ExamPaperVo> list = iExamPaperService.getGoodsExamPaper(goodsId);
+        return AjaxResult.success(list);
+    }
 
 }

+ 11 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserExamRecordController.java

@@ -174,4 +174,15 @@ public class UserExamRecordController extends BaseController {
         List<UserExamWrongRecordVo> list = iUserExamRecordService.getExamRecordWrongList(bo);
         return getDataTable(list);
     }
+
+    /**
+     * 获取用户最后一次做的题库试卷信息
+     */
+    @ApiOperation("获取用户最后一次做的题库试卷信息")
+    @GetMapping("/getUserDoLast")
+    public AjaxResult<UserExamRecordVo> getUserDoLast(UserExamRecordQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iUserExamRecordService.getUserDoLast(bo));
+    }
 }

+ 9 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java

@@ -149,6 +149,14 @@ public class UserStudyRecordController extends BaseController {
         return AjaxResult.success(iUserStudyRecordService.getLastLive(bo));
     }
 
+    @ApiOperation("查询用户最后一次看的录播的信息")
+    @GetMapping("/getUserWatchLast")
+    public AjaxResult<SectionStudyRecordVo> getUserWatchLast(UserStudyRecordQueryBo bo){
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iUserStudyRecordService.getUserWatchLast(bo));
+    }
+
     @ApiOperation("查询保利威直播间的播放状态")
     @GetMapping("/getChannelBasicInfo")
     public AjaxResult<LiveChannelBasicInfoResponse> getChannelBasicInfo(PolyvLiveQueryBo bo) throws Exception {
@@ -157,7 +165,7 @@ public class UserStudyRecordController extends BaseController {
 
     @ApiOperation("查询用户最后一次看的直播节的信息")
     @GetMapping("/queryLiveLast")
-    public AjaxResult<UserStudyRecordVo> queryLiveLast(UserStudyRecordQueryBo bo) throws Exception {
+    public AjaxResult<UserStudyRecordVo> queryLiveLast(UserStudyRecordQueryBo bo){
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         bo.setUserId(loginUser.getUser().getUserId());
         return AjaxResult.success(iUserStudyRecordService.queryLiveLast(bo));

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamMapper.java

@@ -6,6 +6,7 @@ import com.zhongzheng.modules.bank.bo.QuestionQueryBo;
 import com.zhongzheng.modules.bank.domain.Exam;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionVo;
+import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
 
 import java.util.List;
 
@@ -17,4 +18,5 @@ import java.util.List;
  */
 public interface ExamMapper extends BaseMapper<Exam> {
     List<ExamVo> getList(ExamQueryBo bo);
+    List<ExamVo> getPaperExamList(ExamPaperQueryBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamService.java

@@ -7,6 +7,7 @@ import com.zhongzheng.modules.bank.bo.ExamQueryBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
 import com.zhongzheng.modules.bank.domain.Exam;
 import com.zhongzheng.modules.bank.vo.ExamVo;
+import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
 
 import java.util.Collection;
 import java.util.List;
@@ -55,4 +56,6 @@ public interface IExamService extends IService<Exam> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
 	ExamVo getNextExam(QuestionChapterExamQueryBo bo);
+
+	List<ExamVo> getPaperExamList(ExamPaperQueryBo bo);
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -20,6 +20,7 @@ import com.zhongzheng.modules.course.domain.CourseChapterSection;
 import com.zhongzheng.modules.course.domain.CourseMenuExam;
 import com.zhongzheng.modules.course.service.ICourseChapterBusinessService;
 import com.zhongzheng.modules.course.service.ICourseMenuExamService;
+import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
@@ -268,4 +269,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
         }
         return null;
     }
+
+    @Override
+    public List<ExamVo> getPaperExamList(ExamPaperQueryBo bo) {
+        return this.baseMapper.getPaperExamList(bo);
+    }
 }

+ 0 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -125,8 +125,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
 
     @Override
     public List<GoodsUserQuestionVo> listFreeGoodsList(GoodsQueryBo bo) {
-        System.out.println(123545);
-        System.out.println(bo);
         List<GoodsUserQuestionVo> list = this.baseMapper.listFreeGoodsList(bo);
         for(GoodsUserQuestionVo vo : list){
             Long totalNum = iGoodsService.getExamNum(vo.getGoodsId());

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseMenuQueryBo.java

@@ -73,4 +73,7 @@ public class CourseMenuQueryBo extends BaseEntity {
 	@Excel(name = "1 需重修")
 	@ApiModelProperty("1 需重修")
 	private Integer rebuild;
+
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
 }

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

@@ -37,4 +37,7 @@ public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSect
 
     Integer learningExamCheck(@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);
+
+    Long getStudyDuration(@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/mapper/CourseMenuMapper.java

@@ -29,6 +29,8 @@ public interface CourseMenuMapper extends BaseMapper<CourseMenu> {
 
     Integer learningCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
 
+    Long getStudyDuration(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
+
     Integer auditCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
 
     List<Long> getSectionIds(@Param("chapterIds") List<Long> chapterIds);

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

@@ -163,6 +163,8 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
                     if (learning > 0) {
                         courseMenuVo.setLearning(1L);
                     }
+                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId());
+                    courseMenuVo.setStudyDuration(studyDuration);
                 } else {
                     Integer rebuild = baseMapper.rebuildCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId());
                     if (rebuild > 0) {

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

@@ -245,6 +245,8 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
                     if (learning > 0) {
                         courseMenuVo.setLearning(1L);
                     }
+                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId());
+                    courseMenuVo.setStudyDuration(studyDuration);
                 }
                 //为章的时候查询重修情况
                 if (courseMenuVo.getType().equals(2)){

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserChapterSectionVo.java

@@ -119,4 +119,8 @@ public class CourseUserChapterSectionVo {
 	private Long answerNum;
 	@ApiModelProperty("做次数")
 	private Long doNum;
+	@ApiModelProperty("教师名称")
+	private String teacherName;
+	@ApiModelProperty("观看时长(秒)")
+	private Long studyDuration;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserMenuVo.java

@@ -87,6 +87,10 @@ public class CourseUserMenuVo {
 	@ApiModelProperty("章下面的节")
 	private List<CourseChapterSectionVo> courseChapterSectionList;
 
+	@ApiModelProperty("教师名称")
+	private String teacherName;
 
+	@ApiModelProperty("观察时长(秒)")
+	private Long studyDuration;
 
 }

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

@@ -71,6 +71,7 @@ public class CourseUserModuleChapterVo {
 	@ApiModelProperty("1 需重修")
 	private Integer rebuild;
 
+
 	@Excel(name = "章下面的节")
 	@ApiModelProperty("章下面的节")
 	private List<CourseChapterSectionVo> courseChapterSectionList;

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamPaperQueryBo.java

@@ -46,4 +46,12 @@ public class ExamPaperQueryBo extends BaseEntity {
 	/** 编码SJ */
 	@ApiModelProperty("编码SJ")
 	private String encoder;
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+	@ApiModelProperty("试卷类型ID")
+	private Long paperId;
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
+	@ApiModelProperty("用户ID")
+	private Long userId;
 }

+ 4 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamPaperMapper.java

@@ -2,6 +2,9 @@ package com.zhongzheng.modules.exam.mapper;
 
 import com.zhongzheng.modules.exam.domain.ExamPaper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.exam.vo.ExamPaperVo;
+
+import java.util.List;
 
 /**
  * 试卷类型Mapper接口
@@ -10,5 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @date 2021-10-18
  */
 public interface ExamPaperMapper extends BaseMapper<ExamPaper> {
-
+    List<ExamPaperVo> getGoodsExamPaper(Long goodsId);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamPaperService.java

@@ -49,4 +49,6 @@ public interface IExamPaperService extends IService<ExamPaper> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+	List<ExamPaperVo> getGoodsExamPaper(Long goodsId);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamPaperServiceImpl.java

@@ -123,4 +123,9 @@ public class ExamPaperServiceImpl extends ServiceImpl<ExamPaperMapper, ExamPaper
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<ExamPaperVo> getGoodsExamPaper(Long goodsId) {
+        return this.baseMapper.getGoodsExamPaper(goodsId);
+    }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -379,4 +379,6 @@ public class GoodsUserVo {
 	private Long beforeStartTime;
 	/** 结束时间 */
 	private Long beforeEndTime;
+	@ApiModelProperty("科目名称拼接")
+	private String subjectNames;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java

@@ -301,4 +301,6 @@ public class GoodsVo {
 	private Long certificateTpId;
 	@ApiModelProperty("科目名称拼接")
 	private String subjectNames;
+	@ApiModelProperty("购买用户数")
+	private Integer buyUserNum;
 }

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserExamRecordMapper.java

@@ -18,12 +18,22 @@ import java.util.List;
  */
 public interface UserExamRecordMapper extends BaseMapper<UserExamRecord> {
     List<UserExamRecordVo> selectList(UserExamRecordQueryBo bo);
+
     Long selectDoNum(UserExamRecordQueryBo bo);
+
     Long selectRightNum(UserExamRecordQueryBo bo);
+
     UserExamRecordVo selectDetail(UserExamRecordQueryBo bo);
+
     List<UserExamRecordVo> selectExamList(UserExamRecordQueryBo bo);
+
     List<UserExamWrongRecordVo> getExamRecordRightList(UserExamRecordQueryBo bo);
+
     List<UserExamWrongRecordVo> getExamRecordWrongList(UserExamRecordQueryBo bo);
+
     Long getUserDoQuestionNum(UserExamRecordQueryBo bo);
+
     List<UserExamRecordVo> selectGroupList(UserExamRecordQueryBo bo);
+
+    UserExamRecordVo getUserDoLast(UserExamRecordQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java

@@ -88,4 +88,6 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
     List<SectionStudyRecordVo> userSectionLiveList(UserStudyRecordQueryBo bo);
 
     List<SectionStudyRecordVo> selectSectionRecord(UserStudyRecordQueryBo bo);
+
+    SectionStudyRecordVo getUserWatchLast(UserStudyRecordQueryBo bo);
 }

+ 46 - 39
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserExamRecordService.java

@@ -18,58 +18,65 @@ import java.util.List;
  * @date 2021-12-15
  */
 public interface IUserExamRecordService extends IService<UserExamRecord> {
-	/**
-	 * 查询单个
-	 * @return
-	 */
-	UserExamRecordVo queryById(Long recordId);
+    /**
+     * 查询单个
+     *
+     * @return
+     */
+    UserExamRecordVo queryById(Long recordId);
 
-	UserExamRecordVo selectDetail(UserExamRecordQueryBo bo);
+    UserExamRecordVo selectDetail(UserExamRecordQueryBo bo);
 
-	List<UserExamRecordVo> selectExamList(UserExamRecordQueryBo bo);
+    List<UserExamRecordVo> selectExamList(UserExamRecordQueryBo bo);
 
-	List<UserExamWrongRecordVo> getExamRecordRightList(UserExamRecordQueryBo bo);
+    List<UserExamWrongRecordVo> getExamRecordRightList(UserExamRecordQueryBo bo);
 
-	List<UserExamWrongRecordVo> getExamRecordWrongList(UserExamRecordQueryBo bo);
+    List<UserExamWrongRecordVo> getExamRecordWrongList(UserExamRecordQueryBo bo);
 
-	Long getUserDoQuestionNum(UserExamRecordQueryBo bo);
+    Long getUserDoQuestionNum(UserExamRecordQueryBo bo);
 
-	Boolean delUserBankHistory(Long userId,Long goodsId,Long orderGoodsId);
+    Boolean delUserBankHistory(Long userId, Long goodsId, Long orderGoodsId);
 
-	/**
-	 * 查询列表
-	 */
-	List<UserExamRecordVo> queryList(UserExamRecordQueryBo bo);
+    /**
+     * 查询列表
+     */
+    List<UserExamRecordVo> queryList(UserExamRecordQueryBo bo);
 
-	Integer recordNum(UserExamRecordQueryBo bo);
+    Integer recordNum(UserExamRecordQueryBo bo);
 
-	Long selectDoNum(UserExamRecordQueryBo bo);
+    Long selectDoNum(UserExamRecordQueryBo bo);
 
-	Long selectRightNum(UserExamRecordQueryBo bo);
+    Long selectRightNum(UserExamRecordQueryBo bo);
 
-	List<UserExamRecordVo> selectList(UserExamRecordQueryBo bo);
+    List<UserExamRecordVo> selectList(UserExamRecordQueryBo bo);
 
-	/**
-	 * 根据新增业务对象插入用户的题库试卷做题历史
-	 * @param bo 用户的题库试卷做题历史新增业务对象
-	 * @return
-	 */
-	Long insertByAddBo(UserExamRecordAddBo bo);
+    /**
+     * 根据新增业务对象插入用户的题库试卷做题历史
+     *
+     * @param bo 用户的题库试卷做题历史新增业务对象
+     * @return
+     */
+    Long insertByAddBo(UserExamRecordAddBo bo);
 
-	/**
-	 * 根据编辑业务对象修改用户的题库试卷做题历史
-	 * @param bo 用户的题库试卷做题历史编辑业务对象
-	 * @return
-	 */
-	Boolean updateByEditBo(UserExamRecordEditBo bo);
+    /**
+     * 根据编辑业务对象修改用户的题库试卷做题历史
+     *
+     * @param bo 用户的题库试卷做题历史编辑业务对象
+     * @return
+     */
+    Boolean updateByEditBo(UserExamRecordEditBo bo);
 
-	/**
-	 * 校验并删除数据
-	 * @param ids 主键集合
-	 * @param isValid 是否校验,true-删除前校验,false-不校验
-	 * @return
-	 */
-	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
-	List<UserExamRecordVo> selectGroupList(UserExamRecordQueryBo bo);
+    /**
+     * 校验并删除数据
+     *
+     * @param ids     主键集合
+     * @param isValid 是否校验,true-删除前校验,false-不校验
+     * @return
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<UserExamRecordVo> selectGroupList(UserExamRecordQueryBo bo);
+
+    UserExamRecordVo getUserDoLast(UserExamRecordQueryBo bo);
 
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java

@@ -102,4 +102,6 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 	List<SectionStudyRecordVo> userSectionLiveList(UserStudyRecordQueryBo bo);
 
 	List<LiveListChannelViewlogResponse.LiveChannelViewlog> userSectionLiveLog(UserStudyRecordQueryBo bo) throws IOException, NoSuchAlgorithmException;
+
+	SectionStudyRecordVo getUserWatchLast(UserStudyRecordQueryBo bo);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserExamRecordServiceImpl.java

@@ -219,4 +219,9 @@ public class UserExamRecordServiceImpl extends ServiceImpl<UserExamRecordMapper,
     public List<UserExamRecordVo> selectGroupList(UserExamRecordQueryBo bo) {
         return this.baseMapper.selectGroupList(bo);
     }
+
+    @Override
+    public UserExamRecordVo getUserDoLast(UserExamRecordQueryBo bo) {
+        return this.baseMapper.getUserDoLast(bo);
+    }
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -604,6 +604,11 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         return iPolyvLiveService.ListChannelViewlog(queryBo);
     }
 
+    @Override
+    public SectionStudyRecordVo getUserWatchLast(UserStudyRecordQueryBo bo) {
+        return this.baseMapper.getUserWatchLast(bo);
+    }
+
 
     //判断当前未看完的节是否是点击播放的节
     private boolean compareSection(UserStudyRecordVo recordVo,UserStudyRecordQueryBo entity){

+ 48 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamMapper.xml

@@ -52,6 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="subjectName" column="subject_name"/>
         <result property="doType" column="do_type"/>
         <result property="questionNum" column="question_num"/>
+        <result property="recordStatus" column="record_status"/>
+        <result property="doQuestionNum" column="do_question_num"/>
         <collection property="goodsList" column="exam_id" select="findGoodsList"/>
     </resultMap>
 
@@ -139,4 +141,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         ORDER BY e.exam_id DESC
     </select>
+
+
+    <select id="getPaperExamList" parameterType="com.zhongzheng.modules.exam.bo.ExamPaperQueryBo" resultMap="ExamVoResult">
+        SELECT
+            e.*,
+            count( eq.question_id ) question_num,
+            ifnull( (select `status` from user_exam_record uer where uer.exam_id = e.exam_id and uer.user_id = #{userId} and uer.order_goods_id = #{orderGoodsId}  ORDER BY uer.record_id desc limit 1),-1) record_status,
+            ifnull( (select do_question_num from user_exam_record uer where uer.exam_id = e.exam_id and uer.user_id = #{userId} and uer.order_goods_id = #{orderGoodsId}  ORDER BY uer.record_id desc limit 1),0) do_question_num
+        FROM
+            exam e
+                LEFT JOIN exam_question eq ON e.exam_id = eq.exam_id
+        WHERE
+                e.exam_id IN (
+                SELECT
+                    exam_id
+                FROM
+                    question_chapter_exam
+                WHERE
+                    FIND_IN_SET(
+                            chapter_exam_id,
+                            (
+                                SELECT
+                                    concat(
+                                            IFNULL(( SELECT GROUP_CONCAT( major_id ) eids FROM goods_attached WHERE goods_id = #{goodsId} AND type = 2 ), '' ),
+                                            ',',
+                                            IFNULL(
+                                                    (
+                                                        SELECT
+                                                            GROUP_CONCAT( chapter_exam_id ) eids2
+                                                        FROM
+                                                            question_module_chapter
+                                                        WHERE
+                                                                module_exam_id IN ( SELECT major_id FROM goods_attached WHERE goods_id = #{goodsId} AND type = 1 )),
+                                                    ''
+                                                )))) UNION
+                SELECT
+                    major_id AS exam_id
+                FROM
+                    goods_attached
+                WHERE
+                    goods_id = #{goodsId}
+                  AND type = 3
+            )
+          AND e.`status` = 1 AND e.exam_paper_id = #{paperId}  GROUP BY
+            e.exam_id
+    </select>
 </mapper>

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

@@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="reportStatus" column="report_status"/>
         <result property="answerNum" column="answer_num"/>
         <result property="doNum" column="do_num"/>
+        <result property="teacherName" column="teacher_name"/>
     </resultMap>
 
 
@@ -104,11 +105,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ccs.sort as c_sort,
             ccs.id,
             ccs.chapter_id,
-            1 as type
+            1 as type,
+            t.teacher_name
 
         FROM
             course_chapter_section ccs
                 LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
+                LEFT JOIN teacher t ON cs.teacher_id = t.teacher_id
         WHERE
             cs.`status` = 1
           AND ccs.chapter_id = #{chapterId}
@@ -203,6 +206,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and ups.record_end_time is not null
     </select>
 
+    <select id="getStudyDuration" parameterType="map"  resultType="long">
+        SELECT
+            IFNULL(MAX(usr.study_duration),0)
+        FROM
+            user_study_record usr
+        WHERE
+            usr.grade_id =#{gradeId}
+          AND usr.user_id = #{userId}
+          AND usr.module_id= #{moduleId}
+          and usr.chapter_id=#{chapterId}
+          and usr.course_id=#{courseId}
+          and usr.section_id=#{typeId}
+          AND usr.current_status =1
+    </select>
+
     <select id="learningExamCheck" parameterType="map"  resultType="integer">
         SELECT
             IFNULL(MAX(ubr.report_status),-1)

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

@@ -204,6 +204,7 @@
         <result property="subscribeId" column="subscribe_id"/>
         <result property="serviceStartTime" column="service_start_time"/>
         <result property="serviceEndTime" column="service_end_time"/>
+        <result property="subjectNames" column="subject_names"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
@@ -525,7 +526,8 @@
         (SELECT ea.apply_name FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = g.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time limit 1) as apply_name,
         (SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = g.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name,
         (SELECT `status` from user_profile where user_id = o.user_id and goods_id = g.goods_id and current_status = 1 and type_status = 1 and order_goods_id = og.order_goods_id limit 1 ) as profile_status,
-        (case WHEN(SELECT COUNT(1) from profile_tp where `status`=1 and FIND_IN_SET(g.goods_id,goods_ids) ) >0 then 1 ELSE 0 end) as profile_tp_status
+        (case WHEN(SELECT COUNT(1) from profile_tp where `status`=1 and FIND_IN_SET(g.goods_id,goods_ids) ) >0 then 1 ELSE 0 end) as profile_tp_status,
+        (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names
         <if test="userId != null and userId != ''">
         ,
         us.exam_status  as sub_exam_status,

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

@@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="liveEndTime" column="live_end_time"/>
         <result property="recordingUrl" column="recording_url"/>
         <result property="liveUrl" column="live_url"/>
+        <result property="teacherName" column="teacher_name"/>
     </resultMap>
 
     <select id="getList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseMenuResultVo">
@@ -169,7 +170,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     ''
                 WHEN m.type = 3 THEN
                     cs.recording_url
-                END recording_url
+                END recording_url,
+            CASE
+                WHEN m.type = 1 THEN
+                    ''
+                WHEN m.type = 2 THEN
+                    ''
+                WHEN m.type = 3 THEN
+                    (SELECT teacher_name from teacher where teacher_id = cs.teacher_id)
+                END teacher_name
 
         FROM
             course_menu m
@@ -264,6 +273,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND ups.period_status =1
           and ups.record_end_time is not null
     </select>
+
+    <select id="getStudyDuration" parameterType="map"  resultType="long">
+        SELECT
+            IFNULL(MAX(usr.study_duration),0)
+        FROM
+            user_study_record usr
+        WHERE
+            usr.grade_id =#{gradeId}
+            AND usr.user_id = #{userId}
+            AND usr.module_id= 0
+            and usr.chapter_id=0
+            and usr.section_id=#{sectionId}
+            and usr.course_id=#{courseId}
+            AND usr.current_status =1
+    </select>
+
     <select id="getSectionIds" parameterType="Integer"  resultType="Integer">
         SELECT
             cs.section_id

+ 47 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamPaperMapper.xml

@@ -14,5 +14,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="encoder" column="encoder"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.exam.vo.ExamPaperVo" id="ExamPaperVoResult">
+        <result property="paperId" column="paper_id"/>
+        <result property="paperName" column="paper_name"/>
+    </resultMap>
+
+    <select id="getGoodsExamPaper" parameterType="Long" resultMap="ExamPaperVoResult">
+        SELECT
+            DISTINCT ep.paper_id,
+            ep.paper_name
+        FROM
+            exam e
+                LEFT JOIN exam_paper ep ON e.exam_paper_id = ep.paper_id
+        WHERE
+                e.exam_id IN (
+                SELECT
+                    exam_id
+                FROM
+                    question_chapter_exam
+                WHERE
+                    FIND_IN_SET(
+                            chapter_exam_id,
+                            (
+                                SELECT
+                                    concat(
+                                            IFNULL(( SELECT GROUP_CONCAT( major_id ) eids FROM goods_attached WHERE goods_id = #{goodsId} AND type = 2 ), '' ),
+                                            ',',
+                                            IFNULL(
+                                                    (
+                                                        SELECT
+                                                            GROUP_CONCAT( chapter_exam_id ) eids2
+                                                        FROM
+                                                            question_module_chapter
+                                                        WHERE
+                                                                module_exam_id IN ( SELECT major_id FROM goods_attached WHERE goods_id = #{goodsId} AND type = 1 )),
+                                                    ''
+                                                )))) UNION
+                SELECT
+                    major_id AS exam_id
+                FROM
+                    goods_attached
+                WHERE
+                    goods_id = #{goodsId}
+                  AND type = 3
+            )
+          AND e.exam_paper_id IS NOT NULL AND ep.`status` != -1
+    </select>
+
 
 </mapper>

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

@@ -173,7 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ,ou.goods_live_num
         </if>
         <if test="getUserNum != null and getUserNum == 1" >
-            ,(SELECT count(*) from order_goods og where og.goods_id = g.goods_id and o.`status` = 1
+            ,(SELECT count(*) from order_goods og where og.goods_id = g.goods_id and og.`status` = 1
             AND og.refund_status in (0,1,3)
             AND og.pay_status in (2,3,4)) as buy_user_num
         </if>

+ 13 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml

@@ -292,5 +292,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
 
+    <select id="getUserDoLast" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultMap="UserExamRecordVoResult">
+        SELECT
+            uer.*,
+            e.exam_name
+        FROM
+            user_exam_record uer
+                LEFT JOIN exam e ON uer.exam_id = e.exam_id
+        WHERE
+           uer.user_id = #{userId}
+        ORDER BY
+            uer.create_time DESC
+            LIMIT 1
+    </select>
 
 </mapper>

+ 12 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -1332,6 +1332,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LIMIT 1
     </select>
 
+    <select id="getUserWatchLast" parameterType="com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo" resultMap="SectionStudyRecordVoResult">
+        SELECT
+            usr.*
+        FROM
+            user_study_record usr
+        WHERE
+           usr.user_id = #{userId}
+        ORDER BY
+            usr.update_time DESC
+            LIMIT 1
+    </select>
+
     <select id="userSectionLiveList" parameterType="com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo" resultMap="SectionStudyRecordVoResult">
         SELECT
             r.*,