|
@@ -6,15 +6,15 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.modules.bank.domain.QuestionModuleChapter;
|
|
|
+import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
|
|
|
import com.zhongzheng.modules.course.bo.*;
|
|
|
import com.zhongzheng.modules.course.domain.*;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseChapterMapper;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseChapterBusinessService;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseChapterService;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
|
|
|
+import com.zhongzheng.modules.course.service.*;
|
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
|
+import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -47,7 +47,11 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
|
|
|
@Autowired
|
|
|
private ICourseChapterSectionService iCourseChapterSectionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseMenuService iCourseMenuService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseModuleChapterService iCourseModuleChapterService;
|
|
|
|
|
|
@Override
|
|
|
public CourseChapterVo queryById(Long chapterId){
|
|
@@ -169,6 +173,15 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
|
|
|
if(checkNameUnique(entity)){
|
|
|
throw new CustomException("名称重复");
|
|
|
}
|
|
|
+ if(entity.getChapterId()!=null&&entity.getPublishStatus()!=null&&entity.getPublishStatus()==0){
|
|
|
+ CourseMenu one = iCourseMenuService.getOne(new LambdaQueryWrapper<CourseMenu>().eq(CourseMenu::getMenuId, entity.getChapterId()).eq(CourseMenu::getType,2).last("limit 1"));
|
|
|
+ if(one!=null){
|
|
|
+ throw new CustomException("该章已被绑定,不允许修改发布状态为未发布");
|
|
|
+ }
|
|
|
+ if(iCourseModuleChapterService.getOne(new LambdaQueryWrapper<CourseModuleChapter>().eq(CourseModuleChapter::getChapterId,entity.getChapterId()).last("limit 1"))!=null){
|
|
|
+ throw new CustomException("该章已被绑定,不允许修改发布状态为未发布");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|