Browse Source

Merge remote-tracking branch 'origin/master'

zx 1 week ago
parent
commit
578cec068d

+ 1 - 1
fs-qw-api-msg/src/main/resources/logback.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 <configuration>
     <!-- 日志存放路径 -->
     <!-- 日志存放路径 -->
-	<property name="log.path" value="/home/fs-qw-api/logs" />
+	<property name="log.path" value="/home/fs-qw-api-msg/logs" />
     <!-- 日志输出格式 -->
     <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 
 

+ 1 - 1
fs-service/src/main/java/com/fs/course/config/CourseConfig.java

@@ -30,7 +30,7 @@ public class CourseConfig implements Serializable {
     private List<DisabledTimeVo> disabledTimeList;//充值手续费百分比
     private List<DisabledTimeVo> disabledTimeList;//充值手续费百分比
     private Integer completionMode; // 完课模式
     private Integer completionMode; // 完课模式
     private Integer minutesNum; //多少分钟算完课
     private Integer minutesNum; //多少分钟算完课
-    private Integer isOpenComment; //是否开启评论
+    private Integer openCommentStatus; //开启评论/弹幕
     private Integer viewCommentNum; // 查看历史评论数量
     private Integer viewCommentNum; // 查看历史评论数量
 
 
 
 

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

@@ -1,6 +1,7 @@
 package com.fs.course.domain;
 package com.fs.course.domain;
 
 
 import com.fs.common.annotation.Excel;
 import com.fs.common.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import com.fs.common.core.domain.BaseEntity;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
@@ -50,5 +51,19 @@ public class FsCourseWatchComment extends BaseEntity{
     @Excel(name = "是否是撤回的消息,1-是,0-否")
     @Excel(name = "是否是撤回的消息,1-是,0-否")
     private Integer isRevoke;
     private Integer isRevoke;
 
 
+    @Excel(name = "时间点,记录发送消息的视频播放时间点")
+    private Integer time;
+
+    @ApiModelProperty(value = "字体大小")
+    @Excel(name = "字体大小")
+    private String fontSize;
+
+    @ApiModelProperty(value = "展示模式")
+    @Excel(name = "展示模式")
+    private String mode;
+
+    @ApiModelProperty(value = "字体颜色")
+    @Excel(name = "字体颜色")
+    private String color;
 
 
 }
 }

+ 4 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCoursePeriod.java

@@ -98,4 +98,8 @@ public class FsUserCoursePeriod
     private List<Long> companyIdList;
     private List<Long> companyIdList;
 
 
     private Integer maxViewNum;
     private Integer maxViewNum;
+
+    @Excel(name = "开启评论或者弹幕,1-开启评论;2-开启弹幕;3-都关闭")
+    private Integer openCommentStatus;
+
 }
 }

+ 8 - 2
fs-service/src/main/java/com/fs/course/param/FsCourseWatchCommentListParam.java

@@ -14,7 +14,13 @@ public class FsCourseWatchCommentListParam{
     @ApiModelProperty(value = "页大小,默认为10", required = true)
     @ApiModelProperty(value = "页大小,默认为10", required = true)
     private Integer pageSize = 10;
     private Integer pageSize = 10;
 
 
-    @ApiModelProperty(value = "不传,通过配置获取")
-    private Integer listNum;
+//    @ApiModelProperty(value = "不传,通过配置获取")
+//    private Integer listNum;
+
+    @ApiModelProperty(value = "课程id")
+    private Long courseId;
+
+    @ApiModelProperty(value = "视频id")
+    private Long videoId;
 
 
 }
 }

+ 12 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseWatchCommentSaveParam.java

@@ -29,4 +29,16 @@ public class FsCourseWatchCommentSaveParam{
     @ApiModelProperty(value = "评论内容")
     @ApiModelProperty(value = "评论内容")
     private String content;
     private String content;
 
 
+    @ApiModelProperty(value = "时间(用于弹幕记录时间)")
+    private Integer time;
+
+    @ApiModelProperty(value = "字体大小")
+    private String fontSize;
+
+    @ApiModelProperty(value = "展示模式")
+    private String mode;
+
+    @ApiModelProperty(value = "字体颜色")
+    private String color;
+
 }
 }

