Browse Source

分页修改

wangliang 4 năm trước cách đây
mục cha
commit
d1960a21da
19 tập tin đã thay đổi với 816 bổ sung996 xóa
  1. 1 6
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBExamInvigilateUserController.java
  2. 1 6
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBOrgController.java
  3. 1 11
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBTaskHistoryController.java
  4. 2 5
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java
  5. 1 6
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamActivityController.java
  6. 1 6
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java
  7. 4 14
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamCourseController.java
  8. 3 13
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamReexamController.java
  9. 257 295
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java
  10. 29 47
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEStudentController.java
  11. 1 3
      themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateCallMobileController.java
  12. 5 17
      themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java
  13. 1 5
      themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateWarnInfoController.java
  14. 21 21
      themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java
  15. 26 31
      themis-business/src/main/java/com/qmth/themis/business/service/TIeReportService.java
  16. 462 506
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java
  17. 0 1
      themis-business/src/main/java/com/qmth/themis/business/templete/TaskExportCommon.java
  18. 0 1
      themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java
  19. 0 2
      themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

+ 1 - 6
themis-backend/src/main/java/com/qmth/themis/backend/api/TBExamInvigilateUserController.java

@@ -1,11 +1,9 @@
 package com.qmth.themis.backend.api;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
@@ -16,7 +14,6 @@ import com.qmth.themis.business.service.MqDtoService;
 import com.qmth.themis.business.service.TBAttachmentService;
 import com.qmth.themis.business.service.TBExamInvigilateUserService;
 import com.qmth.themis.business.service.TBTaskHistoryService;
