he2802 3 лет назад
Родитель
Сommit
190b6c66d5
47 измененных файлов с 633 добавлено и 66 удалено
  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. 14 8
      zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  4. 11 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserExamRecordController.java
  5. 9 1
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java
  6. 15 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  7. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamMapper.java
  8. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamService.java
  9. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java
  10. 0 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  11. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseMenuQueryBo.java
  12. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java
  13. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java
  14. 9 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseMenuService.java
  15. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java
  16. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java
  17. 95 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseLiveVo.java
  18. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserChapterSectionVo.java
  19. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserMenuVo.java
  20. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserModuleChapterVo.java
  21. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamPaperQueryBo.java
  22. 4 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamPaperMapper.java
  23. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamPaperService.java
  24. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamPaperServiceImpl.java
  25. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserQuestionVo.java
  26. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java
  27. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  28. 2 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderGoodsMapper.java
  29. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java
  30. 105 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  31. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserImportAddBo.java
  32. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserExamRecordMapper.java
  33. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java
  34. 46 39
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserExamRecordService.java
  35. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java
  36. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserExamRecordServiceImpl.java
  37. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  38. 48 0
      zhongzheng-system/src/main/resources/mapper/modules/bank/ExamMapper.xml
  39. 3 1
      zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml
  40. 19 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml
  41. 3 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  42. 42 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml
  43. 47 0
      zhongzheng-system/src/main/resources/mapper/modules/exam/ExamPaperMapper.xml
  44. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  45. 19 1
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml
  46. 13 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml
  47. 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);
+    }
 
 }

+ 14 - 8
zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -2,11 +2,11 @@ package com.zhongzheng.controller.goods;
 
 import cn.hutool.core.lang.Validator;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.PageDomain;
 import com.zhongzheng.common.core.page.TableDataInfo;
-import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.core.page.TableSupport;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
@@ -19,14 +19,12 @@ import com.zhongzheng.modules.collect.bo.CollectQuestionQueryBo;
 import com.zhongzheng.modules.collect.service.ICollectQuestionService;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.service.ICourseSectionService;
-import com.zhongzheng.modules.course.vo.CourseModuleFreeExamVo;
+import com.zhongzheng.modules.course.vo.CourseLiveVo;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
-import com.zhongzheng.modules.goods.service.IGoodsAuditionConfigService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
-import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
@@ -37,16 +35,13 @@ import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.user.bo.UserExamRecordQueryBo;
 import com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo;
-import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.service.IUserExamRecordService;
 import com.zhongzheng.modules.user.service.IUserExamWrongRecordService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.models.auth.In;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
@@ -228,4 +223,15 @@ public class GoodsController extends BaseController {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         return AjaxResult.success(iCourseSectionService.livingSectionList(loginUser.getUser().getUserId()));
     }
+
+    /**
+     * 获取直播提醒列表
+     */
+    @ApiOperation("获取直播提醒列表")
+    @GetMapping("/getLiveList")
+    public TableDataInfo<CourseLiveVo> liveList() {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        PageDomain pageDomain = TableSupport.getPageDomain();
+        return iOrderGoodsService.getLiveList(pageDomain,loginUser.getUser().getUserId());
+    }
 }

+ 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));

+ 15 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -667,6 +667,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 itemImport.setRealname(user.getRealname());
                 itemImport.setIdCard(user.getIdCard());
                 successList.add(itemImport);
+                //如果学员公司信息不一样则更新公司信息
+                if (StringUtils.isNotBlank(itemImport.getCompanyName()) &&
+                        (StringUtils.isBlank(user.getCompanyName()) || !user.getCompanyName().equals(itemImport.getCompanyName()))){
+                    user.setCompanyName(itemImport.getCompanyName());
+                    updateById(user);
+                }
                 continue;
             }
             User user2 = getOne(new LambdaQueryWrapper<User>()
@@ -679,6 +685,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 itemImport.setRealname(user2.getRealname());
                 itemImport.setTelphone(user2.getTelphone());
                 successList.add(itemImport);
+                //如果学员公司信息不一样则更新公司信息
+                if (StringUtils.isNotBlank(itemImport.getCompanyName()) &&
+                        (StringUtils.isBlank(user.getCompanyName()) || !user.getCompanyName().equals(itemImport.getCompanyName()))){
+                    user.setCompanyName(itemImport.getCompanyName());
+                    updateById(user);
+                }
                 continue;
             }
             User inertData = new User();
@@ -691,6 +703,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             inertData.setSex(1);
             inertData.setIdCard(itemImport.getIdCard());
             inertData.setRealname(itemImport.getRealname());