+ 12 - 0
fs-service/src/main/java/com/fs/course/vo/FsCourseWatchCommentVO.java

@@ -38,4 +38,16 @@ public class FsCourseWatchCommentVO{
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
     private Date createTime;
 
 
+    @ApiModelProperty(value = "时间(用于弹幕记录时间)")
+    private Integer time;
+
+    @ApiModelProperty(value = "字体大小")
+    private String fontSize;
+
+    @ApiModelProperty(value = "展示模式")
+    private String mode;
+
+    @ApiModelProperty(value = "字体颜色")
+    private String color;
+
 }
 }

+ 3 - 0
fs-service/src/main/java/com/fs/sop/domain/QwSop.java

@@ -113,4 +113,7 @@ public class QwSop implements Serializable
     // 群聊ID
     // 群聊ID
     private String chatId;
     private String chatId;
 
 
+    @Excel(name = "开启评论或者弹幕,1-开启评论;2-开启弹幕;3-都关闭")
+    private Integer openCommentStatus;
+
 }
 }

+ 42 - 2
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsMapper.java

@@ -137,7 +137,6 @@ public interface SopUserLogsMapper {
     @DataSource(DataSourceType.SOP)
     @DataSource(DataSourceType.SOP)
     SopUserLogs selectSopUserLogsByDateAndIds(SopUserLogsParamByDate sopUserLogs);
     SopUserLogs selectSopUserLogsByDateAndIds(SopUserLogsParamByDate sopUserLogs);
 
 
-    //TODO left join 改为inner join
     @DataSource(DataSourceType.SOP)
     @DataSource(DataSourceType.SOP)
     @Select({"<script> " +
     @Select({"<script> " +
             "SELECT DISTINCT\n" +
             "SELECT DISTINCT\n" +
@@ -152,7 +151,7 @@ public interface SopUserLogsMapper {
             "            l.user_id,\n" +
             "            l.user_id,\n" +
             "            DATEDIFF(CURRENT_DATE, l.start_time) + 1 AS count_days\n" +
             "            DATEDIFF(CURRENT_DATE, l.start_time) + 1 AS count_days\n" +
             "        FROM sop_user_logs l " +
             "        FROM sop_user_logs l " +
-            "left join sop_user_logs_info i on l.id = i.user_logs_id "  +
+            "inner join sop_user_logs_info i on l.id = i.user_logs_id "  +
             "where 1=1 " +
             "where 1=1 " +
             "<if test = ' maps.id!=null '> " +
             "<if test = ' maps.id!=null '> " +
             "and l.id = #{maps.id} " +
             "and l.id = #{maps.id} " +
@@ -179,6 +178,47 @@ public interface SopUserLogsMapper {
             "</script>"})
             "</script>"})
     List<SopUserLogsVO> selectSopUserLogsListByParam(@Param("maps") SopUserLogsParam param);
     List<SopUserLogsVO> selectSopUserLogsListByParam(@Param("maps") SopUserLogsParam param);
 
 
+    @DataSource(DataSourceType.SOP)
+    @Select({"<script> " +
+            "SELECT DISTINCT\n" +
+            "            l.id,\n" +
+            "            l.sop_id,\n" +
+            "            l.sop_temp_id,\n" +
+            "            l.qw_user_id,\n" +
+            "            l.corp_id,\n" +
+            "            l.chat_id,\n" +
+            "            l.start_time,\n" +
+            "            l.status,\n" +
+            "            l.user_id,\n" +
+            "            DATEDIFF(CURRENT_DATE, l.start_time) + 1 AS count_days\n" +
+            "        FROM sop_user_logs l " +
+            "left join sop_user_logs_info i on l.id = i.user_logs_id "  +
+            "where 1=1 " +
+            "<if test = ' maps.id!=null '> " +
+            "and l.id = #{maps.id} " +
+            "</if>" +
+            "<if test = ' maps.sopId != null '> " +
+            "and l.sop_id = #{maps.sopId} " +
+            "</if>" +
+            "<if test = ' maps.sopTempId != null '> " +
+            "and l.sop_temp_id = #{maps.sopTempId} " +
+            "</if>" +
+            "<if test = ' maps.qwUserId!=null  '> " +
+            "and l.qw_user_id = #{maps.qwUserId} " +
+            "</if>" +
+            "<if test = ' maps.startTime!=null  '> " +
+            "and l.start_time = #{maps.startTime} " +
+            "</if>" +
+            "<if test = ' maps.status!=null  '> " +
+            "and l.status = #{maps.status} " +
+            "</if>" +
+            "<if test = ' maps.externalUserName!=null and maps.externalUserName != \"\"  '> " +
+            "and i.external_user_name like concat('%', #{maps.externalUserName}, '%') " +
+            "</if>" +
+            "order by start_time desc" +
+            "</script>"})
+    List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogsParam param);
+
 
 
     @DataSource(DataSourceType.SOP)
     @DataSource(DataSourceType.SOP)
     void batchInsertSopUserLogs(@Param("list") List<SopUserLogs> list);
     void batchInsertSopUserLogs(@Param("list") List<SopUserLogs> list);

+ 9 - 1
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsServiceImpl.java

@@ -22,6 +22,7 @@ import com.fs.qw.service.IQwGroupChatService;
 import com.fs.qw.vo.QwSopRuleTimeVO;
 import com.fs.qw.vo.QwSopRuleTimeVO;
 import com.fs.qw.vo.QwSopTempSetting;
 import com.fs.qw.vo.QwSopTempSetting;
 import com.fs.qwApi.service.QwApiService;
 import com.fs.qwApi.service.QwApiService;
+import com.fs.sop.domain.QwSop;
 import com.fs.sop.domain.QwSopLogs;
 import com.fs.sop.domain.QwSopLogs;
 import com.fs.sop.domain.SopUserLogs;
 import com.fs.sop.domain.SopUserLogs;
 import com.fs.sop.domain.SopUserLogsInfo;
 import com.fs.sop.domain.SopUserLogsInfo;
@@ -616,7 +617,14 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 
 
     @Override
     @Override
     public List<SopUserLogsVO> selectSopUserLogsList(SopUserLogsParam param) {
     public List<SopUserLogsVO> selectSopUserLogsList(SopUserLogsParam param) {
-        List<SopUserLogsVO> list = sopUserLogsMapper.selectSopUserLogsListByParam(param);
+        QwSop qwSop = sopMapper.selectQwSopById(param.getSopId());
+        Integer filterMode = qwSop.getFilterMode();
+        List<SopUserLogsVO> list;
+        if(filterMode == null || filterMode == 1){
+            list = sopUserLogsMapper.selectSopUserLogsListByParam(param);
+        }else{
+            list = sopUserLogsMapper.selectSopUserLogsGroupListByParam(param);
+        }
         List<String> chatIdList = PubFun.listToNewList(list, SopUserLogsVO::getChatId);
         List<String> chatIdList = PubFun.listToNewList(list, SopUserLogsVO::getChatId);
         if(!chatIdList.isEmpty()){
         if(!chatIdList.isEmpty()){
             List<QwGroupChat> qwGroupChatList = qwGroupChatService.selectQwGroupChatByChatIds(chatIdList.toArray(new String[0]));
             List<QwGroupChat> qwGroupChatList = qwGroupChatService.selectQwGroupChatByChatIds(chatIdList.toArray(new String[0]));

+ 18 - 0
fs-service/src/main/resources/db/20250528-sop.sql

@@ -0,0 +1,18 @@
+DROP PROCEDURE IF EXISTS add_tb_column;
+DELIMITER $$
+CREATE PROCEDURE add_tb_column()
+BEGIN
+		DECLARE  CurrentDatabase VARCHAR(100);
+SELECT DATABASE() INTO CurrentDatabase;
+
+-- qw_sop 表添加 open_comment_status 字段
+IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS  WHERE TABLE_SCHEMA=CurrentDatabase
+            AND TABLE_NAME='qw_sop'
+            AND COLUMN_NAME='open_comment_status' )
+		THEN
+alter table qw_sop add column open_comment_status int COMMENT '开启评论或者弹幕,1-开启评论;2-开启弹幕;3-都关闭';
+END IF;
+
+END;
+
+CALL add_tb_column;

+ 28 - 0
fs-service/src/main/resources/db/20250528.sql

@@ -0,0 +1,28 @@
+DROP PROCEDURE IF EXISTS add_tb_column;
+DELIMITER $$
+CREATE PROCEDURE add_tb_column()
+BEGIN
+		DECLARE  CurrentDatabase VARCHAR(100);
+SELECT DATABASE() INTO CurrentDatabase;
+
+
+-- fs_user_course_period 表添加 open_comment_status 字段
+IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS  WHERE TABLE_SCHEMA=CurrentDatabase
+				AND TABLE_NAME='fs_user_course_period'
+				AND COLUMN_NAME='open_comment_status' )
+		THEN
+alter table fs_user_course_period add column open_comment_status int COMMENT '开启评论或者弹幕,1-开启评论;2-开启弹幕;3-都关闭';
+END IF;
+
+-- qw_external_contact 表添加 comment_status 字段
+IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS  WHERE TABLE_SCHEMA=CurrentDatabase
+				AND TABLE_NAME='qw_external_contact'
+				AND COLUMN_NAME='comment_status' )
+		THEN
+alter table qw_external_contact add column comment_status tinyint COMMENT '看课评论状态,1-拉黑;0-正常';
+END IF;
+
+
+END;
+
+CALL add_tb_column;

+ 25 - 2
fs-service/src/main/resources/mapper/course/FsCourseWatchCommentMapper.xml

@@ -16,10 +16,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="isRevoke"    column="is_revoke"    />
         <result property="isRevoke"    column="is_revoke"    />
+        <result property="time"    column="time"    />
+        <result property="fontSize"    column="font_size"    />
+        <result property="mode"    column="mode"    />
+        <result property="color"    column="color"    />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectFsCourseWatchCommentVo">
     <sql id="selectFsCourseWatchCommentVo">
-        select comment_id, user_id, user_type, course_id, video_id, type, parent_id, content, create_time, update_time, is_revoke from fs_course_watch_comment
+        select comment_id, user_id, user_type, course_id, video_id, type, parent_id, content, create_time, update_time, is_revoke, `time`,
+               font_size, mode, color from fs_course_watch_comment
     </sql>
     </sql>
 
 
     <select id="selectFsCourseWatchCommentList" parameterType="FsCourseWatchComment" resultMap="FsCourseWatchCommentResult">
     <select id="selectFsCourseWatchCommentList" parameterType="FsCourseWatchComment" resultMap="FsCourseWatchCommentResult">
@@ -54,6 +59,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="isRevoke != null">is_revoke,</if>
             <if test="isRevoke != null">is_revoke,</if>
+            <if test="time != null">`time`,</if>
+            <if test="fontSize != null">font_size,</if>
+            <if test="mode != null">mode,</if>
+            <if test="color != null">color,</if>
          </trim>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
             <if test="userId != null">#{userId},</if>
@@ -66,6 +75,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isRevoke != null">#{isRevoke},</if>
             <if test="isRevoke != null">#{isRevoke},</if>
+            <if test="time != null">#{time},</if>
+            <if test="fontSize != null">#{fontSize},</if>
+            <if test="mode != null">#{mode},</if>
+            <if test="color != null">#{color},</if>
          </trim>
          </trim>
     </insert>
     </insert>
 
 
@@ -82,6 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isRevoke != null">is_revoke = #{isRevoke},</if>
             <if test="isRevoke != null">is_revoke = #{isRevoke},</if>
+            <if test="time != null">`time` = #{time},</if>
+            <if test="fontSize != null">font_size = #{fontSize},</if>
+            <if test="mode != null">mode = #{mode},</if>
+            <if test="color != null">color = #{color},</if>
         </trim>
         </trim>
         where comment_id = #{commentId}
         where comment_id = #{commentId}
     </update>
     </update>
@@ -99,10 +116,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectH5CourseWatchComments" resultType="com.fs.course.vo.FsCourseWatchCommentVO">
     <select id="selectH5CourseWatchComments" resultType="com.fs.course.vo.FsCourseWatchCommentVO">
         select cwc.comment_id, cwc.user_id, cwc.user_type, cwc.course_id, cwc.video_id, cwc.type, cwc.content, cwc.create_time,
         select cwc.comment_id, cwc.user_id, cwc.user_type, cwc.course_id, cwc.video_id, cwc.type, cwc.content, cwc.create_time,
-        fs_user.nick_name from fs_course_watch_comment cwc
+        fs_user.nick_name,cwc.time,cwc.font_size, cwc.mode, cwc.color from fs_course_watch_comment cwc
         left join fs_user on fs_user.user_id = cwc.user_id
         left join fs_user on fs_user.user_id = cwc.user_id
         <where>
         <where>
            and cwc.is_revoke = 0
            and cwc.is_revoke = 0
+            <if test="courseId != null">
+                and cwc.course_id = #{courseId}
+           </if>
+            <if test="videoId != null">
+                and cwc.video_id = #{videoId}
+            </if>
         </where>
         </where>
         order by cwc.create_time desc
         order by cwc.create_time desc
     </select>
     </select>

+ 4 - 0
fs-service/src/main/resources/mapper/course/FsUserCoursePeriodMapper.xml

@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="periodStartingTime"    column="period_starting_time"    />
         <result property="periodStartingTime"    column="period_starting_time"    />
         <result property="periodEndTime"    column="period_end_time"    />
         <result property="periodEndTime"    column="period_end_time"    />
         <result property="maxViewNum"    column="max_view_num"    />
         <result property="maxViewNum"    column="max_view_num"    />
+        <result property="openCommentStatus"    column="open_comment_status"    />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectFsUserCoursePeriodVo">
     <sql id="selectFsUserCoursePeriodVo">
@@ -102,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="viewEndTime != null">view_end_time,</if>
             <if test="viewEndTime != null">view_end_time,</if>
             <if test="lastJoinTime != null">last_join_time,</if>
             <if test="lastJoinTime != null">last_join_time,</if>
             <if test="maxViewNum != null">max_view_num,</if>
             <if test="maxViewNum != null">max_view_num,</if>
+            <if test="openCommentStatus != null">open_comment_status,</if>
          </trim>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="periodId != null">#{periodId},</if>
             <if test="periodId != null">#{periodId},</if>
@@ -120,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="viewEndTime != null">#{viewEndTime},</if>
             <if test="viewEndTime != null">#{viewEndTime},</if>
             <if test="lastJoinTime != null">#{lastJoinTime},</if>
             <if test="lastJoinTime != null">#{lastJoinTime},</if>
             <if test="maxViewNum != null">#{maxViewNum},</if>
             <if test="maxViewNum != null">#{maxViewNum},</if>
+            <if test="openCommentStatus != null">#{openCommentStatus},</if>
          </trim>
          </trim>
     </insert>
     </insert>
 
 
@@ -141,6 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="viewEndTime != null">view_end_time = #{viewEndTime},</if>
             <if test="viewEndTime != null">view_end_time = #{viewEndTime},</if>
             <if test="lastJoinTime != null">last_join_time = #{lastJoinTime},</if>
             <if test="lastJoinTime != null">last_join_time = #{lastJoinTime},</if>
             <if test="maxViewNum != null">max_view_num = #{maxViewNum},</if>
             <if test="maxViewNum != null">max_view_num = #{maxViewNum},</if>
+            <if test="openCommentStatus != null">open_comment_status = #{openCommentStatus},</if>
         </trim>
         </trim>
         where period_id = #{periodId}
         where period_id = #{periodId}
     </update>
     </update>

+ 5 - 1
fs-service/src/main/resources/mapper/sop/QwSopMapper.xml

@@ -30,6 +30,7 @@
         <result property="stopTime"    column="stop_time"    />
         <result property="stopTime"    column="stop_time"    />
         <result property="isRating"    column="is_rating"    />
         <result property="isRating"    column="is_rating"    />
         <result property="courseDay"    column="course_day"    />
         <result property="courseDay"    column="course_day"    />
+        <result property="openCommentStatus"    column="open_comment_status"    />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectQwSopVo">
     <sql id="selectQwSopVo">
@@ -247,7 +248,7 @@
         and send_type in(2,3)
         and send_type in(2,3)
         order by create_time desc
         order by create_time desc
     </select>
     </select>
-    <select id="selectQwSopById" parameterType="String" resultMap="QwSopResult">
+    <select id="selectQwSopById" parameterType="String" resultType="com.fs.sop.domain.QwSop">
         <include refid="selectQwSopVo"/>
         <include refid="selectQwSopVo"/>
         where id = #{id}
         where id = #{id}
     </select>
     </select>
@@ -278,6 +279,7 @@
             <if test="data.maxSend != null">max_send,</if>
             <if test="data.maxSend != null">max_send,</if>
             <if test="data.isRating != null">is_rating,</if>
             <if test="data.isRating != null">is_rating,</if>
             <if test="data.courseDay != null">course_day,</if>
             <if test="data.courseDay != null">course_day,</if>
+            <if test="data.openCommentStatus != null">open_comment_status,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="data.name != null">#{data.name},</if>
             <if test="data.name != null">#{data.name},</if>
@@ -303,6 +305,7 @@
             <if test="data.maxSend != null">#{data.maxSend},</if>
             <if test="data.maxSend != null">#{data.maxSend},</if>
             <if test="data.isRating != null">#{data.isRating},</if>
             <if test="data.isRating != null">#{data.isRating},</if>
             <if test="data.courseDay != null">#{data.courseDay},</if>
             <if test="data.courseDay != null">#{data.courseDay},</if>
+            <if test="data.openCommentStatus != null">#{data.openCommentStatus},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -422,6 +425,7 @@
             <if test="data.voice != null">voice = #{data.voice},</if>
             <if test="data.voice != null">voice = #{data.voice},</if>
             <if test="data.isRating != null">is_rating = #{data.isRating},</if>
             <if test="data.isRating != null">is_rating = #{data.isRating},</if>
             <if test="data.courseDay != null">course_day = #{data.courseDay},</if>
             <if test="data.courseDay != null">course_day = #{data.courseDay},</if>
+            <if test="data.openCommentStatus != null">open_comment_status = #{data.openCommentStatus},</if>
         </trim>
         </trim>
         where id = #{data.id}
         where id = #{data.id}
     </update>
     </update>

+ 7 - 1
fs-service/src/main/resources/mapper/statis/ConsumptionBalanceMapper.xml

@@ -380,7 +380,13 @@
                                     </if>
                                     </if>
                                 </where>
                                 </where>
                 ) AS black_num,
                 ) AS black_num,
-                (select COUNT(*) FROM qw_user) AS qw_member_num
+                (select COUNT(*) FROM qw_user
+                    <where>
+                        <if test="companyId != null">
+                            company_id = ${companyId}
+                        </if>
+                    </where>
+        ) AS qw_member_num
     </select>
     </select>
     <select id="getCurrentBalanceCompanyId" resultType="java.math.BigDecimal">
     <select id="getCurrentBalanceCompanyId" resultType="java.math.BigDecimal">
         select sum(money) from company
         select sum(money) from company

+ 17 - 4
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -18,6 +18,8 @@ import com.fs.course.service.impl.TencentCloudCosService;
 import com.fs.course.vo.*;
 import com.fs.course.vo.*;
 import com.fs.his.service.IFsIntegralGoodsService;
 import com.fs.his.service.IFsIntegralGoodsService;
 import com.fs.his.vo.OptionsVO;
 import com.fs.his.vo.OptionsVO;
+import com.fs.sop.domain.QwSop;
+import com.fs.sop.service.IQwSopService;
 import com.fs.system.service.ISysConfigService;
 import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
@@ -85,6 +87,9 @@ public class CourseController extends  AppBaseController{
     @Autowired
     @Autowired
     private IFsIntegralGoodsService goodsService;
     private IFsIntegralGoodsService goodsService;
 
 
+    @Autowired
+    private IQwSopService qwSopService;
+
 
 
     @Cacheable(value="getCourseCate" )
     @Cacheable(value="getCourseCate" )
     @ApiOperation("获取分类")
     @ApiOperation("获取分类")
@@ -405,7 +410,11 @@ public class CourseController extends  AppBaseController{
         if (videoDuration==null){
         if (videoDuration==null){
             redisCache.setCacheObject(videoRedisKey,course.getDuration());
             redisCache.setCacheObject(videoRedisKey,course.getDuration());
         }
         }
-
+        // 返回是否开启评论/弹幕。优先获取sop任务配置的是否开启评论/弹幕,如果没有配置就取总后台的配置;
+        QwSop qwSop = qwSopService.selectQwSopById(log.getSopId());
+        if(qwSop != null && qwSop.getOpenCommentStatus() != null) {
+            config.setOpenCommentStatus(qwSop.getOpenCommentStatus());
+        }
 
 
         return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime).put("isFinish",isFinish);
         return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime).put("isFinish",isFinish);
     }
     }
