1
0

4 کامیت‌ها 0ae51940c8 ... 9d6aa1dd53

نویسنده SHA1 پیام تاریخ
  caoliqin 9d6aa1dd53 Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java 4 روز پیش
  caoliqin 1dc575664d feat:管理端单独的评论模块 4 روز پیش
  caoliqin 5c11ac310e Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java 5 روز پیش
  caoliqin 88872460fa feat:管理端课程查看评论列表 5 روز پیش

+ 33 - 8
fs-admin/src/main/java/com/fs/course/controller/FsCourseWatchCommentController.java

@@ -1,6 +1,13 @@
 package com.fs.course.controller;
 
 import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.course.param.FsCourseWatchCommentPageParam;
+import com.fs.course.vo.FsCourseWatchCommentListVO;
+import com.fs.qw.service.IQwExternalContactService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -22,7 +29,7 @@ import com.fs.common.core.page.TableDataInfo;
 
 /**
  * 看课评论Controller
- * 
+ *
  * @author fs
  * @date 2025-05-26
  */
@@ -33,16 +40,21 @@ public class FsCourseWatchCommentController extends BaseController
     @Autowired
     private IFsCourseWatchCommentService fsCourseWatchCommentService;
 
+    @Autowired
+    private IQwExternalContactService qwExternalContactService;
+
     /**
      * 查询看课评论列表
      */
     @PreAuthorize("@ss.hasPermi('course:courseWatchComment:list')")
     @GetMapping("/list")
-    public TableDataInfo list(FsCourseWatchComment fsCourseWatchComment)
+    public R list(FsCourseWatchCommentPageParam fsCourseWatchCommentPageParam)
     {
-        startPage();
-        List<FsCourseWatchComment> list = fsCourseWatchCommentService.selectFsCourseWatchCommentList(fsCourseWatchComment);
-        return getDataTable(list);
+//        startPage();
+        PageHelper.startPage(fsCourseWatchCommentPageParam.getPageNum(), fsCourseWatchCommentPageParam.getPageSize());
+        List<FsCourseWatchCommentListVO> list = fsCourseWatchCommentService.selectFsCourseWatchCommentList(fsCourseWatchCommentPageParam);
+        PageInfo<FsCourseWatchCommentListVO> pageInfo = new PageInfo<>(list);
+        return R.ok().put("rows", pageInfo);
     }
 
     /**
@@ -51,10 +63,10 @@ public class FsCourseWatchCommentController extends BaseController
     @PreAuthorize("@ss.hasPermi('course:courseWatchComment:export')")
     @Log(title = "看课评论", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(FsCourseWatchComment fsCourseWatchComment)
+    public AjaxResult export(FsCourseWatchCommentPageParam fsCourseWatchCommentPageParam)
     {
-        List<FsCourseWatchComment> list = fsCourseWatchCommentService.selectFsCourseWatchCommentList(fsCourseWatchComment);
-        ExcelUtil<FsCourseWatchComment> util = new ExcelUtil<FsCourseWatchComment>(FsCourseWatchComment.class);
+        List<FsCourseWatchCommentListVO> list = fsCourseWatchCommentService.selectFsCourseWatchCommentList(fsCourseWatchCommentPageParam);
+        ExcelUtil<FsCourseWatchCommentListVO> util = new ExcelUtil<FsCourseWatchCommentListVO>(FsCourseWatchCommentListVO.class);
         return util.exportExcel(list, "看课评论数据");
     }
 
@@ -100,4 +112,17 @@ public class FsCourseWatchCommentController extends BaseController
     {
         return toAjax(fsCourseWatchCommentService.deleteFsCourseWatchCommentByCommentIds(commentIds));
     }
+
+    @Log(title = "手动拉黑外部联系人用户", businessType = BusinessType.UPDATE)
+    @PutMapping("/addBlack")
+    public R addBlack(Integer commentStatus, Long fsUserId)
+    {
+        int i = qwExternalContactService.updateQwExternalContactByFsUserId(commentStatus, fsUserId);
+        if (i > 0){
+            return R.ok();
+        } else {
+            return R.error();
+        }
+    }
+
 }

+ 1 - 0
fs-service/src/main/java/com/fs/course/domain/FsCourseWatchComment.java

@@ -1,5 +1,6 @@
 package com.fs.course.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fs.common.annotation.Excel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;

+ 4 - 2
fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchCommentMapper.java

@@ -4,6 +4,8 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.course.domain.FsCourseWatchComment;
 import com.fs.course.param.FsCourseWatchCommentListParam;
+import com.fs.course.param.FsCourseWatchCommentPageParam;
+import com.fs.course.vo.FsCourseWatchCommentListVO;
 import com.fs.course.vo.FsCourseWatchCommentVO;
 import org.apache.ibatis.annotations.Update;
 
@@ -25,10 +27,10 @@ public interface FsCourseWatchCommentMapper extends BaseMapper<FsCourseWatchComm
     /**
      * 查询看课评论列表
      *
-     * @param fsCourseWatchComment 看课评论
+     * @param fsCourseWatchCommentPageParam 看课评论
      * @return 看课评论集合
      */