-import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.ServletUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
@@ -66,9 +63,7 @@ public class TBExamInvigilateUserController {
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考员信息", response = TBExamInvigilateUserDto.class)})
     public Result query(@ApiParam(value = "考试批次id", required = true) @RequestParam(required = false) Long examId, @ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode, @ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        IPage<TBExamInvigilateUserDto> examInvigilateUserDtoIPage = tbExamInvigilateUserService.examInvigilateUserQuery(new Page<>(pageNumber, pageSize), examId, roomCode, userId);
-        BasePage basePage = new BasePage(examInvigilateUserDtoIPage.getRecords(), examInvigilateUserDtoIPage.getCurrent(), examInvigilateUserDtoIPage.getSize(), examInvigilateUserDtoIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tbExamInvigilateUserService.examInvigilateUserQuery(new Page<>(pageNumber, pageSize), examId, roomCode, userId));
     }
 
     @ApiOperation(value = "监考员修改接口")

+ 1 - 6
themis-backend/src/main/java/com/qmth/themis/backend/api/TBOrgController.java

@@ -1,10 +1,8 @@
 package com.qmth.themis.backend.api;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.response.TBOrgDto;
@@ -24,7 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.io.File;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Objects;
@@ -59,9 +56,7 @@ public class TBOrgController {
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "机构信息", response = TBOrgDto.class)})
     public Result queryByPage(@ApiParam(value = "机构代码", required = false) @RequestParam(required = false) String code, @ApiParam(value = "机构名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        IPage<TBOrgDto> tborgIPage = tbOrgService.queryByPage(new Page<>(pageNumber, pageSize), code, name, enable);
-        BasePage basePage = new BasePage(tborgIPage.getRecords(), tborgIPage.getCurrent(), tborgIPage.getSize(), tborgIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tbOrgService.queryByPage(new Page<>(pageNumber, pageSize), code, name, enable));
     }
 
     //    @CacheEvict(value = "org_cache", key = "'orgCacheQuery'")

+ 1 - 11
themis-backend/src/main/java/com/qmth/themis/backend/api/TBTaskHistoryController.java

@@ -1,15 +1,10 @@
 package com.qmth.themis.backend.api;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.themis.business.base.BasePage;
-import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.response.TBTaskDto;
 import com.qmth.themis.business.enums.TaskStatusEnum;
 import com.qmth.themis.business.enums.TaskTypeEnum;
 import com.qmth.themis.business.service.TBTaskHistoryService;
-import com.qmth.themis.common.enums.ExceptionResultEnum;
-import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
@@ -19,9 +14,6 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
 
 /**
  * @Description: 任务 前端控制器
@@ -42,8 +34,6 @@ public class TBTaskHistoryController {
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "任务信息", response = TBTaskDto.class)})
     public Result query(@ApiParam(value = "任务id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "业务对象id", required = false) @RequestParam(required = false) Long entityId, @ApiParam(value = "任务类型", required = false) @RequestParam(required = false) TaskTypeEnum type, @ApiParam(value = "任务状态", required = false) @RequestParam(required = false) TaskStatusEnum status, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        IPage<TBTaskDto> taskDtoIPage = tbTaskHistoryService.taskQuery(new Page<>(pageNumber, pageSize), id, entityId, type, status);
-        BasePage basePage = new BasePage(taskDtoIPage.getRecords(), taskDtoIPage.getCurrent(), taskDtoIPage.getSize(), taskDtoIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tbTaskHistoryService.taskQuery(new Page<>(pageNumber, pageSize), id, entityId, type, status));
     }
 }

+ 2 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.gson.Gson;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
 import com.qmth.themis.business.dto.MqDto;
@@ -546,9 +545,7 @@ public class TBUserController {
     @ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = TBUserDto.class)})
     public Result query(@ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "登录名", required = false) @RequestParam(required = false) String loginName, @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name, @ApiParam(value = "角色", required = false) @RequestParam(required = false) String roleCode, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         IPage<TBUserDto> tbUserIPage = tbUserService.userQuery(new Page<>(pageNumber, pageSize), id, loginName, name, roleCode, enable);
-        List<TBUserDto> tbUserDtoList = tbUserIPage.getRecords();
-        BasePage basePage = new BasePage(tbUserDtoList, tbUserIPage.getCurrent(), tbUserIPage.getSize(), tbUserIPage.getTotal());
-        tbUserDtoList.forEach(s -> {
+        tbUserIPage.getRecords().forEach(s -> {
             if (Objects.nonNull(s.getRoleNameStr())) {
                 s.setRoleName(Arrays.asList(s.getRoleNameStr().split(",")));
             }
@@ -556,7 +553,7 @@ public class TBUserController {
                 s.setRoleCode(Arrays.asList(s.getRoleCodeStr().split(",")));
             }
         });
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tbUserIPage);
     }
 
     //    @CacheEvict(value = "user_cache", key = "'userCacheQuery'")

+ 1 - 6
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamActivityController.java

@@ -1,10 +1,7 @@
 package com.qmth.themis.backend.api;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.dto.MqDto;
-import com.qmth.themis.business.dto.response.TEExamActivityQueryDto;
 import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TEExam;
 import com.qmth.themis.business.entity.TEExamActivity;
@@ -114,8 +111,6 @@ public class TEExamActivityController {
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试场次信息", response = TEExamActivity.class)})
     public Result query(@ApiParam(value = "主键", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId, @ApiParam(value = "考试场次编码", required = false) @RequestParam(required = false) String code, @ApiParam(value = "开始日期", required = false) @RequestParam(required = false) String startDate, @ApiParam(value = "结束日期", required = false) @RequestParam(required = false) String finishDate, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        IPage<TEExamActivityQueryDto> teExamActivityIPage = teExamActivityService.examActivityQuery(new Page<>(pageNumber, pageSize), id, examId, code, startDate, finishDate);
-        BasePage basePage = new BasePage(teExamActivityIPage.getRecords(), teExamActivityIPage.getCurrent(), teExamActivityIPage.getSize(), teExamActivityIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(teExamActivityService.examActivityQuery(new Page<>(pageNumber, pageSize), id, examId, code, startDate, finishDate));
     }
 }

+ 1 - 6
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -1,11 +1,9 @@
 package com.qmth.themis.backend.api;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.constant.SystemConstant;
@@ -13,7 +11,6 @@ import com.qmth.themis.business.dto.AuthDto;
 import com.qmth.themis.business.dto.ExamPropCountDto;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.dto.request.TEExamDto;
-import com.qmth.themis.business.dto.response.TEExamQueryDto;
 import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.*;
@@ -218,9 +215,7 @@ public class TEExamController {
     @ApiResponses({@ApiResponse(code = 200, message = "考试批次信息", response = TEExam.class)})
     public Result query(@ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId, @ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "考试批次编码", required = false) @RequestParam(required = false) String code, @ApiParam(value = "考试批次名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "考试批次模式", required = false) @RequestParam(required = false) String mode, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        IPage<TEExamQueryDto> teExamQueryDtoIPage = teExamService.examQuery(new Page<>(pageNumber, pageSize), userId, id, code, name, mode, enable, tbUser.getOrgId());
-        BasePage basePage = new BasePage(teExamQueryDtoIPage.getRecords(), teExamQueryDtoIPage.getCurrent(), teExamQueryDtoIPage.getSize(), teExamQueryDtoIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(teExamService.examQuery(new Page<>(pageNumber, pageSize), userId, id, code, name, mode, enable, tbUser.getOrgId()));
     }
 
     @ApiOperation(value = "考试批次停用/启用接口")

+ 4 - 14
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamCourseController.java

@@ -1,18 +1,12 @@
 package com.qmth.themis.backend.api;
 
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.themis.business.base.BasePage;
-import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.dto.response.TEExamCourseDto;
 import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TEExamCourse;
 import com.qmth.themis.business.enums.FieldUniqueEnum;
 import com.qmth.themis.business.service.TEExamCourseService;
-import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.ServletUtil;
-import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
@@ -26,8 +20,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
 import java.util.Objects;
 
 /**
@@ -57,9 +49,9 @@ public class TEExamCourseController {
         try {
             TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
             UpdateWrapper<TEExamCourse> teExamCourseUpdateWrapper = new UpdateWrapper<>();
-            teExamCourseUpdateWrapper.lambda().set(TEExamCourse::getObjectiveShuffle,teExamCourse.getObjectiveShuffle())
-                    .set(TEExamCourse::getOptionShuffle,teExamCourse.getOptionShuffle())
-                    .set(TEExamCourse::getUpdateId,tbUser.getId())
+            teExamCourseUpdateWrapper.lambda().set(TEExamCourse::getObjectiveShuffle, teExamCourse.getObjectiveShuffle())
+                    .set(TEExamCourse::getOptionShuffle, teExamCourse.getOptionShuffle())
+                    .set(TEExamCourse::getUpdateId, tbUser.getId())
                     .eq(TEExamCourse::getExamId, teExamCourse.getExamId()).eq(TEExamCourse::getCourseCode, teExamCourse.getCourseCode());
             teExamCourseService.update(teExamCourseUpdateWrapper);
         } catch (Exception e) {
@@ -85,8 +77,6 @@ public class TEExamCourseController {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }
-        IPage<TEExamCourseDto> examCourseIPage = teExamCourseService.examCourseQuery(new Page<>(pageNumber, pageSize), id, examId, courseCode, courseName, hasPaper);
-        BasePage basePage = new BasePage(examCourseIPage.getRecords(), examCourseIPage.getCurrent(), examCourseIPage.getSize(), examCourseIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(teExamCourseService.examCourseQuery(new Page<>(pageNumber, pageSize), id, examId, courseCode, courseName, hasPaper));
     }
 }

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

@@ -1,12 +1,8 @@
 package com.qmth.themis.backend.api;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
-import com.qmth.themis.business.bean.backend.ReexamListDoneBean;
-import com.qmth.themis.business.bean.backend.ReexamListNotDoneBean;
 import com.qmth.themis.business.bean.backend.ReexamListRequestBean;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
@@ -222,9 +218,7 @@ public class TEExamReexamController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        IPage<ReexamListRequestBean> reexamListRequestBeanIPage = teExamReexamService.reexamPageRequestList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, userId);
-        BasePage basePage = new BasePage(reexamListRequestBeanIPage.getRecords(), reexamListRequestBeanIPage.getCurrent(), reexamListRequestBeanIPage.getSize(), reexamListRequestBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(teExamReexamService.reexamPageRequestList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, userId));
     }
 
     @ApiOperation(value = "重考待审列表接口")
@@ -243,9 +237,7 @@ public class TEExamReexamController {
                               @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
                               @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        IPage<ReexamListNotDoneBean> reexamListNotDongBeanIPage = teExamReexamService.reexamPageNotDoneList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, reason, reasonStartTime, reasonEndTime, applyName, tbUser.getId());
-        BasePage basePage = new BasePage(reexamListNotDongBeanIPage.getRecords(), reexamListNotDongBeanIPage.getCurrent(), reexamListNotDongBeanIPage.getSize(), reexamListNotDongBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(teExamReexamService.reexamPageNotDoneList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, reason, reasonStartTime, reasonEndTime, applyName, tbUser.getId()));
     }
 
     @ApiOperation(value = "重考待审提醒接口")
@@ -273,8 +265,6 @@ public class TEExamReexamController {
                            @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
                            @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        IPage<ReexamListDoneBean> reexamListRequestBeanIPage = teExamReexamService.reexamPageDoneList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, auditingStatus,reasonStartTime,reasonEndTime,applyName,tbUser.getId());
-        BasePage basePage = new BasePage(reexamListRequestBeanIPage.getRecords(), reexamListRequestBeanIPage.getCurrent(), reexamListRequestBeanIPage.getSize(), reexamListRequestBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(teExamReexamService.reexamPageDoneList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, auditingStatus, reasonStartTime, reasonEndTime, applyName, tbUser.getId()));
     }
 }

+ 257 - 295
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -1,74 +1,38 @@
 package com.qmth.themis.backend.api;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestBody;
-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 org.springframework.web.multipart.MultipartFile;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.dto.response.TEExamStudentDto;
-import com.qmth.themis.business.entity.TBAttachment;
-import com.qmth.themis.business.entity.TBExamInvigilateUser;
-import com.qmth.themis.business.entity.TBOrg;
-import com.qmth.themis.business.entity.TBTaskHistory;
-import com.qmth.themis.business.entity.TBUser;
-import com.qmth.themis.business.entity.TEExam;
-import com.qmth.themis.business.entity.TEExamActivity;
-import com.qmth.themis.business.entity.TEExamStudent;
-import com.qmth.themis.business.entity.TEStudent;
-import com.qmth.themis.business.enums.MqTagEnum;
-import com.qmth.themis.business.enums.MqTopicEnum;
-import com.qmth.themis.business.enums.TaskStatusEnum;
-import com.qmth.themis.business.enums.TaskTypeEnum;
-import com.qmth.themis.business.enums.UploadFileEnum;
+import com.qmth.themis.business.entity.*;
+import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.excel.ExportUtils;
-import com.qmth.themis.business.service.MqDtoService;
-import com.qmth.themis.business.service.TBAttachmentService;
-import com.qmth.themis.business.service.TBExamInvigilateUserService;
-import com.qmth.themis.business.service.TBTaskHistoryService;
-import com.qmth.themis.business.service.TEExamActivityService;
-import com.qmth.themis.business.service.TEExamService;
-import com.qmth.themis.business.service.TEExamStudentService;
-import com.qmth.themis.business.service.TEStudentService;
+import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.ServletUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
-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;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 考生库 前端控制器
@@ -81,268 +45,266 @@ import io.swagger.annotations.ApiResponses;
 @RestController
 @RequestMapping("/${prefix.url.admin}/examStudent")
 public class TEExamStudentController {
-	private final static Logger log = LoggerFactory.getLogger(TEExamStudentController.class);
+    private final static Logger log = LoggerFactory.getLogger(TEExamStudentController.class);
+
+    @Resource
+    TEExamStudentService teExamStudentService;
 
-	@Resource
-	TEExamStudentService teExamStudentService;
+    @Resource
+    TBAttachmentService tbAttachmentService;
 
-	@Resource
-	TBAttachmentService tbAttachmentService;
+    @Resource
+    TBTaskHistoryService taskHistoryService;
 
-	@Resource
-	TBTaskHistoryService taskHistoryService;
+    @Resource
+    TEExamService teExamService;
 
-	@Resource
-	TEExamService teExamService;
+    @Resource
+    TEExamActivityService teExamActivityService;
 
-	@Resource
-	TEExamActivityService teExamActivityService;
+    @Resource
+    TBExamInvigilateUserService tbExamInvigilateUserService;
 
-	@Resource
-	TBExamInvigilateUserService tbExamInvigilateUserService;
+    @Resource
+    MqDtoService mqDtoService;
 
-	@Resource
-	MqDtoService mqDtoService;
+    @Resource
+    SystemConfig systemConfig;
 
-	@Resource
-	SystemConfig systemConfig;
+    @Resource
+    TEStudentService teStudentService;
 
-	@Resource
-	TEStudentService teStudentService;
-	
     @ApiOperation(value = "考生导出")
-	@RequestMapping(value = "/export", method = RequestMethod.POST)
+    @RequestMapping(value = "/export", method = RequestMethod.POST)
     public void export(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId,
-			@ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long activityId,
-			@ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
-			@ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
-			@ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode,
-			@ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
-			@ApiParam(value = "年级", required = false) @RequestParam(required = false) String grade,
-			@ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable,
-			@ApiParam(value = "教学班级", required = false) @RequestParam(required = false) String classNo,
-			@ApiParam(value = "底照是否上传", required = false) @RequestParam(required = false) Integer hasPhoto,
-			HttpServletResponse response) throws Exception {
-		if (Objects.isNull(examId) || Objects.equals(examId, "")) {
-			throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
-		}
-		List<TEExamStudentDto> list = teExamStudentService.examStudentList(examId, activityId, identity, name, roomCode, courseCode, grade,
-				enable, classNo,hasPhoto);
-		if(list!=null&&list.size()>0) {
-			for(TEExamStudentDto dto:list) {
-				if(StringUtils.isNotBlank(dto.getBasePhotoUrl())) {
-					dto.setBasePhotoUrl(systemConfig.getProperty("aliyun.oss.url") + "/" +dto.getBasePhotoUrl());
-				}
-			}
-		}
-		ExportUtils.exportEXCEL("考生信息", TEExamStudentDto.class, list, response);
-	}
+                       @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long activityId,
+                       @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                       @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
+                       @ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode,
+                       @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
+                       @ApiParam(value = "年级", required = false) @RequestParam(required = false) String grade,
+                       @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable,
+                       @ApiParam(value = "教学班级", required = false) @RequestParam(required = false) String classNo,
+                       @ApiParam(value = "底照是否上传", required = false) @RequestParam(required = false) Integer hasPhoto,
+                       HttpServletResponse response) throws Exception {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        List<TEExamStudentDto> list = teExamStudentService.examStudentList(examId, activityId, identity, name, roomCode, courseCode, grade,
+                enable, classNo, hasPhoto);
+        if (list != null && list.size() > 0) {
+            for (TEExamStudentDto dto : list) {
+                if (StringUtils.isNotBlank(dto.getBasePhotoUrl())) {
+                    dto.setBasePhotoUrl(systemConfig.getProperty("aliyun.oss.url") + "/" + dto.getBasePhotoUrl());
+                }
+            }
+        }
+        ExportUtils.exportEXCEL("考生信息", TEExamStudentDto.class, list, response);
+    }
 
-	@ApiOperation(value = "考生查询接口")
-	@RequestMapping(value = "/query", method = RequestMethod.POST)
-	@ApiResponses({ @ApiResponse(code = 200, message = "考生信息", response = TEExamStudentDto.class) })
-	public Result query(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId,
-			@ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long activityId,
-			@ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
-			@ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
-			@ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode,
-			@ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
-			@ApiParam(value = "年级", required = false) @RequestParam(required = false) String grade,
-			@ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable,
-			@ApiParam(value = "教学班级", required = false) @RequestParam(required = false) String classNo,
-			@ApiParam(value = "底照是否上传", required = false) @RequestParam(required = false) Integer hasPhoto,
-			@ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
-			@ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-		if (Objects.isNull(examId) || Objects.equals(examId, "")) {
-			throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
-		}
-		IPage<TEExamStudentDto> teExamStudentIPage = teExamStudentService.examStudentQuery(
-				new Page<>(pageNumber, pageSize), examId, activityId, identity, name, roomCode, courseCode, grade,
-				enable, classNo,hasPhoto);
-		if(teExamStudentIPage.getRecords()!=null&&teExamStudentIPage.getRecords().size()>0) {
-			for(TEExamStudentDto dto:teExamStudentIPage.getRecords()) {
-				if(StringUtils.isNotBlank(dto.getBasePhotoUrl())) {
-					dto.setBasePhotoUrl(systemConfig.getProperty("aliyun.oss.url") + "/" +dto.getBasePhotoUrl());
-				}
-			}
-		}
-		BasePage basePage = new BasePage(teExamStudentIPage.getRecords(), teExamStudentIPage.getCurrent(),
-				teExamStudentIPage.getSize(), teExamStudentIPage.getTotal());
-		return ResultUtil.ok(basePage);
-	}
+    @ApiOperation(value = "考生查询接口")
+    @RequestMapping(value = "/query", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TEExamStudentDto.class)})
+    public Result query(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId,
+                        @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long activityId,
+                        @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                        @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
+                        @ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode,
+                        @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
+                        @ApiParam(value = "年级", required = false) @RequestParam(required = false) String grade,
+                        @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable,
+                        @ApiParam(value = "教学班级", required = false) @RequestParam(required = false) String classNo,
+                        @ApiParam(value = "底照是否上传", required = false) @RequestParam(required = false) Integer hasPhoto,
+                        @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                        @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        IPage<TEExamStudentDto> teExamStudentIPage = teExamStudentService.examStudentQuery(
+                new Page<>(pageNumber, pageSize), examId, activityId, identity, name, roomCode, courseCode, grade,
+                enable, classNo, hasPhoto);
+        if (teExamStudentIPage.getRecords() != null && teExamStudentIPage.getRecords().size() > 0) {
+            for (TEExamStudentDto dto : teExamStudentIPage.getRecords()) {
+                if (StringUtils.isNotBlank(dto.getBasePhotoUrl())) {
+                    dto.setBasePhotoUrl(systemConfig.getProperty("aliyun.oss.url") + "/" + dto.getBasePhotoUrl());
+                }
+            }
+        }
+        return ResultUtil.ok(teExamStudentIPage);
+    }
 
-	@ApiOperation(value = "考生停用/启用接口")
-	@RequestMapping(value = "/toggle", method = RequestMethod.POST)
-	@ApiResponses({ @ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class) })
-	@Transactional
-	public Result examStudentToggle(@ApiJsonObject(name = "examStudentToggle", value = {
-			@ApiJsonProperty(key = "id", type = "long", example = "1", description = "考生ID"),
-			@ApiJsonProperty(key = "enable", type = "int", example = "1", description = "是否启用") }) @ApiParam(value = "考生信息", required = true) @RequestBody List<Map<String, Object>> mapParameter) {
-		if (Objects.isNull(mapParameter) || mapParameter.size() == 0) {
-			throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_INFO_IS_NULL);
-		}
-		TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-		List<TEExamStudent> teExamStudentList = new ArrayList<>();
-		for (int i = 0; i < mapParameter.size(); i++) {
-			Map map = mapParameter.get(i);
-			TEExamStudent teExamStudent = teExamStudentService.getById(Long.parseLong(String.valueOf(map.get("id"))));
-			if (Objects.isNull(teExamStudent)) {
-				throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_NO);
-			}
-			teExamStudent.setEnable(Integer.parseInt(String.valueOf(map.get("enable"))));
-			teExamStudent.setUpdateId(tbUser.getId());
-			teExamStudentList.add(teExamStudent);
-		}
-		teExamStudentService.updateBatchById(teExamStudentList);
-		teExamStudentList.forEach(s -> {
-			teExamStudentService.updateExamStudentCacheBean(s.getId());
-		});
-		return ResultUtil.ok(Collections.singletonMap("success", true));
-	}
+    @ApiOperation(value = "考生停用/启用接口")
+    @RequestMapping(value = "/toggle", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
+    @Transactional
+    public Result examStudentToggle(@ApiJsonObject(name = "examStudentToggle", value = {
+            @ApiJsonProperty(key = "id", type = "long", example = "1", description = "考生ID"),
+            @ApiJsonProperty(key = "enable", type = "int", example = "1", description = "是否启用")}) @ApiParam(value = "考生信息", required = true) @RequestBody List<Map<String, Object>> mapParameter) {
+        if (Objects.isNull(mapParameter) || mapParameter.size() == 0) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_INFO_IS_NULL);
+        }
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        List<TEExamStudent> teExamStudentList = new ArrayList<>();
+        for (int i = 0; i < mapParameter.size(); i++) {
+            Map map = mapParameter.get(i);
+            TEExamStudent teExamStudent = teExamStudentService.getById(Long.parseLong(String.valueOf(map.get("id"))));
+            if (Objects.isNull(teExamStudent)) {
+                throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_NO);
+            }
+            teExamStudent.setEnable(Integer.parseInt(String.valueOf(map.get("enable"))));
+            teExamStudent.setUpdateId(tbUser.getId());
+            teExamStudentList.add(teExamStudent);
+        }
+        teExamStudentService.updateBatchById(teExamStudentList);
+        teExamStudentList.forEach(s -> {
+            teExamStudentService.updateExamStudentCacheBean(s.getId());
+        });
+        return ResultUtil.ok(Collections.singletonMap("success", true));
+    }
 
-	@ApiOperation(value = "考生修改接口")
-	@RequestMapping(value = "/save", method = RequestMethod.POST)
-	@ApiResponses({ @ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class) })
-	@Transactional
-	public Result save(@ApiParam(value = "考生信息", required = true) @RequestBody List<TEExamStudent> teExamStudentList) {
-		if (Objects.isNull(teExamStudentList) || teExamStudentList.size() == 0) {
-			throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_INFO_IS_NULL);
-		}
-		TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-		TBOrg tbOrg = (TBOrg) ServletUtil.getRequestOrg();
-		teExamStudentList.forEach(s -> {
-			if (Objects.isNull(s.getId())) {
-				QueryWrapper<TEStudent> teExamStudentQueryWrapper = new QueryWrapper<>();
-				teExamStudentQueryWrapper.lambda().eq(TEStudent::getName, s.getName())
-						.eq(TEStudent::getIdentity, s.getIdentity()).eq(TEStudent::getOrgId, tbOrg.getId());
-				int count = teStudentService.count(teExamStudentQueryWrapper);
-				if (count == 0) {
-					TEStudent teStudent = new TEStudent(tbOrg.getId(), s.getIdentity(), s.getName(), tbUser.getId());
-					teStudentService.save(teStudent);
-					s.setStudentId(teStudent.getId());
-					s.setCreateId(tbUser.getId());
-				}
-			} else {
-				UpdateWrapper<TEExamStudent> teExamStudentUpdateWrapper = new UpdateWrapper<>();
-				teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getName, s.getName())
-						.eq(TEExamStudent::getIdentity, s.getIdentity());
-				teExamStudentService.update(teExamStudentUpdateWrapper);
+    @ApiOperation(value = "考生修改接口")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
+    @Transactional
+    public Result save(@ApiParam(value = "考生信息", required = true) @RequestBody List<TEExamStudent> teExamStudentList) {
+        if (Objects.isNull(teExamStudentList) || teExamStudentList.size() == 0) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_INFO_IS_NULL);
+        }
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        TBOrg tbOrg = (TBOrg) ServletUtil.getRequestOrg();
+        teExamStudentList.forEach(s -> {
+            if (Objects.isNull(s.getId())) {
+                QueryWrapper<TEStudent> teExamStudentQueryWrapper = new QueryWrapper<>();
+                teExamStudentQueryWrapper.lambda().eq(TEStudent::getName, s.getName())
+                        .eq(TEStudent::getIdentity, s.getIdentity()).eq(TEStudent::getOrgId, tbOrg.getId());
+                int count = teStudentService.count(teExamStudentQueryWrapper);
+                if (count == 0) {
+                    TEStudent teStudent = new TEStudent(tbOrg.getId(), s.getIdentity(), s.getName(), tbUser.getId());
+                    teStudentService.save(teStudent);
+                    s.setStudentId(teStudent.getId());
+                    s.setCreateId(tbUser.getId());
+                }
+            } else {
+                UpdateWrapper<TEExamStudent> teExamStudentUpdateWrapper = new UpdateWrapper<>();
+                teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getName, s.getName())
+                        .eq(TEExamStudent::getIdentity, s.getIdentity());
+                teExamStudentService.update(teExamStudentUpdateWrapper);
 
-				UpdateWrapper<TEStudent> teStudentUpdateWrapper = new UpdateWrapper<>();
-				teStudentUpdateWrapper.lambda().set(TEStudent::getName, s.getName()).eq(TEStudent::getIdentity,
-						s.getIdentity());
-				teStudentService.update(teStudentUpdateWrapper);
+                UpdateWrapper<TEStudent> teStudentUpdateWrapper = new UpdateWrapper<>();
+                teStudentUpdateWrapper.lambda().set(TEStudent::getName, s.getName()).eq(TEStudent::getIdentity,
+                        s.getIdentity());
+                teStudentService.update(teStudentUpdateWrapper);
 
-				s.setUpdateId(tbUser.getId());
-			}
-		});
-		teExamStudentService.saveOrUpdateBatch(teExamStudentList);
-		teExamStudentList.forEach(s -> {
-			teExamStudentService.updateExamStudentCacheBean(s.getId());
-		});
-		return ResultUtil.ok(Collections.singletonMap("success", true));
-	}
+                s.setUpdateId(tbUser.getId());
+            }
+        });
+        teExamStudentService.saveOrUpdateBatch(teExamStudentList);
+        teExamStudentList.forEach(s -> {
+            teExamStudentService.updateExamStudentCacheBean(s.getId());
+        });
+        return ResultUtil.ok(Collections.singletonMap("success", true));
+    }
 
-	@ApiOperation(value = "考生删除接口")
-	@RequestMapping(value = "/delete", method = RequestMethod.POST)
-	@ApiResponses({ @ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class) })
-	@Transactional
-	public Result delete(@ApiParam(value = "考生id", required = true) @RequestBody List<Long> ids) {
-		if (Objects.isNull(ids) || ids.size() == 0) {
-			throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_ID_IS_NULL);
-		}
-		teExamStudentService.removeByIds(ids);
-		ids.forEach(s -> {
-			teExamStudentService.deleteExamStudentCacheBean(s);
-		});
-		return ResultUtil.ok(Collections.singletonMap("success", true));
-	}
+    @ApiOperation(value = "考生删除接口")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
+    @Transactional
+    public Result delete(@ApiParam(value = "考生id", required = true) @RequestBody List<Long> ids) {
+        if (Objects.isNull(ids) || ids.size() == 0) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_ID_IS_NULL);
+        }
+        teExamStudentService.removeByIds(ids);
+        ids.forEach(s -> {
+            teExamStudentService.deleteExamStudentCacheBean(s);
+        });
+        return ResultUtil.ok(Collections.singletonMap("success", true));
+    }
 
-	@ApiOperation(value = "考生导入接口")
-	@RequestMapping(value = "/import", method = RequestMethod.POST)
-	@Transactional
-	@ApiResponses({ @ApiResponse(code = 200, message = "{\"taskId\":0}", response = Result.class) })
-	public Result importData(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
-			@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId) throws IOException {
-		if (Objects.isNull(file) || Objects.equals(file, "")) {
-			throw new BusinessException(ExceptionResultEnum.ATTACHMENT_IS_NULL);
-		}
-		if (Objects.isNull(examId) || Objects.equals(examId, "")) {
-			throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
-		}
-		Map<String, Object> mapParameter = systemConfig.getOssEnv(UploadFileEnum.file.getId());
-		TBAttachment tbAttachment = null;
-		TBTaskHistory tbTaskHistory = null;
-		Map transMap = new HashMap();
-		try {
-			TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-			tbAttachment = tbAttachmentService.saveAttachment(file, ServletUtil.getRequestMd5(),
-					ServletUtil.getRequestPath(), mapParameter, tbUser.getOrgId(), tbUser.getId());
-			if (Objects.isNull(tbAttachment)) {
-				throw new BusinessException(ExceptionResultEnum.ATTACHMENT_ERROR);
-			} else {
-				// 往任务表里插一条数据
-				tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_EXAM_STUDENT, examId, TaskStatusEnum.INIT,
-						SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(),
-						tbUser.getId());
-				taskHistoryService.save(tbTaskHistory);
-				transMap.put("tbTaskHistory", tbTaskHistory);
-			}
-			transMap.put("examId", examId);
-			transMap.put("createId", tbUser.getId());
+    @ApiOperation(value = "考生导入接口")
+    @RequestMapping(value = "/import", method = RequestMethod.POST)
+    @Transactional
+    @ApiResponses({@ApiResponse(code = 200, message = "{\"taskId\":0}", response = Result.class)})
+    public Result importData(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+                             @ApiParam(value = "考试批次id", required = true) @RequestParam Long examId) throws IOException {
+        if (Objects.isNull(file) || Objects.equals(file, "")) {
+            throw new BusinessException(ExceptionResultEnum.ATTACHMENT_IS_NULL);
+        }
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        Map<String, Object> mapParameter = systemConfig.getOssEnv(UploadFileEnum.file.getId());
+        TBAttachment tbAttachment = null;
+        TBTaskHistory tbTaskHistory = null;
+        Map transMap = new HashMap();
+        try {
+            TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+            tbAttachment = tbAttachmentService.saveAttachment(file, ServletUtil.getRequestMd5(),
+                    ServletUtil.getRequestPath(), mapParameter, tbUser.getOrgId(), tbUser.getId());
+            if (Objects.isNull(tbAttachment)) {
+                throw new BusinessException(ExceptionResultEnum.ATTACHMENT_ERROR);
+            } else {
+                // 往任务表里插一条数据
+                tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_EXAM_STUDENT, examId, TaskStatusEnum.INIT,
+                        SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(),
+                        tbUser.getId());
+                taskHistoryService.save(tbTaskHistory);
+                transMap.put("tbTaskHistory", tbTaskHistory);
+            }
+            transMap.put("examId", examId);
+            transMap.put("createId", tbUser.getId());
 
-			// 先查询考试相关信息
-			TEExam teExam = teExamService.getById(examId);
-			if (Objects.isNull(teExam)) {
-				throw new BusinessException(ExceptionResultEnum.EXAM_NO);
-			}
-			transMap.put("mode", teExam.getMode());
-			transMap.put("orgId", teExam.getOrgId());
-			transMap.put("examCount", teExam.getExamCount());
+            // 先查询考试相关信息
+            TEExam teExam = teExamService.getById(examId);
+            if (Objects.isNull(teExam)) {
+                throw new BusinessException(ExceptionResultEnum.EXAM_NO);
+            }
+            transMap.put("mode", teExam.getMode());
+            transMap.put("orgId", teExam.getOrgId());
+            transMap.put("examCount", teExam.getExamCount());
 
-			// 获取该批次下的所有考场,校验考场id是否存在
-			QueryWrapper<TEExamActivity> teExamActivityQueryWrapper = new QueryWrapper<>();
-			teExamActivityQueryWrapper.lambda().eq(TEExamActivity::getExamId, examId);
-			List<TEExamActivity> teExamActivityList = teExamActivityService.list(teExamActivityQueryWrapper);
-			if (Objects.isNull(teExamActivityList) || teExamActivityList.size() == 0) {
-				throw new BusinessException(ExceptionResultEnum.EXAM_ACTIVITY_NO);
-			}
-			Map<String, TEExamActivity> teExamActivityMap = teExamActivityList.stream()
-					.collect(Collectors.toMap(TEExamActivity::getCode, Function.identity(), (dto1, dto2) -> dto1));
-			transMap.put("teExamActivityMap", teExamActivityMap);
+            // 获取该批次下的所有考场,校验考场id是否存在
+            QueryWrapper<TEExamActivity> teExamActivityQueryWrapper = new QueryWrapper<>();
+            teExamActivityQueryWrapper.lambda().eq(TEExamActivity::getExamId, examId);
+            List<TEExamActivity> teExamActivityList = teExamActivityService.list(teExamActivityQueryWrapper);
+            if (Objects.isNull(teExamActivityList) || teExamActivityList.size() == 0) {
+                throw new BusinessException(ExceptionResultEnum.EXAM_ACTIVITY_NO);
+            }
+            Map<String, TEExamActivity> teExamActivityMap = teExamActivityList.stream()
+                    .collect(Collectors.toMap(TEExamActivity::getCode, Function.identity(), (dto1, dto2) -> dto1));
+            transMap.put("teExamActivityMap", teExamActivityMap);
 
-			// 获取考场代码和考场名称
-			QueryWrapper<TBExamInvigilateUser> tbExamInvigilateUserQueryWrapper = new QueryWrapper<>();
-			tbExamInvigilateUserQueryWrapper.lambda().eq(TBExamInvigilateUser::getOrgId, teExam.getOrgId());
-			List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService
-					.list(tbExamInvigilateUserQueryWrapper);
-			if (Objects.nonNull(tbExamInvigilateUserList) && tbExamInvigilateUserList.size() > 0) {
-				Map<String, String> tbExamInvigilateUserMap = new HashMap();
-				tbExamInvigilateUserList.forEach(s -> {
-					tbExamInvigilateUserMap.put(s.getExamId() + ":" + s.getRoomCode() + ":" + s.getRoomName(),
-							s.getRoomCode() + ":" + s.getRoomName());
-				});
-				transMap.put("tbExamInvigilateUserMap", tbExamInvigilateUserMap);
-			}
-			transMap.put("remark", tbAttachment.getRemark());
-			// mq发送消息start
-			MqDto mqDto = new MqDto(MqTopicEnum.THEMIS_TOPIC.getCode(), MqTagEnum.EXAM_STUDENT_IMPORT.name(), transMap,
-					MqTagEnum.EXAM_STUDENT_IMPORT, String.valueOf(tbTaskHistory.getId()), tbUser.getName());
-			mqDtoService.assembleSendOneWayMsg(mqDto);
-			// mq发送消息end
-		} catch (Exception e) {
-			log.error("请求出错", e);
-			if (Objects.nonNull(tbAttachment)) {
-				tbAttachmentService.deleteAttachment(mapParameter, tbAttachment);
-			}
-			if (e instanceof BusinessException) {
-				throw new BusinessException(e.getMessage());
-			} else {
-				throw new RuntimeException(e);
-			}
-		}
-		Map map = new HashMap();
-		map.put(SystemConstant.TASK_ID, tbTaskHistory.getId());
-		return ResultUtil.ok(map);
-	}
+            // 获取考场代码和考场名称
+            QueryWrapper<TBExamInvigilateUser> tbExamInvigilateUserQueryWrapper = new QueryWrapper<>();
+            tbExamInvigilateUserQueryWrapper.lambda().eq(TBExamInvigilateUser::getOrgId, teExam.getOrgId());
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService
+                    .list(tbExamInvigilateUserQueryWrapper);
+            if (Objects.nonNull(tbExamInvigilateUserList) && tbExamInvigilateUserList.size() > 0) {
+                Map<String, String> tbExamInvigilateUserMap = new HashMap();
+                tbExamInvigilateUserList.forEach(s -> {
+                    tbExamInvigilateUserMap.put(s.getExamId() + ":" + s.getRoomCode() + ":" + s.getRoomName(),
+                            s.getRoomCode() + ":" + s.getRoomName());
+                });
+                transMap.put("tbExamInvigilateUserMap", tbExamInvigilateUserMap);
+            }
+            transMap.put("remark", tbAttachment.getRemark());
+            // mq发送消息start
+            MqDto mqDto = new MqDto(MqTopicEnum.THEMIS_TOPIC.getCode(), MqTagEnum.EXAM_STUDENT_IMPORT.name(), transMap,
+                    MqTagEnum.EXAM_STUDENT_IMPORT, String.valueOf(tbTaskHistory.getId()), tbUser.getName());
+            mqDtoService.assembleSendOneWayMsg(mqDto);
+            // mq发送消息end
+        } catch (Exception e) {
+            log.error("请求出错", e);
+            if (Objects.nonNull(tbAttachment)) {
+                tbAttachmentService.deleteAttachment(mapParameter, tbAttachment);
+            }
+            if (e instanceof BusinessException) {
+                throw new BusinessException(e.getMessage());
+            } else {
+                throw new RuntimeException(e);
+            }
+        }
+        Map map = new HashMap();
+        map.put(SystemConstant.TASK_ID, tbTaskHistory.getId());
+        return ResultUtil.ok(map);
+    }
 }

+ 29 - 47
themis-backend/src/main/java/com/qmth/themis/backend/api/TEStudentController.java

@@ -1,31 +1,13 @@
 package com.qmth.themis.backend.api;
 
-import java.util.Collections;
-import java.util.Map;
-import java.util.Objects;
-
-import javax.annotation.Resource;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestBody;
-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 org.springframework.web.multipart.MultipartFile;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.gson.Gson;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
-import com.qmth.themis.business.dto.response.TEExamStudentDto;
 import com.qmth.themis.business.dto.response.TEStudentDto;
-import com.qmth.themis.business.dto.response.TEStudentExamRecordDto;
 import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TEStudent;
 import com.qmth.themis.business.entity.TOeExamRecord;
@@ -36,12 +18,16 @@ import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
-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;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * @Description: 学生档案 前端控制器
@@ -60,25 +46,23 @@ public class TEStudentController {
 
     @Resource
     RedisUtil redisUtil;
-    
-	@Resource
-	SystemConfig systemConfig;
+
+    @Resource
+    SystemConfig systemConfig;
 
     @ApiOperation(value = "学生查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TEStudentDto.class)})
     public Result query(@ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity, @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         IPage<TEStudentDto> teExamStudentIPage = teStudentService.studentQuery(new Page<>(pageNumber, pageSize), identity, name, enable);
-        if(teExamStudentIPage.getRecords()!=null&&teExamStudentIPage.getRecords().size()>0) {
-			for(TEStudentDto dto:teExamStudentIPage.getRecords()) {
-				if(StringUtils.isNotBlank(dto.getBasePhotoPath())) {
-					dto.setBasePhotoPath(systemConfig.getProperty("aliyun.oss.url") + "/" +dto.getBasePhotoPath());
-				}
-			}
-		}
-        
-        BasePage basePage = new BasePage(teExamStudentIPage.getRecords(), teExamStudentIPage.getCurrent(), teExamStudentIPage.getSize(), teExamStudentIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        if (teExamStudentIPage.getRecords() != null && teExamStudentIPage.getRecords().size() > 0) {
+            for (TEStudentDto dto : teExamStudentIPage.getRecords()) {
+                if (StringUtils.isNotBlank(dto.getBasePhotoPath())) {
+                    dto.setBasePhotoPath(systemConfig.getProperty("aliyun.oss.url") + "/" + dto.getBasePhotoPath());
+                }
+            }
+        }
+        return ResultUtil.ok(teExamStudentIPage);
     }
 
     @ApiOperation(value = "学生停用/启用接口")
@@ -148,27 +132,25 @@ public class TEStudentController {
         if (Objects.isNull(studentId) || Objects.equals(studentId, "")) {
             throw new BusinessException(ExceptionResultEnum.STUDENT_ID_IS_NULL);
         }
-        IPage<TEStudentExamRecordDto> teStudentExamRecordDtoIPage = teStudentService.studentExamRecordQuery(new Page<>(pageNumber, pageSize), studentId, examId);
-        BasePage basePage = new BasePage(teStudentExamRecordDtoIPage.getRecords(), teStudentExamRecordDtoIPage.getCurrent(), teStudentExamRecordDtoIPage.getSize(), teStudentExamRecordDtoIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(teStudentService.studentExamRecordQuery(new Page<>(pageNumber, pageSize), studentId, examId));
     }
-    
+
     @ApiOperation(value = "底照上传")
     @RequestMapping(value = "/base_photo/upload", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
     public Result photoUpload(@ApiParam(value = "证件号", required = true) @RequestParam String identity,
-                             @ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
-                             @ApiParam(value = "md5", required = true) @RequestParam String md5) {
-    	if (StringUtils.isBlank(identity)) {
+                              @ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+                              @ApiParam(value = "md5", required = true) @RequestParam String md5) {
+        if (StringUtils.isBlank(identity)) {
             throw new BusinessException("证件号不能为空");
         }
-    	if (file==null) {
+        if (file == null) {
             throw new BusinessException("文件不能为空");
         }
-    	if (StringUtils.isBlank(md5)) {
+        if (StringUtils.isBlank(md5)) {
             throw new BusinessException("md5不能为空");
         }
-    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        return ResultUtil.ok(teStudentService.photoUpload(tbUser.getOrgId(), identity, file,  md5));
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        return ResultUtil.ok(teStudentService.photoUpload(tbUser.getOrgId(), identity, file, md5));
     }
 }

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

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.bean.mobile.MobileAuthorizationMonitorBean;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.config.SystemConfig;
@@ -90,8 +89,7 @@ public class TIeInvigilateCallMobileController {
         tIeExamInvigilateCallIPage.getRecords().forEach(s -> {
             s.setBasePhotoPath(systemConfig.getProperty("aliyun.oss.url") + File.separator + s.getBasePhotoPath());
         });
-        BasePage basePage = new BasePage(tIeExamInvigilateCallIPage.getRecords(), tIeExamInvigilateCallIPage.getCurrent(), tIeExamInvigilateCallIPage.getSize(), tIeExamInvigilateCallIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tIeExamInvigilateCallIPage);
     }
 
     @ApiOperation(value = "监考监控通话提醒接口")

+ 5 - 17
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -1,11 +1,9 @@
 package com.qmth.themis.backend.api;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.bean.backend.*;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
@@ -117,9 +115,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        IPage<InvigilateListBean> invigilateListBeanIPage = tOeExamRecordService.invigilatePageList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
-        BasePage basePage = new BasePage(invigilateListBeanIPage.getRecords(), invigilateListBeanIPage.getCurrent(), invigilateListBeanIPage.getSize(), invigilateListBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId));
     }
 
     @ApiOperation(value = "实时监控台视频列表接口")
@@ -145,9 +141,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        IPage<InvigilateListVideoBean> invigilateListVideoBeanIPage = tOeExamRecordService.invigilatePageListVideo(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
-        BasePage basePage = new BasePage(invigilateListVideoBeanIPage.getRecords(), invigilateListVideoBeanIPage.getCurrent(), invigilateListVideoBeanIPage.getSize(), invigilateListVideoBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageListVideo(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId));
     }
 
     @ApiOperation(value = "实时监控台视频随机列表接口")
@@ -196,9 +190,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        IPage<InvigilateListHistoryBean> invigilateListHistoryBeanIPage = tOeExamRecordService.invigilatePageListHistory(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
-        BasePage basePage = new BasePage(invigilateListHistoryBeanIPage.getRecords(), invigilateListHistoryBeanIPage.getCurrent(), invigilateListHistoryBeanIPage.getSize(), invigilateListHistoryBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageListHistory(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId));
     }
 
     @ApiOperation(value = "实时监控台列表明细接口")
@@ -314,9 +306,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        IPage<InvigilateListPatrolBean> invigilateListPatrolBeanIPage = tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
-        BasePage basePage = new BasePage(invigilateListPatrolBeanIPage.getRecords(), invigilateListPatrolBeanIPage.getCurrent(), invigilateListPatrolBeanIPage.getSize(), invigilateListPatrolBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId));
     }
 
     @ApiOperation(value = "进度查询列表接口")
@@ -337,9 +327,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        IPage<InvigilateListProgressBean> invigilateListProgressBeanIPage = tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, userId);
-        BasePage basePage = new BasePage(invigilateListProgressBeanIPage.getRecords(), invigilateListProgressBeanIPage.getCurrent(), invigilateListProgressBeanIPage.getSize(), invigilateListProgressBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, userId));
     }
 
     @ApiOperation(value = "进度查询列表导出接口")

+ 1 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateWarnInfoController.java

@@ -1,11 +1,9 @@
 package com.qmth.themis.backend.api;
 
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
-import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.bean.backend.InvigilateListWarningBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
@@ -91,9 +89,7 @@ public class TIeInvigilateWarnInfoController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        IPage<InvigilateListWarningBean> invigilateListWarningBeanIPage = tOeExamRecordService.invigilatePageWarningList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
-        BasePage basePage = new BasePage(invigilateListWarningBeanIPage.getRecords(), invigilateListWarningBeanIPage.getCurrent(), invigilateListWarningBeanIPage.getSize(), invigilateListWarningBeanIPage.getTotal());
-        return ResultUtil.ok(basePage);
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageWarningList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId));
     }
 
     @ApiOperation(value = "预警消息接口")

+ 21 - 21
themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java

@@ -222,27 +222,27 @@ public class SystemConstant {
         return diff < -1 * Constants.SIGNATURE_AHEAD_SECONDS || diff > Constants.SIGNATURE_EXPIRE_SECONDS;
     }
 
-    /**
-     * 毫秒时间转换
-     *
-     * @param map
-     * @return
-     */
-    public static Map timeTransform(Map map) {
-        if (Objects.nonNull(map) && Objects.nonNull(map.get("createTime")) && map.get("createTime") instanceof Long) {
-            map.put("createTime", new Date((Long) map.get("createTime")));
-        }
-        if (Objects.nonNull(map) && Objects.nonNull(map.get("startTime")) && map.get("startTime") instanceof Long) {
-            map.put("startTime", new Date((Long) map.get("startTime")));
-        }
-        if (Objects.nonNull(map) && Objects.nonNull(map.get("finishTime")) && map.get("finishTime") instanceof Long) {
-            map.put("finishTime", new Date((Long) map.get("finishTime")));
-        }
-        if (Objects.nonNull(map) && Objects.nonNull(map.get("updateTime")) && map.get("updateTime") instanceof Long) {
-            map.put("updateTime", new Date((Long) map.get("updateTime")));
-        }
-        return map;
-    }
+//    /**
+//     * 毫秒时间转换
+//     *
+//     * @param map
+//     * @return
+//     */
+//    public static Map timeTransform(Map map) {
+//        if (Objects.nonNull(map) && Objects.nonNull(map.get("createTime")) && map.get("createTime") instanceof Long) {
+//            map.put("createTime", new Date((Long) map.get("createTime")));
+//        }
+//        if (Objects.nonNull(map) && Objects.nonNull(map.get("startTime")) && map.get("startTime") instanceof Long) {
+//            map.put("startTime", new Date((Long) map.get("startTime")));
+//        }
+//        if (Objects.nonNull(map) && Objects.nonNull(map.get("finishTime")) && map.get("finishTime") instanceof Long) {
+//            map.put("finishTime", new Date((Long) map.get("finishTime")));
+//        }
+//        if (Objects.nonNull(map) && Objects.nonNull(map.get("updateTime")) && map.get("updateTime") instanceof Long) {
+//            map.put("updateTime", new Date((Long) map.get("updateTime")));
+//        }
+//        return map;
+//    }
 
     /**
      * 初始化附件文件路径

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

@@ -1,48 +1,41 @@
 package com.qmth.themis.business.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.qmth.themis.business.bean.backend.*;
+
 import java.util.List;
 import java.util.Map;
 
-import com.qmth.themis.business.base.BasePage;
-import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
-import com.qmth.themis.business.bean.backend.ExamExceptionDetailListBean;
-import com.qmth.themis.business.bean.backend.ExamStudentLogDetailListBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorCountBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorHourWarnCountBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorWarnDistributionBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorWarnMsgBean;
-import com.qmth.themis.business.bean.backend.InvigilateListPatrolReportBean;
-
 public interface TIeReportService {
     public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
                                         String name, String identity);
 
-    public BasePage examViewCount(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-                                  String identity, int pageNumber, int pageSize);
+    public IPage examViewCount(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+                               String identity, int pageNumber, int pageSize);
 
-    public BasePage examDeficiencyList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-                                       String identity, int pageNumber, int pageSize);
+    public IPage examDeficiencyList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+                                    String identity, int pageNumber, int pageSize);
 
-    public BasePage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-                                      String identity, int pageNumber, int pageSize);
+    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 BasePage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-                                   String identity, int pageNumber, int pageSize);
+    public IPage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+                                String identity, int pageNumber, int pageSize);
 
-    public BasePage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-                                   String identity, int pageNumber, int pageSize);
+    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);
 
-    public BasePage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
-                                         String name, String identity, 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);
 
-    public BasePage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-                                       String identity, 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);
 
@@ -55,14 +48,16 @@ public interface TIeReportService {
      */
     public List<InvigilateListPatrolReportBean> patrolReport(Long examId, Long userId);
 
-	/**考情监控-人数
-	 * @return
-	 */
-	public ExaminationMonitorCountBean examinationMonitorCount();
+    /**
+     * 考情监控-人数
+     *
+     * @return
+     */
+    public ExaminationMonitorCountBean examinationMonitorCount();
 
-	public ExaminationMonitorWarnDistributionBean warnDistribution();
+    public ExaminationMonitorWarnDistributionBean warnDistribution();
 
-	public List<ExaminationMonitorHourWarnCountBean> warnTrend();
+    public List<ExaminationMonitorHourWarnCountBean> warnTrend();
 
-	public List<ExaminationMonitorWarnMsgBean> warnMsg();
+    public List<ExaminationMonitorWarnMsgBean> warnMsg();
 }

