Przeglądaj źródła

Merge remote-tracking branch 'origin/bjcz_his_scrm' into bjcz_his_scrm

吴树波 1 tydzień temu
rodzic
commit
ac692a2890

+ 5 - 1
fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java

@@ -12,7 +12,9 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ServletUtils;
 import com.fs.course.config.CourseConfig;
+import com.fs.course.domain.FsUserCourseVideo;
 import com.fs.course.domain.FsVideoResource;
+import com.fs.course.service.IFsUserCourseVideoService;
 import com.fs.course.service.IFsVideoResourceService;
 import com.fs.course.vo.FsVideoResourceVO;
 import com.fs.framework.web.service.TokenService;
@@ -36,7 +38,8 @@ import java.util.stream.Collectors;
 public class FsVideoResourceController extends BaseController {
 
     private final IFsVideoResourceService fsVideoResourceService;
-
+    @Autowired
+    private IFsUserCourseVideoService fsUserCourseVideoService;
     @Autowired
     private TokenService tokenService;
 
@@ -112,6 +115,7 @@ public class FsVideoResourceController extends BaseController {
     {
         fsVideoResource.setUpdateTime(LocalDateTime.now());
         fsVideoResourceService.updateById(fsVideoResource);
+        fsUserCourseVideoService.updateVideoByVideoUrl(fsVideoResource.getVideoUrl());
         return AjaxResult.success();
     }
 

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

@@ -91,6 +91,6 @@ public class FsCourseWatchLog extends BaseEntity
     /** im发送消息详情id */
     private Long imMsgSendDetailId;
     /** 所属小程序id**/
-    private String appid;
+    private String appId;
 
 }

+ 3 - 4
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoMapper.java

@@ -1,10 +1,7 @@
 package com.fs.course.mapper;
 
 import com.fs.course.domain.FsUserCourseVideo;
-import com.fs.course.param.CourseVideoUpdates;
-import com.fs.course.param.FsCourseListBySidebarParam;
-import com.fs.course.param.FsUserCourseVideoListUParam;
-import com.fs.course.param.FsUserCourseVideoParam;
+import com.fs.course.param.*;
 import com.fs.course.param.newfs.UserCourseVideoPageParam;
 import com.fs.course.vo.*;
 import com.fs.course.vo.newfs.FsUserCourseVideoPageListVO;
@@ -60,6 +57,8 @@ public interface FsUserCourseVideoMapper
      * @return 结果
      */
     public int updateFsUserCourseVideo(FsUserCourseVideo fsUserCourseVideo);
+    int updateVideoByVideoUrl(@Param("videoUrl") String videoUrl, @Param("ids") List<Long> ids);
+    List<FsUserCourseVideo> selectByVideoUrl(String videoUrl);
 
     @Update("<script> " +
             "update fs_user_course_video set red_packet_money=#{data.redPacketMoney}, random_red_packet_rules = #{data.randomRedPacketRules} where course_id=#{data.courseId} " +

+ 1 - 1
fs-service/src/main/java/com/fs/course/param/FsUserCourseVideoAddKfUParam.java

@@ -70,5 +70,5 @@ public class FsUserCourseVideoAddKfUParam implements Serializable {
 
     private Integer isOpenCourse;
     /** 所属小程序id**/
-    private String appid;
+    private String appId;
 }

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

@@ -1,6 +1,6 @@
 package com.fs.course.service;
 
-import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.ResponseResult;
 import com.fs.course.domain.FsUserCourseVideo;
@@ -17,7 +17,6 @@ import com.fs.course.vo.newfs.FsUserVideoListVO;
 import com.fs.his.domain.FsUser;
 import com.fs.his.vo.OptionsVO;
 import com.fs.qw.param.FsUserCourseRedPageParam;
-import com.fs.sop.domain.QwSopTempDay;
 
 import java.util.List;
 import java.util.Map;
@@ -195,6 +194,7 @@ public interface IFsUserCourseVideoService
     R checkUserInfo(long l);
 
     R updateVideo();
+    AjaxResult updateVideoByVideoUrl(String videoUrl);
 
     R checkUserInfo(Long userId);
 

+ 13 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fs.common.BeanCopyUtils;
 import com.fs.common.constant.FsConstants;
+import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.ResponseResult;
 import com.fs.common.core.domain.entity.SysDictData;
@@ -934,7 +935,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
                 log.setUserId(param.getUserId());
             }
             //跟新所属小程序ID
-            log.setAppid(param.getAppid());
+            log.setAppId(param.getAppId());
             log.setUpdateTime(new Date());
             courseWatchLogMapper.updateFsCourseWatchLog(log);
 
@@ -3321,7 +3322,17 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
                 videoDuration/60, config.getMinutesNum()));
     }
 
