浏览代码

fix 随机练习

he2802 2 年之前
父节点
当前提交
ab5e5b32ac

+ 7 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -375,15 +375,16 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                 if(Validator.isNotEmpty(add.getStatus())&&add.getStatus()==1){
                     lastVo.setStatus(1);
                 }
-                lastVo.setStudyDuration(lastVo.getStudyDuration().longValue()+add.getStudyDuration().longValue());
+              /*  lastVo.setStudyDuration(lastVo.getStudyDuration().longValue()+add.getStudyDuration().longValue());
                 if(lastVo.getStudyDuration().longValue()>add.getVideoCurrentTime().longValue()){
                     lastVo.setStudyDuration(add.getVideoCurrentTime());
-                }
-                /*if(lastVo.getVideoCurrentTime().longValue()<=add.getVideoCurrentTime().longValue()){
-                    lastVo.setStudyDuration(lastVo.getStudyDuration().longValue()+(add.getVideoCurrentTime().longValue()-lastVo.getVideoCurrentTime().longValue()));
-                }else{
-                    lastVo.setStudyDuration(lastVo.getStudyDuration().longValue()+add.getStudyDuration().longValue());
                 }*/
+                if(lastVo.getVideoCurrentTime().longValue()<=add.getVideoCurrentTime().longValue()){
+                    lastVo.setStudyDuration(lastVo.getStudyDuration().longValue()+(add.getVideoCurrentTime().longValue()-lastVo.getVideoCurrentTime().longValue()));
+                }
+                if(lastVo.getStudyDuration().longValue()>add.getVideoCurrentTime().longValue()){
+                    lastVo.setStudyDuration(add.getVideoCurrentTime());
+                }
                 lastVo.setVideoCurrentTime(add.getVideoCurrentTime());
                 lastVo.setEndTime(add.getEndTime());