| | |
| | | row=baseMapper.updateById(existStudentStudy); |
| | | }else{ |
| | | row=baseMapper.insert(studentStudy); |
| | | } |
| | | if(row<1){ |
| | | throw new ApiException("新增学习记录失败"); |
| | | } |
| | | } |
| | | System.out.println("student_study id:"+studentStudy.getId()); |
| | | return studentStudy.getId(); |
| | | } |
| | | |
| | |
| | | studentStudyPeriodVO.setPeriodId(courseChapterPeriod.getId()); |
| | | studentStudyPeriodVO.setPeriod(courseChapterPeriod.getPeriod()); |
| | | studentStudyPeriodVO.setResourceId(courseChapterPeriod.getResourceId()); |
| | | studentStudyPeriodVO.setResourceType(courseChapterPeriod.getResource()!=null?courseChapterPeriod.getResource().getResourceType():null); |
| | | ExStudentStudy exStudentStudy=studentStudyMap.get(courseChapterPeriod.getId()); |
| | | if(exStudentStudy!=null){ |
| | | studentStudyPeriodVO.setProgress(exStudentStudy.getProgress()); |
| | |
| | | |
| | | @Override |
| | | public void progress(ExStudentStudy studentStudy) { |
| | | if(studentStudy.getPhaseId()==null||studentStudy.getPeriodId()==null||studentStudy.getStudentId()==null||studentStudy.getResourceId()==null){ |
| | | if(studentStudy.getId()==null||studentStudy.getPhaseId()==null||studentStudy.getPeriodId()==null||studentStudy.getStudentId()==null||studentStudy.getResourceId()==null){ |
| | | throw new ApiException("参数传参错误"); |
| | | } |
| | | ExResource resource=resourceMapper.selectById(studentStudy.getResourceId()); |
| | |
| | | } |
| | | } else if (ResourceTypeEnum.DOC.getCode().equals(resource.getResourceType())) { |
| | | // 文档类型处理 |
| | | if (studentStudy.getCurrentPage().compareTo(resource.getDocPage()) >= 0) { |
| | | // if (studentStudy.getCurrentPage().compareTo(resource.getDocPage()) >= 0) { |
| | | // // 学习完成 |
| | | // completeStudy(studentStudy); |
| | | // } |
| | | // 学习完成 |
| | | completeStudy(studentStudy); |
| | | } |
| | | } |
| | | redisUtils.set(CacheConstant.STUDY_PROCESS_KEY + studentStudy.getId(), studentStudy, 1, TimeUnit.DAYS); |
| | | } |