-    List<FsCourseWatchComment> selectFsCourseWatchCommentList(FsCourseWatchComment fsCourseWatchComment);
+    List<FsCourseWatchCommentListVO> selectFsCourseWatchCommentList(FsCourseWatchCommentPageParam fsCourseWatchCommentPageParam);
 
     /**
      * 新增看课评论

+ 33 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseWatchCommentPageParam.java

@@ -0,0 +1,33 @@
+package com.fs.course.param;
+
+import com.fs.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 看课评论对象 fs_course_watch_comment
+ *
+ * @author fs
+ * @date 2025-05-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsCourseWatchCommentPageParam extends BaseEntity{
+
+    @ApiModelProperty(value = "页码,默认为1", required = true)
+    private Integer pageNum = 1;
+
+    @ApiModelProperty(value = "页大小,默认为10", required = true)
+    private Integer pageSize = 10;
+
+    @ApiModelProperty(value = "用户名称")
+    private String nickName;
+
+    @ApiModelProperty(value = "模糊搜索")
+    private String keywords;
+
+    @ApiModelProperty(value = "是否全部")
+    private Boolean isAll = false;
+
+}

+ 4 - 2
fs-service/src/main/java/com/fs/course/service/IFsCourseWatchCommentService.java

@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.common.core.domain.R;
 import com.fs.course.domain.FsCourseWatchComment;
 import com.fs.course.param.FsCourseWatchCommentListParam;
+import com.fs.course.param.FsCourseWatchCommentPageParam;
 import com.fs.course.param.FsCourseWatchCommentSaveParam;
+import com.fs.course.vo.FsCourseWatchCommentListVO;
 import com.fs.course.vo.FsCourseWatchCommentVO;
 
 /**
@@ -26,10 +28,10 @@ public interface IFsCourseWatchCommentService extends IService<FsCourseWatchComm
     /**
      * 查询看课评论列表
      *
-     * @param fsCourseWatchComment 看课评论
+     * @param fsCourseWatchCommentPageParam 看课评论
      * @return 看课评论集合
      */
-    List<FsCourseWatchComment> selectFsCourseWatchCommentList(FsCourseWatchComment fsCourseWatchComment);
+    List<FsCourseWatchCommentListVO> selectFsCourseWatchCommentList(FsCourseWatchCommentPageParam fsCourseWatchCommentPageParam);
 
     /**
      * 新增看课评论

+ 5 - 3
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchCommentServiceImpl.java

@@ -9,7 +9,9 @@ import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.course.param.FsCourseWatchCommentListParam;
+import com.fs.course.param.FsCourseWatchCommentPageParam;
 import com.fs.course.param.FsCourseWatchCommentSaveParam;
+import com.fs.course.vo.FsCourseWatchCommentListVO;
 import com.fs.course.vo.FsCourseWatchCommentVO;
 import com.fs.qw.mapper.QwExternalContactMapper;
 import com.fs.system.domain.SysKeyword;
@@ -60,13 +62,13 @@ public class FsCourseWatchCommentServiceImpl extends ServiceImpl<FsCourseWatchCo
     /**
      * 查询看课评论列表
      *
-     * @param fsCourseWatchComment 看课评论
+     * @param fsCourseWatchCommentPageParam 看课评论
      * @return 看课评论
      */
     @Override
-    public List<FsCourseWatchComment> selectFsCourseWatchCommentList(FsCourseWatchComment fsCourseWatchComment)
+    public List<FsCourseWatchCommentListVO> selectFsCourseWatchCommentList(FsCourseWatchCommentPageParam fsCourseWatchCommentPageParam)
     {
-        return baseMapper.selectFsCourseWatchCommentList(fsCourseWatchComment);
+        return baseMapper.selectFsCourseWatchCommentList(fsCourseWatchCommentPageParam);
     }
 
     /**

+ 58 - 0
fs-service/src/main/java/com/fs/course/vo/FsCourseWatchCommentListVO.java

@@ -0,0 +1,58 @@
+package com.fs.course.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ApiModel(value = "评论列表-管理端")
+public class FsCourseWatchCommentListVO {
+
+    @ApiModelProperty(value = "评论id")
+    private Long commentId;
+
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+    @Excel(name = "用户名称")
+    @ApiModelProperty(value = "用户名称")
+    private String nickName;
+
+    @ApiModelProperty(value = "课程id")
+    private Long courseId;
+
+    @ApiModelProperty(value = "视频id")
+    private Long videoId;
+
+    @Excel(name = "评论内容", width = 120)
+    @ApiModelProperty(value = "评论内容")
+    private String content;
+
+    @Excel(name = "评论时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "评论时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "时间(用于弹幕记录时间)")
+    private Integer time;
+
+    @ApiModelProperty(value = "字体大小")
+    private String fontSize;
+
+    @ApiModelProperty(value = "展示模式")
+    private String mode;
+
+    @ApiModelProperty(value = "字体颜色")
+    private String color;
+
+    @ApiModelProperty(value = "课程名称")
+    private String courseName;
+
+    @ApiModelProperty(value = "小节名称")
+    private String title;
+
+}

+ 8 - 0
fs-service/src/main/java/com/fs/qw/service/IQwExternalContactService.java

@@ -184,4 +184,12 @@ public interface IQwExternalContactService extends IService<QwExternalContact> {
 
 
     List<QwExternalListByHeavyVO> getQwExternalListByHeavy(FsCourseListBySidebarParam param);
+
+    /**
+     * 根据userid修改外部联系人评论状态
+     * @param commentStatus 评论状态
+     * @param fsUserId 用户id
+     * @return
+     */
+    int updateQwExternalContactByFsUserId(Integer commentStatus, Long fsUserId);
 }

