|
@@ -23,9 +23,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Description 学生课后作业相关接口
|
|
* Description 学生课后作业相关接口
|
|
@@ -93,8 +92,9 @@ public class CourseHomeworkController extends BaseController {
|
|
@ApiOperation(value = "课后作业-列表", httpMethod = "POST", consumes = "application/json", produces = "application/json")
|
|
@ApiOperation(value = "课后作业-列表", httpMethod = "POST", consumes = "application/json", produces = "application/json")
|
|
@PostMapping(value = "/list", consumes = "application/json", produces = "application/json")
|
|
@PostMapping(value = "/list", consumes = "application/json", produces = "application/json")
|
|
public HttpResponseResult<PageInfo<CourseHomeworkVo>> list(@Valid @RequestBody HomeworkSearch query) {
|
|
public HttpResponseResult<PageInfo<CourseHomeworkVo>> list(@Valid @RequestBody HomeworkSearch query) {
|
|
|
|
+ Long userId = sysUserService.getUserId();
|
|
query.setDecorate(YesOrNoEnum.YES);
|
|
query.setDecorate(YesOrNoEnum.YES);
|
|
- query.setStudentId(sysUserService.getUserId());
|
|
|
|
|
|
+ query.setStudentId(userId);
|
|
query.setCourseStatus(CourseScheduleEnum.COMPLETE);
|
|
query.setCourseStatus(CourseScheduleEnum.COMPLETE);
|
|
List<CourseScheduleEnum> list = new ArrayList<>();
|
|
List<CourseScheduleEnum> list = new ArrayList<>();
|
|
list.add(CourseScheduleEnum.PIANO_ROOM_CLASS);
|
|
list.add(CourseScheduleEnum.PIANO_ROOM_CLASS);
|
|
@@ -103,9 +103,9 @@ public class CourseHomeworkController extends BaseController {
|
|
query.setCourseType(list);
|
|
query.setCourseType(list);
|
|
|
|
|
|
IPage<CourseHomeworkVo> page = courseHomeworkService.selectPage(PageUtil.getPage(query), query);
|
|
IPage<CourseHomeworkVo> page = courseHomeworkService.selectPage(PageUtil.getPage(query), query);
|
|
- if (CollectionUtils.isNotEmpty(page.getRecords())) {
|
|
|
|
-
|
|
|
|
- for (CourseHomeworkVo item : page.getRecords()) {
|
|
|
|
|
|
+ List<CourseHomeworkVo> records = page.getRecords();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(records)) {
|
|
|
|
+ for (CourseHomeworkVo item : records) {
|
|
item.setImUserId(imGroupService.getImUserId(String.valueOf(item.getTeacherId()),ClientEnum.TEACHER.name()));
|
|
item.setImUserId(imGroupService.getImUserId(String.valueOf(item.getTeacherId()),ClientEnum.TEACHER.name()));
|
|
}
|
|
}
|
|
}
|
|
}
|