mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 09:26:48 +08:00
作业导出判空
This commit is contained in:
@@ -369,7 +369,11 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
public void export(String courseName,String courseId,String contentId,String name,Integer status,HttpServletResponse response) throws IOException {
|
||||
Map<String, String>map=new HashMap<>();
|
||||
try {
|
||||
studyService.getList(courseId, contentId, name, status).stream().filter(Objects::nonNull).forEach(s->{
|
||||
List<StudyCourseItem> list = studyService.getList(courseId, contentId, name, status);
|
||||
if(list.isEmpty()){
|
||||
throw new RuntimeException("暂无数据");
|
||||
}
|
||||
list.stream().filter(Objects::nonNull).forEach(s->{
|
||||
shomeworkService.getByStudyIdAndContentId(s.getStudyId(),contentId).stream().filter(Objects::nonNull).filter(e->e.getFilePath()!=null).forEach(e->{
|
||||
//取作业后缀名
|
||||
int dotIndex = e.getFilePath().lastIndexOf('/'); // 查找最后一个'.'的位置
|
||||
|
||||
Reference in New Issue
Block a user