Explorar o código

增加財務訂單管理

周箭河 %!s(int64=5) %!d(string=hai) anos
pai
achega
1acb675e87

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java

@@ -59,6 +59,9 @@ public class CourseScheduleEvaluate {
     @ApiModelProperty(value = "报告版本")
     private Integer version;
 
+    @ApiModelProperty(value = "报告提交或查看Url")
+    private String reportLink;
+
 
     public Integer getIsPushed() {
         return isPushed;
@@ -219,4 +222,12 @@ public class CourseScheduleEvaluate {
     public void setTeachingMaterial(String teachingMaterial) {
         this.teachingMaterial = teachingMaterial;
     }
+
+    public String getReportLink() {
+        return reportLink;
+    }
+
+    public void setReportLink(String reportLink) {
+        this.reportLink = reportLink;
+    }
 }

+ 36 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/StudyReportController.java

@@ -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));
+	}
 }