From 28813f6e577a2cb4ba5e658c846ad0cea4e6d838 Mon Sep 17 00:00:00 2001 From: pd <2776455882@qq.com> Date: Mon, 10 Aug 2020 16:15:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=AD=A6=E7=94=9F=E7=AB=AF-?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E9=A1=B9=E7=9B=AE=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ExperimentallearningController.java | 5 ++--- .../service/ExperimentallearningService.java | 14 ++------------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/controller/ExperimentallearningController.java b/src/main/java/com/yipin/liuwanr/controller/ExperimentallearningController.java index 0cc52ce..abdde49 100644 --- a/src/main/java/com/yipin/liuwanr/controller/ExperimentallearningController.java +++ b/src/main/java/com/yipin/liuwanr/controller/ExperimentallearningController.java @@ -23,14 +23,13 @@ public class ExperimentallearningController { * @return */ @GetMapping("/queryExperimentallearning") - Response queryExperimentallearning(@RequestParam Integer studentId,@RequestParam Integer courseId, - @RequestParam Integer pageNo,@RequestParam Integer pageSize) { + Response queryExperimentallearning(@RequestParam Integer studentId,@RequestParam Integer courseId) { Response resp = new Response(); if(StringUtils.isEmpty(studentId)){ resp.setStatus(300); resp.setMessage("学生信息为空"); }else { - HashMap ret = service.queryProject(studentId,courseId,pageNo, pageSize); + HashMap ret = service.queryProject(studentId,courseId); int status = (int) ret.get("retcode"); if (status == 200) { resp.setStatus(status); diff --git a/src/main/java/com/yipin/liuwanr/service/ExperimentallearningService.java b/src/main/java/com/yipin/liuwanr/service/ExperimentallearningService.java index 0f4cc11..d82bd64 100644 --- a/src/main/java/com/yipin/liuwanr/service/ExperimentallearningService.java +++ b/src/main/java/com/yipin/liuwanr/service/ExperimentallearningService.java @@ -39,11 +39,10 @@ public class ExperimentallearningService { * @param courseId * @return */ - public HashMap queryProject(Integer studentId, Integer courseId,Integer pageNo,Integer pageSize) { + public HashMap queryProject(Integer studentId, Integer courseId) { HashMap resp = new HashMap(); try { if(!StringUtils.isEmpty(courseId)&&!StringUtils.isEmpty(studentId)){ - PageHelper.startPage(pageNo, pageSize); Integer experimentalClassId=mapper.queryExperimentalClassId(courseId,studentId); List projectIds = mapper.queryIsAttendance(studentId, courseId); List projects = mapper.getBycourseId(experimentalClassId,courseId); @@ -60,16 +59,7 @@ public class ExperimentallearningService { projects.set(i, project); } } - - PageInfo info=new PageInfo(projects); - int total1 = (int) info.getTotal(); - int totalPages; - totalPages = total1 / pageSize; - if (total1 % pageSize != 0){ - totalPages ++; - } - long total = total1; - resp.put("retvalue", new PageResult(total,projects,totalPages)); + resp.put("retvalue", projects); } resp.put("retcode", 200); }catch(Exception e){