Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

ct 4 napja
szülő
commit
0ea400c300

+ 52 - 9
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseVideoController.java

@@ -2,6 +2,7 @@ package com.fs.course.controller;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
@@ -12,13 +13,12 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.course.config.CourseConfig;
+import com.fs.course.domain.FsDepVideoShow;
 import com.fs.course.domain.FsUserCourse;
 import com.fs.course.domain.FsUserCourseVideo;
+import com.fs.course.mapper.FsDepVideoShowMapper;
 import com.fs.course.mapper.FsUserCourseVideoMapper;
-import com.fs.course.param.BatchEditCoverParam;
-import com.fs.course.param.BatchRedUpdate;
-import com.fs.course.param.BatchVideoSvae;
-import com.fs.course.param.CourseVideoUpdates;
+import com.fs.course.param.*;
 import com.fs.course.service.IFsUserCourseService;
 import com.fs.course.service.IFsUserCourseVideoService;
 import com.fs.course.vo.FsUserCourseVideoChooseVO;
@@ -29,6 +29,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -59,7 +60,10 @@ public class FsUserCourseVideoController extends BaseController
 
     @Autowired
     private ISysConfigService configService;
-
+    @Autowired
+    private FsDepVideoShowMapper fsDepVideoShowMapper;
+    @Value("${cloud_host.company_name}")
+    private String companyName;
     /**
      * 查询课堂视频列表
      */
@@ -138,17 +142,56 @@ public class FsUserCourseVideoController extends BaseController
         // 设置项目ID
         FsUserCourse fsUserCourse = fsUserCourseService.selectFsUserCourseByCourseId(fsUserCourseVideo.getCourseId());
         fsUserCourseVideo.setProjectId(fsUserCourse.getProject());
-        return toAjax(fsUserCourseVideoService.insertFsUserCourseVideo(fsUserCourseVideo));
+        int result = fsUserCourseVideoService.insertFsUserCourseVideo(fsUserCourseVideo);
+        if ("北京卓美".equals(companyName) && result > 0 &&  fsUserCourseVideo.getShowProduct() != null) {
+                // 先检查是否存在相同记录
+                QueryWrapper<FsDepVideoShow> queryWrapper = new QueryWrapper<>();
+                Long videoId = fsUserCourseVideo.getVideoId();
+                queryWrapper.eq("video_id", videoId);
+                FsDepVideoShow fsDepVideoShow = fsDepVideoShowMapper.selectOne(queryWrapper);
+                if (fsDepVideoShow != null) {
+                    // 更新现有记录
+                    fsDepVideoShow.setIsShow(fsUserCourseVideo.getShowProduct().toString());
+                    fsDepVideoShowMapper.updateByVideoId(fsDepVideoShow);
+                } else {
+                    // 插入新记录
+                    fsDepVideoShow = new FsDepVideoShow();
+                    fsDepVideoShow.setVideoId(videoId);
+                    fsDepVideoShow.setIsShow(fsUserCourseVideo.getShowProduct().toString());
+                    fsDepVideoShow.setDepId(loginUser.getDeptId());
+                    fsDepVideoShowMapper.insertFsDepVideoShowByVideoId(fsDepVideoShow);
+                }
+        }
+        return toAjax(result);
     }
-
     /**
      * 修改课堂视频
      */
     @PreAuthorize("@ss.hasPermi('course:userCourseVideo:edit')")
     @Log(title = "课堂视频", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody FsUserCourseVideo fsUserCourseVideo)
