Browse Source

Merge remote-tracking branch 'origin/master'

weifanli 3 years ago
parent
commit
3ba23c3d7f

+ 25 - 20
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/UserController.java

@@ -1,19 +1,5 @@
 package com.yonge.cooleshow.auth.web.controller;
 
-import com.alibaba.druid.sql.PagerUtils;
-import com.yonge.cooleshow.auth.api.dto.RealnameAuthReq;
-import com.yonge.cooleshow.auth.api.dto.UpdatePasswordDto;
-import com.yonge.cooleshow.auth.api.dto.UserSetReq;
-import com.yonge.cooleshow.auth.api.entity.SysRole;
-import com.yonge.cooleshow.auth.api.vo.UserSetVo;
-import com.yonge.cooleshow.auth.service.SysConfigService;
-import com.yonge.cooleshow.common.constant.CommonConstants;
-import com.yonge.cooleshow.common.constant.SysConfigConstant;
-import com.yonge.cooleshow.common.page.PageInfo;
-import com.yonge.toolset.thirdparty.user.realname.RealnameAuthenticationPlugin;
-import com.yonge.toolset.utils.idcard.IdcardInfoExtractor;
-import com.yonge.toolset.utils.idcard.IdcardValidator;
-import com.yonge.toolset.utils.string.StringUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -22,6 +8,8 @@ import io.swagger.annotations.ApiOperation;
 import java.util.Date;
 import java.util.List;
 
+import javax.validation.Valid;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -29,24 +17,40 @@ import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
 
+import com.yonge.cooleshow.auth.api.dto.RealnameAuthReq;
+import com.yonge.cooleshow.auth.api.dto.SysUserQueryInfo;
+import com.yonge.cooleshow.auth.api.dto.UpdatePasswordDto;
+import com.yonge.cooleshow.auth.api.dto.UserSetReq;
+import com.yonge.cooleshow.auth.api.entity.SysRole;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.auth.api.vo.UserSetVo;
+import com.yonge.cooleshow.auth.service.SysConfigService;
 import com.yonge.cooleshow.auth.service.SysRoleService;
 import com.yonge.cooleshow.auth.service.SysUserRoleService;
 import com.yonge.cooleshow.auth.service.SysUserService;
-import com.yonge.cooleshow.auth.api.dto.SysUserQueryInfo;
+import com.yonge.cooleshow.auth.web.controller.queryInfo.RoleQueryInfo;
+import com.yonge.cooleshow.common.constant.CommonConstants;
+import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.exception.BizException;
-import com.yonge.cooleshow.common.page.QueryInfo;
 import com.yonge.cooleshow.common.security.AuthUser;
 import com.yonge.cooleshow.common.security.SecurityConstants;
 import com.yonge.cooleshow.common.security.SecurityUtils;
 import com.yonge.cooleshow.common.service.IdGeneratorService;
+import com.yonge.toolset.thirdparty.user.realname.RealnameAuthenticationPlugin;
 import com.yonge.toolset.utils.date.DateUtil;
-
-import javax.validation.Valid;
+import com.yonge.toolset.utils.idcard.IdcardInfoExtractor;
+import com.yonge.toolset.utils.idcard.IdcardValidator;
+import com.yonge.toolset.utils.string.StringUtil;
 
 @RestController()
 @RequestMapping("user")
