Procházet zdrojové kódy

add 需提交报告列表接口

周箭河 před 5 roky
rodič
revize
c3926a7203

+ 7 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -674,9 +674,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 e.setStudentNames(practiceStuNames.get(e.getPracticeId()));
                 e.setPracticeRenewUrl(practiceRenewUrlConfig.getParanValue() + e.getPracticeId());
                 if(reportMap.containsKey(e.getClassGroupId())){
+                    List<CourseScheduleEvaluate> classGroupCourseScheduleEvaluates = reportMap.get(e.getClassGroupId());
+                    CourseScheduleEvaluate courseScheduleEvaluate = classGroupCourseScheduleEvaluates.get(classGroupCourseScheduleEvaluates.size() - 1);
                     e.setHasReport(true);
                     String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-                    e.setStudyReportUrl(baseUrl + "/#/reportDetail?classGroupId=" + e.getClassGroupId());
+                    if(courseScheduleEvaluate.getVersion().equals(1)){
+                        e.setStudyReportUrl(baseUrl + "/#/reportDetail?classGroupId=" + e.getClassGroupId());
+                    }else if(courseScheduleEvaluate.getVersion().equals(2)){
+                        e.setStudyReportUrl(baseUrl + "/#/reportDetailNew?classGroupId=" + e.getClassGroupId());
+                    }
                 }
             }
             if (ClassGroupTypeEnum.VIP == e.getType()) {

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -88,7 +88,7 @@
         FROM course_schedule_evaluate cse
                  LEFT JOIN practice_group pg ON pg.id_ = cse.music_group_id_
                  LEFT JOIN subject s on s.id_ = pg.subject_id_
-        WHERE cse.class_group_id_ = #{classGroupId} AND status_=1
+        WHERE cse.class_group_id_ = #{classGroupId} AND status_=1 AND version_=1
         ORDER BY create_time_ DESC
         LIMIT 1
     </select>

+ 4 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/StudyReportController.java

@@ -47,10 +47,11 @@ public class StudyReportController extends BaseController {
         for (CourseScheduleEvaluate courseScheduleEvaluate : courseScheduleEvaluates) {
             courseScheduleEvaluate.setTimes(2);
             courseScheduleEvaluate.setTotalMinutes(100);
-            if (courseScheduleEvaluate.getStatus().equals(1)) {
+            courseScheduleEvaluate.setReportLink(teacherBaseUrl + "/#/studyReportNew?id=" + courseScheduleEvaluate.getId() + "&classGroupId=" + courseScheduleEvaluate.getClassGroupId());
+            if (courseScheduleEvaluate.getStatus().equals(1) && courseScheduleEvaluate.getVersion().equals(2)) {
                 courseScheduleEvaluate.setReportLink(teacherBaseUrl + "/#/reportDetailNew?id=" + courseScheduleEvaluate.getId() + "&classGroupId=" + courseScheduleEvaluate.getClassGroupId());
-            } else {
-                courseScheduleEvaluate.setReportLink(teacherBaseUrl + "/#/studyReportNew?id=" + courseScheduleEvaluate.getId() + "&classGroupId=" + courseScheduleEvaluate.getClassGroupId());
+            } else if ((courseScheduleEvaluate.getStatus().equals(1) && courseScheduleEvaluate.getVersion().equals(1))){
+                courseScheduleEvaluate.setReportLink(teacherBaseUrl + "/#/reportDetail?classGroupId=" + courseScheduleEvaluate.getClassGroupId());
             }
         }
         return succeed(courseScheduleEvaluates);