|
@@ -2,8 +2,11 @@ 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.dao.SysConfigDao;
|
|
|
import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
|
|
|
+import com.ym.mec.biz.dal.entity.SysConfig;
|
|
|
import com.ym.mec.biz.service.CourseScheduleEvaluateService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
@@ -26,6 +29,8 @@ public class StudyReportController extends BaseController {
|
|
|
private CourseScheduleEvaluateService courseScheduleEvaluateService;
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigDao sysConfigDao;
|
|
|
|
|
|
|
|
|
@ApiOperation("获取学生陪练报告信息")
|
|
@@ -38,10 +43,15 @@ public class StudyReportController extends BaseController {
|
|
|
@GetMapping("getGroupReviews")
|
|
|
public Object getGroupReviews(Integer groupId) {
|
|
|
List<CourseScheduleEvaluate> courseScheduleEvaluates = courseScheduleEvaluateService.findByGroupId(groupId);
|
|
|
+ String teacherBaseUrl = sysConfigDao.findConfigValue(SysConfigService.TEACHER_BASE_URL);
|
|
|
for (CourseScheduleEvaluate courseScheduleEvaluate : courseScheduleEvaluates) {
|
|
|
courseScheduleEvaluate.setTimes(2);
|
|
|
courseScheduleEvaluate.setTotalMinutes(100);
|
|
|
- courseScheduleEvaluate.setReportLink("http://www.baidu.com");
|
|
|
+ if (courseScheduleEvaluate.getStatus().equals(1)) {
|
|
|
+ courseScheduleEvaluate.setReportLink(teacherBaseUrl + "/#/reportDetailNew?id=" + courseScheduleEvaluate.getId() + "&classGroupId=" + courseScheduleEvaluate.getClassGroupId());
|
|
|
+ } else {
|
|
|
+ courseScheduleEvaluate.setReportLink(teacherBaseUrl + "/#/studyReportNew?id=" + courseScheduleEvaluate.getId() + "&classGroupId=" + courseScheduleEvaluate.getClassGroupId());
|
|
|
+ }
|
|
|
}
|
|
|
return succeed(courseScheduleEvaluates);
|
|
|
}
|
|
@@ -66,7 +76,7 @@ public class StudyReportController extends BaseController {
|
|
|
@GetMapping("createEvaluate")
|
|
|
public Object createEvaluate(Date date) {
|
|
|
Date nowDate = new Date();
|
|
|
- if(date != null){
|
|
|
+ if (date != null) {
|
|
|
nowDate = date;
|
|
|
}
|
|
|
Date afterDate = DateUtil.addDays1(nowDate, 5);
|
|
@@ -77,17 +87,17 @@ public class StudyReportController extends BaseController {
|
|
|
@PostMapping(value = "/addStudyReport")
|
|
|
public HttpResponseResult addStudyReport(@RequestBody CourseScheduleEvaluate courseScheduleEvaluate) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(Objects.isNull(sysUser)){
|
|
|
- return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
+ if (Objects.isNull(sysUser)) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
}
|
|
|
- if(courseScheduleEvaluate.getId()==null || courseScheduleEvaluate.getId()<0){
|
|
|
- return failed(HttpStatus.BAD_REQUEST,"报告id不能为空");
|
|
|
+ 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.getClassGroupId() == null || courseScheduleEvaluate.getClassGroupId() < 0) {
|
|
|
+ return failed(HttpStatus.BAD_REQUEST, "班级id必须大于0");
|
|
|
}
|
|
|
- if(courseScheduleEvaluate.getItem()==null || courseScheduleEvaluate.getItem().isEmpty()){
|
|
|
- return failed(HttpStatus.BAD_REQUEST,"课程评价选项不能为空");
|
|
|
+ if (courseScheduleEvaluate.getItem() == null || courseScheduleEvaluate.getItem().isEmpty()) {
|
|
|
+ return failed(HttpStatus.BAD_REQUEST, "课程评价选项不能为空");
|
|
|
}
|
|
|
courseScheduleEvaluate.setTeacherId(sysUser.getId());
|
|
|
return succeed(courseScheduleEvaluateService.updateStudyReport(courseScheduleEvaluate));
|