@@ -554,15 +563,19 @@ public class CourseController extends  AppBaseController{
     @ApiOperation("获取历史评论数据")
     @ApiOperation("获取历史评论数据")
     @GetMapping("/getComments")
     @GetMapping("/getComments")
     public ResponseResult<PageInfo<FsCourseWatchCommentVO>> getCourseWatchComments(@ApiParam(value = "页码", required = true) @RequestParam Integer pageNum,
     public ResponseResult<PageInfo<FsCourseWatchCommentVO>> getCourseWatchComments(@ApiParam(value = "页码", required = true) @RequestParam Integer pageNum,
-            @ApiParam(value = "每页大小", required = true) @RequestParam Integer pageSize)
+            @ApiParam(value = "每页大小", required = true) @RequestParam Integer pageSize,
+            @ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
+            @ApiParam(value = "视频id", required = true) @RequestParam Long videoId)
     {
     {
         //获取配置信息中需要查询的数据条数
         //获取配置信息中需要查询的数据条数
-        String json = configService.selectConfigByKey("course.config");
-        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+//        String json = configService.selectConfigByKey("course.config");
+//        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
 
 
         FsCourseWatchCommentListParam param = new FsCourseWatchCommentListParam();
         FsCourseWatchCommentListParam param = new FsCourseWatchCommentListParam();
         param.setPageNum(pageNum);
         param.setPageNum(pageNum);
         param.setPageSize(pageSize);
         param.setPageSize(pageSize);
+        param.setCourseId(courseId);
+        param.setVideoId(videoId);
 //        param.setListNum(config.getViewCommentNum() != null &&  config.getViewCommentNum() != 0 ? config.getViewCommentNum() : 200);
 //        param.setListNum(config.getViewCommentNum() != null &&  config.getViewCommentNum() != 0 ? config.getViewCommentNum() : 200);
 
 
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);

+ 12 - 0
fs-user-app/src/main/java/com/fs/websocket/bean/SendMsgVO.java

@@ -32,5 +32,17 @@ public class SendMsgVO {
     @ApiModelProperty("消息内容")
     @ApiModelProperty("消息内容")
     private String msg;
     private String msg;
 
 
+    @ApiModelProperty(value = "时间(用于弹幕记录时间)")
+    private Integer time;
+
+    @ApiModelProperty(value = "字体大小")
+    private String fontSize;
+
+    @ApiModelProperty(value = "展示模式")
+    private String mode;
+
+    @ApiModelProperty(value = "字体颜色")
+    private String color;
+
 
 
 }
 }