2 次代碼提交 c1a07a9ec4 ... 1f0d89850b

作者 SHA1 備註 提交日期
  zyp 1f0d89850b Merge remote-tracking branch 'origin/master' 1 周之前
  zyp b6ce71da8d zyp 1 周之前

+ 2 - 0
fs-service-system/src/main/java/com/fs/course/config/CourseConfig.java

@@ -14,6 +14,8 @@ public class CourseConfig implements Serializable {
     private Integer answerIntegral;//答题获得积分
     private Integer defaultLine;//默认看课线路
     private String realLinkDomainName;//真链域名
+    private String authDomainName;//网页授权域名
+    private String mpAppId;//看课公众号APPID
     private String registerDomainName;//注册域名
     private String courseDomainName;//链接域名
     private Integer rewardType; // 奖励类型 1红包 2积分

+ 2 - 1
fs-service-system/src/main/java/com/fs/course/param/FsCourseSendRewardUParam.java

@@ -22,6 +22,7 @@ public class FsCourseSendRewardUParam implements Serializable
     private String corpId;
     private Integer linkType;
     private Long qwExternalId;
-    private Integer source=1;//来源 1:h5  2:彩虹汇医小程序
+    private Integer source=1;//来源 1:h5  2:小程序
+    private Integer isRoom;
 
 }

+ 1 - 0
fs-service-system/src/main/java/com/fs/course/param/FsUserCourseVideoFinishUParam.java

@@ -19,4 +19,5 @@ public class FsUserCourseVideoFinishUParam implements Serializable {
     private String uuId;
     private Long qwExternalId;
     private Integer linkType;
+    private Integer isRoom;
 }

+ 4 - 3
fs-service-system/src/main/java/com/fs/course/service/impl/FsCourseLinkServiceImpl.java

@@ -382,14 +382,15 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
                         return R.error("真实链接不存在").put("realLink", sLink);
                     }
                     log.info("链接仍然有效: {}", sLink);
+                    String json = configService.selectConfigByKey("course.config");
+                    CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
                     String domainName = companyUserMapper.selectDomainByUserId(courseLink.getCompanyUserId());
                     if (StringUtils.isEmpty(domainName)){
-                        String json = configService.selectConfigByKey("course.config");
-                        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
                         domainName = config.getRealLinkDomainName();
                     }
                     String realLink = domainName+courseLink.getRealLink();
-                    return R.ok().put("realLink",realLink );
+                    String imgUrl = "";
+                    return R.ok().put("realLink",realLink ).put("config",config).put("headerImg",imgUrl);
                 }
             } else {
                 // 链接不存在或解析失败

+ 11 - 1
fs-service-system/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -286,6 +286,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             return R.ok();
         }
 
+        if (param.getIsRoom()!=null&&param.getIsRoom()==1&&param.getQwExternalId()==null){
+            return R.ok();
+        }
+
         // 从Redis中获取观看时长
         String redisKey = "h5user:watch:duration:" + param.getQwUserId()+ ":" + param.getQwExternalId() + ":" + param.getVideoId();
         try {
@@ -373,7 +377,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         log.setSendType(2);
         log.setDuration(0L);
         log.setCreateTime(new Date());
-        log.setLogType(0);
+        log.setLogType(3);
         courseWatchLogMapper.insertFsCourseWatchLog(log);
     }
 
@@ -447,8 +451,14 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             FsUser user = new FsUser();
             user.setUserId(param.getUserId());
             user.setIsAddQw(1);
+            user.setQwExtId(param.getQwExternalId());
             fsUserMapper.updateFsUser(user);
 
+            List<String> list= sopUserLogsInfoMapper.selectSopUserLogsInfoByExtId(contact.getId());
+            if (list!=null&& !list.isEmpty()){
+                sopUserLogsInfoMapper.updateSopUserLogsInfoFsUserIdById(list,param.getUserId());
+            }
+
             //绑定上之后 更新观看记录
             //看课记录中userId为0绑定userId
             if (log.getUserId()==null||log.getUserId().equals(0L) || !log.getUserId().equals(param.getUserId())){

+ 11 - 12
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -8,6 +8,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
+import com.fs.core.utils.OrderCodeUtils;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.*;
 import com.fs.course.param.*;
@@ -360,12 +361,19 @@ public class CourseController extends  AppBaseController{
         long tipsTime = 0L;
         int isFinish = 0;
         if (param.getLinkType()!=null&&param.getLinkType()==1){
-            return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime).put("maxBufferLength",config.getMaxBufferLength());
+            return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime);
+        }
+
+        if (param.getIsRoom()!=null&&param.getIsRoom()==1&&param.getQwExternalId()==null){
+            return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime);
         }
         // 从Redis中获取观看时长
         String redisKey = "h5user:watch:duration:" + param.getQwUserId()+ ":" + param.getQwExternalId() + ":" + param.getVideoId();
         String durationStr = redisCache.getCacheObject(redisKey);
         FsCourseWatchLog log = courseWatchLogService.getWatchCourseVideo(param.getUserId(),param.getVideoId(),param.getQwUserId(),param.getQwExternalId());
+        if (log==null){
+            return R.error("记录不存在,请联系客服!");
+        }
         //redis取不到查库
         if (durationStr != null) {
             duration = Long.parseLong(durationStr);
@@ -378,7 +386,7 @@ public class CourseController extends  AppBaseController{
         }
         //判断是否完课
         if (log.getLogType()==2){
-           isFinish=1;
+            isFinish=1;
         }
 
         //将视频时长也存到redis
@@ -389,7 +397,7 @@ public class CourseController extends  AppBaseController{
         }
 
 
-        return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime).put("maxBufferLength",config.getMaxBufferLength()).put("isFinish",isFinish);
+        return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime).put("isFinish",isFinish);
     }
 
 
@@ -454,16 +462,7 @@ public class CourseController extends  AppBaseController{
         param.setUserId(userId);
         return courseVideoService.isAddKf(param);
     }
-    @Login
-    @ApiOperation("注册看课")
-    @PostMapping("/registerCourse")
-    public R register(@RequestBody FsUserCourseRegisterParam param) {
-        Long userId = Long.parseLong(getUserId());
 
-        param.setUserId(userId);
-        logger.info("小程序用户Id:"+param.getUserId());
-        return courseVideoService.registerCourse(param);
-    }
     @Login
     @ApiOperation("获取缓冲流量")
     @PostMapping("/getInternetTraffic")