Bladeren bron

课程名称

qinchao 4 jaren geleden
bovenliggende
commit
7ef3a049bc

+ 5 - 0
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamControlController.java

@@ -455,4 +455,9 @@ public class ExamControlController extends ControllerSupport {
 
         examControlService.switchScreen(examRecordDataId);
     }
+
+    @GetMapping("/courseName/{id}")
+    public String courseName(@PathVariable Long id) {
+        return examRecordDataService.findCourseNameById(id);
+    }
 }

+ 4 - 0
examcloud-core-oe-student-dao/src/main/java/cn/com/qmth/examcloud/core/oe/student/dao/ExamRecordDataRepo.java

@@ -34,4 +34,8 @@ public interface ExamRecordDataRepo extends JpaRepository<ExamRecordDataEntity,
     @Modifying
     @Query(value = "update ec_oes_exam_record_data set sync_status=?1 where id=?2", nativeQuery = true)
     int updateExamRecordSyncStatusById(String syncStatus, Long id);
+
+    @Query(value = "SELECT c.name from ec_oes_exam_record_data d LEFT JOIN ec_b_course c ON d.course_id = c.id " +
+            "WHERE d.id = ?1", nativeQuery = true)
+    String findCourseNameById(Long id);
 }

+ 1 - 0
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamRecordDataService.java

@@ -72,4 +72,5 @@ public interface ExamRecordDataService {
      */
     void updatePartialExamRecord(UpdatePartialExamRecordReq req);
 
+    String findCourseNameById(Long id);
 }

+ 5 - 0
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordDataServiceImpl.java

@@ -375,6 +375,11 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
         }
     }
 
+    @Override
+    public String findCourseNameById(Long id) {
+        return examRecordDataRepo.findCourseNameById(id);
+    }
+
     /**
      * 更新客观题答案
      *