+ 462 - 506
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -1,51 +1,14 @@
 package com.qmth.themis.business.service.impl;
 
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import javax.annotation.Resource;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.time.DateUtils;
-import org.springframework.stereotype.Service;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.google.common.collect.Lists;
-import com.qmth.themis.business.base.BasePage;
-import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
-import com.qmth.themis.business.bean.backend.ExamBreachListBean;
-import com.qmth.themis.business.bean.backend.ExamDeficiencyListBean;
-import com.qmth.themis.business.bean.backend.ExamExceptionDetailListBean;
-import com.qmth.themis.business.bean.backend.ExamExceptionListBean;
-import com.qmth.themis.business.bean.backend.ExamReexamListBean;
-import com.qmth.themis.business.bean.backend.ExamStudentLogDetailListBean;
-import com.qmth.themis.business.bean.backend.ExamStudentLogListBean;
-import com.qmth.themis.business.bean.backend.ExamViewCountListBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorCountBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorHourWarnCountBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorWarnDistributionBean;
-import com.qmth.themis.business.bean.backend.ExaminationMonitorWarnMsgBean;
-import com.qmth.themis.business.bean.backend.InvigilateListPatrolReportBean;
-import com.qmth.themis.business.bean.backend.WarningNotifyBean;
+import com.qmth.themis.business.bean.backend.*;
 import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.dao.TBExamInvigilateUserMapper;
