|
|
@@ -631,9 +631,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
log.setUserId(param.getUserId());
|
|
|
}
|
|
|
//区分课程来源 0 小程序 1 app
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- log.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// log.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
log.setUpdateTime(new Date());
|
|
|
//重粉逻辑
|
|
|
//
|
|
|
@@ -657,9 +657,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
//看课记录中userId为0绑定userId
|
|
|
log.setUserId(param.getUserId());
|
|
|
//区分课程来源
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- log.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// log.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
log.setUpdateTime(new Date());
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
}
|
|
|
@@ -782,9 +782,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
log.setQwUserId(Long.valueOf(param.getQwUserId()));
|
|
|
log.setCreateTime(new Date());
|
|
|
log.setLogType(3);
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- log.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// log.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
logger.info("【群聊生成看课记录】:{}", param);
|
|
|
courseWatchLogMapper.insertFsCourseWatchLog(log);
|
|
|
}
|
|
|
@@ -865,9 +865,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
if (log.getUserId() == null || log.getUserId().equals(0L) || !log.getUserId().equals(param.getUserId())) {
|
|
|
log.setUserId(param.getUserId());
|
|
|
}
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- log.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// log.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
log.setUpdateTime(new Date());
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
|
|
|
@@ -908,9 +908,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
if (log.getUserId() == null || log.getUserId().equals(0L) || !log.getUserId().equals(param.getUserId())) {
|
|
|
log.setUserId(param.getUserId());
|
|
|
}
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- log.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// log.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
log.setUpdateTime(new Date());
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
|
|
|
@@ -1942,9 +1942,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
if (watchCourseVideo != null) {
|
|
|
FsCourseWatchLog updateLog = new FsCourseWatchLog();
|
|
|
updateLog.setUpdateTime(new Date());
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- updateLog.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// updateLog.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
|
|
|
} else {
|
|
|
FsCourseWatchLog fsCourseWatchLog = new FsCourseWatchLog();
|
|
|
@@ -1953,9 +1953,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
fsCourseWatchLog.setDuration(0L);
|
|
|
fsCourseWatchLog.setCreateTime(new Date());
|
|
|
fsCourseWatchLog.setLogType(1);
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- fsCourseWatchLog.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// fsCourseWatchLog.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
courseWatchLogMapper.insertFsCourseWatchLog(fsCourseWatchLog);
|
|
|
String redisKey = "h5wxuser:watch:heartbeat:" + param.getUserId() + ":" + param.getVideoId() + ":" + 0;
|
|
|
redisCache.setCacheObject(redisKey, LocalDateTime.now().toString());
|
|
|
@@ -1969,20 +1969,23 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
if (companyUser == null) {
|
|
|
return ResponseResult.fail(405, "当前销售不存在");
|
|
|
}
|
|
|
- //营期公司的开关状态
|
|
|
- List<Integer> selected = periodCompanyMapper.selectRegistrationSwitchByPeriodId(param.getPeriodId());
|
|
|
- //课程注册链接开关
|
|
|
- FsUserCoursePeriodDays fsUserCoursePeriodDays = fsUserCoursePeriodDaysMapper.selectFsUserCoursePeriodDaysById(param.getId());
|
|
|
- if (CollectionUtils.isNotEmpty(selected) &&fsUserCoursePeriodDays != null) {
|
|
|
- Integer registrationSwitch = fsUserCoursePeriodDays.getRegistrationSwitch();
|
|
|
- //注册开关开启 未注册的用户不允许看课
|
|
|
- if((registrationSwitch!=null&®istrationSwitch==1)&&selected.contains(1)){
|
|
|
- //查询用户是否注册
|
|
|
- FsSalesUserPeriodRelation fsSalesUserPeriodRelation = periodRelationMapper.selectBySalesUserPeriodAndDays(param.getCompanyUserId(), param.getUserId(), param.getPeriodId(),param.getId());
|
|
|
- if (fsSalesUserPeriodRelation == null) {
|
|
|
- return ResponseResult.fail(506, "当前营期下的用户未绑定该销售,请注册");
|
|
|
- }
|
|
|
- }
|
|
|
+ if(param.getTypeFlag()==0){
|
|
|
+ //小程序看课需要判断是否注册
|
|
|
+ //营期公司的开关状态
|
|
|
+ List<Integer> selected = periodCompanyMapper.selectRegistrationSwitchByPeriodId(param.getPeriodId());
|
|
|
+ //课程注册链接开关
|
|
|
+ FsUserCoursePeriodDays fsUserCoursePeriodDays = fsUserCoursePeriodDaysMapper.selectFsUserCoursePeriodDaysById(param.getId());
|
|
|
+ if (CollectionUtils.isNotEmpty(selected) &&fsUserCoursePeriodDays != null) {
|
|
|
+ Integer registrationSwitch = fsUserCoursePeriodDays.getRegistrationSwitch();
|
|
|
+ //注册开关开启 未注册的用户不允许看课
|
|
|
+ if((registrationSwitch!=null&®istrationSwitch==1)&&selected.contains(1)){
|
|
|
+ //查询用户是否注册
|
|
|
+ FsSalesUserPeriodRelation fsSalesUserPeriodRelation = periodRelationMapper.selectBySalesUserPeriodAndDays(param.getCompanyUserId(), param.getUserId(), param.getPeriodId(),param.getId());
|
|
|
+ if (fsSalesUserPeriodRelation == null) {
|
|
|
+ return ResponseResult.fail(506, "当前营期下的用户未绑定该销售,请注册");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
// 获取课程所属项目id
|
|
|
FsUserCourse fsUserCourse = fsUserCourseMapper.selectFsUserCourseByCourseId(param.getCourseId());
|
|
|
@@ -2055,9 +2058,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
updateLog.setPeriodId(param.getPeriodId());
|
|
|
updateLog.setProject(courseProject);
|
|
|
updateLog.setUpdateTime(new Date());
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- updateLog.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// updateLog.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
|
|
|
} else {
|
|
|
FsCourseWatchLog fsCourseWatchLog = new FsCourseWatchLog();
|
|
|
@@ -2067,9 +2070,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
fsCourseWatchLog.setCreateTime(new Date());
|
|
|
fsCourseWatchLog.setLogType(1);
|
|
|
fsCourseWatchLog.setProject(courseProject);
|
|
|
- if (param.getTypeFlag() != null) {
|
|
|
- fsCourseWatchLog.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if (param.getTypeFlag() != null) {
|
|
|
+// fsCourseWatchLog.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
courseWatchLogMapper.insertFsCourseWatchLog(fsCourseWatchLog);
|
|
|
|
|
|
String redisKey = "h5wxuser:watch:heartbeat:" + param.getUserId() + ":" + param.getVideoId() + ":" + param.getCompanyUserId();
|
|
|
@@ -3132,9 +3135,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
|
|
|
log.setCreateTime(new Date());
|
|
|
log.setLogType(3);
|
|
|
logger.info("【群聊生成看课记录】:{}", param);
|
|
|
- if(param.getTypeFlag()!=null){
|
|
|
- log.setTypeFlag(param.getTypeFlag());
|
|
|
- }
|
|
|
+// if(param.getTypeFlag()!=null){
|
|
|
+// log.setTypeFlag(param.getTypeFlag());
|
|
|
+// }
|
|
|
courseWatchLogMapper.insertFsCourseWatchLog(log);
|
|
|
} catch (BeansException e) {
|
|
|
return R.error("群聊生成看课记录失败!");
|