|
@@ -26,10 +26,10 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 教学班服务实现类
|
|
* @Description: 教学班服务实现类
|
|
@@ -123,13 +123,17 @@ public class TeachClazzServiceImpl extends ServiceImpl<TeachClazzMapper,TeachCla
|
|
.eq(TeachCourse::getUserId, userId)
|
|
.eq(TeachCourse::getUserId, userId)
|
|
.eq(TeachCourse::getSchoolId, schoolId)
|
|
.eq(TeachCourse::getSchoolId, schoolId)
|
|
.orderByDesc(TeachCourse::getCreateTime));
|
|
.orderByDesc(TeachCourse::getCreateTime));
|
|
- return teachCourseList.stream().flatMap(e -> {
|
|
|
|
- BasicCourse basicCourse = basicCourseService.getById(e.getBasicCourseId());
|
|
|
|
- DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
|
- dictionaryResult.setId(e.getId());
|
|
|
|
- dictionaryResult.setCode(basicCourse.getCode());
|
|
|
|
- dictionaryResult.setName(basicCourse.getName());
|
|
|
|
- return Stream.of(dictionaryResult);
|
|
|
|
- }).collect(Collectors.toList());
|
|
|
|
|
|
+ List<DictionaryResult> dictionaryResultList = new ArrayList<>();
|
|
|
|
+ for (TeachCourse teachCourse : teachCourseList) {
|
|
|
|
+ BasicCourse basicCourse = basicCourseService.getById(teachCourse.getBasicCourseId());
|
|
|
|
+ if (basicCourse.getEnable()){
|
|
|
|
+ DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
|
+ dictionaryResult.setId(teachCourse.getId());
|
|
|
|
+ dictionaryResult.setCode(basicCourse.getCode());
|
|
|
|
+ dictionaryResult.setName(basicCourse.getName());
|
|
|
|
+ dictionaryResultList.add(dictionaryResult);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return dictionaryResultList;
|
|
}
|
|
}
|
|
}
|
|
}
|