+            if (StringUtils.isNotBlank(itemImport.getCompanyName())) {
+                inertData.setCompanyName(itemImport.getCompanyName());
+            }
             inertData.setStatus(1);
             inertData.setRegisterPlat("3");
             inertData.setAvatar(Constants.DEFAULT_AVATAR);

+ 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);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java

@@ -29,5 +29,9 @@ 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);
 }

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseMenuService.java

@@ -57,4 +57,13 @@ public interface ICourseMenuService extends IService<CourseMenu> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
 	List<CourseUserMenuVo> menuList(CourseMenuQueryBo bo);
+
+	/**
+	 * 获取节ID
+	 * @author yangdamao
+	 * @date 2022/7/14 9:44
+	 * @param chapterIds
+	 * @return java.util.List<java.lang.Long>
+	 */
+	List<Long> getSectionIds(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) {

+ 7 - 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)){
@@ -270,4 +272,9 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
         }
         return courseMenuVos;
     }
+
+    @Override
+    public List<Long> getSectionIds(List<Long> chapterIds) {
+        return baseMapper.getSectionIds(chapterIds);
+    }
 }

+ 95 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseLiveVo.java

@@ -0,0 +1,95 @@
+package com.zhongzheng.modules.course.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2022年07月14日 8:41
+ */
+@Data
+@ApiModel("直播提醒列表")
+public class CourseLiveVo implements Serializable {
+
+    /** 节ID */
+    @ApiModelProperty("节ID")
+    private Long sectionId;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+    @ApiModelProperty("排序")
+    private Long sort;
+
+    @ApiModelProperty("前缀名称")
+    private String prefixName;
+
+    @ApiModelProperty("状态 1正常 0关闭")
+    private Integer status;
+
+    @ApiModelProperty("节类型 1录播 2直播 3回放")
+    private Integer sectionType;
+
+    @ApiModelProperty("发布状态 1发布 0未发布")
+    private Integer publishStatus;
+
+    @ApiModelProperty("直播流地址")
+    private String liveUrl;
+
+    @ApiModelProperty("频道的观看页状态,取值为:live(直播中)、end(直播结束)、playback(回放中)、waiting(等待直播)")
+    private String watchStatus;
+
+    @ApiModelProperty("直播开始时间")
+    private Long liveStartTime;
+
+    @ApiModelProperty("直播结束时间")
+    private Long liveEndTime;
+
+    @ApiModelProperty("录播和回放的url地址")
+    private String recordingUrl;
+
+    @ApiModelProperty("节时长(秒)")
+    private Long durationTime;
+
+    @ApiModelProperty("封面地址")
+    private String coverUrl;
+
+    @ApiModelProperty("编码")
+    private String code;
+
+    @ApiModelProperty("添加时间")
+    private Long createTime;
+
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+
+    @ApiModelProperty("保利威直播场次ID")
+    private String sessionId;
+
+    @ApiModelProperty("保利威真实直播开始时间")
+    private Long realLiveStartTime;
+
+    @ApiModelProperty("保利威真实直播结束时间")
+    private Long realLiveEndTime;
+
+    @ApiModelProperty("保利威真实直播时长,单位秒")
+    private Long realDuration;
+
+    @ApiModelProperty("课程id")
+    private Long courseId;
+
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    @ApiModelProperty("讲师ID")
+    private Long teacherId;
+
+    @ApiModelProperty("订单ID")
+    private Long orderId;
+}

+ 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/GoodsUserQuestionVo.java

@@ -272,4 +272,6 @@ public class GoodsUserQuestionVo {
 	private Long totalExamNum;
 	@ApiModelProperty("用户ID")
 	private Long userId;
+	@ApiModelProperty("科目名称拼接")
+	private String subjectNames;
 }

+ 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;
 }

+ 2 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderGoodsMapper.java

@@ -1,16 +1,12 @@
 package com.zhongzheng.modules.order.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.zhongzheng.modules.bank.bo.QuestionQueryBo;
-import com.zhongzheng.modules.bank.vo.QuestionVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
-import com.zhongzheng.modules.order.bo.OrderAddBo;
 import com.zhongzheng.modules.order.bo.OrderGoodsQueryBo;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 订单商品Mapper接口
@@ -48,4 +44,6 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
     List<OrderGoodsVo> listUserSubjectGoods(GoodsQueryBo bo);
 
     List<OrderGoodsVo> selectBuyUserList(Long mockMajorSubjectId);
+
+    List<Long> getCourseIdByLive(Long userId);
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java

@@ -1,6 +1,9 @@
 package com.zhongzheng.modules.order.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.common.core.page.PageDomain;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.modules.course.vo.CourseLiveVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.domain.OrderGoods;
