|
@@ -3,17 +3,15 @@ package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.SubjectDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.VideoLessonAuthRecordDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDetailDao;
|
|
|
+import com.yonge.cooleshow.biz.dal.dao.*;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.*;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDao;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupService;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.*;
|
|
|
+import com.yonge.cooleshow.common.exception.BizException;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -44,6 +42,8 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
|
|
|
private SubjectDao subjectDao;
|
|
|
@Autowired
|
|
|
private VideoLessonAuthRecordDao recordDao;
|
|
|
+ @Autowired
|
|
|
+ private TeacherDao teacherDao;
|
|
|
|
|
|
public VideoLessonGroupDao getDao() {
|
|
|
return videoLessonGroupDao;
|
|
@@ -67,6 +67,9 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
|
|
|
public VideoLessonGroup selectGroup(Long groupId) {
|
|
|
VideoLessonGroup lessonGroup = videoLessonGroupDao.selectById(groupId);
|
|
|
Subject subject = subjectDao.selectSubjectById(lessonGroup.getLessonSubject());
|
|
|
+ if (subject==null){
|
|
|
+ throw new BizException("数据异常");
|
|
|
+ }
|
|
|
lessonGroup.setLessonSubjectName(subject.getName());
|
|
|
return lessonGroup;
|
|
|
}
|
|
@@ -131,6 +134,14 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
|
|
|
VideoLessonGroup lessonGroup = lessonVo.getLessonGroup();
|
|
|
List<VideoLessonGroupDetail> lessonList = lessonVo.getLessonList();
|
|
|
|
|
|
+ //校验声部
|
|
|
+ Long subjectId = Long.valueOf(lessonGroup.getLessonSubject());
|
|
|
+ List<Subject> subjectList = teacherDao.querySubject(sysUser.getId());
|
|
|
+ List<Long> longList = subjectList.stream().map(Subject::getId).collect(Collectors.toList());
|
|
|
+ if (!longList.contains(subjectId)){
|
|
|
+ throw new BizException("该声部无法选择");
|
|
|
+ }
|
|
|
+
|
|
|
//添加组
|
|
|
lessonGroup.setTeacherId(sysUser.getId());
|
|
|
videoLessonGroupDao.insert(lessonGroup);
|