|
@@ -1,6 +1,5 @@
|
|
package com.fs.course.service.impl;
|
|
package com.fs.course.service.impl;
|
|
|
|
|
|
-import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
import cn.hutool.core.util.NumberUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -1246,6 +1245,17 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
courseProject = fsUserCourse.getProject();
|
|
courseProject = fsUserCourse.getProject();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 项目校验
|
|
|
|
+ if (Objects.isNull(courseProject) || !courseProject.equals(param.getProjectId())) {
|
|
|
|
+ return ResponseResult.fail(504, "课程项目不匹配");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 项目看课数限制
|
|
|
|
+ Integer logCount = fsUserCourseMapper.selectTodayCourseWatchLogCountByUserIdAndProjectId(param.getUserId(), param.getProjectId());
|
|
|
|
+ if (Objects.isNull(watchCourseVideo) && logCount > 0) {
|
|
|
|
+ return ResponseResult.fail(504, "超过项目看课数量限制");
|
|
|
|
+ }
|
|
|
|
+
|
|
//添加判断:该用户是否已经存在此课程的看课记录,并且看课记录的销售id不是传入的销售id
|
|
//添加判断:该用户是否已经存在此课程的看课记录,并且看课记录的销售id不是传入的销售id
|
|
if(watchCourseVideo != null){
|
|
if(watchCourseVideo != null){
|
|
if(!watchCourseVideo.getCompanyUserId().equals(param.getCompanyUserId())) {
|
|
if(!watchCourseVideo.getCompanyUserId().equals(param.getCompanyUserId())) {
|