@@ -89,4 +92,13 @@ public interface IOrderGoodsService extends IService<OrderGoods> {
     List<OrderGoodsVo> selectBuyUserList(Long mockMajorSubjectId);
 
 
+    /**
+     *
+     * @author 获取直播提醒列表
+     * @date 2022/7/14 8:52
+     * @param pageDomain
+     * @param userId
+     * @return com.zhongzheng.common.core.page.TableDataInfo<com.zhongzheng.modules.course.vo.CourseLiveVo>
+     */
+    TableDataInfo<CourseLiveVo> getLiveList(PageDomain pageDomain,Long userId);
 }

+ 105 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -3,12 +3,24 @@ package com.zhongzheng.modules.order.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpStatus;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.zhongzheng.common.core.page.PageDomain;
+import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
+import com.zhongzheng.modules.course.domain.CourseChapterSection;
+import com.zhongzheng.modules.course.domain.CourseMenu;
+import com.zhongzheng.modules.course.domain.CourseSection;
+import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
+import com.zhongzheng.modules.course.service.ICourseChapterService;
+import com.zhongzheng.modules.course.service.ICourseMenuService;
+import com.zhongzheng.modules.course.service.ICourseSectionService;
+import com.zhongzheng.modules.course.vo.CourseLiveVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
@@ -29,6 +41,8 @@ import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
+import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
+import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
 import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.User;
@@ -36,6 +50,9 @@ import com.zhongzheng.modules.user.service.IUserExamGoodsService;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import com.zhongzheng.modules.user.service.IUserSubscribeService;
+import net.polyv.common.v1.util.StringUtils;
+import net.polyv.live.v1.entity.channel.operate.LiveChannelBasicInfoResponse;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -90,6 +107,17 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
     @Autowired
     private IUserSubscribeService iUserSubscribeService;
 
+    @Autowired
+    private ICourseMenuService courseMenuService;
+
+    @Autowired
+    private ICourseChapterSectionService courseChapterSectionService;
+
+    @Autowired
+    private ICourseSectionService courseSectionService;
+
+    @Autowired
+    private IPolyvLiveService ployvLiveService;
 
     @Override
     public OrderGoodsVo queryById(Long orderGoodsId) {
@@ -453,6 +481,83 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         return baseMapper.selectBuyUserList(mockMajorSubjectId);
     }
 