-import com.qmth.themis.business.dao.TEExamBreachLogMapper;
-import com.qmth.themis.business.dao.TEExamReexamMapper;
-import com.qmth.themis.business.dao.TEExamStudentLogMapper;
-import com.qmth.themis.business.dao.TEExamStudentMapper;
-import com.qmth.themis.business.dao.TIeInvigilateExceptionInfoMapper;
-import com.qmth.themis.business.dao.TIeInvigilateWarnInfoMapper;
-import com.qmth.themis.business.dao.TOeExamRecordMapper;
+import com.qmth.themis.business.dao.*;
 import com.qmth.themis.business.entity.TEExamActivity;
 import com.qmth.themis.business.enums.BreachTypeEnum;
 import com.qmth.themis.business.enums.ExceptionEnum;
@@ -54,475 +17,468 @@ import com.qmth.themis.business.service.TEExamActivityService;
 import com.qmth.themis.business.service.TEExamService;
 import com.qmth.themis.business.service.TIeReportService;
 import com.qmth.themis.business.util.RedisUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class TIeReportServiceImpl implements TIeReportService {
 
-	@Resource
-	TEExamStudentMapper examStudentMapper;
-
-	@Resource
-	TOeExamRecordMapper examRecordMapper;
-
-	@Resource
-	TEExamActivityService examActivityService;
-
-	@Resource
-	TEExamService examService;
-
-	@Resource
-	TIeInvigilateExceptionInfoMapper invigilateExceptionInfoMapper;
-	
-	@Resource
-	TBExamInvigilateUserMapper examInvigilateUserMapper;
-	
-	@Resource
-	TIeInvigilateWarnInfoMapper invigilateWarnInfoMapper;
-
-	@Resource
-	TEExamReexamMapper examReexamMapper;
-
-	@Resource
-	TEExamBreachLogMapper examBreachLogMapper;
-
-	@Resource
-	TEExamStudentLogMapper examStudentLogMapper;
-
-	@Resource
-	TOeExamRecordMapper tOeExamRecordMapper;
-
-	@Resource
-	private RedisUtil redisUtil;
-
-	@Override
-	public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
-			String name, String identity) {
-		// 应考人数
-		Long totalNum = 0L;
-		List<Map<String, Object>> total = examStudentMapper.getTotalCount(examId, examActivityId, roomCode, courseCode);
-		Map<Long, Long> totalMap = new HashMap<Long, Long>();
-		for (Map<String, Object> map : total) {
-			Long acId = (Long) map.get("activityId");
-			Long count = (Long) map.get("cc");
-			totalMap.put(acId, count);
-			totalNum = totalNum + count;
-		}
-		// 实考人数
-		Long doneNum = 0L;
-		List<Map<String, Object>> doneCount = examRecordMapper.getDoneCount(examId, examActivityId, roomCode,
-				courseCode);
-		Map<Long, Long> doneMap = new HashMap<Long, Long>();
-		for (Map<String, Object> map : doneCount) {
-			Long acId = (Long) map.get("activityId");
-			if (acId != null) {
-				Long count = (Long) map.get("cc");
-				doneMap.put(acId, count);
-				doneNum = doneNum + count;
-			}
-
-		}
-		// 缺考人数
-		Map<Long, Long> absentMap = new HashMap<Long, Long>();
-		Date now = new Date();
-		for (Long acId : totalMap.keySet()) {
-			ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(acId);
-			Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000);
-			if (now.getTime() > end) {// 场次开考时间结束,未开考的都是缺考
-				Long done = doneMap.get(acId);
-				if (done == null) {
-					done = 0L;
-				}
-				absentMap.put(acId, totalMap.get(acId) - done);
-			}
-		}
-		Long absentNum = 0L;
-		if (absentMap.size() > 0) {
-			for (Long c : absentMap.values()) {
-				absentNum = absentNum + c;
-			}
-		}
-		// 每日已考人数
-		List<Map<String, Object>> doneCountByDay = examRecordMapper.getDoneCountByDay(examId, examActivityId, roomCode,
-				courseCode);
-
-		Map<String, Object> ret = new HashMap<String, Object>();
-		ret.put("examTotal", totalNum);
-		ret.put("actualExamTotal", doneNum);
-		ret.put("deficiencyExamTotal", absentNum);
-		ret.put("completeOffExamTotal", totalNum - doneNum - absentNum);
-		ret.put("examTotalList", doneCountByDay);
-
-		return ret;
-	}
-
-	@Override
-	public BasePage examViewCount(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-			String identity, int pageNumber, int pageSize) {
-		// 应考人数
-		IPage<ExamViewCountListBean> total = examStudentMapper.getTotalCountInfo(new Page<>(pageNumber, pageSize),
-				examId, examActivityId, roomCode, courseCode);
-		List<ExamViewCountListBean> data = total.getRecords();
-		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		if (data == null || data.size() == 0) {
-			return basePage;
-		}
-		List<Long> activityIds = data.stream().map(e -> e.getExamActivityId()).collect(Collectors.toList());
-
-		// 实考
-		List<Map<String, Object>> doneCountByDay = examStudentMapper.getDoneCountByActivityIds(examId, activityIds);
-		Map<String, Long> doneMap = new HashMap<String, Long>();
-		for (Map<String, Object> map : doneCountByDay) {
-			Long acId = (Long) map.get("activityId");
-			String roomcode = (String) map.get("roomCode");
-			Long count = (Long) map.get("cc");
-			doneMap.put(acId + "-" + roomcode, count);
-		}
-
-		// 缺考
-		List<Long> absentActivityIds = new ArrayList<>();
-		Date now = new Date();
-		for (Long acid : activityIds) {
-			ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(acid);
-			Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000);
-			if (now.getTime() > end) {// 场次开考时间结束,未开考的都是缺考
-				absentActivityIds.add(acid);
-			}
-		}
-
-		Map<String, Long> absentMap = new HashMap<String, Long>();
-		if (absentActivityIds.size() > 0) {
-			List<Map<String, Object>> absentCountByDay = examStudentMapper.getAbsentCountByActivityIds(examId,
-					absentActivityIds);
-			for (Map<String, Object> map : absentCountByDay) {
-				Long acId = (Long) map.get("activityId");
-				String roomcode = (String) map.get("roomCode");
-				Long count = (Long) map.get("cc");
-				absentMap.put(acId + "-" + roomcode, count);
-			}
-		}
-		ExamCacheBean exam = examService.getExamCacheBean(examId);
-		for (ExamViewCountListBean b : data) {
-			Long done = doneMap.get(b.getExamActivityId() + "-" + b.getRoomCode());
-			if (done == null) {
-				done = 0L;
-			}
-			Long absent = absentMap.get(b.getExamActivityId() + "-" + b.getRoomCode());
-			if (absent == null) {
-				absent = 0L;
-			}
-			b.setActualExamTotal(done);
-			b.setDeficiencyExamTotal(absent);
-			b.setExamName(exam.getName());
-		}
-		basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		return basePage;
-	}
-
-	@Override
-	public BasePage examDeficiencyList(Long examId, Long examActivityId, String roomCode, String courseCode,
-			String name, String identity, int pageNumber, int pageSize) {
-		Page<ExamDeficiencyListBean> ipage = new Page<>(pageNumber, pageSize);
-		ipage.addOrder(OrderItem.asc("t.exam_activity_id"));
-		ipage.addOrder(OrderItem.asc("t.room_code"));
-		QueryWrapper<TEExamActivity> wp = new QueryWrapper<>();
-		wp.lambda().eq(TEExamActivity::getExamId, examId);
-		List<TEExamActivity> acs = examActivityService.list(wp);
-		List<Long> absentActivityIds = new ArrayList<>();
-		Date now = new Date();
-		for (TEExamActivity ac : acs) {
-			Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000L);
-			if (now.getTime() > end) {// 场次开考时间结束,未开考的都是缺考
-				absentActivityIds.add(ac.getId());
-			}
-		}
-		if (absentActivityIds.size() == 0) {
-			BasePage basePage = new BasePage(Lists.newArrayList(), 1, pageSize, 0);
-			return basePage;
-		}
-		IPage<ExamDeficiencyListBean> total = examStudentMapper.getExamDeficiencyPage(ipage, examId, examActivityId,
-				roomCode, courseCode, name, identity, absentActivityIds);
-		List<ExamDeficiencyListBean> data = total.getRecords();
-		if (data == null || data.size() == 0) {
-			BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-			return basePage;
-		}
-		ExamCacheBean exam = examService.getExamCacheBean(examId);
-		for (ExamDeficiencyListBean b : data) {
-			b.setExamName(exam.getName());
-		}
-		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		return basePage;
-	}
-
-	@Override
-	public BasePage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-			String identity, int pageNumber, int pageSize) {
-		Page<ExamExceptionListBean> ipage = new Page<>(pageNumber, pageSize);
-		ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-		IPage<ExamExceptionListBean> total = invigilateExceptionInfoMapper.getExamExceptionPage(ipage, examId,
-				examActivityId, roomCode, courseCode, name, identity);
-		List<ExamExceptionListBean> data = total.getRecords();
-		if (data == null || data.size() == 0) {
-			BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-			return basePage;
-		}
-		ExamCacheBean exam = examService.getExamCacheBean(examId);
-		for (ExamExceptionListBean b : data) {
-			b.setExamName(exam.getName());
-		}
-		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		return basePage;
-	}
-
-	@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());
-			}
-		}
-		return ret;
-	}
-
-	@Override
-	public BasePage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-			String identity, int pageNumber, int pageSize) {
-		Page<ExamReexamListBean> ipage = new Page<>(pageNumber, pageSize);
-		ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-		IPage<ExamReexamListBean> total = examReexamMapper.getExamReexamPage(ipage, examId, examActivityId, roomCode,
-				courseCode, name, identity);
-		List<ExamReexamListBean> data = total.getRecords();
-		if (data == null || data.size() == 0) {
-			BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-			return basePage;
-		}
-		ExamCacheBean exam = examService.getExamCacheBean(examId);
-		for (ExamReexamListBean b : data) {
-			b.setExamName(exam.getName());
-		}
-		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		return basePage;
-	}
-
-	@Override
-	public BasePage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-			String identity, int pageNumber, int pageSize) {
-		Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
-		ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-		IPage<ExamBreachListBean> total = examBreachLogMapper.getExamBreachPage(ipage, examId, examActivityId, roomCode,
-				courseCode, name, identity);
-		List<ExamBreachListBean> data = total.getRecords();
-		if (data == null || data.size() == 0) {
-			BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-			return basePage;
-		}
-		ExamCacheBean exam = examService.getExamCacheBean(examId);
-		for (ExamBreachListBean b : data) {
-			b.setExamName(exam.getName());
-		}
-		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		return basePage;
-	}
-
-	@Override
-	public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId) {
-		List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
-		if (ret != null && ret.size() > 0) {
-			for (ExamBreachDetailListBean b : ret) {
-				if (StringUtils.isNotBlank(b.getType())) {
-					b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
-				}
-			}
-		}
-		return ret;
-	}
-
-	@Override
-	public BasePage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
-			String name, String identity, int pageNumber, int pageSize) {
-		Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
-		ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-		IPage<ExamBreachListBean> total = examBreachLogMapper.getExamRevokeBreachPage(ipage, examId, examActivityId,
-				roomCode, courseCode, name, identity);
-		List<ExamBreachListBean> data = total.getRecords();
-		if (data == null || data.size() == 0) {
-			BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-			return basePage;
-		}
-		ExamCacheBean exam = examService.getExamCacheBean(examId);
-		for (ExamBreachListBean b : data) {
-			b.setExamName(exam.getName());
-		}
-		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		return basePage;
-	}
-
-	@Override
-	public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId) {
-		List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
-		if (ret != null && ret.size() > 0) {
-			for (ExamBreachDetailListBean b : ret) {
-				if (StringUtils.isNotBlank(b.getType())) {
-					b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
-				}
-			}
-		}
-		return ret;
-	}
-
-	@Override
-	public BasePage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
-			String name, String identity, int pageNumber, int pageSize) {
-		Page<ExamStudentLogListBean> ipage = new Page<>(pageNumber, pageSize);
-		ipage.addOrder(OrderItem.asc("t.id"));
-		IPage<ExamStudentLogListBean> total = examStudentMapper.getPageForStudentLog(ipage, examId, examActivityId,
-				roomCode, courseCode, name, identity);
-		List<ExamStudentLogListBean> data = total.getRecords();
-		if (data == null || data.size() == 0) {
-			BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-			return basePage;
-		}
-		ExamCacheBean exam = examService.getExamCacheBean(examId);
-		for (ExamStudentLogListBean b : data) {
-			b.setExamName(exam.getName());
-		}
-		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
-		return basePage;
-	}
-
-	@Override
-	public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId) {
-		return examStudentLogMapper.getExamStudentLogList(examStudentId);
-	}
-
-	/**
-	 * 在线巡考报表接口
-	 *
-	 * @param examId
-	 * @param userId
-	 * @return
-	 */
-	@Override
-	public List<InvigilateListPatrolReportBean> patrolReport(Long examId, Long userId) {
-		return tOeExamRecordMapper.patrolReport(examId, userId);
-	}
-
-	/**
-	 * 考情监控-人数
-	 */
-	@Override
-	public ExaminationMonitorCountBean examinationMonitorCount() {
-		ExaminationMonitorCountBean ret = new ExaminationMonitorCountBean();
-		Integer onlineCount = (Integer) redisUtil.get(SystemConstant.WEBSOCKET_OE_ONLINE_COUNT);
-		if (onlineCount == null) {
-			onlineCount = 0;
-		}
-		// 在线人数
-		ret.setOnlineCount(Long.valueOf(onlineCount.toString()));
-		// 考试人数
-		Long examingCount = tOeExamRecordMapper.getExamingCount();
-		if (examingCount == null) {
-			examingCount = 0L;
-		}
-		ret.setExamingCount(examingCount);
-
-		// 待考人数
-		ret.setWaitingCount(onlineCount - examingCount);
-
-		// 通讯故障人数
-		ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount());
-		// 预警人数
-		ret.setWarnCount(tOeExamRecordMapper.getWarnCount());
-		// 机构在考人数
-		ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount());
-		return ret;
-	}
-
-	/**
-	 * 考情监控-预警分布
-	 */
-	@Override
-	public ExaminationMonitorWarnDistributionBean warnDistribution() {
-		ExaminationMonitorWarnDistributionBean ret = new ExaminationMonitorWarnDistributionBean();
-		ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution());
-		List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution();
-		if (typeList != null && typeList.size() > 0) {
-			for (Map<String, Object> map : typeList) {
-				map.put("type", VerifyExceptionEnum.valueOf((String) map.get("type")).getCode());
-			}
-		}
-		ret.setTypeDistribution(typeList);
-		return ret;
-	}
-
-	/**
-	 * 考情监控-预警时间趋势
-	 */
-	@Override
-	public List<ExaminationMonitorHourWarnCountBean> warnTrend() {
-		List<ExaminationMonitorHourWarnCountBean> ret = new ArrayList<ExaminationMonitorHourWarnCountBean>();
-		SimpleDateFormat sd = new SimpleDateFormat("HH");
-		Date start = null;
-		Date now = new Date();
-		for (int i = 11; i >= 0; i--) {
-			ExaminationMonitorHourWarnCountBean b = new ExaminationMonitorHourWarnCountBean();
-			Date before = DateUtils.addHours(now, -i);
-			b.setHour(sd.format(before));
-			b.setCount(0L);
-			ret.add(b);
-			if (i == 11) {
-				start = before;
-			}
-		}
-		start = DateUtils.setMinutes(start, 0);
-		start = DateUtils.setSeconds(start, 0);
-		start = DateUtils.setMilliseconds(start, 0);
-		List<ExaminationMonitorHourWarnCountBean> list = tOeExamRecordMapper.getWarnTrend(start);
-		if (list != null && list.size() > 0) {
-			Map<String, Long> map = list.stream().collect(Collectors.toMap(ExaminationMonitorHourWarnCountBean::getHour,
-					ExaminationMonitorHourWarnCountBean::getCount, (key1, key2) -> key2));
-			for(ExaminationMonitorHourWarnCountBean b:ret) {
-				Long c=map.get(b.getHour());
-				if(c!=null) {
-					b.setCount(c);
-				}
-				b.setHour(b.getHour()+":00");
-			}
-		}
-		return ret;
-	}
-
-	@Override
-	public List<ExaminationMonitorWarnMsgBean> warnMsg() {
-		List<ExaminationMonitorWarnMsgBean> ret=new ArrayList<ExaminationMonitorWarnMsgBean>();
-		List<WarningNotifyBean> list=invigilateWarnInfoMapper.findLastMsg(6);
-		if(list!=null&&list.size()>0) {
-			for(WarningNotifyBean b:list) {
-				ExaminationMonitorWarnMsgBean bean=new ExaminationMonitorWarnMsgBean();
-				bean.setTime(b.getCreateTime());
-				StringBuilder sb=new StringBuilder();
-				sb.append(b.getName()).append(" (证件号:").append(b.getIdentity()).append(") ").append(b.getInfo());
-				List<Map<String,String>> users=examInvigilateUserMapper.getInvigilateUsers(b.getExamId(),b.getRoomCode());
-				if(users!=null&&users.size()>0) {
-					StringBuilder usersb=new StringBuilder();
-					for(Map<String,String> map:users) {
-						if(map!=null) {
-							String lname=map.get("loginName");
-							String name=map.get("name");
-							if(StringUtils.isNotBlank(lname)&&StringUtils.isNotBlank(name)) {
-								usersb.append(lname).append("(账号:").append(name).append(") ");
-							}
-						}
-					}
-					if(usersb.length()>0) {
-						sb.append(",系统已提示").append(usersb).append("进行人工干预");
-					}
-				}
-				bean.setContent(sb.toString());
-				ret.add(bean);
-			}
-		}
-		return ret;
-	}
+    @Resource
+    TEExamStudentMapper examStudentMapper;
+
+    @Resource
+    TOeExamRecordMapper examRecordMapper;
+
+    @Resource
+    TEExamActivityService examActivityService;
+
+    @Resource
+    TEExamService examService;
+
+    @Resource
+    TIeInvigilateExceptionInfoMapper invigilateExceptionInfoMapper;
+
+    @Resource
+    TBExamInvigilateUserMapper examInvigilateUserMapper;
+
+    @Resource
+    TIeInvigilateWarnInfoMapper invigilateWarnInfoMapper;
+
+    @Resource
+    TEExamReexamMapper examReexamMapper;
+
+    @Resource
+    TEExamBreachLogMapper examBreachLogMapper;
+
+    @Resource
+    TEExamStudentLogMapper examStudentLogMapper;
+
+    @Resource
+    TOeExamRecordMapper tOeExamRecordMapper;
+
+    @Resource
+    private RedisUtil redisUtil;
+
+    @Override
+    public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
+                                        String name, String identity) {
+        // 应考人数
+        Long totalNum = 0L;
+        List<Map<String, Object>> total = examStudentMapper.getTotalCount(examId, examActivityId, roomCode, courseCode);
+        Map<Long, Long> totalMap = new HashMap<Long, Long>();
+        for (Map<String, Object> map : total) {
+            Long acId = (Long) map.get("activityId");
+            Long count = (Long) map.get("cc");
+            totalMap.put(acId, count);
+            totalNum = totalNum + count;
+        }
+        // 实考人数
+        Long doneNum = 0L;
+        List<Map<String, Object>> doneCount = examRecordMapper.getDoneCount(examId, examActivityId, roomCode,
+                courseCode);
+        Map<Long, Long> doneMap = new HashMap<Long, Long>();
+        for (Map<String, Object> map : doneCount) {
+            Long acId = (Long) map.get("activityId");
+            if (acId != null) {
+                Long count = (Long) map.get("cc");
+                doneMap.put(acId, count);
+                doneNum = doneNum + count;
+            }
+
+        }
+        // 缺考人数
+        Map<Long, Long> absentMap = new HashMap<Long, Long>();
+        Date now = new Date();
+        for (Long acId : totalMap.keySet()) {
+            ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(acId);
+            Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000);
+            if (now.getTime() > end) {// 场次开考时间结束,未开考的都是缺考
+                Long done = doneMap.get(acId);
+                if (done == null) {
+                    done = 0L;
+                }
+                absentMap.put(acId, totalMap.get(acId) - done);
+            }
+        }
+        Long absentNum = 0L;
+        if (absentMap.size() > 0) {
+            for (Long c : absentMap.values()) {
+                absentNum = absentNum + c;
+            }
+        }
+        // 每日已考人数
+        List<Map<String, Object>> doneCountByDay = examRecordMapper.getDoneCountByDay(examId, examActivityId, roomCode,
+                courseCode);
+
+        Map<String, Object> ret = new HashMap<String, Object>();
+        ret.put("examTotal", totalNum);
+        ret.put("actualExamTotal", doneNum);
+        ret.put("deficiencyExamTotal", absentNum);
+        ret.put("completeOffExamTotal", totalNum - doneNum - absentNum);
+        ret.put("examTotalList", doneCountByDay);
+
+        return ret;
+    }
+
+    @Override
+    public IPage examViewCount(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+                               String identity, int pageNumber, int pageSize) {
+        // 应考人数
+        IPage<ExamViewCountListBean> total = examStudentMapper.getTotalCountInfo(new Page<>(pageNumber, pageSize),
+                examId, examActivityId, roomCode, courseCode);
+        List<ExamViewCountListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        List<Long> activityIds = data.stream().map(e -> e.getExamActivityId()).collect(Collectors.toList());
+
+        // 实考
+        List<Map<String, Object>> doneCountByDay = examStudentMapper.getDoneCountByActivityIds(examId, activityIds);
+        Map<String, Long> doneMap = new HashMap<String, Long>();
+        for (Map<String, Object> map : doneCountByDay) {
+            Long acId = (Long) map.get("activityId");
+            String roomcode = (String) map.get("roomCode");
+            Long count = (Long) map.get("cc");
+            doneMap.put(acId + "-" + roomcode, count);
+        }
+
+        // 缺考
+        List<Long> absentActivityIds = new ArrayList<>();
+        Date now = new Date();
+        for (Long acid : activityIds) {
+            ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(acid);
+            Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000);
+            if (now.getTime() > end) {// 场次开考时间结束,未开考的都是缺考
+                absentActivityIds.add(acid);
+            }
+        }
+
+        Map<String, Long> absentMap = new HashMap<String, Long>();
+        if (absentActivityIds.size() > 0) {
+            List<Map<String, Object>> absentCountByDay = examStudentMapper.getAbsentCountByActivityIds(examId,
+                    absentActivityIds);
+            for (Map<String, Object> map : absentCountByDay) {
+                Long acId = (Long) map.get("activityId");
+                String roomcode = (String) map.get("roomCode");
+                Long count = (Long) map.get("cc");
+                absentMap.put(acId + "-" + roomcode, count);
+            }
+        }
+        ExamCacheBean exam = examService.getExamCacheBean(examId);
+        for (ExamViewCountListBean b : data) {
+            Long done = doneMap.get(b.getExamActivityId() + "-" + b.getRoomCode());
+            if (done == null) {
+                done = 0L;
+            }
+            Long absent = absentMap.get(b.getExamActivityId() + "-" + b.getRoomCode());
+            if (absent == null) {
+                absent = 0L;
+            }
+            b.setActualExamTotal(done);
+            b.setDeficiencyExamTotal(absent);
+            b.setExamName(exam.getName());
+        }
+        return total;
+    }
+
+    @Override
+    public IPage examDeficiencyList(Long examId, Long examActivityId, String roomCode, String courseCode,
+                                    String name, String identity, int pageNumber, int pageSize) {
+        Page<ExamDeficiencyListBean> ipage = new Page<>(pageNumber, pageSize);
+        ipage.addOrder(OrderItem.asc("t.exam_activity_id"));
+        ipage.addOrder(OrderItem.asc("t.room_code"));
+        QueryWrapper<TEExamActivity> wp = new QueryWrapper<>();
+        wp.lambda().eq(TEExamActivity::getExamId, examId);
+        List<TEExamActivity> acs = examActivityService.list(wp);
+        List<Long> absentActivityIds = new ArrayList<>();
+        Date now = new Date();
+        for (TEExamActivity ac : acs) {
+            Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000L);
+            if (now.getTime() > end) {// 场次开考时间结束,未开考的都是缺考
+                absentActivityIds.add(ac.getId());
+            }
+        }
+        if (absentActivityIds.size() == 0) {
+            return new Page<>(pageNumber, pageSize);
+        }
+        IPage<ExamDeficiencyListBean> total = examStudentMapper.getExamDeficiencyPage(ipage, examId, examActivityId,
+                roomCode, courseCode, name, identity, absentActivityIds);
+        List<ExamDeficiencyListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        ExamCacheBean exam = examService.getExamCacheBean(examId);
+        for (ExamDeficiencyListBean b : data) {
+            b.setExamName(exam.getName());
+        }
+        return total;
+    }
+
+    @Override
+    public IPage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+                                   String identity, int pageNumber, int pageSize) {
+        Page<ExamExceptionListBean> ipage = new Page<>(pageNumber, pageSize);
+        ipage.addOrder(OrderItem.asc("f.exam_student_id"));
+        IPage<ExamExceptionListBean> total = invigilateExceptionInfoMapper.getExamExceptionPage(ipage, examId,
+                examActivityId, roomCode, courseCode, name, identity);
+        List<ExamExceptionListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        ExamCacheBean exam = examService.getExamCacheBean(examId);
+        for (ExamExceptionListBean b : data) {
+            b.setExamName(exam.getName());
+        }
+        return total;
+    }
+
+    @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());
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public IPage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+                                String identity, int pageNumber, int pageSize) {
+        Page<ExamReexamListBean> ipage = new Page<>(pageNumber, pageSize);
+        ipage.addOrder(OrderItem.asc("f.exam_student_id"));
+        IPage<ExamReexamListBean> total = examReexamMapper.getExamReexamPage(ipage, examId, examActivityId, roomCode,
+                courseCode, name, identity);
+        List<ExamReexamListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        ExamCacheBean exam = examService.getExamCacheBean(examId);
+        for (ExamReexamListBean b : data) {
+            b.setExamName(exam.getName());
+        }
+        return total;
+    }
+
+    @Override
+    public IPage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+                                String identity, int pageNumber, int pageSize) {
+        Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
+        ipage.addOrder(OrderItem.asc("f.exam_student_id"));
+        IPage<ExamBreachListBean> total = examBreachLogMapper.getExamBreachPage(ipage, examId, examActivityId, roomCode,
+                courseCode, name, identity);
+        List<ExamBreachListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        ExamCacheBean exam = examService.getExamCacheBean(examId);
+        for (ExamBreachListBean b : data) {
+            b.setExamName(exam.getName());
+        }
+        return total;
+    }
+
+    @Override
+    public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId) {
+        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
+        if (ret != null && ret.size() > 0) {
+            for (ExamBreachDetailListBean b : ret) {
+                if (StringUtils.isNotBlank(b.getType())) {
+                    b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
+                }
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public IPage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
+                                      String name, String identity, int pageNumber, int pageSize) {
+        Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
+        ipage.addOrder(OrderItem.asc("f.exam_student_id"));
+        IPage<ExamBreachListBean> total = examBreachLogMapper.getExamRevokeBreachPage(ipage, examId, examActivityId,
+                roomCode, courseCode, name, identity);
+        List<ExamBreachListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        ExamCacheBean exam = examService.getExamCacheBean(examId);
+        for (ExamBreachListBean b : data) {
+            b.setExamName(exam.getName());
+        }
+        return total;
+    }
+
+    @Override
+    public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId) {
+        List<ExamBreachDetailListBean> ret = examBreachLogMapper.getExamBreachDetailList(examStudentId);
+        if (ret != null && ret.size() > 0) {
+            for (ExamBreachDetailListBean b : ret) {
+                if (StringUtils.isNotBlank(b.getType())) {
+                    b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
+                }
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public IPage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
+                                    String name, String identity, int pageNumber, int pageSize) {
+        Page<ExamStudentLogListBean> ipage = new Page<>(pageNumber, pageSize);
+        ipage.addOrder(OrderItem.asc("t.id"));
+        IPage<ExamStudentLogListBean> total = examStudentMapper.getPageForStudentLog(ipage, examId, examActivityId,
+                roomCode, courseCode, name, identity);
+        List<ExamStudentLogListBean> data = total.getRecords();
+        if (data == null || data.size() == 0) {
+            return total;
+        }
+        ExamCacheBean exam = examService.getExamCacheBean(examId);
+        for (ExamStudentLogListBean b : data) {
+            b.setExamName(exam.getName());
+        }
+        return total;
+    }
+
+    @Override
+    public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId) {
+        return examStudentLogMapper.getExamStudentLogList(examStudentId);
+    }
+
+    /**
+     * 在线巡考报表接口
+     *
+     * @param examId
+     * @param userId
+     * @return
+     */
+    @Override
+    public List<InvigilateListPatrolReportBean> patrolReport(Long examId, Long userId) {
+        return tOeExamRecordMapper.patrolReport(examId, userId);
+    }
+
+    /**
+     * 考情监控-人数
+     */
+    @Override
+    public ExaminationMonitorCountBean examinationMonitorCount() {
+        ExaminationMonitorCountBean ret = new ExaminationMonitorCountBean();
+        Integer onlineCount = (Integer) redisUtil.get(SystemConstant.WEBSOCKET_OE_ONLINE_COUNT);
+        if (onlineCount == null) {
+            onlineCount = 0;
+        }
+        // 在线人数
+        ret.setOnlineCount(Long.valueOf(onlineCount.toString()));
+        // 考试人数
+        Long examingCount = tOeExamRecordMapper.getExamingCount();
+        if (examingCount == null) {
+            examingCount = 0L;
+        }
+        ret.setExamingCount(examingCount);
+
+        // 待考人数
+        ret.setWaitingCount(onlineCount - examingCount);
+
+        // 通讯故障人数
+        ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount());
+        // 预警人数
+        ret.setWarnCount(tOeExamRecordMapper.getWarnCount());
+        // 机构在考人数
+        ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount());
+        return ret;
+    }
+
+    /**
+     * 考情监控-预警分布
+     */
+    @Override
+    public ExaminationMonitorWarnDistributionBean warnDistribution() {
+        ExaminationMonitorWarnDistributionBean ret = new ExaminationMonitorWarnDistributionBean();
+        ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution());
+        List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution();
+        if (typeList != null && typeList.size() > 0) {
+            for (Map<String, Object> map : typeList) {
+                map.put("type", VerifyExceptionEnum.valueOf((String) map.get("type")).getCode());
+            }
+        }
+        ret.setTypeDistribution(typeList);
+        return ret;
+    }
+
+    /**
+     * 考情监控-预警时间趋势
+     */
+    @Override
+    public List<ExaminationMonitorHourWarnCountBean> warnTrend() {
+        List<ExaminationMonitorHourWarnCountBean> ret = new ArrayList<ExaminationMonitorHourWarnCountBean>();
+        SimpleDateFormat sd = new SimpleDateFormat("HH");
+        Date start = null;
+        Date now = new Date();
+        for (int i = 11; i >= 0; i--) {
+            ExaminationMonitorHourWarnCountBean b = new ExaminationMonitorHourWarnCountBean();
+            Date before = DateUtils.addHours(now, -i);
+            b.setHour(sd.format(before));
+            b.setCount(0L);
+            ret.add(b);
+            if (i == 11) {
+                start = before;
+            }
+        }
+        start = DateUtils.setMinutes(start, 0);
+        start = DateUtils.setSeconds(start, 0);
+        start = DateUtils.setMilliseconds(start, 0);
+        List<ExaminationMonitorHourWarnCountBean> list = tOeExamRecordMapper.getWarnTrend(start);
+        if (list != null && list.size() > 0) {
+            Map<String, Long> map = list.stream().collect(Collectors.toMap(ExaminationMonitorHourWarnCountBean::getHour,
+                    ExaminationMonitorHourWarnCountBean::getCount, (key1, key2) -> key2));
+            for (ExaminationMonitorHourWarnCountBean b : ret) {
+                Long c = map.get(b.getHour());
+                if (c != null) {
+                    b.setCount(c);
+                }
+                b.setHour(b.getHour() + ":00");
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public List<ExaminationMonitorWarnMsgBean> warnMsg() {
+        List<ExaminationMonitorWarnMsgBean> ret = new ArrayList<ExaminationMonitorWarnMsgBean>();
+        List<WarningNotifyBean> list = invigilateWarnInfoMapper.findLastMsg(6);
+        if (list != null && list.size() > 0) {
+            for (WarningNotifyBean b : list) {
+                ExaminationMonitorWarnMsgBean bean = new ExaminationMonitorWarnMsgBean();
+                bean.setTime(b.getCreateTime());
+                StringBuilder sb = new StringBuilder();
+                sb.append(b.getName()).append(" (证件号:").append(b.getIdentity()).append(") ").append(b.getInfo());
+                List<Map<String, String>> users = examInvigilateUserMapper.getInvigilateUsers(b.getExamId(), b.getRoomCode());
+                if (users != null && users.size() > 0) {
+                    StringBuilder usersb = new StringBuilder();
+                    for (Map<String, String> map : users) {
+                        if (map != null) {
+                            String lname = map.get("loginName");
+                            String name = map.get("name");
+                            if (StringUtils.isNotBlank(lname) && StringUtils.isNotBlank(name)) {
+                                usersb.append(lname).append("(账号:").append(name).append(") ");
+                            }
+                        }
+                    }
+                    if (usersb.length() > 0) {
+                        sb.append(",系统已提示").append(usersb).append("进行人工干预");
+                    }
+                }
+                bean.setContent(sb.toString());
+                ret.add(bean);
+            }
+        }
+        return ret;
+    }
 }

+ 0 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/TaskExportCommon.java

@@ -64,7 +64,6 @@ public class TaskExportCommon {
         this.ossEnv = systemConfig.getOssEnv(UploadFileEnum.file.ordinal());
         this.type = (boolean) this.ossEnv.get("oss") ? SystemConstant.OSS : SystemConstant.LOCAL;
         Map tbTaskHistoryMap = (Map) this.map.get("tbTaskHistory");
-        tbTaskHistoryMap = SystemConstant.timeTransform(tbTaskHistoryMap);
         this.tbTaskHistory = gson.fromJson(gson.toJson(tbTaskHistoryMap), TBTaskHistory.class);
         this.tbTaskHistoryService = SpringContextHolder.getBean(TBTaskHistoryService.class);
         this.tbAttachmentService = SpringContextHolder.getBean(TBAttachmentService.class);

+ 0 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java

@@ -73,7 +73,6 @@ public class TaskImportCommon {
         this.ossUtil = SpringContextHolder.getBean(OssUtil.class);
         this.ossEnv = systemConfig.getOssEnv(this.uploadType);
         Map tbTaskHistoryMap = (Map) this.map.get("tbTaskHistory");
-        tbTaskHistoryMap = SystemConstant.timeTransform(tbTaskHistoryMap);
         this.tbTaskHistory = gson.fromJson(gson.toJson(tbTaskHistoryMap), TBTaskHistory.class);
         this.tbTaskHistoryService = SpringContextHolder.getBean(TBTaskHistoryService.class);
         this.timeFormat = "yyyy-MM-dd HH:mm:ss";

+ 0 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -98,7 +98,6 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
             while (iterator.hasNext()) {
                 Map.Entry<String, Map> entry = (Map.Entry<String, Map>) iterator.next();
                 Map m = entry.getValue();
-                m = SystemConstant.timeTransform(m);
                 teExamActivity = gson.fromJson(gson.toJson(m), TEExamActivity.class);
             }
         }
@@ -118,7 +117,6 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                     ExamStudentImportDto examStudentImportDto = (ExamStudentImportDto) subList.get(y);
                     if (Objects.equals(modeEnum, ExamModeEnum.TOGETHER)) {
                         Map m = (Map) teExamActivityMap.get(examStudentImportDto.getExamActivityCode());
-                        m = SystemConstant.timeTransform(m);
                         teExamActivity = gson.fromJson(gson.toJson(m), TEExamActivity.class);
                     }
                     //先根据证件号+科目代码查询考生是否存在,存在则更新,不存在则插入