|
@@ -1,15 +1,21 @@
|
|
|
package com.ym.mec.teacher.controller;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
|
|
|
import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
|
|
|
import com.ym.mec.biz.service.ClassGroupService;
|
|
|
+import com.ym.mec.biz.service.CourseScheduleEvaluateService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* @Author Joburgess
|
|
@@ -22,6 +28,10 @@ public class ClassGroupController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private ClassGroupService classGroupService;
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleEvaluateService courseScheduleEvaluateService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@ApiOperation(value = "教师关联班级获取")
|
|
|
@GetMapping("/findTeacherClassGroups")
|
|
@@ -41,4 +51,21 @@ public class ClassGroupController extends BaseController {
|
|
|
return succeed(classGroupService.findTeacherClassStudents(queryInfo));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "提交陪练报告")
|
|
|
+ @PostMapping(value = "/addStudyReport")
|
|
|
+ public HttpResponseResult addStudyReport(@RequestBody CourseScheduleEvaluate courseScheduleEvaluate) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(Objects.isNull(sysUser)){
|
|
|
+ return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
+ }
|
|
|
+ if(courseScheduleEvaluate.getClassGroupId()==null || courseScheduleEvaluate.getClassGroupId()<0){
|
|
|
+ return failed(HttpStatus.BAD_REQUEST,"班级id必须大于0");
|
|
|
+ }
|
|
|
+ if(courseScheduleEvaluate.getItem()==null || courseScheduleEvaluate.getItem().isEmpty()){
|
|
|
+ return failed(HttpStatus.BAD_REQUEST,"课程评价选项不能为空");
|
|
|
+ }
|
|
|
+ courseScheduleEvaluate.setTeacherId(sysUser.getId());
|
|
|
+ return succeed(courseScheduleEvaluateService.addStudyReport(courseScheduleEvaluate));
|
|
|
+ }
|
|
|
+
|
|
|
}
|