Jelajahi Sumber

报表明细加入分页

wangliang 4 tahun lalu
induk
melakukan
553d8c590d

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

@@ -57,7 +57,6 @@ public class TIeReportController {
         return ResultUtil.ok(reportService.examViewCount(examId, examActivityId, roomCode, courseCode, name, identity, pageNumber, pageSize));
     }
 
-
     @ApiOperation(value = "缺考名单")
     @RequestMapping(value = "/exam_deficiency_list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
@@ -89,8 +88,9 @@ public class TIeReportController {
     @ApiOperation(value = "异常处理明细")
     @RequestMapping(value = "/exam_exception_list_detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
-    public Result examExceptionListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
-        return ResultUtil.ok(reportService.examExceptionDetailList(examStudentId));
+    public Result examExceptionListDetail(@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.examExceptionDetailList(examStudentId, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "重考处理")

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

@@ -24,5 +24,5 @@ public interface TIeInvigilateExceptionInfoMapper extends BaseMapper<TIeInvigila
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 	
-	public List<ExamExceptionDetailListBean> getExamExceptionDetailList(@Param("examStudentId") Long examStudentId);
+	public IPage<ExamExceptionDetailListBean> getExamExceptionDetailList(IPage<ExamExceptionDetailListBean> iPage, @Param("examStudentId") Long examStudentId);
 }

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

@@ -19,7 +19,7 @@ public interface TIeReportService {
     public IPage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                    String identity, int pageNumber, int pageSize);
 
-    public List<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId);
+    public IPage<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId, int pageNumber, int pageSize);
 
     public IPage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize);

+ 9 - 7
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -240,14 +240,16 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId) {
-        List<ExamExceptionDetailListBean> ret = invigilateExceptionInfoMapper.getExamExceptionDetailList(examStudentId);
-        if (ret != null && ret.size() > 0) {
-            for (ExamExceptionDetailListBean b : ret) {
-                b.setReason(ExceptionEnum.valueOf(b.getReason()).getCode());
-            }
+    public IPage<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId, int pageNumber, int pageSize) {
+        IPage<ExamExceptionDetailListBean> total = invigilateExceptionInfoMapper.getExamExceptionDetailList(new Page<>(pageNumber, pageSize), examStudentId);
+        List<ExamExceptionDetailListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
         }
-        return ret;
+        for (ExamExceptionDetailListBean b : data) {
+            b.setReason(ExceptionEnum.valueOf(b.getReason()).getCode());
+        }
+        return total;
     }
 
     @Override

+ 3 - 11
themis-business/src/main/resources/mapper/TIeInvigilateExceptionInfoMapper.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.themis.business.dao.TIeInvigilateExceptionInfoMapper">
+
 <select id="getExamExceptionPage"
 		resultType="com.qmth.themis.business.bean.backend.ExamExceptionListBean">
 		SELECT
@@ -14,13 +15,7 @@
 		t.identity,
 		t.room_name roomName,
 		count(f.exam_student_id) exceptionCount,
-		sum(
-		timestampdiff(
-		MINUTE,
-		f.create_time,
-		f.update_time
-		)
-		) exceptionTotalTime
+		sum(f.difference) exceptionTotalTime
 		FROM
 		t_ie_invigilate_exception_info f
 		LEFT JOIN t_e_exam_student t ON f.exam_student_id = t.id
@@ -49,10 +44,7 @@
 		f.create_time startTime,
 		f.update_time endTime,
 		f.type reason,
-		timestampdiff(
-		MINUTE,
-		f.create_time,
-		f.update_time) totalTime
+		f.difference totalTime
 		FROM
 		t_ie_invigilate_exception_info f
 		where f.exam_student_id =#{examStudentId}

+ 7 - 4
themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

@@ -38,10 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.UUID;
+import java.util.*;
 
 /**
  * @Description: mq执行逻辑 impl
@@ -749,6 +746,12 @@ public class MqLogicServiceImpl implements MqLogicService {
         ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
         //增加异常日志
         TIeInvigilateExceptionInfo tIeInvigilateExceptionInfo = new TIeInvigilateExceptionInfo(examId, examActivityId, recordId, examStudentId, ExceptionEnum.NET_TIME_OUT.getCode(), ExceptionEnum.NET_TIME_OUT, diff, ExamRecordCacheUtil.getLastBreakId(recordId));
+        if (Objects.nonNull(diff)) {
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTimeInMillis(tIeInvigilateExceptionInfo.getCreateTime());
+            calendar.add(Calendar.SECOND, diff);
+            tIeInvigilateExceptionInfo.setUpdateTime(calendar.getTime().getTime());
+        }
         tIeInvigilateExceptionInfoService.saveOrUpdate(tIeInvigilateExceptionInfo);
         TEExamStudentLog teExamStudentLog = new TEExamStudentLog(SystemOperationEnum.BREAK_OFF.name(), SystemOperationEnum.BREAK_OFF.getCode(), SystemOperationEnum.BREAK_OFF.getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, ExamRecordCacheUtil.getLastBreakId(recordId));
         teExamStudentLogService.save(teExamStudentLog);