|
@@ -15,6 +15,7 @@ import com.ym.mec.biz.dal.entity.LessonCourseware;
|
|
|
import com.ym.mec.biz.dal.entity.LessonCoursewareUserMapper;
|
|
|
import com.ym.mec.biz.dal.entity.SysMusicScore;
|
|
|
import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
+import com.ym.mec.biz.dal.enums.ClientEnum;
|
|
|
import com.ym.mec.biz.dal.mapper.LessonCoursewareMapper;
|
|
|
import com.ym.mec.biz.dal.wrapper.LessonCoursewareWrapper;
|
|
|
import com.ym.mec.biz.service.LessonCoursewareService;
|
|
@@ -217,18 +218,29 @@ public class LessonCoursewareServiceImpl extends ServiceImpl<LessonCoursewareMap
|
|
|
if (lessonCourseware == null) {
|
|
|
throw new BizException("课件未找到");
|
|
|
}
|
|
|
- Teacher teacher = teacherDao.get(query.getTeacherId());
|
|
|
- if (teacher == null) {
|
|
|
- throw new BizException("老师信息不存在");
|
|
|
- }
|
|
|
- if (lessonCoursewareDetail.getLevel() == null || teacher.getCoursewareFlag()) {
|
|
|
- result.add(this.initRefLevelDetailInfo(lessonCoursewareDetail,lessonCourseware));
|
|
|
- return result;
|
|
|
+ if (query.getClient() == ClientEnum.TEACHER) {
|
|
|
+ Teacher teacher = teacherDao.get(query.getTeacherId());
|
|
|
+ if (teacher == null) {
|
|
|
+ throw new BizException("老师信息不存在");
|
|
|
+ }
|
|
|
+ if (lessonCoursewareDetail.getLevel() == null || teacher.getCoursewareFlag()) {
|
|
|
+ result.add(this.initRefLevelDetailInfo(lessonCoursewareDetail, lessonCourseware));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (lessonCoursewareDetail.getLevel() == null) {
|
|
|
+ result.add(this.initRefLevelDetailInfo(lessonCoursewareDetail, lessonCourseware));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
LessonCoursewareWrapper.LessonCoursewareQuery query1 = new LessonCoursewareWrapper.LessonCoursewareQuery();
|
|
|
query1.setPage(1);
|
|
|
query1.setRows(9999);
|
|
|
- query1.setTeacherId(query.getTeacherId());
|
|
|
+ if (query.getClient() == ClientEnum.STUDENT) {
|
|
|
+ query1.setStudentId(query.getTeacherId());
|
|
|
+ } else {
|
|
|
+ query1.setTeacherId(query.getTeacherId());
|
|
|
+ }
|
|
|
query1.setEnable(true);
|
|
|
List<LessonCoursewareWrapper.LessonCoursewareDto> dtos = baseMapper.list(query1);
|
|
|
if(CollectionUtils.isEmpty(dtos)){
|