Jelajahi Sumber

fix 随机练习

he2802 2 tahun lalu
induk
melakukan
7422105e98

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

@@ -376,11 +376,15 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                 if(Validator.isNotEmpty(add.getStatus())&&add.getStatus()==1){
                     lastVo.setStatus(1);
                 }
-                if(lastVo.getVideoCurrentTime().longValue()<=add.getVideoCurrentTime().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());
-                }
+                }*/
                 lastVo.setVideoCurrentTime(add.getVideoCurrentTime());
                 lastVo.setEndTime(add.getEndTime());