-    {
+    public AjaxResult edit(@RequestBody FsUserCourseVideo fsUserCourseVideo) {
+        if ("北京卓美".equals(companyName)) {
+            Integer showProduct = fsUserCourseVideo.getShowProduct();
+            if (showProduct != null) {
+                // 先检查是否存在相同记录
+                QueryWrapper<FsDepVideoShow> queryWrapper = new QueryWrapper<>();
+                Long videoId = fsUserCourseVideo.getVideoId();
+                queryWrapper.eq("video_id", videoId);
+                FsDepVideoShow fsDepVideoShow = fsDepVideoShowMapper.selectOne(queryWrapper);
+                if (fsDepVideoShow != null) {
+                    // 更新现有记录
+                    fsDepVideoShow.setIsShow(showProduct.toString());
+                    fsDepVideoShowMapper.updateByVideoId(fsDepVideoShow);
+                } else {
+                    // 插入新记录
+                    fsDepVideoShow = new FsDepVideoShow();
+                    fsDepVideoShow.setIsShow(showProduct.toString());
+                    fsDepVideoShow.setVideoId(videoId);
+                    fsDepVideoShowMapper.insertFsDepVideoShowByVideoId(fsDepVideoShow);
+                }
+            }
+        }
         return toAjax(fsUserCourseVideoService.updateFsUserCourseVideo(fsUserCourseVideo));
     }
 

+ 29 - 0
fs-service/src/main/java/com/fs/course/domain/FsDepVideoShow.java

@@ -0,0 +1,29 @@
+package com.fs.course.domain;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 部门视频疗包展示关联对象 fs_dep_video_show
+ *
+ * @author fs
+ * @date 2025-10-11
+ */
+@Data
+@EqualsAndHashCode()
+public class FsDepVideoShow {
+
+    /** 视频id */
+    private Long videoId;
+
+    /** 是否展示疗包 0展示 1不展示 */
+    @Excel(name = "是否展示疗包 0展示 1不展示")
+    private String isShow;
+
+    /** 部门id */
+    @Excel(name = "部门id")
+    private Long depId;
+
+
+}

+ 5 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCourseVideo.java

@@ -1,5 +1,6 @@
 package com.fs.course.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
@@ -128,4 +129,8 @@ public class FsUserCourseVideo extends BaseEntity
     private String jobId;
 
     private String vid;
+
+    @TableField(exist = false)
+    private Integer showProduct; //1不展示疗法,0展示疗法
+
 }

+ 43 - 0
fs-service/src/main/java/com/fs/course/mapper/FsDepVideoShowMapper.java

@@ -0,0 +1,43 @@
+package com.fs.course.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.course.domain.FsDepVideoShow;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+/**
+ * 部门视频疗包展示关联Mapper接口
+ * 
+ * @author fs
+ * @date 2025-10-11
+ */
+public interface FsDepVideoShowMapper extends BaseMapper<FsDepVideoShow>{
+    /**
+     * 部门视频疗包展示关联
+     * 
+     * @param videoId, depId  部门视频疗包展示关联主键
+     * @return 部门视频疗包展示关联
+     */
+    @Select("<script>" +
+            "SELECT is_show FROM fs_dep_video_show WHERE video_id = #{videoId}" +
+            "<if test='depId != null'> AND dep_id = #{depId}</if>" +
+            "</script>")
+    String selectFsDepVideoShowByVideoId(@Param("videoId")Long videoId,@Param("depId") Long depId);
+
+    @Select("SELECT is_show FROM fs_dep_video_show WHERE video_id = #{videoId}")
+    String searchAllByVideoIdString(Long videoId);
+    /**
+     * 增加部门视频疗包展示关联
+     *
+     * @param fsDepVideoShow 部门视频疗包展示关联主键
+     * @return 部门视频疗包展示关联
+     */
+    @Insert("INSERT INTO fs_dep_video_show(video_id, is_show, dep_id) VALUES(#{videoId}, #{isShow}, #{depId})")
+    int insertFsDepVideoShowByVideoId(FsDepVideoShow fsDepVideoShow);
+
+    @Update("UPDATE fs_dep_video_show SET is_show = #{isShow} WHERE video_id = #{videoId} AND dep_id = #{depId}")
+    int updateByVideoId(FsDepVideoShow fsDepVideoShow);
+
+}

+ 6 - 0
fs-service/src/main/java/com/fs/qw/mapper/QwWatchLogMapper.java

@@ -115,6 +115,12 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
             "<if test ='ids !=null and ids!=\"\"'>\n" +
             "   and qec.qw_user_id in (${ids})\n" +
             "</if>" +
+            "<if test = 'addWays != null and addWays.size()>0' >" +
+            "and qec.add_way in  " +
+            "<foreach collection=\"addWays\" item=\"item\" open=\"(\" close=\")\" separator=\",\">\n" +
+            "       ${item}\n" +
+            "                  </foreach>" +
+            "</if>" +
             "GROUP BY\n" +
             "    qec.qw_user_id, DATE(qec.create_time) \n" +
             "ORDER BY\n" +

+ 6 - 0
fs-service/src/main/java/com/fs/qw/param/QwWatchLogStatisticsListParam.java

@@ -45,6 +45,12 @@ public class QwWatchLogStatisticsListParam {
     private Long pageNum;
     private Long pageSize;
     private List<Long> filterDeptIds;
+
+    /**
+     * 添加方式
+     */
+    private List<Integer> addWays;
+
     /**
      * 今正要求把公司筛选条件优化到细分至部门,销售(前端判断,只有今正传)
      */