|
@@ -14,11 +14,14 @@ import com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.Teacher;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.AudioTypeEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.service.CourseCoursewareService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumMusicService;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.CourseCoursewareVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.MusicSheetDetailVo;
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
|
|
|
import com.yonge.cooleshow.common.enums.YesOrNoEnum;
|
|
|
import com.yonge.toolset.base.exception.BizException;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
@@ -57,6 +60,9 @@ public class CourseCoursewareServiceImpl extends ServiceImpl<CourseCoursewareDao
|
|
|
@Autowired
|
|
|
private TeacherDao teacherDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TenantAlbumMusicService tenantAlbumMusicService;
|
|
|
+
|
|
|
@Override
|
|
|
public CourseCoursewareVo detail(Long id) {
|
|
|
return baseMapper.detail(id);
|
|
@@ -170,6 +176,20 @@ public class CourseCoursewareServiceImpl extends ServiceImpl<CourseCoursewareDao
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 查询老师所在机构存在机构曲目
|
|
|
+ if (query.getClientType().equals(ClientEnum.TEACHER)) {
|
|
|
+ TeacherVo detail = teacherDao.detail(query.getUserId());
|
|
|
+ if (detail != null) {
|
|
|
+ List<Long> musicSheetIds = tenantAlbumMusicService.getMusicIdsByTenantIds(detail.getTenantId());
|
|
|
+
|
|
|
+ for (CourseCoursewareVo record : records) {
|
|
|
+ if (musicSheetIds.contains(record.getMusicSheetId())) {
|
|
|
+ record.setStatus(YesOrNoEnum.YES);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
courseCoursewareVoIPage.setRecords(records);
|
|
|
return courseCoursewareVoIPage;
|
|
|
}
|