| | |
| | | if(!checkNameUnique(chapter)){ |
| | | throw new ApiException("章节名称已存在"); |
| | | } |
| | | SysUser user= SecurityUtils.getLoginUser().getUser(); |
| | | chapter.setUpdateBy(SecurityUtils.getUsername()); |
| | | int row=baseMapper.updateById(chapter); |
| | | if(row<1){ |
| | | throw new ApiException("更新章节失败"); |
| | |
| | | @Transactional(rollbackFor = RuntimeException.class) |
| | | public int deleteChapterById(Long chapterId) { |
| | | //校验课程是否已被分配 ,章节下面是否存在课时 |
| | | checkUserAllowed(baseMapper.selectChapterById(chapterId)); |
| | | checkUserAllowed(baseMapper.selectById(chapterId)); |
| | | |
| | | int periodCount=baseMapper.selectPeriodCountById(chapterId); |
| | | if(periodCount>0){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ExCourseChapter> selectChapterByCourseId(Long courseId) { |
| | | return baseMapper.selectChapterByCourseId(courseId); |
| | | public List<ExCourseChapter> selectChapterByCourseId(Long courseId,Integer status) { |
| | | return baseMapper.selectChapterByCourseId(courseId,null); |
| | | } |
| | | |
| | | |