kongzy
2024-07-05 14821e28286d773ad5ff2c13510e39c5eb117daf
exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterServiceImpl.java
@@ -75,7 +75,7 @@
        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("更新章节失败");
@@ -87,7 +87,7 @@
    @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){
@@ -115,8 +115,8 @@
    }
    @Override
    public List<ExCourseChapter> selectChapterByCourseId(Long courseId) {
        return baseMapper.selectChapterByCourseId(courseId);
    public List<ExCourseChapter> selectChapterByCourseId(Long courseId,Integer status) {
        return baseMapper.selectChapterByCourseId(courseId,null);
    }