|
@@ -151,7 +151,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
lqw.eq(bo.getModuleId() != null, UserStudyRecord::getModuleId, bo.getModuleId());
|
|
lqw.eq(bo.getModuleId() != null, UserStudyRecord::getModuleId, bo.getModuleId());
|
|
|
lqw.eq(bo.getChapterId() != null, UserStudyRecord::getChapterId, bo.getChapterId());
|
|
lqw.eq(bo.getChapterId() != null, UserStudyRecord::getChapterId, bo.getChapterId());
|
|
|
lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
|
|
lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
|
|
|
- // lqw.eq( UserStudyRecord::getCurrentStatus, 1);
|
|
|
|
|
|
|
+ lqw.eq( UserStudyRecord::getCurrentStatus, 1);
|
|
|
UserStudyRecord last = this.getOne(lqw.ge(UserStudyRecord::getFirstStartTime,0).last("limit 1"));
|
|
UserStudyRecord last = this.getOne(lqw.ge(UserStudyRecord::getFirstStartTime,0).last("limit 1"));
|
|
|
if(Validator.isEmpty(last)){
|
|
if(Validator.isEmpty(last)){
|
|
|
return null;
|
|
return null;
|
|
@@ -171,7 +171,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
|
|
lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
|
|
|
lqw.eq(bo.getOrderGoodsId() != null, UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId());
|
|
lqw.eq(bo.getOrderGoodsId() != null, UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId());
|
|
|
lqw.eq( UserStudyRecord::getCurrentStatus, 1);
|
|
lqw.eq( UserStudyRecord::getCurrentStatus, 1);
|
|
|
- lqw.orderByDesc(UserStudyRecord::getRecordId);
|
|
|
|
|
|
|
+ lqw.orderByDesc(UserStudyRecord::getUpdateTime);
|
|
|
UserStudyRecord last = this.getOne(lqw.last("limit 1"));
|
|
UserStudyRecord last = this.getOne(lqw.last("limit 1"));
|
|
|
if(Validator.isNotEmpty(last)&&Validator.isNotEmpty(last.getStatus())&&last.getStatus()==1){
|
|
if(Validator.isNotEmpty(last)&&Validator.isNotEmpty(last.getStatus())&&last.getStatus()==1){
|
|
|
last = null;
|
|
last = null;
|
|
@@ -191,7 +191,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
|
|
lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
|
|
|
lqw.eq(bo.getOrderGoodsId() != null, UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId());
|
|
lqw.eq(bo.getOrderGoodsId() != null, UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId());
|
|
|
lqw.eq( UserStudyRecord::getCurrentStatus, 1);
|
|
lqw.eq( UserStudyRecord::getCurrentStatus, 1);
|
|
|
- lqw.orderByDesc(UserStudyRecord::getRecordId);
|
|
|
|
|
|
|
+ lqw.orderByDesc(UserStudyRecord::getUpdateTime);
|
|
|
UserStudyRecord last = this.getOne(lqw.last("limit 1"));
|
|
UserStudyRecord last = this.getOne(lqw.last("limit 1"));
|
|
|
UserStudyRecordVo vo = BeanUtil.toBean(last, UserStudyRecordVo.class);
|
|
UserStudyRecordVo vo = BeanUtil.toBean(last, UserStudyRecordVo.class);
|
|
|
if(Validator.isNotEmpty(vo)&&Validator.isNotEmpty(vo.getSectionId())){
|
|
if(Validator.isNotEmpty(vo)&&Validator.isNotEmpty(vo.getSectionId())){
|
|
@@ -316,7 +316,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
validEntityBeforeSave(add);
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
- add.setStartTime(DateUtils.getNowTime() - add.getStudyDuration());
|
|
|
|
|
|
|
+ add.setStartTime(DateUtils.getNowTime().longValue() - add.getStudyDuration().longValue());
|
|
|
add.setEndTime(DateUtils.getNowTime());
|
|
add.setEndTime(DateUtils.getNowTime());
|
|
|
if(Validator.isNotEmpty(first)&&Validator.isNotEmpty(first.getFirstStartTime())){
|
|
if(Validator.isNotEmpty(first)&&Validator.isNotEmpty(first.getFirstStartTime())){
|
|
|
add.setFirstStartTime(first.getFirstStartTime());
|
|
add.setFirstStartTime(first.getFirstStartTime());
|
|
@@ -324,14 +324,15 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
add.setFirstStartTime(add.getStartTime());
|
|
add.setFirstStartTime(add.getStartTime());
|
|
|
}
|
|
}
|
|
|
if(courseSectionVo.getSectionType()==1||courseSectionVo.getSectionType()==2||courseSectionVo.getSectionType()==3){
|
|
if(courseSectionVo.getSectionType()==1||courseSectionVo.getSectionType()==2||courseSectionVo.getSectionType()==3){
|
|
|
- UserStudyRecordQueryBo queryBo = new UserStudyRecordQueryBo();
|
|
|
|
|
- queryBo.setUserId(bo.getUserId());
|
|
|
|
|
|
|
+ UserStudyRecordQueryBo queryBo = BeanUtil.toBean(bo, UserStudyRecordQueryBo.class);
|
|
|
|
|
+/* queryBo.setUserId(bo.getUserId());
|
|
|
queryBo.setGradeId(bo.getGradeId());
|
|
queryBo.setGradeId(bo.getGradeId());
|
|
|
queryBo.setGoodsId(bo.getGoodsId());
|
|
queryBo.setGoodsId(bo.getGoodsId());
|
|
|
queryBo.setCourseId(bo.getCourseId());
|
|
queryBo.setCourseId(bo.getCourseId());
|
|
|
queryBo.setModuleId(bo.getModuleId());
|
|
queryBo.setModuleId(bo.getModuleId());
|
|
|
queryBo.setChapterId(bo.getChapterId());
|
|
queryBo.setChapterId(bo.getChapterId());
|
|
|
queryBo.setSectionId(bo.getSectionId());
|
|
queryBo.setSectionId(bo.getSectionId());
|
|
|
|
|
+ queryBo.setOrderGoodsId(bo.getOrderGoodsId());*/
|
|
|
UserStudyRecordVo lastVo = queryLast(queryBo);
|
|
UserStudyRecordVo lastVo = queryLast(queryBo);
|
|
|
if(Validator.isEmpty(lastVo)||Validator.isEmpty(lastVo.getVideoCurrentTime())||lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue()){
|
|
if(Validator.isEmpty(lastVo)||Validator.isEmpty(lastVo.getVideoCurrentTime())||lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue()){
|
|
|
//如果没有历史数据或者之前播放时长比现在晚,则新增观看记录
|
|
//如果没有历史数据或者之前播放时长比现在晚,则新增观看记录
|