| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.qxueyou.scc.admin.classes.service.IClassLectureService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | @Autowired |
| | | IProgressService progressService; |
| | | |
| | | @Autowired |
| | | IClassLectureService clsLectureService; |
| | | |
| | | @Override |
| | | public Result addChapter(String subjectId, String parentChapterId, String name) { |
| | | |
| | |
| | | |
| | | /** |
| | | * 删除单个章节 |
| | | * |
| | | * |
| | | * @param chapterId |
| | | * 章节id |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 初始化 |
| | | * |
| | | * |
| | | * @param subjectId |
| | | * @return |
| | | */ |
| | |
| | | lecture.setRemark(res.getRemark()); |
| | | lecture.setSubjectId(chapter.getSubjectId()); |
| | | lecture.setResItemId(res.getResId()); |
| | | |
| | | |
| | | save(lecture); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @param lectureId |
| | | * 课件id |
| | | * @return |
| | |
| | | @Override |
| | | public int listLectureCount(String chapterId, String keyword, String type) { |
| | | StringBuffer hql = new StringBuffer("from SubjectLecture where chapterId=? and name like ? and deleteFlag is false"); |
| | | |
| | | |
| | | List<Object> args = CollectionUtils.newList(chapterId,'%' + keyword.trim() + '%'); |
| | | |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | hql.append(" and lectureType=?"); |
| | | args.add(type); |
| | | } |
| | | |
| | | |
| | | return findCount(hql.toString(),args); |
| | | |
| | | } |
| | |
| | | @Override |
| | | public Result doStudy(String lectureId, Double from, Double to) { |
| | | String userId = null; |
| | | return progressService.addProgress(Progress.PROGRESS_TYPE_LECTURE, lectureId, from.intValue(), to.intValue(), |
| | | return progressService.addProgress(Progress.PROGRESS_TYPE_LECTURE, lectureId, from.doubleValue(), to.doubleValue(), |
| | | userId); |
| | | } |
| | | |