|
@@ -2,9 +2,11 @@ package com.ym.mec.student.controller;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
|
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
|
|
import com.ym.mec.biz.dal.entity.StudentCourseHomework;
|
|
import com.ym.mec.biz.dal.entity.StudentCourseHomework;
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
|
|
import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
|
|
|
|
+import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
|
|
import com.ym.mec.biz.service.StudentCourseHomeworkService;
|
|
import com.ym.mec.biz.service.StudentCourseHomeworkService;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
@@ -30,6 +32,8 @@ public class StudentCourseHomeworkController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private StudentCourseHomeworkService studentCourseHomeworkService;
|
|
private StudentCourseHomeworkService studentCourseHomeworkService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private ExtracurricularExercisesReplyService extracurricularExercisesReplyService;
|
|
|
|
+ @Autowired
|
|
private SysUserFeignService sysUserFeignService;
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@ApiOperation(value = "提交作业")
|
|
@ApiOperation(value = "提交作业")
|
|
@@ -50,6 +54,23 @@ public class StudentCourseHomeworkController extends BaseController {
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "重新提交-公用")
|
|
|
|
+ @PostMapping(value = "/updatePublic",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
|
+ public Object updatePublic(@RequestBody StudentCourseHomework studentCourseHomework){
|
|
|
|
+ if(!studentCourseHomework.isExtra()){
|
|
|
|
+ studentCourseHomework.setStatus(YesOrNoEnum.YES);
|
|
|
|
+ studentCourseHomework.setId(studentCourseHomework.getCourseHomeworkId());
|
|
|
|
+ studentCourseHomework.setCourseHomeworkId(null);
|
|
|
|
+ studentCourseHomeworkService.submitHomework(studentCourseHomework);
|
|
|
|
+ }else{
|
|
|
|
+ ExtracurricularExercisesReply extracurricularExercisesReply = new ExtracurricularExercisesReply();
|
|
|
|
+ extracurricularExercisesReply.setId(studentCourseHomework.getCourseHomeworkId());
|
|
|
|
+ extracurricularExercisesReply.setAttachments(studentCourseHomework.getAttachments());
|
|
|
|
+ extracurricularExercisesReplyService.submitExtraExercise(extracurricularExercisesReply);
|
|
|
|
+ }
|
|
|
|
+ return succeed();
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "获取学生作业界面详细信息")
|
|
@ApiOperation(value = "获取学生作业界面详细信息")
|
|
@GetMapping(value = "/findCourseHomeworkStudentDetail")
|
|
@GetMapping(value = "/findCourseHomeworkStudentDetail")
|
|
public Object findCourseHomeworkStudentDetail(Long courseScheduleID) {
|
|
public Object findCourseHomeworkStudentDetail(Long courseScheduleID) {
|
|
@@ -60,6 +81,20 @@ public class StudentCourseHomeworkController extends BaseController {
|
|
return succeed(studentCourseHomeworkService.findCourseHomeworkStudentDetail(courseScheduleID,user.getId().longValue()));
|
|
return succeed(studentCourseHomeworkService.findCourseHomeworkStudentDetail(courseScheduleID,user.getId().longValue()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取学生作业界面详细信息-公用")
|
|
|
|
+ @GetMapping(value = "/findPublicCourseHomeworkStudentDetail")
|
|
|
|
+ public Object findPublicCourseHomeworkStudentDetail(Long courseScheduleID, boolean isExtra) {
|
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
|
+ if(Objects.isNull(user)){
|
|
|
|
+ return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
|
+ }
|
|
|
|
+ if(!isExtra){
|
|
|
|
+ return succeed(studentCourseHomeworkService.findCourseHomeworkStudentDetail(courseScheduleID,user.getId().longValue()));
|
|
|
|
+ }else{
|
|
|
|
+ return succeed(extracurricularExercisesReplyService.findStudentExtraExerciseDetail(courseScheduleID));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "获取学生作业记录")
|
|
@ApiOperation(value = "获取学生作业记录")
|
|
@GetMapping(value = "/findStudentHomeworkRecord")
|
|
@GetMapping(value = "/findStudentHomeworkRecord")
|
|
public HttpResponseResult findStudentHomeworkRecord(CourseHomeworkQueryInfo queryInfo){
|
|
public HttpResponseResult findStudentHomeworkRecord(CourseHomeworkQueryInfo queryInfo){
|