mingfu пре 1 недеља
родитељ
комит
26c614da02

+ 8 - 1
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontStudentController.java

@@ -363,7 +363,14 @@ public class FrontStudentController extends BaseController {
     @GetMapping("record/practice")
     public TableDataInfo practice()
     {
-        return getDataTable(learnStatService.selectStudentPractices(SecurityUtils.getUserId()));
+        return getDataTable(learnStatService.selectStudentPractices(SecurityUtils.getUserId(), PaperType.Practice));
+    }
+
+    @ApiOperation("同步练习列表")
+    @GetMapping("record/coursePractice")
+    public TableDataInfo coursePractice()
+    {
+        return getDataTable(learnStatService.selectStudentPractices(SecurityUtils.getUserId(), PaperType.Course));
     }
 
     @ApiOperation("56 记录-视频学习")

+ 3 - 2
ie-admin/src/main/java/com/ruoyi/web/service/LearnStatService.java

@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import com.ruoyi.common.utils.CommonUtils;
 import com.ruoyi.common.utils.NumberUtils;
+import com.ruoyi.enums.PaperType;
 import com.ruoyi.learn.domain.LearnStudent;
 import com.ruoyi.learn.mapper.LearnAnswerMapper;
 import com.ruoyi.learn.mapper.LearnExamineeMapper;
@@ -33,8 +34,8 @@ public class LearnStatService {
         this.learnStudentService = learnStudentService;
         this.learnTeacherService = learnTeacherService1;
     }
-    public List<JSONObject> selectStudentPractices(Long studentId) {
-        return examineeMapper.selectStudentPractices(studentId);
+    public List<JSONObject> selectStudentPractices(Long studentId, PaperType paperType) {
+        return examineeMapper.selectStudentPractices(studentId, paperType.getVal());
     }
 
     public List<JSONObject> getSimulatedClassRecord(Long teacherId) {

+ 1 - 1
ie-system/src/main/java/com/ruoyi/learn/mapper/LearnExamineeMapper.java

@@ -20,7 +20,7 @@ public interface LearnExamineeMapper
     public List<JSONObject> selectSimulatedStuSubjectStats(@Param("studentId") Long studentId);
 
     public List<JSONObject> selectExamRankingStats(@Param("stuScore") Integer stuScore, @Param("paperIds") Collection<Long> paperIds);
-    public List<JSONObject> selectStudentPractices(@Param("studentId") Long studentId);
+    public List<JSONObject> selectStudentPractices(@Param("studentId") Long studentId, @Param("paperType") Integer paperType);
 
     /**
      * 查询答卷

+ 1 - 1
ie-system/src/main/resources/mapper/learn/LearnExamineeMapper.xml

@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT e.`examinee_id` examineeId, e.`end_time` endTime, SUBSTRING_INDEX(SUBSTRING_INDEX(p.`paperName`, '-', 2), '-', -1) paperName, LENGTH(SUBSTRING_INDEX(SUBSTRING_INDEX(p.`direct_key`, '_', 2), '_', -1)) > 0 AS directed
           FROM `learn_examinee` e
           JOIN `learn_paper` p ON e.`paper_id` = p.`id`
-         WHERE e.student_id = #{studentId} and e.`paper_type` = '50' AND e.`state` &gt;= 4
+         WHERE e.student_id = #{studentId} and e.`paper_type` = #{paperType} AND e.`state` &gt;= 4
         ORDER BY e.`end_time` DESC
     </select>