Browse Source

公域视频 查看范围修改

yuhongqi 1 tháng trước cách đây
mục cha
commit
4c3ecb980b

+ 13 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseCommentController.java

@@ -85,6 +85,19 @@ public class FsUserCourseCommentController extends BaseController
         return util.exportExcel(list, "课堂评论数据");
     }
 
+    /**
+     * 导出公域看课评论列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseWatchComment:export')")
+    @Log(title = "公域看课评论", businessType = BusinessType.EXPORT)
+    @GetMapping("/publicCourseVideoWatchComment/export")
+    public AjaxResult exportPublicCourseWatchComment(FsCourseWatchCommentPageParam param)
+    {
+        List<FsCourseWatchCommentListVO> list = fsCourseWatchCommentService.selectFsCourseWatchCommentPublicList(param);
+        ExcelUtil<FsCourseWatchCommentListVO> util = new ExcelUtil<FsCourseWatchCommentListVO>(FsCourseWatchCommentListVO.class);
+        return util.exportExcel(list, "公域看课评论数据");
+    }
+
     /**
      * 获取课堂评论详细信息
      */

+ 8 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseVideoController.java

@@ -248,6 +248,14 @@ public class FsUserCourseVideoController extends BaseController
         return getDataTable(list);
     }
 
+    @GetMapping("/getPublicVideoListByCourseId")
+    public TableDataInfo getPublicVideoListByCourseId(FsUserCourseVideo fsUserCourseVideo)
+    {
+        startPage();
+        List<FsUserCourseVideo> list = fsUserCourseVideoService.selectFsUserCourseVideoListByCourseId(fsUserCourseVideo);
+        return getDataTable(list);
+    }
+
     @GetMapping("/getVideoListByCourseIdAll")
     public TableDataInfo getVideoListByCourseIdAll(Long courseId)
     {

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

@@ -43,4 +43,8 @@ public class FsCourseWatchCommentPageParam extends BaseEntity{
     @ApiModelProperty(value = "分类类型:0-评论,1-公域看课评论")
     private Integer cateType;
 
+    /** 弹幕状态:0-正常,1-屏蔽 */
+    @ApiModelProperty(value = "弹幕状态:0-正常,1-屏蔽")
+    private Integer status;
+
 }

+ 37 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseQuestionBankServiceImpl.java

@@ -720,6 +720,43 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
         if (thisRightCount == questionCount) {
             logs.setIsRight(1);
             courseAnswerLogsMapper.insertFsCourseAnswerLogs(logs);
+
+            // 答题成功自动发放积分
+            try {
+                FsUserCourseVideo video = courseVideoMapper.selectFsUserCourseVideoByVideoId(param.getVideoId());
+                if (video != null && video.getIntegralReward() != null && video.getIntegralReward() > 0) {
+                    String businessId = resolveAnswerIntegralBusinessId(param.getVideoId(), param.getPeriodId());
+                    FsUserIntegralLogs existed = fsUserIntegralLogsMapper.selectAnswerRewardIntegralLog(param.getUserId(), businessId);
+                    if (existed == null) {
+                        FsUser user = fsUserMapper.selectFsUserByUserId(param.getUserId());
+                        if (user != null) {
+                            long baseIntegral = user.getIntegral() != null ? user.getIntegral() : 0L;
+                            long reward = video.getIntegralReward().longValue();
+                            long newBalance = baseIntegral + reward;
+
+                            FsUser upd = new FsUser();
+                            upd.setUserId(param.getUserId());
+                            upd.setIntegral(newBalance);
+                            fsUserMapper.updateFsUser(upd);
+
+                            FsUserIntegralLogs integralLogs = new FsUserIntegralLogs();
+                            integralLogs.setIntegral(reward);
+                            integralLogs.setUserId(param.getUserId());
+                            integralLogs.setBalance(newBalance);
+                            integralLogs.setLogType(FsUserIntegralLogTypeEnum.TYPE_17.getValue());
+                            integralLogs.setBusinessId(businessId);
+                            integralLogs.setRemark(FsUserIntegralLogTypeEnum.TYPE_17.getDesc());
+                            integralLogs.setCreateTime(new Date());
+                            fsUserIntegralLogsService.insertFsUserIntegralLogs(integralLogs);
+
+                            return R.ok("答题成功").put("integral", video.getIntegralReward()).put("balance", newBalance);
+                        }
+                    }
+                }
+            } catch (Exception e) {
+
+            }
+
             return R.ok("答题成功");
         }
         logs.setIsRight(0);

+ 1 - 0
fs-service/src/main/resources/mapper/course/FsCourseWatchCommentMapper.xml

@@ -103,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             c.is_del = 0
             <if test="courseId != null"> AND c.course_id = #{courseId}</if>
             <if test="nickName != null and nickName != ''"> AND u.nick_name LIKE CONCAT('%', #{nickName}, '%')</if>
+            <if test="status != null"> AND c.status = #{status}</if>
             <if test="keywords != null and keywords != '' and isAll != null and isAll == true">
                 AND (
                     u.nick_name LIKE CONCAT('%',#{keywords},'%')

+ 3 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseMapper.xml

@@ -339,12 +339,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="recHomeCourseTopEnabled != null">rec_home_course_top_enabled = #{recHomeCourseTopEnabled},</if>
             <if test="recHomeCourseTopMode != null">rec_home_course_top_mode = #{recHomeCourseTopMode},</if>
             <if test="recHomeCourseTopSort != null">rec_home_course_top_sort = #{recHomeCourseTopSort},</if>
+            <if test="recHomeCourseTopSort == null">rec_home_course_top_sort = null,</if>
             <if test="recMallHomeEnabled != null">rec_mall_home_enabled = #{recMallHomeEnabled},</if>
             <if test="recMallHomeMode != null">rec_mall_home_mode = #{recMallHomeMode},</if>
             <if test="recMallHomeSort != null">rec_mall_home_sort = #{recMallHomeSort},</if>
+            <if test="recMallHomeSort == null">rec_mall_home_sort = null,</if>
             <if test="recHomeLongVideoEnabled != null">rec_home_long_video_enabled = #{recHomeLongVideoEnabled},</if>
             <if test="recHomeLongVideoMode != null">rec_home_long_video_mode = #{recHomeLongVideoMode},</if>
             <if test="recHomeLongVideoSort != null">rec_home_long_video_sort = #{recHomeLongVideoSort},</if>
+            <if test="recHomeLongVideoSort == null">rec_home_long_video_sort = null,</if>
         </trim>
         where course_id = #{courseId}
     </update>