+    @Override
+    public TableDataInfo<CourseLiveVo> getLiveList(PageDomain pageDomain, Long userId) {
+        TableDataInfo<CourseLiveVo> info = new TableDataInfo<>();
+        info.setCode(HttpStatus.HTTP_OK);
+        info.setMsg("查询成功");
+        //获取所有直播课程ID
+        List<Long> courseIds = orderGoodsMapper.getCourseIdByLive(userId);
+        if (CollectionUtils.isEmpty(courseIds)){
+            return info;
+        }
+        //课程目录
+        List<CourseMenu> menus = courseMenuService.list(new LambdaQueryWrapper<CourseMenu>()
+                .in(CourseMenu::getCourseId, courseIds));
+        if (CollectionUtils.isEmpty(menus)){
+            return info;
+        }
+
+        //节ID
+        List<Long> sectionIds = menus.stream().filter(x -> x.getType() == 3).map(CourseMenu::getMenuId).collect(Collectors.toList());
+        //章ID
+        List<Long> chapterIds = menus.stream().filter(x -> x.getType() == 2).map(CourseMenu::getMenuId).collect(Collectors.toList());
+        if (!CollectionUtils.isEmpty(chapterIds)){
+            List<CourseChapterSection> chapterSections = courseChapterSectionService.list(new LambdaQueryWrapper<CourseChapterSection>()
+                    .in(CourseChapterSection::getChapterId, chapterIds));
+            if (!CollectionUtils.isEmpty(chapterSections)){
+                List<Long> ids = chapterSections.stream().map(CourseChapterSection::getSectionId).collect(Collectors.toList());
+                sectionIds.addAll(ids);
+            }
+        }
+        //模块ID
+        List<Long> moduleIds = menus.stream().filter(x -> x.getType() == 1).map(CourseMenu::getMenuId).collect(Collectors.toList());
+        if (!CollectionUtils.isEmpty(moduleIds)){
+            List<Long> ids = courseMenuService.getSectionIds(moduleIds);
+            if (!CollectionUtils.isEmpty(ids)){
+                sectionIds.addAll(ids);
+            }
+        }
+        if (CollectionUtils.isEmpty(sectionIds)){
+            return info;
+        }
+
+        //分页查询节直播信息
+        com.baomidou.mybatisplus.extension.plugins.pagination.Page<CourseSection> page = courseSectionService.page(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageDomain.getPageNum(), pageDomain.getPageSize()),
+                new LambdaQueryWrapper<CourseSection>()
+                        .in(CourseSection::getSectionId, sectionIds)
+                        .orderByAsc(CourseSection::getLiveStartTime));
+        if (CollectionUtils.isEmpty(page.getRecords())){
+            return info;
+        }
+        List<CourseLiveVo> list = page.getRecords().stream().map(item -> BeanUtil.copyProperties(item, CourseLiveVo.class)).collect(Collectors.toList());
+        //获取保利威直播状态
+        Set<String> setUrl = list.stream().filter(x -> StringUtils.isNotBlank(x.getLiveUrl())).map(CourseLiveVo::getLiveUrl).collect(Collectors.toSet());
+        List<LiveChannelBasicInfoResponse> result = setUrl.stream().map(url -> {
+            PolyvLiveQueryBo bo = new PolyvLiveQueryBo();
+            bo.setChannelId(url);
+            LiveChannelBasicInfoResponse response = new LiveChannelBasicInfoResponse();
+            try {
+                response = ployvLiveService.GetChannelBasicInfo(bo);
+            } catch (Exception e) {
+//                throw new CustomException("获取保利威直播状态失败");
+                response.setChannelId(url);
+                response.setWatchStatus("waiting");
+            }
+            return response;
+        }).collect(Collectors.toList());
+        list.forEach(item -> {
+            for (LiveChannelBasicInfoResponse response : result) {
+                if (StringUtils.isNotBlank(item.getLiveUrl()) && item.getLiveUrl().equals(response.getChannelId())){
+                    item.setWatchStatus(response.getWatchStatus());
+                }
+            }
+        });
+        info.setTotal(page.getTotal());
+        info.setRows(list);
+        return info;
+    }
+
     public boolean joinGrade(Long orderGoodsId, Long gradeId, Long userId, Long goodsId) {
         ClassGradeVo classGradeVo = iClassGradeService.queryById(gradeId);
         if (classGradeVo == null) {

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

@@ -24,6 +24,10 @@ public class UserImportAddBo {
     @Excel(name = "*学员身份证号码")
     @ApiModelProperty("身份证号")
     private String idCard;
+    /** 所在公司 */
+    @Excel(name = "所在公司")
+    @ApiModelProperty("所在公司")
+    private String companyName;
     /** 手机号码 */
     @Excel(name = "*手机号码")
     @ApiModelProperty("手机号码")

+ 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>

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -171,6 +171,7 @@
         <result property="doStartTime" column="do_start_time"/>
         <result property="doEndTime" column="do_end_time"/>
         <result property="doExamNum" column="do_exam_num"/>
+        <result property="subjectNames" column="subject_names"/>
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.bank.bo.QuestionQueryBo" resultMap="QuestionResultVo">
@@ -298,7 +299,8 @@
             og.create_time as order_create_time,
             og.service_start_time,
             og.service_end_time,
-            og.order_goods_id
+            og.order_goods_id,
+           (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names
         FROM
             goods g
                 LEFT JOIN pay_supply ps ON g.supply_id = ps.supply_id

+ 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,

+ 42 - 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,4 +273,36 @@ 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
+        FROM
+            course_module_chapter cm
+                LEFT JOIN course_chapter_section cs ON cm.chapter_id = cs.chapter_id
+        WHERE
+             1=1
+             <if test="chapterIds != null and chapterIds.size() > 0">
+             AND cm.module_id IN
+                 <foreach item="id" index="index" collection="chapterIds"
+                          open="(" separator="," close=")">
+                     # {id}
+                 </foreach>
+             </if>
+    </select>
 </mapper>

+ 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>

+ 19 - 1
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -460,8 +460,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN mock_major_subject_goods mmsg ON og.goods_id = mmsg.goods_id
         WHERE
             og.refund_status != 2
-			and og.pay_status in (3,4)
+			and og.pay_status in (2,3,4)
 			and og.`status` = 1
 			and mmsg.mock_major_subject_id = #{mockMajorSubjectId}
     </select>
+    <select id="getCourseIdByLive" parameterType="java.lang.Long" resultType="java.lang.Long">
+        SELECT
+            gc.course_id
+        FROM
+            `order` o
+                LEFT JOIN order_goods og ON o.order_sn = og.order_sn
+                LEFT JOIN goods g ON og.goods_id = g.goods_id
+                INNER JOIN goods_course gc ON g.goods_id = gc.goods_id
+        WHERE
+            o.user_id = #{userId}
+          AND o.order_status = 1
+          AND og.pay_status in (2,3,4)
+          AND og.refund_status != 2
+          AND og.status = 1
+          AND o.`status` = 1
+          AND g.`status` = 1
+          AND g.goods_type = 6
+    </select>
 </mapper>

+ 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.*,