-
+    @Override
+    public AjaxResult updateVideoByVideoUrl(String videoUrl) {
+        List<FsUserCourseVideo> videoList = fsUserCourseVideoMapper.selectByVideoUrl(videoUrl);
+        if (CollectionUtils.isEmpty(videoList)){
+            log.warn("根据videoUrl:{} 未查询到fs_user_course_video表数据",videoUrl);
+            return AjaxResult.success();
+        }
+        List<Long> idList = videoList.stream().map(FsUserCourseVideo::getVideoId).collect(Collectors.toList());
+        fsUserCourseVideoMapper.updateVideoByVideoUrl(videoUrl, idList);
+        return AjaxResult.success();
+    }
     @Override
     public R updateVideo() {
         FsUserCourseVideo param = new FsUserCourseVideo();

+ 11 - 11
fs-service/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml

@@ -26,11 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="lastHeartbeatTime"    column="last_heartbeat_time"    />
         <result property="project"    column="project"    />
         <result property="periodId"    column="period_id"    />
-        <result property="appid"    column="appid"    />
+        <result property="appId"    column="app_id"    />
     </resultMap>
 
     <sql id="selectFsCourseWatchLogVo">
-        select log_id, user_id,finish_time,send_finish_msg,sop_id,video_id,reward_type, log_type, create_time, update_time, qw_external_contact_id, duration, qw_user_id, company_user_id, company_id, course_id,camp_period_time,project,period_id,appid  from fs_course_watch_log
+        select log_id, user_id,finish_time,send_finish_msg,sop_id,video_id,reward_type, log_type, create_time, update_time, qw_external_contact_id, duration, qw_user_id, company_user_id, company_id, course_id,camp_period_time,project,period_id,app_id  from fs_course_watch_log
     </sql>
 
     <select id="selectFsCourseWatchLogList" parameterType="FsCourseWatchLog" resultMap="FsCourseWatchLogResult">
@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sendType != null "> and send_type = #{sendType}</if>
             <if test="campPeriodTime != null "> and camp_period_time = #{campPeriodTime}</if>
             <if test="project != null "> and project = #{project}</if>
-            <if test="appid != null "> and appid = #{appid}</if>
+            <if test="appId != null "> and app_id = #{appId}</if>
         </where>
     </select>
 
@@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectFsCourseWatchLogListVO" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
         select l.log_id,l.project,l.period_id,l.user_id,uc.course_name,v.title as video_name,qec.avatar as external_user_avatar,
-        l.log_type,SEC_TO_TIME(l.duration) as duration,c.company_name,l.camp_period_time,l.finish_time,l.appid,
+        l.log_type,SEC_TO_TIME(l.duration) as duration,c.company_name,l.camp_period_time,l.finish_time,l.app_id,
         cu.nick_name as company_user_name ,l.send_type,l.create_time,l.update_time,l.last_heartbeat_time,fcpsc.name,
         CASE
             WHEN qu.qw_user_name IS NOT NULL AND qu.qw_user_name LIKE '{%' THEN JSON_UNQUOTE(JSON_EXTRACT(qu.qw_user_name, '$.name'))
@@ -75,10 +75,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          left join company c on c.company_id = l.company_id
          LEFT JOIN qw_user qu on qu.id= l.qw_user_id
          LEFT JOIN qw_external_contact qec on l.qw_external_contact_id = qec.id
-         LEFT JOIN fs_course_play_source_config fcpsc on l.appid = fcpsc.appid
+         LEFT JOIN fs_course_play_source_config fcpsc on l.app_id = fcpsc.appid
         <where>
             <if test ='maps.appid != null'>
-                and l.appid = #{maps.appid}
+                and l.app_id = #{maps.appid}
             </if>
             <if test ='maps.isVip != null and maps.isVip == 0'>
                 and (l.user_id = 0 or l.user_id is null)
@@ -284,7 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="campPeriodTime != null">camp_period_time,</if>
             <if test="periodId != null">period_id,</if>
             <if test="project != null">project,</if>
-            <if test="appid != null">appid,</if>
+            <if test="appId != null">app_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -306,7 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="campPeriodTime != null">#{campPeriodTime},</if>
             <if test="periodId != null">#{periodId},</if>
             <if test="project != null">#{project},</if>
-            <if test="appid != null">#{appid},</if>
+            <if test="appId != null">#{appId},</if>
         </trim>
     </insert>
 
@@ -331,7 +331,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sendFinishMsg != null">send_finish_msg,</if>
             <if test="campPeriodTime != null">camp_period_time,</if>
             <if test="project != null">project,</if>
-            <if test="appid != null">appid,</if>
+            <if test="appId != null">app_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -352,7 +352,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sendFinishMsg != null">#{sendFinishMsg},</if>
             <if test="campPeriodTime != null">#{campPeriodTime},</if>
             <if test="project != null">#{project},</if>
-            <if test="appid != null">#{appid},</if>
+            <if test="appId != null">#{appId},</if>
         </trim>
         on duplicate key update
         <trim suffixOverrides=",">
@@ -435,7 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="lastHeartbeatTime != null">last_heartbeat_time = #{lastHeartbeatTime},</if>
             <if test="periodId != null">period_id = #{periodId},</if>
             <if test="project != null">project = #{project},</if>
-            <if test="appid != null">appid = #{appid},</if>
+            <if test="appId != null">app_id = #{appId},</if>
         </trim>
         where log_id = #{logId}
     </update>

+ 11 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml

@@ -239,6 +239,17 @@
         </trim>
         where video_id = #{videoId}
     </update>
+    
+    <select id="selectByVideoUrl" parameterType="String" resultMap="FsUserCourseVideoResult">
+        select v.* from fs_user_course_video v where v.is_del = 0 and  v.video_url = #{videoUrl} 
+    </select>
+    <update id="updateVideoByVideoUrl" >
+        update fs_user_course_video set video_url = #{videoUrl} 
+        where video_id in 
+        <foreach item="videoId" collection="ids" open="(" separator="," close=")">
+            #{videoId}
+        </foreach>
+    </update>
 
     <update id="deleteFsUserCourseVideoByVideoId" parameterType="String">
         update fs_user_course_video set is_del = 1 where video_id = #{videoId}