|
@@ -2,6 +2,7 @@ package com.ym.mec.web.controller.education;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.CourseHomework;
|
|
|
import com.ym.mec.biz.dal.page.StudentCourseHomeWorkQueryInfo;
|
|
|
import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
|
|
|
import com.ym.mec.biz.service.StudentCourseHomeworkService;
|
|
@@ -20,6 +21,8 @@ import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
|
|
|
import com.ym.mec.biz.service.CourseHomeworkService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
@@ -64,15 +67,22 @@ public class CourseHomeworkController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "根据课程计划获取需要交作业的学生-公用")
|
|
|
@GetMapping("/findHomeworkStudents")
|
|
|
- public Object findHomeworkStudents(Long homeworkId,String userName, boolean extra){
|
|
|
+ public HttpResponseResult findHomeworkStudents(Long homeworkId,String userName, boolean extra){
|
|
|
if(Objects.isNull(extra)){
|
|
|
extra = false;
|
|
|
}
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("content", "");
|
|
|
if(!extra){
|
|
|
- return succeed(studentCourseHomeworkService.findStudentCourseHomeworkByCourse(null, homeworkId,userName));
|
|
|
+ CourseHomework courseHomework = courseHomeworkService.get(homeworkId);
|
|
|
+ if(Objects.nonNull(courseHomework)){
|
|
|
+ result.put("content", courseHomework.getContent());
|
|
|
+ }
|
|
|
+ result.put("data", studentCourseHomeworkService.findStudentCourseHomeworkByCourse(null, homeworkId,userName));
|
|
|
}else{
|
|
|
- return succeed(extracurricularExercisesReplyService.findExtraExerciseStudents(homeworkId,userName));
|
|
|
+ result.put("data", extracurricularExercisesReplyService.findExtraExerciseStudents(homeworkId,userName));
|
|
|
}
|
|
|
+ return succeed(result);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "作业统计")
|