@@ -419,8 +423,9 @@ public class UserController extends BaseController {
         if (user != null) {
             SysUser sysUser = sysUserService.get(user.getUserId());
             if (sysUser.getIsSuperAdmin()) {
-                QueryInfo queryInfo = new QueryInfo();
+            	RoleQueryInfo queryInfo = new RoleQueryInfo();
                 queryInfo.setRows(9999);
+                queryInfo.setIsEnable(true);
                 return succeed(sysRoleService.queryPage(queryInfo).getRows());
             }
             return succeed(sysRoleService.findRoleByUserId(user.getUserId()));

+ 16 - 0
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/queryInfo/RoleQueryInfo.java

@@ -0,0 +1,16 @@
+package com.yonge.cooleshow.auth.web.controller.queryInfo;
+
+import com.yonge.cooleshow.common.page.QueryInfo;
+
+public class RoleQueryInfo extends QueryInfo {
+
+	private Boolean isEnable;
+
+	public Boolean getIsEnable() {
+		return isEnable;
+	}
+
+	public void setIsEnable(Boolean isEnable) {
+		this.isEnable = isEnable;
+	}
+}

+ 9 - 7
cooleshow-auth/auth-server/src/main/resources/config/mybatis/SysRoleMapper.xml

@@ -68,11 +68,12 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="SysRole" parameterType="map">
         SELECT * FROM sys_role WHERE del_flag_ = 0
-        <where>
         	<if test="search != null and search != ''">
-        		role_name_ like CONCAT('%',#{search},'%')
+        		and role_name_ like CONCAT('%',#{search},'%')
+        	</if>
+        	<if test="isEnable != null">
+        		and is_enable_ = #{isEnable}
         	</if>
-        </where>
         ORDER BY update_time_ DESC
         <include refid="global.limit"/>
     </select>
@@ -80,15 +81,16 @@
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM sys_role WHERE del_flag_ = 0
-        <where>
         	<if test="search != null and search != ''">
-        		role_name_ like CONCAT('%',#{search},'%')
+        		and role_name_ like CONCAT('%',#{search},'%')
+        	</if>
+        	<if test="isEnable != null">
+        		and is_enable_ = #{isEnable}
         	</if>
-        </where>
 	</select>
 
     <select id="findRoleByUserId" resultMap="SysRole">
-		SELECT sr.* FROM sys_user_role sur LEFT JOIN sys_role sr ON sur.role_id_ = sr.id_ WHERE sur.user_id_ = #{userId} AND sr.del_flag_ = 0
+		SELECT sr.* FROM sys_user_role sur LEFT JOIN sys_role sr ON sur.role_id_ = sr.id_ WHERE sur.user_id_ = #{userId} and sr.is_enable_ = 1 AND sr.del_flag_ = 0
 	</select>
 
     <select id="findRoleByCode" resultMap="SysRole">

+ 1 - 1
cooleshow-auth/auth-server/src/main/resources/config/mybatis/SysUserRoleMapper.xml

@@ -48,7 +48,7 @@
 		SELECT COUNT(*) FROM sys_user_role
 	</select>
 
-    <select id="queryRoleIdListByUserId" resultType="int" parameterType="long">
+    <select id="queryRoleIdListByUserId" resultType="long" parameterType="long">
 		SELECT ur.role_id_ FROM sys_user_role ur left join sys_role r on ur.role_id_ = r.id_ where ur.user_id_ = #{userId} and r.del_flag_ = 0
 	</select>
 

+ 0 - 30
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsInformation.java

@@ -67,20 +67,14 @@ public class SysNewsInformation {
 
 	private Boolean delFlag= false;
 
-	private Integer tenantId;
-
 	private String attribute1;
 	
 	private String attribute2;
 	
 	private String subjectIdList;
 	
-	private String organIdList;
-	
 	private String subjectName;
 	
-	private String organNameList;
-
 	public String getLinkUrl() {
 		return linkUrl;
 	}
@@ -193,14 +187,6 @@ public class SysNewsInformation {
 		this.delFlag = delFlag;
 	}
 
-	public Integer getTenantId() {
-		return tenantId;
-	}
-
-	public void setTenantId(Integer tenantId) {
-		this.tenantId = tenantId;
-	}
-
 	public Integer getSubType() {
 		return subType;
 	}
@@ -249,14 +235,6 @@ public class SysNewsInformation {
 		this.subjectIdList = subjectIdList;
 	}
 
-	public String getOrganIdList() {
-		return organIdList;
-	}
-
-	public void setOrganIdList(String organIdList) {
-		this.organIdList = organIdList;
-	}
-
 	public String getSubjectName() {
 		return subjectName;
 	}
@@ -265,14 +243,6 @@ public class SysNewsInformation {
 		this.subjectName = subjectName;
 	}
 
-	public String getOrganNameList() {
-		return organNameList;
-	}
-
-	public void setOrganNameList(String organNameList) {
-		this.organNameList = organNameList;
-	}
-
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 2 - 33
cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -24,13 +24,9 @@
 		<result column="href_target_" property="hrefTarget" />
 		<result column="order_" property="order" />
 		<result column="memo_" property="memo" />
-		<result column="tenant_id_" property="tenantId" />
 		<result column="attribute1_" property="attribute1" />
 		<result column="attribute2_" property="attribute2" />
 		<result column="subject_id_list_" property="subjectIdList" />
-		<result column="organ_id_list_" property="organIdList" />
-		<result column="subject_name_" property="subjectName" />
-		<result column="organ_name_list_" property="organNameList" />
 	</resultMap>
 	
 	<resultMap type="com.yonge.cooleshow.cms.dto.SysNewsInformationDto" id="SysNewsInformationDto" extends="SysNewsInformation">
@@ -47,9 +43,6 @@
 			<if test="subType != null">
 				and sni.sub_type_ = #{subType}
 			</if>
-			<if test="tenantId != null">
-				and sni.tenant_id_ = #{tenantId}
-			</if>
 			<if test="status != null">
 				and sni.status_ = #{status, typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler}
 			</if>
@@ -62,12 +55,6 @@
 			<if test="subjectId != null">
 				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
-			<if test="organId != null">
-				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
-			</if>
-			<if test="organIdList != null">
-				and INTE_ARRAY(#{organIdList},sni.organ_id_list_)
-			</if>
 			<if test="excludeIds!=null and excludeIds.size()>0">
 				AND sni.id_ NOT IN
 				<foreach collection="excludeIds" item="excludeId" open="(" close=")" separator=",">
@@ -99,8 +86,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.SysNewsInformation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_,attribute1_,attribute2_,subject_id_list_,organ_id_list_)
-		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId},#{attribute1},#{attribute2},#{subjectIdList},#{organIdList})
+		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,attribute1_,attribute2_,subject_id_list_)
+		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{attribute1},#{attribute2},#{subjectIdList})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -113,9 +100,6 @@
 			<if test="title != null">
 				title_ = #{title},
 			</if>
-			<if test="tenantId != null">
-				tenant_id_ = #{tenantId},
-			</if>
 			<if test="updateTime != null">
 				update_time_ = NOW(),
 			</if>
@@ -160,9 +144,6 @@
 			<if test="subjectIdList != null">
 				subject_id_list_ = #{subjectIdList},
 			</if>
-			<if test="organIdList != null">
-				organ_id_list_ = #{organIdList},
-			</if>
 		</set>
 		WHERE id_ = #{id}
 	</update>
@@ -222,9 +203,6 @@
 		<if test="search != null">
 			and sni.title_ like '%' #{search} '%'
 		</if>
-		<if test="tenantId != null">
-			and sni.tenant_id_ = #{tenantId}
-		</if>
 		<if test="excludeIds!=null and excludeIds.size()>0">
 			AND sni.id_ NOT IN
 			<foreach collection="excludeIds" item="excludeId" open="(" close=")" separator=",">
@@ -234,9 +212,6 @@
 			<if test="subjectId != null">
 				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
-			<if test="organId != null">
-				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
-			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">
@@ -271,15 +246,9 @@
 		<if test="search != null">
 			and sni.title_ like '%' #{search} '%'
 		</if>
-		<if test="tenantId != null">
-			and sni.tenant_id_ = #{tenantId}
-		</if>
 			<if test="subjectId != null">
 				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
-			<if test="organId != null">
-				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
-			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java

@@ -120,5 +120,11 @@ public interface CourseScheduleDao extends BaseMapper<CourseSchedule> {
 
     //根据课程id修改时间
     void courseAdjust(CourseAdjustVo adjustVo);
+
+    //学生端-首页-直播课
+    List<StudentHomePage.Live> selectLive();
+
+    //学生端-首页-视频课
+    List<StudentHomePage.Video> selectVideo();
 }
 

+ 3 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseScheduleService.java

@@ -180,8 +180,10 @@ public interface CourseScheduleService extends IService<CourseSchedule> {
 
     void buyPracticeCourseSuccess(UserOrderDetailVo orderParam);
 
-    void buyPracticeCourseFailed(String orderNo);
+    void buyPracticeCourseFailed(UserOrderDetailVo orderParam);
 
     void courseAdjust(CourseAdjustVo adjustVo);
+
+    StudentHomePage queryLiveAndVideo();
 }
 

+ 14 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -893,7 +893,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      * 学生购买陪练课-失败-回调
      */
     @Transactional(rollbackFor = Exception.class)
-    public void buyPracticeCourseFailed(String orderNo) {
+    public void buyPracticeCourseFailed(UserOrderDetailVo orderParam) {
+        String orderNo = orderParam.getOrderNo();
         List<CourseScheduleStudentPayment> paymentList = paymentDao.selectList(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
                 .eq(CourseScheduleStudentPayment::getOrderNo, orderNo));
         if (paymentList.isEmpty()) {
@@ -924,5 +925,17 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         baseMapper.courseAdjust(adjustVo);
     }
 
+    /**
+     * @Description: 学生-首页-直播课&视频课
+     * @Author: cy
+     * @Date: 2022/4/22
+     */
+    @Override
+    public StudentHomePage queryLiveAndVideo() {
+        StudentHomePage homePage = new StudentHomePage();
+        homePage.setLiveList(baseMapper.selectLive());
+        homePage.setVideoList(baseMapper.selectVideo());
+        return homePage;
+    }
 }
 

+ 3 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderServiceImpl.java

@@ -9,7 +9,6 @@ import com.yonge.cooleshow.biz.dal.vo.UserOrderDetailVo;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.cooleshow.biz.dal.dto.req.OrderPayReq;
 import com.yonge.cooleshow.biz.dal.dto.req.OrderReq;
-import com.yonge.cooleshow.biz.dal.entity.UserOrderDetail;
 import com.yonge.cooleshow.biz.dal.entity.UserOrder;
 import com.yonge.cooleshow.biz.dal.entity.UserOrderPayment;
 import com.yonge.cooleshow.biz.dal.sdk.PaymentSdk;
@@ -30,7 +29,6 @@ import org.springframework.stereotype.Service;
 import com.yonge.cooleshow.biz.dal.dto.search.OrderSearch;
 import com.yonge.cooleshow.biz.dal.dao.UserOrderDao;
 import org.springframework.transaction.annotation.Transactional;
-import springfox.documentation.spring.web.json.Json;
 
 import javax.annotation.PostConstruct;
 import java.math.BigDecimal;
@@ -39,7 +37,6 @@ import java.util.*;
 import java.util.function.Consumer;
 import java.util.function.Function;
 
-
 @Service
 public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> implements UserOrderService {
     private final static Logger log = LoggerFactory.getLogger(UserOrderServiceImpl.class);
@@ -94,7 +91,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
         orderSuccess.put(GoodTypeEnum.PRACTICE, scheduleService::buyPracticeCourseSuccess);
 
         /**********订单取消后******************/
-        //orderCancel.put();
+        orderCancel.put(GoodTypeEnum.PRACTICE, scheduleService::buyPracticeCourseFailed);
     }
 
     @Override
@@ -176,7 +173,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
         }
 
         //验证成功后,订单入库
-        UserOrderVo orderVo = insertOrder(orderNo,orderReq, resList);
+        UserOrderVo orderVo = insertOrder(orderNo, orderReq, resList);
 
         List<UserOrderDetailVo> orderDetailList = orderVo.getOrderDetailList();
         for (UserOrderDetailVo orderDetailVo : orderDetailList) {
@@ -213,7 +210,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
     public HttpResponseResult<OrderPayRes> orderPaytoPaying(OrderPayReq payReq) {
         //查询订单
         UserOrderVo detail = detail(payReq.getOrderNo());
-        if(OrderStatusEnum.PAYING.equals(detail.getStatus())){
+        if (OrderStatusEnum.PAYING.equals(detail.getStatus())) {
             //处于付款中状态,需要拉起付款接口返回信息,并且去到汇付
             return orderPayPaying(payReq, detail);
         }

+ 246 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/StudentHomePage.java

@@ -0,0 +1,246 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/22
+ */
+@ApiModel(value = "StudentHomePage")
+public class StudentHomePage implements Serializable {
+    @ApiModelProperty(value = "直播课")
+    private List<Live> liveList;
+    @ApiModelProperty(value = "视频课")
+    private List<Video> videoList;
+
+    public static class Live {
+        @ApiModelProperty(value = "老师id")
+        private Long teacherId;
+        @ApiModelProperty(value = "老师姓名")
+        private String teacherName;
+        @ApiModelProperty(value = "老师头像")
+        private String avatar;
+
+        @ApiModelProperty(value = "课程组id")
+        private Long courseGroupId;
+        @ApiModelProperty(value = "课程组名称")
+        private String courseGroupName;
+        @ApiModelProperty(value = "课程组售价")
+        private BigDecimal courseGroupPrice;
+        @ApiModelProperty(value = "开课时间")
+        private Date courseStartTime;
+        @ApiModelProperty(value = "直播背景图")
+        private String backgroundPic;
+        @ApiModelProperty(value = "课程数")
+        private Integer courseNum;
+
+        public Long getTeacherId() {
+            return teacherId;
+        }
+
+        public void setTeacherId(Long teacherId) {
+            this.teacherId = teacherId;
+        }
+
+        public String getTeacherName() {
+            return teacherName;
+        }
+
+        public void setTeacherName(String teacherName) {
+            this.teacherName = teacherName;
+        }
+
+        public String getAvatar() {
+            return avatar;
+        }
+
+        public void setAvatar(String avatar) {
+            this.avatar = avatar;
+        }
+
+        public Long getCourseGroupId() {
+            return courseGroupId;
+        }
+
+        public void setCourseGroupId(Long courseGroupId) {
+            this.courseGroupId = courseGroupId;
+        }
+
+        public String getCourseGroupName() {
+            return courseGroupName;
+        }
+
+        public void setCourseGroupName(String courseGroupName) {
+            this.courseGroupName = courseGroupName;
+        }
+
+        public BigDecimal getCourseGroupPrice() {
+            return courseGroupPrice;
+        }
+
+        public void setCourseGroupPrice(BigDecimal courseGroupPrice) {
+            this.courseGroupPrice = courseGroupPrice;
+        }
+
+        public Date getCourseStartTime() {
+            return courseStartTime;
+        }
+
+        public void setCourseStartTime(Date courseStartTime) {
+            this.courseStartTime = courseStartTime;
+        }
+
+        public String getBackgroundPic() {
+            return backgroundPic;
+        }
+
+        public void setBackgroundPic(String backgroundPic) {
+            this.backgroundPic = backgroundPic;
+        }
+
+        public Integer getCourseNum() {
+            return courseNum;
+        }
+
+        public void setCourseNum(Integer courseNum) {
+            this.courseNum = courseNum;
+        }
+    }
+
+    public static class Video {
+        @ApiModelProperty(value = "老师id")
+        private Long teacherId;
+        @ApiModelProperty(value = "老师姓名")
+        private String teacherName;
+        @ApiModelProperty(value = "老师头像")
+        private String avatar;
+
+        @ApiModelProperty(value = "视频课组id")
+        private Long videoGroupId;
+        @ApiModelProperty(value = "视频课组名称")
+        private String videoGroupName;
+        @ApiModelProperty(value = "视频课组售价")
+        private BigDecimal lessonPrice;
+        @ApiModelProperty(value = "创建时间")
+        private Date createTime;
+        @ApiModelProperty(value = "课程封面")
+        private String lessonCoverUrl;
+        @ApiModelProperty(value = "课程数")
+        private Integer lessonCount;
+        @ApiModelProperty(value = "声部id")
+        private Integer subjectId;
+        @ApiModelProperty(value = "声部名称")
+        private String subjectName;
+
+        public Long getTeacherId() {
+            return teacherId;
+        }
+
+        public void setTeacherId(Long teacherId) {
+            this.teacherId = teacherId;
+        }
+
+        public String getTeacherName() {
+            return teacherName;
+        }
+
+        public void setTeacherName(String teacherName) {
+            this.teacherName = teacherName;
+        }
+
+        public String getAvatar() {
+            return avatar;
+        }
+
+        public void setAvatar(String avatar) {
+            this.avatar = avatar;
+        }
+
+        public Long getVideoGroupId() {
+            return videoGroupId;
+        }
+
+        public void setVideoGroupId(Long videoGroupId) {
+            this.videoGroupId = videoGroupId;
+        }
+
+        public String getVideoGroupName() {
+            return videoGroupName;
+        }
+
+        public void setVideoGroupName(String videoGroupName) {
+            this.videoGroupName = videoGroupName;
+        }
+
+        public BigDecimal getLessonPrice() {
+            return lessonPrice;
+        }
+
+        public void setLessonPrice(BigDecimal lessonPrice) {
+            this.lessonPrice = lessonPrice;
+        }
+
+        public Date getCreateTime() {
+            return createTime;
+        }
+
+        public void setCreateTime(Date createTime) {
+            this.createTime = createTime;
+        }
+
+        public String getLessonCoverUrl() {
+            return lessonCoverUrl;
+        }
+
+        public void setLessonCoverUrl(String lessonCoverUrl) {
+            this.lessonCoverUrl = lessonCoverUrl;
+        }
+
+        public Integer getLessonCount() {
+            return lessonCount;
+        }
+
+        public void setLessonCount(Integer lessonCount) {
+            this.lessonCount = lessonCount;
+        }
+
+        public Integer getSubjectId() {
+            return subjectId;
+        }
+
+        public void setSubjectId(Integer subjectId) {
+            this.subjectId = subjectId;
+        }
+
+        public String getSubjectName() {
+            return subjectName;
+        }
+
+        public void setSubjectName(String subjectName) {
+            this.subjectName = subjectName;
+        }
+    }
+
+    public List<Live> getLiveList() {
+        return liveList;
+    }
+
+    public void setLiveList(List<Live> liveList) {
+        this.liveList = liveList;
+    }
+
+    public List<Video> getVideoList() {
+        return videoList;
+    }
+
+    public void setVideoList(List<Video> videoList) {
+        this.videoList = videoList;
+    }
+}
+

+ 35 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -454,4 +454,39 @@
         SET class_date_=#{classDate},start_time_=#{startTime},end_time_=#{endTime}
         WHERE id_ = #{courseId}
     </update>
+    <select id="selectLive" resultType="com.yonge.cooleshow.biz.dal.vo.StudentHomePage$Live">
+        SELECT
+            u.id_ AS teacherId,
+            u.username_ AS teacherName,
+            u.avatar_ AS avatar,
+            g.id_ AS courseGroupId,
+            g.name_ AS courseGroupName,
+            g.course_price_ AS courseGroupPrice,
+            g.course_start_time_ AS courseStartTime,
+            g.background_pic_ AS backgroundPic,
+            g.course_num_ AS courseNum
+        FROM course_group g
+        LEFT JOIN sys_user u ON g.teacher_id_=u.id_
+        WHERE type_='LIVE'
+        ORDER BY courseStartTime DESC LIMIT 4
+    </select>
+    <select id="selectVideo" resultType="com.yonge.cooleshow.biz.dal.vo.StudentHomePage$Video">
+        SELECT
+            u.id_ AS teacherId,
+            u.username_ AS teacherName,
+            u.avatar_ AS avatar,
+            g.id_ AS videoGroupId,
+            g.lesson_name_ AS videoGroupName,
+            g.lesson_price_ AS lessonPrice,
+            g.create_time_ AS createTime,
+            g.lesson_cover_url_ AS lessonCoverUrl,
+            g.lesson_count_ AS lessonCount,
+            g.lesson_subject_ AS subjectId,
+            s.name_ AS subjectName
+        FROM video_lesson_group g
+        LEFT JOIN sys_user u ON g.teacher_id_=u.id_
+        LEFT JOIN `subject` s ON g.lesson_subject_=s.id_
+        WHERE g.audit_status_='PASS'
+        ORDER BY g.create_time_ DESC LIMIT 4
+    </select>
 </mapper>

+ 7 - 5
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/StudentCourseScheduleController.java

@@ -13,6 +13,7 @@ import com.yonge.cooleshow.biz.dal.support.PageUtil;
 import com.yonge.cooleshow.biz.dal.vo.CourseStudent;
 import com.yonge.cooleshow.biz.dal.vo.MyCourseVo;
 import com.yonge.cooleshow.biz.dal.vo.PracticeTeacherVo;
+import com.yonge.cooleshow.biz.dal.vo.StudentHomePage;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.page.PageInfo;
@@ -23,12 +24,8 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -129,5 +126,10 @@ public class StudentCourseScheduleController extends BaseController {
         return succeed(courseScheduleService.queryStudentLiveCourse(param));
     }
 
+    @ApiOperation("学生-首页-直播课&视频课")
+    @GetMapping("/queryLiveAndVideo")
+    public HttpResponseResult<StudentHomePage> queryLiveAndVideo() {
+        return succeed(courseScheduleService.queryLiveAndVideo());
+    }
 }