|  | @@ -1884,12 +1884,21 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
 | 
	
		
			
				|  |  |          if (!isUserCoursePeriodValid(param)) {
 | 
	
		
			
				|  |  |              return ResponseResult.fail(504, "请观看最新的课程项目");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        // 项目看课数限制
 | 
	
		
			
				|  |  | -        if(!"福本源".equals(signProjectName) && !"宽益堂".equals(signProjectName) && !CloudHostUtils.hasCloudHostName("弘德堂")) {
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        // 检查是否为自由模式
 | 
	
		
			
				|  |  | +        FsUserCoursePeriod period = fsUserCoursePeriodMapper.selectFsUserCoursePeriodById(param.getPeriodId());
 | 
	
		
			
				|  |  | +        boolean isFreeMode = period != null && period.getFreeMode() != null && period.getFreeMode() == 1;
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        // 项目看课数限制(自由模式下跳过此限制)
 | 
	
		
			
				|  |  | +        if(!isFreeMode && !"福本源".equals(signProjectName) && !"宽益堂".equals(signProjectName) && !CloudHostUtils.hasCloudHostName("弘德堂")) {
 | 
	
		
			
				|  |  |              Integer logCount = fsUserCourseMapper.selectTodayCourseWatchLogCountByUserIdAndProjectId(param.getUserId(), courseProject);
 | 
	
		
			
				|  |  |              if (Objects.isNull(watchCourseVideo) && logCount > 0) {
 | 
	
		
			
				|  |  | +                log.info("【自由模式检查】固定模式下超过项目看课数量限制,periodId={}, userId={}, logCount={}", 
 | 
	
		
			
				|  |  | +                        param.getPeriodId(), param.getUserId(), logCount);
 | 
	
		
			
				|  |  |                  return ResponseResult.fail(504, "超过项目看课数量限制");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +        } else if(isFreeMode) {
 | 
	
		
			
				|  |  | +            log.info("【自由模式检查】✅ 自由模式,跳过项目看课数量限制检查,periodId={}", param.getPeriodId());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //添加判断:该用户是否已经存在此课程的看课记录,并且看课记录的销售id不是传入的销售id
 | 
	
	
		
			
				|  | @@ -1947,16 +1956,33 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
 | 
	
		
			
				|  |  |       * @return 如果当前时间在有效范围内且状态为1,返回true,否则返回false
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      public boolean isUserCoursePeriodValid(FsUserCourseAddCompanyUserParam param) {
 | 
	
		
			
				|  |  | +        log.info("【自由模式检查】开始验证课程权限,参数:periodId={}, videoId={}, courseId={}, companyUserId={}", 
 | 
	
		
			
				|  |  | +                param.getPeriodId(), param.getVideoId(), param.getCourseId(), param.getCompanyUserId());
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  |          // 查询课程周期信息
 | 
	
		
			
				|  |  |          FsUserCoursePeriodDays periodDays = getPeriodDaysInfo(param);
 | 
	
		
			
				|  |  | +        log.info("【自由模式检查】课程周期信息:periodDays={}, status={}, startTime={}, endTime={}", 
 | 
	
		
			
				|  |  | +                periodDays != null ? periodDays.getId() : null,
 | 
	
		
			
				|  |  | +                periodDays != null ? periodDays.getStatus() : null,
 | 
	
		
			
				|  |  | +                periodDays != null ? periodDays.getStartDateTime() : null,
 | 
	
		
			
				|  |  | +                periodDays != null ? periodDays.getEndDateTime() : null);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 检查是否开启自由模式
 | 
	
		
			
				|  |  |          FsUserCoursePeriod period = fsUserCoursePeriodMapper.selectFsUserCoursePeriodById(param.getPeriodId());
 | 
	
		
			
				|  |  | +        log.info("【自由模式检查】营期信息:periodId={}, periodName={}, freeMode={}, period对象={}", 
 | 
	
		
			
				|  |  | +                param.getPeriodId(),
 | 
	
		
			
				|  |  | +                period != null ? period.getPeriodName() : "NULL",
 | 
	
		
			
				|  |  | +                period != null ? period.getFreeMode() : "NULL",
 | 
	
		
			
				|  |  | +                period != null ? "存在" : "不存在");
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  |          if (period != null && period.getFreeMode() != null && period.getFreeMode() == 1) {
 | 
	
		
			
				|  |  |              // 自由模式:不检查时间和状态,直接返回有效
 | 
	
		
			
				|  |  | -            log.info("自由模式营期,跳过时间和状态检查,periodId={}", param.getPeriodId());
 | 
	
		
			
				|  |  | +            log.info("【自由模式检查】✅ 检测到自由模式,跳过时间和状态检查,periodId={}, periodName={}", 
 | 
	
		
			
				|  |  | +                    param.getPeriodId(), period.getPeriodName());
 | 
	
		
			
				|  |  |              return true;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        log.info("【自由模式检查】固定模式,继续进行时间和状态检查...");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 固定模式:检查时间范围和状态
 | 
	
		
			
				|  |  |          // 获取公司用户时间段信息
 |