Browse Source

视频课审核

cy 3 years ago
parent
commit
421c6dfeba

+ 45 - 9
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonController.java

@@ -1,5 +1,9 @@
 package com.yonge.cooleshow.admin.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail;
@@ -15,10 +19,12 @@ import com.yonge.cooleshow.common.page.PageInfo;
 import io.swagger.annotations.Api;
 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.*;
 
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 /**
  * @Author: cy
@@ -30,18 +36,11 @@ import javax.validation.constraints.NotNull;
 @Validated
 public class VideoLessonController extends BaseController {
     @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
     private VideoLessonGroupService lessonGroupService;
     @Autowired
     private VideoLessonGroupDetailService videoLessonGroupDetailService;
-    @Autowired
-    private VideoLessonGroupService videoLessonGroupService;
-
-    @ApiOperation(value = "修改视频课组审核状态", httpMethod = "POST", consumes = "application/json", produces = "application/json")
-    @PostMapping(value = "/updateGroup", consumes = "application/json", produces = "application/json")
-    public HttpResponseResult<Object> update(@Validated @RequestBody VideoLessonExamineVo examineVo) {
-        videoLessonGroupService.updateGroup(examineVo);
-        return succeed();
-    }
 
     @ApiOperation(value = "根据视频课组id查详情")
     @GetMapping(value = "/selectGroupById")
@@ -92,4 +91,41 @@ public class VideoLessonController extends BaseController {
     public HttpResponseResult<PageInfo<VideoLessonGroupDetail>> page(@Validated(SelectGroup.class) @RequestBody VideoLessonSearch search) {
         return succeed(PageUtil.pageInfo(videoLessonGroupDetailService.selectPage(PageUtil.getPage(search), search)));
     }
+
+    /**
+     * @Description: 审核-视频课组列表
+     * @Author: cy
+     * @Date: 2022/4/20
+     */
+    @ApiOperation(value = "审核-视频课组列表", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/queryGroupList", consumes = "application/json", produces = "application/json")
+    public HttpResponseResult<PageInfo<VideoLessonAuthGroup>> queryGroupList(@RequestBody VideoGroupSearch search) {
+        return succeed(PageUtil.pageInfo(lessonGroupService.queryGroupList(PageUtil.getPage(search), search)));
+    }
+
+    /**
+     * @Description: 审核-根据视频课组id查视频课详情
+     * @Author: cy
+     * @Date: 2022/4/20
+     */
+    @ApiOperation(value = "审核-根据视频课组id查视频课详情", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @GetMapping("/queryLessonInfo")
+    public HttpResponseResult<List<VideoLessonGroupDetail>> queryLessonInfo(Integer groupId) {
+        QueryWrapper<VideoLessonGroupDetail> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("video_lesson_group_id_", groupId);
+        return succeed(videoLessonGroupDetailService.list(queryWrapper));
+    }
+
+    @ApiOperation(value = "审核-修改视频课组审核状态", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/updateGroup", consumes = "application/json", produces = "application/json")
+    public HttpResponseResult<Object> update(@Validated @RequestBody VideoLessonExamineVo examineVo) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        examineVo.setAuditId(user.getId());
+        examineVo.setAuditName(user.getUsername());
+        lessonGroupService.updateGroup(examineVo);
+        return succeed();
+    }
 }

+ 8 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/VideoLessonGroupDao.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.dao;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
@@ -12,9 +13,10 @@ import java.util.List;
 
 /**
  * VideoLessonGroupDao数据库访问类
+ *
  * @author yzp
- * @date 2022-03-25 23:46:28
  * @version v1.0
+ * @date 2022-03-25 23:46:28
  **/
 public interface VideoLessonGroupDao extends BaseMapper<VideoLessonGroup> {
     //查询视频课组
@@ -22,6 +24,7 @@ public interface VideoLessonGroupDao extends BaseMapper<VideoLessonGroup> {
 
     //修改视频课组
     void updateGroup(VideoLessonGroupUpVo lessonGroupUpVo);
+
     void updateExamine(VideoLessonExamineVo examineVo);
 
     //学员详情-查询视频课列表
@@ -34,5 +37,8 @@ public interface VideoLessonGroupDao extends BaseMapper<VideoLessonGroup> {
     List<VideoLessonPurchaseVo> selectPurchaseStudent(IPage page, @Param("param") VideoLessonSearch search);
 
     //查询视频课组
-    List<LessonGroupVo> selectLessonGroup(IPage page,@Param("param") VideoLessonGroupSearch search);
+    List<LessonGroupVo> selectLessonGroup(IPage page, @Param("param") VideoLessonGroupSearch search);
+
+    //查询所有视频课组
+    List<VideoLessonAuthGroup> queryGroupList(IPage<VideoLessonAuthGroup> page, @Param("param") VideoGroupSearch query);
 }

+ 86 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/VideoGroupSearch.java

@@ -0,0 +1,86 @@
+package com.yonge.cooleshow.biz.dal.dto.search;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.common.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/20
+ */
+@ApiModel(value = "VideoGroupSearch")
+public class VideoGroupSearch extends QueryInfo {
+    @ApiModelProperty(value = "课程组编号/课程组名称/老师编号/老师姓名/老师手机")
+    private String search;
+
+    @ApiModelProperty("审批人姓名")
+    private String auditName;
+
+    @ApiModelProperty("声部id")
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "审核状态(DOING:待审核 PASS:通过 UNPASS:未通过)")
+    private String auditStatus;
+
+    @ApiModelProperty(value = "开始时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    public String getSearch() {
+        return search;
+    }
+
+    public void setSearch(String search) {
+        this.search = search;
+    }
+
+    public String getAuditName() {
+        return auditName;
+    }
+
+    public void setAuditName(String auditName) {
+        this.auditName = auditName;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(String auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+}

+ 24 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/VideoLessonGroup.java

@@ -93,6 +93,30 @@ public class VideoLessonGroup extends BaseEntity {
     @ApiModelProperty(value = "更新时间")
     private java.util.Date updateTime;  //更新时间
 
+    @TableField("audit_name_")
+    @ApiModelProperty(value = "审批人")
+    private String auditName;
+
+    @TableField("audit_id_")
+    @ApiModelProperty(value = "审批人id")
+    private Integer auditId;
+
+    public String getAuditName() {
+        return auditName;
+    }
+
+    public void setAuditName(String auditName) {
+        this.auditName = auditName;
+    }
+
+    public Integer getAuditId() {
+        return auditId;
+    }
+
+    public void setAuditId(Integer auditId) {
+        this.auditId = auditId;
+    }
+
     public VideoLessonGroup setId(Long id) {
         this.id = id;
         return this;

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VideoLessonGroupService.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
@@ -39,4 +40,6 @@ public interface VideoLessonGroupService extends IService<VideoLessonGroup> {
     void update(VideoLessonVo lessonVo, SysUser sysUser);
 
     IPage<LessonGroupVo> selectLessonGroup(IPage<LessonGroupVo> page, VideoLessonGroupSearch query);
+
+    IPage<VideoLessonAuthGroup> queryGroupList(IPage<VideoLessonAuthGroup> page, VideoGroupSearch query);
 }

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VideoLessonGroupServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dao.SubjectDao;
 import com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDetailDao;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
@@ -220,4 +221,14 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
         query.setAuditStatus(AuthStatusEnum.PASS);
         return page.setRecords(baseMapper.selectLessonGroup(page, query));
     }
+
+    /**
+     * @Description: 查询所有视频课组
+     * @Author: cy
+     * @Date: 2022/4/20
+     */
+    @Override
+    public IPage<VideoLessonAuthGroup> queryGroupList(IPage<VideoLessonAuthGroup> page, VideoGroupSearch query) {
+        return page.setRecords(baseMapper.queryGroupList(page, query));
+    }
 }

+ 45 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonAuthGroup.java

@@ -0,0 +1,45 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/20
+ */
+@ApiModel(value = "VideoLessonAuthGroup")
+public class VideoLessonAuthGroup extends VideoLessonGroup {
+    @ApiModelProperty(value = "老师姓名")
+    private String teacherName;
+
+    @ApiModelProperty(value = "老师手机号")
+    private String teacherPhone;
+
+    @ApiModelProperty(value = "课程名称")
+    private String subjectName;
+
+    public String getTeacherPhone() {
+        return teacherPhone;
+    }
+
+    public void setTeacherPhone(String teacherPhone) {
+        this.teacherPhone = teacherPhone;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+}

+ 20 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonExamineVo.java

@@ -20,6 +20,26 @@ public class VideoLessonExamineVo extends BaseEntity {
     @ApiModelProperty(value = "审核状态  UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过")
     private String auditStatus;
 
+    private Long auditId;
+
+    private String auditName;
+
+    public Long getAuditId() {
+        return auditId;
+    }
+
+    public void setAuditId(Long auditId) {
+        this.auditId = auditId;
+    }
+
+    public String getAuditName() {
+        return auditName;
+    }
+
+    public void setAuditName(String auditName) {
+        this.auditName = auditName;
+    }
+
     public Long getId() {
         return id;
     }

+ 44 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/VideoLessonGroupMapper.xml

@@ -18,6 +18,8 @@
 		<result column="audit_status_" jdbcType="TINYINT" property="auditStatus" />
 		<result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
 		<result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
+		<result column="audit_id_" jdbcType="INTEGER" property="auditId" />
+		<result column="audit_name_" jdbcType="VARCHAR" property="auditName" />
 	</resultMap>
 
 	<sql id="baseColumns">
@@ -35,7 +37,9 @@
 		g.hot_flag_ AS hotFlag,
 		g.audit_status_ AS auditStatus,
 		g.create_time_ AS createTime,
-		g.update_time_ AS updateTime
+		g.update_time_ AS updateTime,
+		g.audit_id_ AS auditId,
+		g.audit_name_ AS auditName,
 	</sql>
 
 	<update id="updateGroup" parameterType="com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupUpVo">
@@ -59,7 +63,9 @@
 	<update id="updateExamine" parameterType="com.yonge.cooleshow.biz.dal.vo.VideoLessonExamineVo">
 		UPDATE video_lesson_group
 		<set>
-			<if test="auditStatus !=null">audit_status_ = #{auditStatus},</if>
+			<if test="auditStatus !=null and auditStatus !=''">audit_status_ = #{auditStatus},</if>
+			<if test="auditName !=null and auditName!=''">audit_name_ = #{auditName},</if>
+			<if test="auditId !=null">audit_id_ = #{auditId},</if>
 			update_time_ = SYSDATE()
 		</set>
 		WHERE id_ = #{id}
@@ -216,4 +222,40 @@
 			</if>
 		</where>
 	</select>
+	<select id="queryGroupList" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonAuthGroup">
+		SELECT
+		<include refid="baseColumns"/>
+		s.name_ AS subjectName,
+		t.username_ AS teacherName,
+		t.phone_ AS teacherPhone
+		FROM video_lesson_group g
+		LEFT JOIN `subject` s ON g.lesson_subject_=s.id_
+		LEFT JOIN sys_user t ON g.teacher_id_=t.id_
+		<where>
+			<if test="null != param.search and '' != param.search">
+				AND (
+				g.id_ LIKE CONCAT('%', #{param.search}, '%') OR
+				g.lesson_name_ LIKE CONCAT('%', #{param.search}, '%') OR
+				t.id_ LIKE CONCAT('%', #{param.search}, '%') OR
+				t.username_ LIKE CONCAT('%', #{param.search}, '%') OR
+				t.phone_ LIKE CONCAT('%', #{param.search}, '%')
+				)
+			</if>
+			<if test="param.auditStatus !=null and param.auditStatus !=''">
+				AND g.audit_status_ = #{param.auditStatus}
+			</if>
+			<if test="param.subjectId !=null">
+				AND g.lesson_subject_ = #{param.subjectId}
+			</if>
+			<if test="param.auditName !=null and param.auditName !=''">
+				AND g.audit_name_ LIKE CONCAT('%', #{param.auditName}, '%')
+			</if>
+			<if test="param.startTime !=null">
+				<![CDATA[AND g.create_time_ >= #{param.startTime} ]]>
+			</if>
+			<if test="param.endTime !=null">
+				<![CDATA[AND g.create_time_ <= #{param.endTime} ]]>
+			</if>
+		</where>
+	</select>
 </mapper>

+ 0 - 1
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/CourseScheduleController.java

@@ -7,7 +7,6 @@ import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseCalendarEntity;
 import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
 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.TeacherLiveCourseInfoVo;
 import com.yonge.cooleshow.common.controller.BaseController;