|
@@ -2214,11 +2214,13 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
boolean isFreeMode = period != null && period.getFreeMode() != null && period.getFreeMode() == 1;
|
|
boolean isFreeMode = period != null && period.getFreeMode() != null && period.getFreeMode() == 1;
|
|
|
|
|
|
|
|
// 项目看课数限制(自由模式下跳过此限制)
|
|
// 项目看课数限制(自由模式下跳过此限制)
|
|
|
|
|
+ // 注意:此限制仅针对手动发课(send_type=1),企微自动发课(send_type=2)不受此限制
|
|
|
|
|
+ // 逻辑:如果用户今天已经看过其他手动发课的课程,则不能再看新的手动发课课程
|
|
|
if(!isFreeMode && !EXCLUDE_PROJECTS.contains(signProjectName) && !CloudHostUtils.hasCloudHostName("弘德堂")) {
|
|
if(!isFreeMode && !EXCLUDE_PROJECTS.contains(signProjectName) && !CloudHostUtils.hasCloudHostName("弘德堂")) {
|
|
|
Integer logCount = fsUserCourseMapper.selectTodayCourseWatchLogCountByUserIdAndProjectId(param.getUserId(), courseProject);
|
|
Integer logCount = fsUserCourseMapper.selectTodayCourseWatchLogCountByUserIdAndProjectId(param.getUserId(), courseProject);
|
|
|
if (Objects.isNull(watchCourseVideo) && logCount > 0) {
|
|
if (Objects.isNull(watchCourseVideo) && logCount > 0) {
|
|
|
- log.info("【自由模式检查】固定模式下超过项目看课数量限制,periodId={}, userId={}, logCount={}",
|
|
|
|
|
- param.getPeriodId(), param.getUserId(), logCount);
|
|
|
|
|
|
|
+ log.info("【手动发课限制】用户今日已观看{}门手动发课课程,超过限制,periodId={}, userId={}, videoId={}",
|
|
|
|
|
+ logCount, param.getPeriodId(), param.getUserId(), param.getVideoId());
|
|
|
return ResponseResult.fail(504, "超过项目看课数量限制");
|
|
return ResponseResult.fail(504, "超过项目看课数量限制");
|
|
|
}
|
|
}
|
|
|
} else if(isFreeMode) {
|
|
} else if(isFreeMode) {
|
|
@@ -2240,9 +2242,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
updateLog.setUpdateTime(new Date());
|
|
updateLog.setUpdateTime(new Date());
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
|
|
courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ // 创建新的看课记录(手动发课:send_type=1)
|
|
|
FsCourseWatchLog fsCourseWatchLog = new FsCourseWatchLog();
|
|
FsCourseWatchLog fsCourseWatchLog = new FsCourseWatchLog();
|
|
|
BeanUtils.copyProperties(param, fsCourseWatchLog);
|
|
BeanUtils.copyProperties(param, fsCourseWatchLog);
|
|
|
- fsCourseWatchLog.setSendType(1);
|
|
|
|
|
|
|
+ fsCourseWatchLog.setSendType(1); // 1=手动发课(个微/后台)
|
|
|
fsCourseWatchLog.setDuration(0L);
|
|
fsCourseWatchLog.setDuration(0L);
|
|
|
fsCourseWatchLog.setCreateTime(new Date());
|
|
fsCourseWatchLog.setCreateTime(new Date());
|
|
|
fsCourseWatchLog.setLogType(1);
|
|
fsCourseWatchLog.setLogType(1);
|