Browse Source

Merge branch 'dev' into pre

he2802 3 years ago
parent
commit
c6dde9395b

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

@@ -84,4 +84,7 @@ public class CourseSectionAddBo {
     /** 保利威真实直播时长,单位秒 */
     /** 保利威真实直播时长,单位秒 */
     @ApiModelProperty("保利威真实直播时长,单位秒")
     @ApiModelProperty("保利威真实直播时长,单位秒")
     private Long realDuration;
     private Long realDuration;
+    /** 讲师ID */
+    @ApiModelProperty("讲师ID")
+    private Long teacherId;
 }
 }

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

@@ -91,4 +91,7 @@ public class CourseSectionEditBo {
     /** 保利威真实直播时长,单位秒 */
     /** 保利威真实直播时长,单位秒 */
     @ApiModelProperty("保利威真实直播时长,单位秒")
     @ApiModelProperty("保利威真实直播时长,单位秒")
     private Long realDuration;
     private Long realDuration;
+    /** 讲师ID */
+    @ApiModelProperty("讲师ID")
+    private Long teacherId;
 }
 }

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

@@ -101,4 +101,7 @@ public class CourseSectionQueryBo extends BaseEntity {
 	private Long sectionId;
 	private Long sectionId;
 	@ApiModelProperty("是否获取未同步节 1是")
 	@ApiModelProperty("是否获取未同步节 1是")
 	private Integer syncVid;
 	private Integer syncVid;
+	/** 讲师ID */
+	@ApiModelProperty("讲师ID")
+	private Long teacherId;
 }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseSection.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.course.domain;
 package com.zhongzheng.modules.course.domain;
 
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
@@ -70,4 +71,6 @@ private static final long serialVersionUID=1L;
     private Long realLiveEndTime;
     private Long realLiveEndTime;
     /** 保利威真实直播时长,单位秒 */
     /** 保利威真实直播时长,单位秒 */
     private Long realDuration;
     private Long realDuration;
+    /** 讲师ID */
+    private Long teacherId;
 }
 }

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

@@ -117,6 +117,7 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
         lqw.eq(bo.getLiveEndTime() != null, CourseSection::getLiveEndTime, bo.getLiveEndTime());
         lqw.eq(bo.getLiveEndTime() != null, CourseSection::getLiveEndTime, bo.getLiveEndTime());
         lqw.eq(StrUtil.isNotBlank(bo.getRecordingUrl()), CourseSection::getRecordingUrl, bo.getRecordingUrl());
         lqw.eq(StrUtil.isNotBlank(bo.getRecordingUrl()), CourseSection::getRecordingUrl, bo.getRecordingUrl());
         lqw.eq(bo.getDurationTime() != null, CourseSection::getDurationTime, bo.getDurationTime());
         lqw.eq(bo.getDurationTime() != null, CourseSection::getDurationTime, bo.getDurationTime());
+        lqw.eq(bo.getTeacherId() != null, CourseSection::getTeacherId, bo.getTeacherId());
         if(bo.getSyncVid()==1){
         if(bo.getSyncVid()==1){
             lqw.isNull(CourseSection::getRecordingUrl);
             lqw.isNull(CourseSection::getRecordingUrl);
             lqw.isNotNull(CourseSection::getSessionId);
             lqw.isNotNull(CourseSection::getSessionId);

+ 33 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -24,6 +24,11 @@ import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.exam.domain.ExamApplyGoods;
+import com.zhongzheng.modules.exam.domain.ExamApplyUser;
+import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
+import com.zhongzheng.modules.exam.service.IExamApplyUserService;
+import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
@@ -57,6 +62,7 @@ import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Collections;
 import java.util.List;
 import java.util.List;
@@ -98,6 +104,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     @Autowired
     @Autowired
     private IClassGradeUserService iClassGradeUserService;
     private IClassGradeUserService iClassGradeUserService;
 
 
+    @Autowired
+    private IExamApplyGoodsService iExamApplyGoodsService;
+
+    @Autowired
+    private IExamApplyUserService iExamApplyUserService;
+
 
 
 
 
     @Override
     @Override
@@ -386,6 +398,27 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             }
             }
             goodsUserVo.setSecAllNum(secLong);
             goodsUserVo.setSecAllNum(secLong);
             goodsUserVo.setStuAllNum(studyLong);
             goodsUserVo.setStuAllNum(studyLong);
