|
@@ -9,6 +9,7 @@ import com.fs.common.core.domain.ResponseResult;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
|
+import com.fs.common.utils.date.DateUtil;
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
import com.fs.course.config.CourseConfig;
|
|
import com.fs.course.config.CourseConfig;
|
|
@@ -27,13 +28,7 @@ import com.fs.course.vo.FsUserCourseVideoQVO;
|
|
import com.fs.course.vo.FsUserCourseVideoVO;
|
|
import com.fs.course.vo.FsUserCourseVideoVO;
|
|
import com.fs.course.vo.newfs.*;
|
|
import com.fs.course.vo.newfs.*;
|
|
import com.fs.his.param.WxSendRedPacketParam;
|
|
import com.fs.his.param.WxSendRedPacketParam;
|
|
-import com.fs.sop.mapper.SopUserLogsInfoMapper;
|
|
|
|
-import com.fs.store.domain.FsUser;
|
|
|
|
-import com.fs.store.domain.FsUserIntegralLogs;
|
|
|
|
-import com.fs.store.mapper.FsUserIntegralLogsMapper;
|
|
|
|
-import com.fs.store.mapper.FsUserMapper;
|
|
|
|
-import com.fs.store.service.IFsStorePaymentService;
|
|
|
|
-import com.fs.store.service.IFsUserService;
|
|
|
|
|
|
+import com.fs.his.vo.OptionsVO;
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
import com.fs.qw.domain.QwUser;
|
|
import com.fs.qw.domain.QwUser;
|
|
import com.fs.qw.mapper.QwExternalContactMapper;
|
|
import com.fs.qw.mapper.QwExternalContactMapper;
|
|
@@ -42,25 +37,30 @@ import com.fs.qwApi.Result.QwAddContactWayResult;
|
|
import com.fs.qwApi.param.QwAddContactWayParam;
|
|
import com.fs.qwApi.param.QwAddContactWayParam;
|
|
import com.fs.qwApi.service.QwApiService;
|
|
import com.fs.qwApi.service.QwApiService;
|
|
import com.fs.sop.mapper.QwSopLogsMapper;
|
|
import com.fs.sop.mapper.QwSopLogsMapper;
|
|
|
|
+import com.fs.sop.mapper.SopUserLogsInfoMapper;
|
|
|
|
+import com.fs.store.domain.FsUser;
|
|
|
|
+import com.fs.store.domain.FsUserIntegralLogs;
|
|
|
|
+import com.fs.store.mapper.FsUserIntegralLogsMapper;
|
|
|
|
+import com.fs.store.mapper.FsUserMapper;
|
|
|
|
+import com.fs.store.service.IFsStorePaymentService;
|
|
|
|
+import com.fs.store.service.IFsUserService;
|
|
import com.fs.store.service.cache.IFsUserCourseCacheService;
|
|
import com.fs.store.service.cache.IFsUserCourseCacheService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.github.binarywang.wxpay.bean.transfer.TransferBillsResult;
|
|
import com.github.binarywang.wxpay.bean.transfer.TransferBillsResult;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
-import java.util.Collections;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.time.LocalTime;
|
|
|
|
+import java.util.*;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
-import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -70,6 +70,7 @@ import java.util.stream.Collectors;
|
|
* @author fs
|
|
* @author fs
|
|
* @date 2024-05-17
|
|
* @date 2024-05-17
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
{
|
|
{
|
|
@@ -97,7 +98,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
private FsCourseSopLogsMapper courseSopLogsMapper;
|
|
private FsCourseSopLogsMapper courseSopLogsMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private QwApiService qwApiService;
|
|
private QwApiService qwApiService;
|
|
-// @Autowired
|
|
|
|
|
|
+ // @Autowired
|
|
// private IAdHtmlClickLogService adHtmlClickLogService;
|
|
// private IAdHtmlClickLogService adHtmlClickLogService;
|
|
@Autowired
|
|
@Autowired
|
|
private QwUserMapper qwUserMapper;
|
|
private QwUserMapper qwUserMapper;
|
|
@@ -133,6 +134,15 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
@Autowired
|
|
@Autowired
|
|
private FsVideoResourceMapper fsVideoResourceMapper;
|
|
private FsVideoResourceMapper fsVideoResourceMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private FsUserCourseMapper fsUserCourseMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private FsUserCoursePeriodMapper fsUserCoursePeriodMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private FsUserCoursePeriodDaysMapper fsUserCoursePeriodDaysMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询课堂视频
|
|
* 查询课堂视频
|
|
*
|
|
*
|
|
@@ -304,6 +314,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
// 从Redis中获取观看时长
|
|
// 从Redis中获取观看时长
|
|
String redisKey = "h5user:watch:duration:" + param.getQwUserId()+ ":" + param.getQwExternalId() + ":" + param.getVideoId();
|
|
String redisKey = "h5user:watch:duration:" + param.getQwUserId()+ ":" + param.getQwExternalId() + ":" + param.getVideoId();
|
|
|
|
+ log.info("看课redis-key:{}", redisKey);
|
|
try {
|
|
try {
|
|
String durationStr = redisCache.getCacheObject(redisKey);
|
|
String durationStr = redisCache.getCacheObject(redisKey);
|
|
Long duration = durationStr != null ? Long.parseLong(durationStr) : 0L;
|
|
Long duration = durationStr != null ? Long.parseLong(durationStr) : 0L;
|
|
@@ -725,9 +736,23 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
* @return 处理结果
|
|
* @return 处理结果
|
|
*/
|
|
*/
|
|
private R sendRedPacketReward(FsCourseSendRewardUParam param, FsUser user, FsCourseWatchLog log, FsUserCourseVideo video, CourseConfig config) {
|
|
private R sendRedPacketReward(FsCourseSendRewardUParam param, FsUser user, FsCourseWatchLog log, FsUserCourseVideo video, CourseConfig config) {
|
|
|
|
+ // 判断是否属于领取红包时间(会员看课发放红包)
|
|
|
|
+ FsUserCoursePeriodDays periodDays = new FsUserCoursePeriodDays();
|
|
|
|
+ periodDays.setVideoId(param.getVideoId());
|
|
|
|
+ periodDays.setPeriodId(param.getPeriodId());
|
|
|
|
+ //正常情况是只能查询到一条,之前可能存在重复的脏数据,暂使用查询list的方式
|
|
|
|
+ List<FsUserCoursePeriodDays> fsUserCoursePeriodDays = fsUserCoursePeriodDaysMapper.selectFsUserCoursePeriodDaysList(periodDays);
|
|
|
|
+ if(fsUserCoursePeriodDays != null && !fsUserCoursePeriodDays.isEmpty()){
|
|
|
|
+ periodDays = fsUserCoursePeriodDays.get(0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(periodDays != null && periodDays.getLastJoinTime() !=null && LocalDateTime.now().isAfter(periodDays.getLastJoinTime())) {
|
|
|
|
+ return R.error(403,"已超过领取红包时间");
|
|
|
|
+ }
|
|
|
|
+
|
|
// 确定红包金额
|
|
// 确定红包金额
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
- FsUserCourseVideoRedPackage redPackage = fsUserCourseVideoRedPackageMapper.selectRedPacketByCompanyId(param.getVideoId(), param.getCompanyId());
|
|
|
|
|
|
+ FsUserCourseVideoRedPackage redPackage = fsUserCourseVideoRedPackageMapper.selectRedPacketByCompanyId(param.getVideoId(), param.getCompanyId(), param.getPeriodId());
|
|
|
|
|
|
if (redPackage != null) {
|
|
if (redPackage != null) {
|
|
amount = redPackage.getRedPacketMoney();
|
|
amount = redPackage.getRedPacketMoney();
|
|
@@ -771,13 +796,14 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
redPacketLog.setCreateTime(new Date());
|
|
redPacketLog.setCreateTime(new Date());
|
|
redPacketLog.setAmount(amount);
|
|
redPacketLog.setAmount(amount);
|
|
redPacketLog.setWatchLogId(log.getLogId() != null ? log.getLogId() : null);
|
|
redPacketLog.setWatchLogId(log.getLogId() != null ? log.getLogId() : null);
|
|
|
|
+ redPacketLog.setPeriodId(param.getPeriodId());
|
|
redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
|
|
redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
|
|
|
|
|
|
// 更新观看记录的奖励类型
|
|
// 更新观看记录的奖励类型
|
|
- if (param.getLinkType() == null || param.getLinkType() == 0) {
|
|
|
|
- log.setRewardType(config.getRewardType());
|
|
|
|
- courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
|
- }
|
|
|
|
|
|
+// if (param.getLinkType() == null || param.getLinkType() == 0) {
|
|
|
|
+ log.setRewardType(config.getRewardType());
|
|
|
|
+ courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
|
+// }
|
|
return sendRedPacket;
|
|
return sendRedPacket;
|
|
} else {
|
|
} else {
|
|
return R.error("奖励发送失败,请联系客服");
|
|
return R.error("奖励发送失败,请联系客服");
|
|
@@ -809,6 +835,11 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
integralLogs.setCreateTime(new Date());
|
|
integralLogs.setCreateTime(new Date());
|
|
fsUserIntegralLogsMapper.insertFsUserIntegralLogs(integralLogs);
|
|
fsUserIntegralLogsMapper.insertFsUserIntegralLogs(integralLogs);
|
|
|
|
|
|
|
|
+ //更新看课记录的奖励类型
|
|
|
|
+ log.setRewardType(config.getRewardType());
|
|
|
|
+ courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
|
+ logger.info("发放奖励====================》看课记录,{}",log);
|
|
|
|
+
|
|
return R.ok("奖励发放成功");
|
|
return R.ok("奖励发放成功");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -913,21 +944,31 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
log.setCompanyUserId(param.getCompanyUserId());
|
|
log.setCompanyUserId(param.getCompanyUserId());
|
|
log.setVideoId(param.getVideoId());
|
|
log.setVideoId(param.getVideoId());
|
|
List<FsCourseWatchLog> fsCourseWatchLogs = courseWatchLogMapper.selectFsCourseWatchLogList(log);
|
|
List<FsCourseWatchLog> fsCourseWatchLogs = courseWatchLogMapper.selectFsCourseWatchLogList(log);
|
|
|
|
+
|
|
|
|
+ // 获取课程所属项目id
|
|
|
|
+ FsUserCourse fsUserCourse = fsUserCourseMapper.selectFsUserCourseByCourseId(param.getCourseId());
|
|
|
|
+ Long courseProject = null;
|
|
|
|
+ if(fsUserCourse != null){
|
|
|
|
+ courseProject = fsUserCourse.getProject();
|
|
|
|
+ }
|
|
//如果存在,则更新
|
|
//如果存在,则更新
|
|
if (fsCourseWatchLogs != null && !fsCourseWatchLogs.isEmpty()){
|
|
if (fsCourseWatchLogs != null && !fsCourseWatchLogs.isEmpty()){
|
|
FsCourseWatchLog updateLog = new FsCourseWatchLog();
|
|
FsCourseWatchLog updateLog = new FsCourseWatchLog();
|
|
|
|
+ updateLog.setPeriodId(param.getPeriodId());
|
|
|
|
+ updateLog.setProject(courseProject);
|
|
updateLog.setUpdateTime(new Date());
|
|
updateLog.setUpdateTime(new Date());
|
|
courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
|
|
courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
|
|
|
|
+ } else {
|
|
|
|
+ //如果是会员,则需要添加看课记录
|
|
|
|
+ FsCourseWatchLog fsCourseWatchLog = new FsCourseWatchLog();
|
|
|
|
+ BeanUtils.copyProperties(param, fsCourseWatchLog);
|
|
|
|
+ fsCourseWatchLog.setSendType(1);
|
|
|
|
+ fsCourseWatchLog.setDuration(0L);
|
|
|
|
+ fsCourseWatchLog.setCreateTime(new Date());
|
|
|
|
+ fsCourseWatchLog.setLogType(1);
|
|
|
|
+ fsCourseWatchLog.setProject(courseProject);
|
|
|
|
+ courseWatchLogMapper.insertFsCourseWatchLog(fsCourseWatchLog);
|
|
}
|
|
}
|
|
-
|
|
|
|
- //如果是会员,则需要添加看课记录
|
|
|
|
- FsCourseWatchLog fsCourseWatchLog = new FsCourseWatchLog();
|
|
|
|
- BeanUtils.copyProperties(param, fsCourseWatchLog);
|
|
|
|
- fsCourseWatchLog.setSendType(1);
|
|
|
|
- fsCourseWatchLog.setDuration(0L);
|
|
|
|
- fsCourseWatchLog.setCreateTime(new Date());
|
|
|
|
- fsCourseWatchLog.setLogType(1);
|
|
|
|
- courseWatchLogMapper.insertFsCourseWatchLog(fsCourseWatchLog);
|
|
|
|
} else {
|
|
} else {
|
|
return ResponseResult.ok(Boolean.FALSE);
|
|
return ResponseResult.ok(Boolean.FALSE);
|
|
}
|
|
}
|
|
@@ -936,6 +977,19 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ResponseResult<FsUserCourseVideoLinkDetailsVO> getLinkCourseVideoDetails(FsUserCourseVideoLinkParam param) {
|
|
public ResponseResult<FsUserCourseVideoLinkDetailsVO> getLinkCourseVideoDetails(FsUserCourseVideoLinkParam param) {
|
|
|
|
+ //判断营期的课程状态是否是进行中
|
|
|
|
+ FsUserCoursePeriodDays periodDays = new FsUserCoursePeriodDays();
|
|
|
|
+ periodDays.setVideoId(param.getVideoId());
|
|
|
|
+ periodDays.setPeriodId(param.getPeriodId());
|
|
|
|
+ //正常情况是只能查询到一条,之前可能存在重复的脏数据,暂使用查询list的方式
|
|
|
|
+ List<FsUserCoursePeriodDays> fsUserCoursePeriodDays = fsUserCoursePeriodDaysMapper.selectFsUserCoursePeriodDaysList(periodDays);
|
|
|
|
+ if(fsUserCoursePeriodDays != null && !fsUserCoursePeriodDays.isEmpty()){
|
|
|
|
+ periodDays = fsUserCoursePeriodDays.get(0);
|
|
|
|
+ }
|
|
|
|
+ if(periodDays.getStatus() != 1){
|
|
|
|
+ return ResponseResult.fail(403, "当前课程未开始或已结束,暂不能看课");
|
|
|
|
+ }
|
|
|
|
+
|
|
String json = configService.selectConfigByKey("course.config");
|
|
String json = configService.selectConfigByKey("course.config");
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
|
|
|
@@ -957,15 +1011,15 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
ResponseResult.ok(vo);
|
|
ResponseResult.ok(vo);
|
|
}
|
|
}
|
|
// 从Redis中获取用户目前的观看时长
|
|
// 从Redis中获取用户目前的观看时长
|
|
- String redisKey = "h5wxuser:watch:duration:" + param.getFsUserId() + ":" + param.getVideoId();
|
|
|
|
|
|
+ String redisKey = "h5wxuser:watch:duration:" + param.getFsUserId() + ":" + param.getVideoId() + ":" + param.getCompanyUserId();
|
|
String durationCurrent = redisCache.getCacheObject(redisKey);
|
|
String durationCurrent = redisCache.getCacheObject(redisKey);
|
|
|
|
|
|
//3、获取看课记录
|
|
//3、获取看课记录
|
|
- FsCourseWatchLog watchLog = courseWatchLogMapper.getWatchLogByFsUser(param.getVideoId(), param.getFsUserId());
|
|
|
|
|
|
+ FsCourseWatchLog watchLog = courseWatchLogMapper.getWatchLogByFsUser(param.getVideoId(), param.getFsUserId(), param.getCompanyUserId());
|
|
if (durationCurrent != null) {
|
|
if (durationCurrent != null) {
|
|
duration = Long.parseLong(durationCurrent);
|
|
duration = Long.parseLong(durationCurrent);
|
|
} else {
|
|
} else {
|
|
- duration = watchLog.getDuration();
|
|
|
|
|
|
+ duration = Objects.isNull(watchLog) ? 0 : watchLog.getDuration();
|
|
}
|
|
}
|
|
//
|
|
//
|
|
// if (course.getDuration()!=null){
|
|
// if (course.getDuration()!=null){
|
|
@@ -980,10 +1034,16 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
String videoRedisKey = "h5wxuser:video:duration:" + param.getVideoId();
|
|
String videoRedisKey = "h5wxuser:video:duration:" + param.getVideoId();
|
|
Long videoDuration = redisCache.getCacheObject(videoRedisKey);
|
|
Long videoDuration = redisCache.getCacheObject(videoRedisKey);
|
|
if (videoDuration == null) {
|
|
if (videoDuration == null) {
|
|
- redisCache.setCacheObject(videoRedisKey, courseVideoDetails != null ? courseVideoDetails.getDuration() : 0);
|
|
|
|
|
|
+ redisCache.setCacheObject(videoRedisKey, courseVideoDetails != null ? courseVideoDetails.getDuration() != null ? courseVideoDetails.getDuration() : 0 : 0);
|
|
}
|
|
}
|
|
vo.setIsFinish(isFinish);
|
|
vo.setIsFinish(isFinish);
|
|
vo.setPlayDuration(duration);
|
|
vo.setPlayDuration(duration);
|
|
|
|
+ if(param.getId() != null){
|
|
|
|
+ FsUserCoursePeriodDays days = fsUserCoursePeriodDaysMapper.selectById(param.getId());
|
|
|
|
+ vo.setStartDateTime(days.getStartDateTime());
|
|
|
|
+ vo.setEndDateTime(days.getEndDateTime());
|
|
|
|
+ vo.setRang(DateUtil.isWithinRangeSafe(LocalDateTime.now(), days.getStartDateTime(), days.getEndDateTime()));
|
|
|
|
+ }
|
|
return ResponseResult.ok(vo);
|
|
return ResponseResult.ok(vo);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1001,9 +1061,11 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
}
|
|
}
|
|
|
|
|
|
// 从Redis中获取观看时长
|
|
// 从Redis中获取观看时长
|
|
- String redisKey = "h5wxuser:watch:duration:" + param.getUserId() + ":" + param.getVideoId();
|
|
|
|
|
|
+ String redisKey = "h5wxuser:watch:duration:" + param.getUserId() + ":" + param.getVideoId() + ":" + param.getCompanyUserId();
|
|
|
|
+ log.info("看课redis缓存key:{}", redisKey);
|
|
try {
|
|
try {
|
|
String durationStr = redisCache.getCacheObject(redisKey);
|
|
String durationStr = redisCache.getCacheObject(redisKey);
|
|
|
|
+ log.info("看课记录:{}", durationStr);
|
|
long duration = durationStr != null ? Long.parseLong(durationStr) : 0L;
|
|
long duration = durationStr != null ? Long.parseLong(durationStr) : 0L;
|
|
|
|
|
|
// 更新Redis中的观看时长
|
|
// 更新Redis中的观看时长
|
|
@@ -1059,9 +1121,26 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
fsUserCourseVideoMapper.insertBatchFsUserCourseVideo(collect);
|
|
fsUserCourseVideoMapper.insertBatchFsUserCourseVideo(collect);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void batchUpdateRed(List<BatchRedUpdate> list) {
|
|
|
|
+ list.forEach(e -> {
|
|
|
|
+ fsUserCourseVideoMapper.updateRedPacketMoney(e.getVideoId(), e.getRedPacketMoney());
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取选项列表
|
|
|
|
+ * @param params 参数
|
|
|
|
+ * @return list
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<OptionsVO> selectVideoListByMap(Map<String, Object> params) {
|
|
|
|
+ return fsUserCourseVideoMapper.selectVideoListByMap(params);
|
|
|
|
+ }
|
|
|
|
+
|
|
//会员-更新心跳时间
|
|
//会员-更新心跳时间
|
|
public void updateHeartbeatWx(FsUserCourseVideoUParam param) {
|
|
public void updateHeartbeatWx(FsUserCourseVideoUParam param) {
|
|
- String redisKey = "h5wxuser:watch:heartbeat:" + param.getUserId() + ":" + param.getVideoId();
|
|
|
|
|
|
+ String redisKey = "h5wxuser:watch:heartbeat:" + param.getUserId() + ":" + param.getVideoId() + ":" + param.getCompanyUserId();
|
|
redisCache.setCacheObject(redisKey, LocalDateTime.now().toString());
|
|
redisCache.setCacheObject(redisKey, LocalDateTime.now().toString());
|
|
// 设置 Redis 记录的过期时间(例如 5 分钟)
|
|
// 设置 Redis 记录的过期时间(例如 5 分钟)
|
|
redisCache.expire(redisKey, 300, TimeUnit.SECONDS);
|
|
redisCache.expire(redisKey, 300, TimeUnit.SECONDS);
|