Merge remote-tracking branch 'origin/zcc'

This commit is contained in:
wangjinlei
2024-06-13 13:21:53 +08:00
9 changed files with 132 additions and 5 deletions

View File

@@ -33,6 +33,7 @@ public class CourseCatalogueChapterServiceImpl extends ServiceImpl<CourseCatalog
for (CourseCatalogueChapterEntity chapter:page.getRecords()){
LambdaQueryWrapper<CourseCatalogueChapterVideoEntity> videoWrapper = new LambdaQueryWrapper<>();
videoWrapper.eq(CourseCatalogueChapterVideoEntity::getChapterId,chapter.getId());
videoWrapper.orderByAsc(CourseCatalogueChapterVideoEntity::getSort);
chapter.setVideoList(courseCatalogueChapterVideoDao.selectList(videoWrapper));
}
}

View File

@@ -262,17 +262,30 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
@Override
public R getCourseLableLinkList(Map<String, Object> param) {
List resList = new ArrayList();
//医学
MPJLambdaWrapper<CourseToMedicine> toMedicineWrapper = new MPJLambdaWrapper<>();
toMedicineWrapper.leftJoin(CourseMedicine.class,CourseMedicine::getId,CourseToMedicine::getMedicalId);
toMedicineWrapper.selectAll(CourseMedicine.class);
toMedicineWrapper.eq(CourseToMedicine::getCourseId,param.get("courseId"));
List<CourseMedicine> list = toMedicalDao.selectJoinList(CourseMedicine.class,toMedicineWrapper);
if (list.size() > 0) {
for (CourseMedicine m:list){
List<CourseMedicine> mlist = toMedicalDao.selectJoinList(CourseMedicine.class,toMedicineWrapper);
if (mlist.size() > 0) {
for (CourseMedicine m:mlist){
m = getPCourseMedicine(m);
resList.add(m);
}
}
//国学
MPJLambdaWrapper<CourseToSociologyEntity> toSociologyWrapper = new MPJLambdaWrapper<>();
toSociologyWrapper.leftJoin(CourseSociologyEntity.class,CourseSociologyEntity::getId,CourseToSociologyEntity::getSociologyId);
toSociologyWrapper.selectAll(CourseSociologyEntity.class);
toSociologyWrapper.eq(CourseToSociologyEntity::getCourseId,param.get("courseId"));
List<CourseSociologyEntity> slist = courseToSociologyDao.selectJoinList(CourseSociologyEntity.class,toSociologyWrapper);
if (slist.size() > 0) {
for (CourseSociologyEntity s:slist){
s = getPCourseSociology(s);
resList.add(s);
}
}
return R.ok().put("resList",resList);
}
@@ -287,6 +300,17 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
return m;
}
private CourseSociologyEntity getPCourseSociology(CourseSociologyEntity s){
if (s.getPid()!=0){
CourseSociologyEntity pm = courseSociologyDao.selectById(s.getPid());
List<CourseSociologyEntity> list = new ArrayList<>();
list.add(s);
pm.setChildren(list);
s = getPCourseSociology(pm);
}
return s;
}
private List<Integer> sociologyIds(Integer id){
ArrayList<Integer> integers = new ArrayList<>();