|
@@ -5,14 +5,13 @@ import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
|
|
|
import com.ym.mec.biz.service.CourseScheduleEvaluateService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -86,4 +85,24 @@ public class StudyReportController extends BaseController {
|
|
|
Date afterDate = DateUtil.addDays1(nowDate, 5);
|
|
|
return succeed(courseScheduleEvaluateService.createEvaluate(nowDate, afterDate));
|
|
|
}
|
|
|
+
|
|
|
+ @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.getId()==null || courseScheduleEvaluate.getId()<0){
|
|
|
+ return failed(HttpStatus.BAD_REQUEST,"报告id不能为空");
|
|
|
+ }
|
|
|
+ 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.updateStudyReport(courseScheduleEvaluate));
|
|
|
+ }
|
|
|
}
|