|
@@ -7,10 +7,12 @@ import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.course.bo.*;
|
|
|
import com.zhongzheng.modules.course.domain.CourseChapter;
|
|
|
import com.zhongzheng.modules.course.domain.CourseChapterBusiness;
|
|
|
+import com.zhongzheng.modules.course.domain.CourseChapterSection;
|
|
|
import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
|
|
|
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.vo.CourseChapterVo;
|
|
@@ -41,6 +43,9 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
|
|
|
@Autowired
|
|
|
private CourseChapterMapper courseChapterMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseChapterSectionService iCourseChapterSectionService;
|
|
|
+
|
|
|
@Override
|
|
|
public CourseChapterVo queryById(Long chapterId){
|
|
|
CourseChapter db = this.baseMapper.selectById(chapterId);
|
|
@@ -94,11 +99,24 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
boolean result = this.save(add);
|
|
|
if(result){
|
|
|
- for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
- CourseChapterBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
- item.setChapterId(add.getChapterId());
|
|
|
- iCourseChapterBusinessService.insertByAddBo(item);
|
|
|
+ if(bo.getBusinessList()!=null){
|
|
|
+ for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
+ CourseChapterBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
+ item.setChapterId(add.getChapterId());
|
|
|
+ iCourseChapterBusinessService.insertByAddBo(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(bo.getSectionIdList()!=null){
|
|
|
+ for(int i=0;i<bo.getSectionIdList().size();i++){
|
|
|
+ CourseChapterSectionListAddBo item = bo.getSectionIdList().get(i);
|
|
|
+ CourseChapterSection addItem = new CourseChapterSection();
|
|
|
+ addItem.setChapterId(add.getChapterId());
|
|
|
+ addItem.setSectionId(item.getSectionId());
|
|
|
+ addItem.setSort(item.getSort());
|
|
|
+ iCourseChapterSectionService.save(addItem);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
return add.getChapterId();
|
|
|
}
|