Browse Source

课程学生列表分页bug

tags/正式3.2.0
雍文秀 2 years ago
parent
commit
e7ce0d9fa3

+ 3
- 2
slive/src/main/java/com/xhkjedu/slive/controller/liveplay/CourseSectionController.java View File

@@ -260,14 +260,15 @@ public class CourseSectionController {
260 260
         N_Utils.validation(new Object[]{classid, "班级id", 1});
261 261
         Integer page = student.getPage();
262 262
         String studentname = student.getStudentname();
263
+        Integer year = courseSectionService.getYearByClassId(classid);
263 264
         if (N_Utils.isEmptyInteger(page)) {
264
-            List<Map> list = courseSectionService.listStudent(classid, studentname);
265
+            List<Map> list = courseSectionService.listStudent(classid, studentname, year);
265 266
             return new ResultVo(0,"获取课程学生列表成功",list);
266 267
         } else {
267 268
             Integer pageSize = student.getPageSize();
268 269
             N_Utils.validation(new Object[]{pageSize, "显示条数", 1});
269 270
             PageHelper.startPage(page, pageSize);
270
-            List<Map> list = courseSectionService.listStudent(classid, studentname);
271
+            List<Map> list = courseSectionService.listStudent(classid, studentname, year);
271 272
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
272 273
             return new ResultVo(0, "获取课程学生列表成功", pageResult);
273 274
         }

+ 14
- 8
slive/src/main/java/com/xhkjedu/slive/service/liveplay/CourseSectionService.java View File

@@ -27,12 +27,7 @@ import java.io.IOException;
27 27
 import java.util.ArrayList;
28 28
 import java.util.List;
29 29
 import java.util.Map;
30
-import java.util.concurrent.Callable;
31
-import java.util.concurrent.ExecutorService;
32
-import java.util.concurrent.Executors;
33
-import java.util.concurrent.Future;
34
-import java.util.concurrent.TimeUnit;
35
-import java.util.concurrent.TimeoutException;
30
+import java.util.concurrent.*;
36 31
 import java.util.stream.Collectors;
37 32
 
38 33
 /**
@@ -357,8 +352,7 @@ public class CourseSectionService {
357 352
     }
358 353
 
359 354
     //获取课程学生列表
360
-    public List<Map> listStudent(Integer classid, String studentname) {
361
-        Integer year = classMapper.getYearById(classid);
355
+    public List<Map> listStudent(Integer classid, String studentname, Integer year) {
362 356
         List<Map> list = courseSectionMapper.listStudent(classid, studentname, year);
363 357
         for (Map map : list) {
364 358
             String classname = (String) map.get("classname");
@@ -371,6 +365,18 @@ public class CourseSectionService {
371 365
         return list;
372 366
     }
373 367
 
368
+    /**
369
+     * 获取当前班级年份
370
+     *
371
+     * @param [classid]
372
+     * @return java.lang.Integer
373
+     * @author ywx
374
+     * @date 2022/4/8 21:02
375
+     */
376
+    public Integer getYearByClassId(Integer classid) {
377
+        return classMapper.getYearById(classid);
378
+    }
379
+
374 380
     //学生课节日历
375 381
     public List<Map> listStuSectionDate(CourseParams params) {
376 382
         return courseSectionMapper.listStuSectionDate(params);

Loading…
Cancel
Save