+
+            //查询对应考试安排
+            List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsUserVo.getGoodsId());
+            if (examApplyGoodsVoList != null && examApplyGoodsVoList.size() > 0) {
+                List<ExamApplyGoodsVo> examApplyGoodsVos = new ArrayList<>();
+                examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
+                    LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
+                    lqw.eq(ExamApplyUser::getApplyId, examApplyGoodsVo.getApplyId());
+                    List<ExamApplyUser> examApplyUserList = iExamApplyUserService.list(lqw);
+                    if (examApplyUserList != null && examApplyUserList.size() > 0) {
+                        ArrayList<Long> userIds = new ArrayList<>();
+                        examApplyUserList.forEach(examApplyUser -> {
+                            userIds.add(examApplyUser.getUserId());
+                        });
+                        if (userIds.contains(bo.getUserId())) {
+                            examApplyGoodsVos.add(examApplyGoodsVo);
+                        }
+                    }
+                });
+                goodsUserVo.setExamApplyGoodsList(examApplyGoodsVos);
+            }
         }
         }
         return goodsUserVos;
         return goodsUserVos;
     }
     }

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

@@ -129,4 +129,8 @@ public class CourseSectionVo {
 	/** 商品ID */
 	/** 商品ID */
 	@ApiModelProperty("商品ID")
 	@ApiModelProperty("商品ID")
 	private Long goodsId;
 	private Long goodsId;
+
+	/** 讲师ID */
+	@ApiModelProperty("讲师ID")
+	private Long teacherId;
 }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyGoodsMapper.java

@@ -17,4 +17,6 @@ import java.util.List;
  */
  */
 public interface ExamApplyGoodsMapper extends BaseMapper<ExamApplyGoods> {
 public interface ExamApplyGoodsMapper extends BaseMapper<ExamApplyGoods> {
     List<ExamApplyGoodsVo> listGoods(ExamApplyGoodsQueryBo bo);
     List<ExamApplyGoodsVo> listGoods(ExamApplyGoodsQueryBo bo);
+
+    List<ExamApplyGoodsVo> listByGoodsId(Long goodsId);
 }
 }

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

@@ -53,4 +53,6 @@ public interface IExamApplyGoodsService extends IService<ExamApplyGoods> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
 
     boolean addGoods(ExamApplyGoodsAddBo bo);
     boolean addGoods(ExamApplyGoodsAddBo bo);
+
+    List<ExamApplyGoodsVo> listByGoodsId(Long goodsId);
 }
 }

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

@@ -154,4 +154,9 @@ public class ExamApplyGoodsServiceImpl extends ServiceImpl<ExamApplyGoodsMapper,
         iExamApplyUserService.saveBatch(coll2);
         iExamApplyUserService.saveBatch(coll2);
         return true;
         return true;
     }
     }
+
+    @Override
+    public List<ExamApplyGoodsVo> listByGoodsId(Long goodsId) {
+        return baseMapper.listByGoodsId(goodsId);
+    }
 }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyGoodsVo.java

