|
|
@@ -322,6 +322,9 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ if(Validator.isEmpty(add.getVideoCurrentTime())){
|
|
|
+ add.setVideoCurrentTime(0L);
|
|
|
+ }
|
|
|
if(Validator.isNotEmpty(add.getStudyDuration())){
|
|
|
add.setStartTime(DateUtils.getNowTime().longValue() - add.getStudyDuration().longValue());
|
|
|
}else{
|
|
|
@@ -364,7 +367,12 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
if(Validator.isNotEmpty(add.getStatus())&&add.getStatus()==1){
|
|
|
lastVo.setStatus(1);
|
|
|
}
|
|
|
- lastVo.setStudyDuration(add.getStudyDuration()+lastVo.getStudyDuration());
|
|
|
+ if(lastVo.getVideoCurrentTime().longValue()<=add.getVideoCurrentTime().longValue()){
|
|
|
+ lastVo.setStudyDuration(lastVo.getStudyDuration()+(add.getVideoCurrentTime().longValue()-lastVo.getVideoCurrentTime().longValue()));
|
|
|
+ }else{
|
|
|
+ lastVo.setStudyDuration(lastVo.getStudyDuration()+add.getStudyDuration());
|
|
|
+ }
|
|
|
+
|
|
|
UserStudyRecord update = BeanUtil.toBean(lastVo, UserStudyRecord.class);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
this.updateById(update);
|