+ 5 - 0
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -342,6 +342,11 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
         return qwUserMapper.getQwExternalListByHeavy(param);
     }
 
+    @Override
+    public int updateQwExternalContactByFsUserId(Integer commentStatus, Long fsUserId) {
+        return qwExternalContactMapper.updateQwExternalContactByFsUserId(commentStatus, fsUserId);
+    }
+
     /**
      * 处理一个分组(组内串行)
      */

+ 4 - 2
fs-service/src/main/resources/db/20250530-初始化表结构.sql

@@ -18,7 +18,7 @@ CREATE TABLE `sys_keyword`  (
 SET FOREIGN_KEY_CHECKS = 1;
 
 
-    
+
 
 SET NAMES utf8mb4;
 SET FOREIGN_KEY_CHECKS = 0;
@@ -44,7 +44,9 @@ CREATE TABLE `fs_course_watch_comment`  (
                                             `mode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '展示模式',
                                             `color` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字体颜色',
                                             PRIMARY KEY (`comment_id`) USING BTREE,
-                                            INDEX `user_id_index`(`user_id` ASC) USING BTREE
+                                            INDEX `user_id_index`(`user_id` ASC) USING BTREE,
+                                            INDEX `course_id_index`(`course_id` ASC) USING BTREE,
+                                            INDEX `video_id_index`(`video_id` ASC) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '看课评论表' ROW_FORMAT = Dynamic;
 
 SET FOREIGN_KEY_CHECKS = 1;

+ 35 - 10
fs-service/src/main/resources/mapper/course/FsCourseWatchCommentMapper.xml

@@ -27,17 +27,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                font_size, mode, color from fs_course_watch_comment
     </sql>
 
-    <select id="selectFsCourseWatchCommentList" parameterType="FsCourseWatchComment" resultMap="FsCourseWatchCommentResult">
-        <include refid="selectFsCourseWatchCommentVo"/>
+    <select id="selectFsCourseWatchCommentList" resultType="com.fs.course.vo.FsCourseWatchCommentListVO">
+        SELECT
+        fs_course_watch_comment.comment_id,
+        fs_course_watch_comment.user_id,
+        fs_course_watch_comment.user_type,
+        fs_course_watch_comment.course_id,
+        fs_course_watch_comment.video_id,
+        fs_course_watch_comment.type,
+        fs_course_watch_comment.parent_id,
+        fs_course_watch_comment.content,
+        fs_course_watch_comment.create_time,
+        fs_course_watch_comment.update_time,
+        fs_course_watch_comment.is_revoke,
+        fs_course_watch_comment.`time`,
+        fs_course_watch_comment.font_size,
+        fs_course_watch_comment.`mode`,
+        fs_course_watch_comment.color,
+        fs_user.nick_name
+        <if test="isAll != null and isAll == true ">
+            ,fs_user_course.course_name, fs_user_course_video.title
+        </if>
+        FROM
+        fs_course_watch_comment
+        LEFT JOIN fs_user ON fs_user.user_id = fs_course_watch_comment.user_id
+        <if test="isAll != null and isAll == true">
+            LEFT JOIN fs_user_course on fs_user_course.course_id = fs_course_watch_comment.course_id
+            LEFT JOIN fs_user_course_video on fs_user_course_video.video_id = fs_course_watch_comment.video_id
+        </if>
         <where>
-            <if test="userId != null "> and user_id = #{userId}</if>
-            <if test="userType != null "> and user_type = #{userType}</if>
-            <if test="courseId != null "> and course_id = #{courseId}</if>
-            <if test="videoId != null "> and video_id = #{videoId}</if>
-            <if test="type != null "> and type = #{type}</if>
-            <if test="parentId != null "> and parent_id = #{parentId}</if>
-            <if test="content != null  and content != ''"> and content = #{content}</if>
-            <if test="isRevoke != null "> and is_revoke = #{isRevoke}</if>
+            <if test="nickName != null and nickName != '' ">and fs_user.nick_name like concat('%', #{nickName}, '%')</if>
+            <if test="isAll != null and isAll == true and keywords != null and keywords !='' ">
+                AND (fs_user.nickname LIKE concat('%',#{keywords},'%')
+                or  fs_user_course.course_name LIKE concat('%',#{keywords},'%')
+                or  fs_user_course_video.title LIKE concat('%',#{keywords},'%')
+                )
+            </if>
         </where>
     </select>