|
@@ -1,18 +1,19 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
-import com.netflix.discovery.converters.Auto;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.CourseScheduleDao;
|
|
|
-import com.ym.mec.biz.dal.dao.ExtracurricularExercisesDao;
|
|
|
-import com.ym.mec.biz.dal.dao.ExtracurricularExercisesReplyDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentCourseHomeworkDao;
|
|
|
-import com.ym.mec.biz.dal.entity.*;
|
|
|
+import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentCourseHomework;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentCourseHomeworkReply;
|
|
|
import com.ym.mec.biz.dal.page.StudentCourseHomeworkReplyQueryInfo;
|
|
|
import com.ym.mec.biz.service.ExtracurricularExercisesMessageService;
|
|
|
import com.ym.mec.biz.service.StudentCourseHomeworkReplyService;
|
|
|
import com.ym.mec.biz.service.StudentServeService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import com.yonge.log.model.AuditLogAnnotation;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -47,10 +48,6 @@ public class StudentCourseHomeworkReplyController extends BaseController {
|
|
|
private StudentServeService studentServeService;
|
|
|
@Autowired
|
|
|
private CourseScheduleDao courseScheduleDao;
|
|
|
- @Autowired
|
|
|
- private ExtracurricularExercisesReplyDao extracurricularExercisesReplyDao;
|
|
|
- @Autowired
|
|
|
- private ExtracurricularExercisesDao extracurricularExercisesDao;
|
|
|
|
|
|
@ApiOperation(value = "新增回复")
|
|
|
@PostMapping("/add")
|
|
@@ -72,14 +69,12 @@ public class StudentCourseHomeworkReplyController extends BaseController {
|
|
|
if (sysUser == null) {
|
|
|
return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
}
|
|
|
- Integer teacherId = null;
|
|
|
if(!studentCourseHomeworkReply.isExtra()){
|
|
|
studentCourseHomeworkReply.setUserId(sysUser.getId());
|
|
|
studentCourseHomeworkReplyService.insert(studentCourseHomeworkReply);
|
|
|
StudentCourseHomework studentCourseHomework = studentCourseHomeworkDao.get(studentCourseHomeworkReply.getStudentCourseHomeworkId());
|
|
|
CourseSchedule courseSchedule = courseScheduleDao.get(studentCourseHomework.getCourseScheduleId());
|
|
|
- teacherId=courseSchedule.getActualTeacherId();
|
|
|
- studentServeService.updateExercisesSituation(courseSchedule.getClassDate(), new ArrayList<>(Arrays.asList(sysUser.getId())), teacherId);
|
|
|
+ studentServeService.updateExercisesSituation(courseSchedule.getClassDate(), new ArrayList<>(Arrays.asList(sysUser.getId())), courseSchedule.getActualTeacherId());
|
|
|
}else{
|
|
|
ExtracurricularExercisesMessage extracurricularExercisesMessage=new ExtracurricularExercisesMessage();
|
|
|
extracurricularExercisesMessage.setExtracurricularExercisesReplyId(studentCourseHomeworkReply.getStudentCourseHomeworkId());
|
|
@@ -101,6 +96,9 @@ public class StudentCourseHomeworkReplyController extends BaseController {
|
|
|
@ApiOperation(value = "回复查询-公用")
|
|
|
@PostMapping("/queryPagePublic")
|
|
|
public Object queryPagePublic(@RequestBody StudentCourseHomeworkReplyQueryInfo queryInfo){
|
|
|
+ if(queryInfo.getStudentCourseHomeworkId() == null){
|
|
|
+ throw new BizException("参数校验异常");
|
|
|
+ }
|
|
|
if(!queryInfo.isExtra()){
|
|
|
return succeed(studentCourseHomeworkReplyService.queryPage(queryInfo));
|
|
|
}else{
|