|
@@ -1,7 +1,9 @@
|
|
|
package com.ym.mec.teacher.controller;
|
|
|
|
|
|
+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.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -9,6 +11,9 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@RequestMapping("studyReport")
|
|
|
@Api(tags = "陪练报告")
|
|
|
@RestController
|
|
@@ -23,4 +28,35 @@ public class StudyReportController extends BaseController {
|
|
|
public Object info(Integer classGroupId) {
|
|
|
return succeed(courseScheduleEvaluateService.getStudyReport(classGroupId));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "课程组评论列表")
|
|
|
+ @GetMapping("getGroupReviews")
|
|
|
+ public Object getGroupReviews(Integer groupId) {
|
|
|
+ List<CourseScheduleEvaluate> courseScheduleEvaluates = courseScheduleEvaluateService.findByGroupId(groupId);
|
|
|
+ boolean hasReport = false;
|
|
|
+ Date nowDate = new Date();
|
|
|
+ for (CourseScheduleEvaluate courseScheduleEvaluate : courseScheduleEvaluates) {
|
|
|
+ courseScheduleEvaluate.setTimes(2);
|
|
|
+ courseScheduleEvaluate.setTotalMinutes(100);
|
|
|
+ courseScheduleEvaluate.setReportLink("http://www.baidu.com");
|
|
|
+ if(DateUtil.format(courseScheduleEvaluate.getCreateTime(),"yyyy-MM").equals(DateUtil.format(nowDate,"yyyy-MM"))){
|
|
|
+ hasReport = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!hasReport){
|
|
|
+ CourseScheduleEvaluate courseScheduleEvaluate = new CourseScheduleEvaluate();
|
|
|
+ courseScheduleEvaluate.setReportLink("http://www.baidu.com");
|
|
|
+ courseScheduleEvaluate.setTimes(2);
|
|
|
+ courseScheduleEvaluate.setTotalMinutes(100);
|
|
|
+ courseScheduleEvaluate.setMonth(DateUtil.format(nowDate,"yyyy年MM月"));
|
|
|
+ }
|
|
|
+
|
|
|
+ return succeed(courseScheduleEvaluateService.findByGroupId(groupId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "评论详情")
|
|
|
+ @GetMapping("getReviewsInfo")
|
|
|
+ public Object getReviewsInfo(Integer id) {
|
|
|
+ return succeed(courseScheduleEvaluateService.findById(id));
|
|
|
+ }
|
|
|
}
|