Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 năm trước cách đây
mục cha
commit
b7d15bbc24

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseListDto.java

@@ -75,6 +75,12 @@ public class CourseListDto {
 
     private String practiceRenewUrl;
 
+    @ApiModelProperty(value = "是否有陪练报告")
+    private Boolean hasReport = false;
+
+    @ApiModelProperty(value = "陪练报告地址")
+    private String studyReportUrl;
+
     public String getPracticeRenewUrl() {
         return practiceRenewUrl;
     }
@@ -269,4 +275,20 @@ public class CourseListDto {
     public void setTeachMode(String teachMode) {
         this.teachMode = teachMode;
     }
+
+    public Boolean getHasReport() {
+        return hasReport;
+    }
+
+    public void setHasReport(Boolean hasReport) {
+        this.hasReport = hasReport;
+    }
+
+    public String getStudyReportUrl() {
+        return studyReportUrl;
+    }
+
+    public void setStudyReportUrl(String studyReportUrl) {
+        this.studyReportUrl = studyReportUrl;
+    }
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -609,6 +609,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         Set<String> practiceGroupId = practiceCourse.stream().map(e -> e.getPracticeId()).collect(Collectors.toSet());
         //获取陪练课学生名字
         Map<String, String> practiceStuNames = MapUtil.convertIntegerMap(classGroupDao.findVipStuNames(StringUtils.join(practiceGroupId, ","),"PRACTICE"));
+        //获取有陪练报告的课程组
+        List<Integer> classGroupIds = practiceCourse.stream().map(e -> e.getClassGroupId()).collect(Collectors.toList());
+        List<CourseScheduleEvaluate> courseScheduleEvaluates = courseScheduleEvaluateDao.findByClassGroupIds(classGroupIds);
+        Map<Integer, Long> reportMap = courseScheduleEvaluates.stream().collect(Collectors.toMap(CourseScheduleEvaluate::getClassGroupId, CourseScheduleEvaluate::getId));
 
         Set<String> musicGroupId = musicCourse.stream().map(e -> e.getMusicId()).collect(Collectors.toSet());
 //        Set<String> vipGroupId = vipCourses.stream().map(e -> e.getVipId()).collect(Collectors.toSet());
@@ -663,6 +667,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             if(ClassGroupTypeEnum.PRACTICE == e.getType()){
                 e.setStudentNames(practiceStuNames.get(e.getPracticeId()));
                 e.setPracticeRenewUrl(practiceRenewUrlConfig.getParanValue());
+                if(reportMap.containsKey(e.getClassGroupId())){
+                    e.setHasReport(true);
+                    String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+                    e.setStudyReportUrl(baseUrl + "/#/reportDetail?classGroupId=" + e.getClassGroupId());
+                }
             }
             if (ClassGroupTypeEnum.VIP == e.getType()) {
                 e.setStudentNames(vipStuNames.get(e.getVipId()));