|
@@ -2181,10 +2181,17 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
List<FsUserCourseVideoPageListVO> vos = fsUserCourseVideoMapper.selectFsUserCourseVideoListByMap(params);
|
|
|
// 项目
|
|
|
List<SysDictData> courseProject = dictDataMapper.selectDictDataByType("sys_course_project");
|
|
|
- vos.forEach(vo -> courseProject.stream()
|
|
|
- .filter(c -> c.getDictValue().equals(vo.getProjectId().toString()))
|
|
|
- .findFirst()
|
|
|
- .ifPresent(c -> vo.setProjectName(c.getDictLabel())));
|
|
|
+ Map<String, String> projectMap = courseProject.stream()
|
|
|
+ .collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel));
|
|
|
+ vos.forEach(vo -> {
|
|
|
+ if (vo.getProjectId() != null) {
|
|
|
+ String projectName = projectMap.get(vo.getProjectId().toString());
|
|
|
+ if (projectName != null) {
|
|
|
+ vo.setProjectName(projectName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
return vos;
|
|
|
}
|
|
|
/**
|