处理study接口,studyitemid返回值为空的问题

This commit is contained in:
zhaolongfei
2024-08-15 19:03:11 +08:00
parent f0fe015561
commit 30aab6eab4

View File

@@ -98,8 +98,15 @@ public class StudyServiceImpl implements IStudyService{
//sci.setProgress(100);//直接设置为学习完成
sci.setLastTime(ldt);
scItemDao.saveOrUpdate(sci);
dto.setStudyItemId(sci.getId());
StudyCourseItem sci2 = scItemDao.findOne(FieldFilters
.eq("studyId", dto.getStudyId()),FieldFilters
.eq("contentId", dto.getContentId()),FieldFilters
.eq("aid", dto.getAid()));
if (sci2!=null){
dto.setStudyItemId(sci2.getId());
}else {
throw new IllegalArgumentException("StudyItemId不能为空");
}
//检查是否全部学习完成
scDao.finishCheck(dto.getStudyId(),dto.getCourseId(),dto.getContentTotal(),token);