浏览代码

报表明细加入分页

wangliang 4 年之前
父节点
当前提交
7c96a41cdd

+ 15 - 18
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeReportController.java

@@ -1,23 +1,17 @@
 package com.qmth.themis.backend.api;
 
-import javax.annotation.Resource;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.qmth.themis.business.bean.backend.InvigilateListPatrolReportBean;
 import com.qmth.themis.business.service.TIeReportService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import javax.annotation.Resource;
 
 /**
  * 监考报表
@@ -130,8 +124,9 @@ public class TIeReportController {
     @ApiOperation(value = "违纪名单明细")
     @RequestMapping(value = "/exam_breach_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examBreachListDetail(examStudentId, 0));
+    public Result examBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                                       @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examBreachListDetail(examStudentId, 0, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "撤销违纪名单")
@@ -151,8 +146,9 @@ public class TIeReportController {
     @ApiOperation(value = "撤销违纪名单明细")
     @RequestMapping(value = "/exam_revoke_breach_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examRevokeBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examRevokeBreachListDetail(examStudentId, 1));
+    public Result examRevokeBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                                             @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examRevokeBreachListDetail(examStudentId, 1, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "考生日志")
@@ -172,8 +168,9 @@ public class TIeReportController {
     @ApiOperation(value = "考生日志明细")
     @RequestMapping(value = "/exam_student_log_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examStudentLogListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examStudentLogListDetail(examStudentId));
+    public Result examStudentLogListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                                           @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examStudentLogListDetail(examStudentId, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "在线巡考报表接口")

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamBreachLogMapper.java

@@ -24,7 +24,7 @@ public interface TEExamBreachLogMapper extends BaseMapper<TEExamBreachLog> {
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 	
-	public List<ExamBreachDetailListBean> getExamBreachDetailList(@Param("examStudentId") Long examStudentId,@Param("status") Integer status);
+	public IPage<ExamBreachDetailListBean> getExamBreachDetailList(IPage<ExamBreachDetailListBean> iPage,@Param("examStudentId") Long examStudentId,@Param("status") Integer status);
 
 	public IPage<ExamBreachListBean> getExamRevokeBreachPage(IPage<ExamBreachListBean> iPage, @Param("examId") Long examId,
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,

+ 3 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentLogMapper.java

@@ -2,6 +2,8 @@ package com.qmth.themis.business.dao;
 
 import java.util.List;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -18,5 +20,5 @@ import com.qmth.themis.business.entity.TEExamStudentLog;
  */
 @Mapper
 public interface TEExamStudentLogMapper extends BaseMapper<TEExamStudentLog> {
-	public List<ExamStudentLogDetailListBean> getExamStudentLogList(@Param("examStudentId") Long examStudentId);
+	public IPage<ExamStudentLogDetailListBean> getExamStudentLogList(IPage<ExamStudentLogDetailListBean> iPage, @Param("examStudentId") Long examStudentId);
 }

+ 3 - 3
themis-business/src/main/java/com/qmth/themis/business/service/TIeReportService.java

@@ -27,17 +27,17 @@ public interface TIeReportService {
     public IPage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize);
 
-    public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId,Integer status);
+    public IPage<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize);
 
     public IPage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
                                       String name, String identity, int pageNumber, int pageSize);
 
-    public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId,Integer status);
+    public IPage<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize);
 
     public IPage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                     String identity, int pageNumber, int pageSize);
 
-    public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId);
+    public IPage<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId, int pageNumber, int pageSize);
 
     /**
      * 在线巡考报表接口

+ 22 - 18
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -287,16 +287,18 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status) {
-        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId, status);
-        if (ret != null && ret.size() > 0) {
-            for (ExamBreachDetailListBean b : ret) {
-                if (StringUtils.isNotBlank(b.getType())) {
-                    b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
-                }
+    public IPage<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize) {
+        IPage<ExamBreachDetailListBean> total = examBreachLogMapper.getExamBreachDetailList(new Page<>(pageNumber, pageSize), examStudentId, status);
+        List<ExamBreachDetailListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        for (ExamBreachDetailListBean b : data) {
+            if (StringUtils.isNotBlank(b.getType())) {
+                b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
             }
         }
-        return ret;
+        return total;
     }
 
     @Override
@@ -318,16 +320,18 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status) {
-        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId, status);
-        if (ret != null && ret.size() > 0) {
-            for (ExamBreachDetailListBean b : ret) {
-                if (StringUtils.isNotBlank(b.getType())) {
-                    b.setType(BreachCancelTypeEnum.valueOf(b.getType()).getCode());
-                }
+    public IPage<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize) {
+        IPage<ExamBreachDetailListBean> total = examBreachLogMapper.getExamBreachDetailList(new Page<>(pageNumber, pageSize), examStudentId, status);
+        List<ExamBreachDetailListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        for (ExamBreachDetailListBean b : data) {
+            if (StringUtils.isNotBlank(b.getType())) {
+                b.setType(BreachCancelTypeEnum.valueOf(b.getType()).getCode());
             }
         }
-        return ret;
+        return total;
     }
 
     @Override
@@ -349,8 +353,8 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId) {
-        return examStudentLogMapper.getExamStudentLogList(examStudentId);
+    public IPage<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId, int pageNumber, int pageSize) {
+        return examStudentLogMapper.getExamStudentLogList(new Page<>(pageNumber, pageSize), examStudentId);
     }
 
     /**