@@ -27,6 +27,9 @@ public class ExamApplyGoodsVo {
 	/** 绑定考试安排ID */
 	/** 绑定考试安排ID */
 	@ApiModelProperty("绑定考试安排ID")
 	@ApiModelProperty("绑定考试安排ID")
 	private Long applyId;
 	private Long applyId;
+	/** 考试标题 */
+	@ApiModelProperty("考试标题")
+	private String applyName;
 	/** $column.columnComment */
 	/** $column.columnComment */
 	@ApiModelProperty("$column.columnComment")
 	@ApiModelProperty("$column.columnComment")
 	private Long goodsId;
 	private Long goodsId;

+ 10 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.goods.vo;
 package com.zhongzheng.modules.goods.vo;
 
 
 import com.zhongzheng.common.annotation.Excel;
 import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
@@ -252,7 +253,11 @@ public class GoodsUserVo {
 	@ApiModelProperty("商品关联前培状态")
 	@ApiModelProperty("商品关联前培状态")
 	private Long beforeStatus;
 	private Long beforeStatus;
 
 
-	/** 学习进度 */
+	/** 考试ID */
+	@ApiModelProperty("考试ID")
+	private Long applyId;
+
+	/** 考试标题 */
 	@ApiModelProperty("考试标题")
 	@ApiModelProperty("考试标题")
 	private String applyName;
 	private String applyName;
 
 
@@ -366,4 +371,8 @@ public class GoodsUserVo {
 	@Excel(name = "官方班级")
 	@Excel(name = "官方班级")
 	@ApiModelProperty("官方班级")
 	@ApiModelProperty("官方班级")
 	private String officialName;
 	private String officialName;
+	/** 考试列表 */
+	@Excel(name = "考试列表")
+	@ApiModelProperty("考试列表")
+	private List<ExamApplyGoodsVo> examApplyGoodsList;
 }
 }

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="realLiveStartTime" column="real_live_start_time"/>
         <result property="realLiveStartTime" column="real_live_start_time"/>
         <result property="realLiveEndTime" column="real_live_end_time"/>
         <result property="realLiveEndTime" column="real_live_end_time"/>
         <result property="realDuration" column="real_duration"/>
         <result property="realDuration" column="real_duration"/>
+        <result property="teacherId" column="teacher_id"/>
     </resultMap>
     </resultMap>
 
 
     <resultMap type="com.zhongzheng.modules.course.vo.CourseSectionVo" id="CourseSectionResultVo">
     <resultMap type="com.zhongzheng.modules.course.vo.CourseSectionVo" id="CourseSectionResultVo">
@@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="realLiveStartTime" column="real_live_start_time"/>
         <result property="realLiveStartTime" column="real_live_start_time"/>
         <result property="realLiveEndTime" column="real_live_end_time"/>
         <result property="realLiveEndTime" column="real_live_end_time"/>
         <result property="realDuration" column="real_duration"/>
         <result property="realDuration" column="real_duration"/>
+        <result property="teacherId" column="teacher_id"/>
         <collection property="businessList" column="section_id" select="findBusinessList"/>
         <collection property="businessList" column="section_id" select="findBusinessList"/>
         <collection property="chapterList" column="section_id" select="findChapterList"/>
         <collection property="chapterList" column="section_id" select="findChapterList"/>
       <!--  <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
       <!--  <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>

+ 14 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyGoodsMapper.xml

@@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsName" column="goods_name"/>
         <result property="goodsName" column="goods_name"/>
         <result property="code" column="code"/>
         <result property="code" column="code"/>
         <result property="goodsId" column="goods_id"/>
         <result property="goodsId" column="goods_id"/>
+        <result property="applyId" column="apply_id"/>
+        <result property="applyName" column="apply_name"/>
     </resultMap>
     </resultMap>
 
 
     <select id="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyGoodsQueryBo" resultMap="ExamApplyGoodsVoResult">
     <select id="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyGoodsQueryBo" resultMap="ExamApplyGoodsVoResult">
@@ -46,4 +48,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND g.stand_price = #{standPrice}
             AND g.stand_price = #{standPrice}
         </if>
         </if>
     </select>
     </select>
+    <select id="listByGoodsId" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo">
+        SELECT
+            eag.apply_id,
+            eag.goods_id,
+            ea.apply_name
+        FROM exam_apply_goods eag
+        LEFT JOIN exam_apply ea ON eag.apply_id = ea.apply_id
+        WHERE
+            goods_id = #{goodsId}
+            and unix_timestamp(now()) &lt; ea.apply_start_time
+        ORDER BY ea.apply_start_time
+    </select>
 </mapper>
 </mapper>