|
@@ -1014,20 +1014,16 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
courseWatchLogMapper.insertFsCourseWatchLog(fsCourseWatchLog);
|
|
|
}
|
|
|
|
|
|
- // 判断是否重粉
|
|
|
- if(!companyUser.getUserId().equals(fsUser.getCompanyUserId())){
|
|
|
- FsUserCompanyUser fsUserCompanyUser = new FsUserCompanyUser();
|
|
|
- fsUserCompanyUser.setIsRepeatFans(1);
|
|
|
- fsUserCompanyUser.setUserId(param.getUserId());
|
|
|
- fsUserCompanyUser.setCompanyId(param.getCompanyId());
|
|
|
- fsUserCompanyUser.setCompanyUserId(param.getCompanyUserId());
|
|
|
- QueryWrapper<FsUserCompanyUser> queryWrapper = new QueryWrapper<FsUserCompanyUser>().eq("user_id", param.getUserId()).eq("company_user_id", param.getCompanyUserId());
|
|
|
- Integer i = fsUserCompanyUserMapper.selectCount(queryWrapper);
|
|
|
- if(i == 0) {
|
|
|
- fsUserCompanyUserMapper.insertFsUserCompanyUser(fsUserCompanyUser);
|
|
|
- }
|
|
|
+ // 判断是否重粉,添加关系表数据
|
|
|
+ FsUserCompanyUser fsUserCompanyUser = getFsUserCompanyUser(param, fsUser);
|
|
|
+ QueryWrapper<FsUserCompanyUser> queryWrapper = new QueryWrapper<FsUserCompanyUser>().eq("user_id", param.getUserId()).eq("company_user_id", param.getCompanyUserId());
|
|
|
+ Integer i = fsUserCompanyUserMapper.selectCount(queryWrapper);
|
|
|
+ if(i == 0) {
|
|
|
+ fsUserCompanyUserMapper.insertFsUserCompanyUser(fsUserCompanyUser);
|
|
|
+ }
|
|
|
|
|
|
- // 打上重粉标签
|
|
|
+ // 如果重粉需要打上重粉标签
|
|
|
+ if(1 == fsUserCompanyUser.getIsRepeatFans()){
|
|
|
FsUserCourseBeMemberParam fsUserCourseBeMemberParam = new FsUserCourseBeMemberParam();
|
|
|
fsUserCourseBeMemberParam.setUserId(param.getUserId());
|
|
|
fsUserCourseBeMemberParam.setCompanyId(param.getCompanyId());
|
|
@@ -1037,6 +1033,21 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
return ResponseResult.ok(Boolean.TRUE);
|
|
|
}
|
|
|
|
|
|
+ // 添加关系表数据
|
|
|
+ public static FsUserCompanyUser getFsUserCompanyUser(FsUserCourseAddCompanyUserParam param, FsUser fsUser) {
|
|
|
+ FsUserCompanyUser fsUserCompanyUser = new FsUserCompanyUser();
|
|
|
+ // 判断是否绑定了销售,如果已绑定,则需要标识为重粉,且放黑名单
|
|
|
+ if (fsUser.getCompanyUserId() != null && !fsUser.getCompanyUserId().equals(param.getCompanyUserId())) {
|
|
|
+ fsUserCompanyUser.setIsRepeatFans(1);
|
|
|
+ } else {
|
|
|
+ fsUserCompanyUser.setIsRepeatFans(0);
|
|
|
+ }
|
|
|
+ fsUserCompanyUser.setUserId(param.getUserId());
|
|
|
+ fsUserCompanyUser.setCompanyId(param.getCompanyId());
|
|
|
+ fsUserCompanyUser.setCompanyUserId(param.getCompanyUserId());
|
|
|
+ return fsUserCompanyUser;
|
|
|
+ }
|
|
|
+
|
|
|
private String getCompanyUserQRCode(CompanyUser companyUser) {
|
|
|
String companyUserQRCode;
|
|
|
if(StringUtils.isNotEmpty(companyUser.getQrCodeWeixin())){
|
|
@@ -1078,7 +1089,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Long duration = 0L;
|
|
|
+ long duration = 0L;
|
|
|
long tipsTime = 0L;
|
|
|
int isFinish = 0;
|
|
|
FsUserCourseVideoLinkDetailsVO vo = new FsUserCourseVideoLinkDetailsVO();
|
|
@@ -1103,9 +1114,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
duration = Objects.isNull(watchLog) ? 0 : watchLog.getDuration();
|
|
|
}
|
|
|
//
|
|
|
-// if (course.getDuration()!=null){
|
|
|
-// tipsTime = course.getDuration()/2;
|
|
|
-// }
|
|
|
+ if (courseVideoDetails != null && courseVideoDetails.getDuration() != null){
|
|
|
+ tipsTime = courseVideoDetails.getDuration()/2;
|
|
|
+ }
|
|
|
+ vo.setTipsTime(tipsTime);
|
|
|
//判断是否完课
|
|
|
if (watchLog!=null && watchLog.getLogType() == 2) {
|
|
|
isFinish = 1;
|