zyp 1 kuukausi sitten
vanhempi
commit
dd787604b5

+ 6 - 9
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -582,11 +582,13 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
     @Override
     public R getInternetTraffic(FsUserCourseVideoFinishUParam param) {
         try {
+            if (param.getBufferRate()==null){
+                logger.error("zyp \n【缓冲值空】参数: {}",param);
+                return R.error("缓冲值空");
+            }
             FsCourseTrafficLog trafficLog = new FsCourseTrafficLog();
             trafficLog.setQwExternalContactId(param.getQwExternalId());
-            trafficLog.setUserId(param.getUserId());
             trafficLog.setCreateTime(new Date());
-//            trafficLog.setTime(new Date());
             BeanUtils.copyProperties(param, trafficLog);
 
             FsUserCourseVideo video = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(param.getVideoId());
@@ -604,17 +606,12 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             if (StringUtils.isNotEmpty(trafficLog.getUuId())) {
                 // 直接插入或更新
 //                logger.error("zyp \n【插入或更新流量】:{}",trafficLog);
-//                if(ObjectUtils.isNotNull(trafficLog.getCourseId())) {
-//                    FsUserCourse course = fsUserCourseCacheService.selectFsUserCourseByCourseId(trafficLog.getCourseId());
-//                    if(ObjectUtils.isNotNull(course)){
-//                        trafficLog.setProject(course.getProject());
-//                    }
-//                }
                 fsCourseTrafficLogMapper.insertOrUpdateTrafficLog(trafficLog);
             }
         } catch (Exception e) {
             e.printStackTrace();
-            logger.error("zyp \n【插入或更新流量失败】:{}",e.getMessage());
+            // 打印参数param和异常信息
+            logger.error("zyp \n【插入或更新流量失败】参数: {}, 错误信息:{}", param, e.getMessage(), e);
             return R.error();
         }
         return R.ok();