Browse Source

扫描管理

xiatian 9 months ago
parent
commit
cad0e5fb76

+ 24 - 0
src/main/java/cn/com/qmth/scancentral/controller/admin/BatchController.java

@@ -5,6 +5,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.annotation.Aac;
@@ -13,7 +14,12 @@ import com.qmth.boot.api.constant.ApiConstant;
 import cn.com.qmth.scancentral.controller.BaseController;
 import cn.com.qmth.scancentral.controller.BaseController;
 import cn.com.qmth.scancentral.service.BatchService;
 import cn.com.qmth.scancentral.service.BatchService;
 import cn.com.qmth.scancentral.vo.SubjectVo;
 import cn.com.qmth.scancentral.vo.SubjectVo;
+import cn.com.qmth.scancentral.vo.batch.BatchDeviceQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchStudentSimpleVo;
 import cn.com.qmth.scancentral.vo.batch.BatchSubjectQuery;
 import cn.com.qmth.scancentral.vo.batch.BatchSubjectQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchVo;
+import cn.com.qmth.scancentral.vo.device.DeviceVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 
 
@@ -32,4 +38,22 @@ public class BatchController extends BaseController {
         return batchService.subjectList(req);
         return batchService.subjectList(req);
     }
     }
 
 
+    @ApiOperation(value = "获取扫描批次机器列表")
+    @PostMapping("device/list")
+    public List<DeviceVo> deviceList(BatchDeviceQuery req) {
+        return batchService.deviceList(req);
+    }
+
+    @ApiOperation(value = "获取批次列表")
+    @PostMapping("list")
+    public List<BatchVo> batchList(BatchQuery req) {
+        return batchService.batchList(req);
+    }
+
+    @ApiOperation(value = "查询批次考生列表")
+    @PostMapping("student/list")
+    public List<BatchStudentSimpleVo> studentList(@RequestParam Long batchId) {
+        return batchService.studentList(batchId);
+    }
+
 }
 }

+ 33 - 0
src/main/java/cn/com/qmth/scancentral/controller/admin/StudentController.java

@@ -0,0 +1,33 @@
+package cn.com.qmth.scancentral.controller.admin;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.constant.ApiConstant;
+
+import cn.com.qmth.scancentral.controller.BaseController;
+import cn.com.qmth.scancentral.service.StudentService;
+import cn.com.qmth.scancentral.vo.student.StudentAnswerVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@Api(tags = "管理功能-考生接口")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/admin/student")
+@Aac(strict = false, auth = true)
+public class StudentController extends BaseController {
+
+    @Autowired
+    private StudentService studentService;
+
+    @ApiOperation(value = "考生查询")
+    @PostMapping("answer")
+    public StudentAnswerVo studentAnswer(@RequestParam Long batchId, @RequestParam Long studentId) {
+        return studentService.studentAnswer(batchId, studentId);
+    }
+
+}

+ 16 - 0
src/main/java/cn/com/qmth/scancentral/dao/BatchDao.java

@@ -7,7 +7,15 @@ import cn.com.qmth.scancentral.enums.CheckStatus;
 import cn.com.qmth.scancentral.enums.VerifyStatus;
 import cn.com.qmth.scancentral.enums.VerifyStatus;
 import cn.com.qmth.scancentral.vo.BatchQueryVo;
 import cn.com.qmth.scancentral.vo.BatchQueryVo;
 import cn.com.qmth.scancentral.vo.ScannerWorkloadVo;
 import cn.com.qmth.scancentral.vo.ScannerWorkloadVo;
+import cn.com.qmth.scancentral.vo.SubjectVo;
+import cn.com.qmth.scancentral.vo.batch.BatchDeviceQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchStudentSimpleVo;
+import cn.com.qmth.scancentral.vo.batch.BatchSubjectQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchVo;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchDetailDO;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchDetailDO;
+import cn.com.qmth.scancentral.vo.device.DeviceVo;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -45,4 +53,12 @@ public interface BatchDao extends BaseMapper<BatchEntity> {
     BatchEntity getHistory(@Param(value = "examId") Long examId, @Param("batchId") Long batchId,
     BatchEntity getHistory(@Param(value = "examId") Long examId, @Param("batchId") Long batchId,
             @Param("userId") Long userId, @Param("status") CheckStatus status);
             @Param("userId") Long userId, @Param("status") CheckStatus status);
 
 
+    List<SubjectVo> subjectList(@Param(value = "req") BatchSubjectQuery req);
+
+    List<DeviceVo> deviceList(@Param(value = "req") BatchDeviceQuery req);
+
+    List<BatchVo> batchList(@Param(value = "req") BatchQuery req);
+
+    List<BatchStudentSimpleVo> studentList(@Param(value = "batchId") Long batchId);
+
 }
 }

+ 2 - 0
src/main/java/cn/com/qmth/scancentral/dao/PaperDao.java

@@ -27,4 +27,6 @@ public interface PaperDao extends BaseMapper<PaperEntity> {
 
 
     List<PaperCetVo> findByStudentIds(@Param("studentIds") List<Long> studentIds);
     List<PaperCetVo> findByStudentIds(@Param("studentIds") List<Long> studentIds);
 
 
+    List<StudentPaperVo> listByBatchIdAndStudentId(@Param("batchId") Long batchId, @Param("studentId") Long studentId);
+
 }
 }

+ 11 - 0
src/main/java/cn/com/qmth/scancentral/service/BatchService.java

@@ -26,9 +26,14 @@ import cn.com.qmth.scancentral.vo.SliceUploadVo;
 import cn.com.qmth.scancentral.vo.SubjectVo;
 import cn.com.qmth.scancentral.vo.SubjectVo;
 import cn.com.qmth.scancentral.vo.batch.AnswerSaveVo;
 import cn.com.qmth.scancentral.vo.batch.AnswerSaveVo;
 import cn.com.qmth.scancentral.vo.batch.BatchCreateVo;
 import cn.com.qmth.scancentral.vo.batch.BatchCreateVo;
+import cn.com.qmth.scancentral.vo.batch.BatchDeviceQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchStudentSimpleVo;
 import cn.com.qmth.scancentral.vo.batch.BatchSubjectQuery;
 import cn.com.qmth.scancentral.vo.batch.BatchSubjectQuery;
+import cn.com.qmth.scancentral.vo.batch.BatchVo;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchDetailVo;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchDetailVo;
 import cn.com.qmth.scancentral.vo.checkimage.CheckImageSubmitVo;
 import cn.com.qmth.scancentral.vo.checkimage.CheckImageSubmitVo;
+import cn.com.qmth.scancentral.vo.device.DeviceVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
 import cn.com.qmth.scancentral.vo.verify.VerifyTaskVo;
 import cn.com.qmth.scancentral.vo.verify.VerifyTaskVo;
 
 
@@ -111,4 +116,10 @@ public interface BatchService extends IService<BatchEntity> {
     void updateBatchCount();
     void updateBatchCount();
 
 
     List<SubjectVo> subjectList(BatchSubjectQuery req);
     List<SubjectVo> subjectList(BatchSubjectQuery req);
+
+    List<DeviceVo> deviceList(BatchDeviceQuery req);
+
+    List<BatchVo> batchList(BatchQuery req);
+
+    List<BatchStudentSimpleVo> studentList(Long batchId);
 }
 }

+ 2 - 0
src/main/java/cn/com/qmth/scancentral/service/PaperService.java

@@ -51,4 +51,6 @@ public interface PaperService extends IService<PaperEntity> {
     List<PaperCetVo> findByStudentIds(List<Long> studentIds);
     List<PaperCetVo> findByStudentIds(List<Long> studentIds);
 
 
     void updatePaperAssignedSuspect(Long id, Integer number, Boolean assignedSuspect);
     void updatePaperAssignedSuspect(Long id, Integer number, Boolean assignedSuspect);
+
+    List<StudentPaperVo> listByBatchIdAndStudentId(Long batchId, Long studentId);
 }
 }

+ 3 - 0
src/main/java/cn/com/qmth/scancentral/service/StudentService.java

@@ -48,6 +48,7 @@ import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssginedTaskResult;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssginedTaskResult;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExport;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExport;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
+import cn.com.qmth.scancentral.vo.student.StudentAnswerVo;
 import cn.com.qmth.scancentral.vo.student.StudentQuery;
 import cn.com.qmth.scancentral.vo.student.StudentQuery;
 import cn.com.qmth.scancentral.vo.student.StudentVo;
 import cn.com.qmth.scancentral.vo.student.StudentVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
@@ -185,4 +186,6 @@ public interface StudentService extends IService<StudentEntity> {
     List<AnswerQueryVo> getAssignedCheckTaskHistory(Long id, Long pageSize, User user);
     List<AnswerQueryVo> getAssignedCheckTaskHistory(Long id, Long pageSize, User user);
 
 
     AnswerQueryVo getAssignedCheckTask(Long examId, String account);
     AnswerQueryVo getAssignedCheckTask(Long examId, String account);
+
+    StudentAnswerVo studentAnswer(Long batchId, Long studentId);
 }
 }

+ 35 - 2
src/main/java/cn/com/qmth/scancentral/service/impl/BatchServiceImpl.java

@@ -21,6 +21,7 @@ import cn.com.qmth.scancentral.vo.batchdetail.BatchDetailDO;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchDetailVo;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchDetailVo;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchStudentVo;
 import cn.com.qmth.scancentral.vo.batchdetail.BatchStudentVo;
 import cn.com.qmth.scancentral.vo.checkimage.CheckImageSubmitVo;
 import cn.com.qmth.scancentral.vo.checkimage.CheckImageSubmitVo;
+import cn.com.qmth.scancentral.vo.device.DeviceVo;
 import cn.com.qmth.scancentral.vo.paper.PaperVo;
 import cn.com.qmth.scancentral.vo.paper.PaperVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
 import cn.com.qmth.scancentral.vo.verify.VerifyStudentVo;
 import cn.com.qmth.scancentral.vo.verify.VerifyStudentVo;
@@ -839,7 +840,39 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
         if (req.getExamId() == null) {
         if (req.getExamId() == null) {
             throw new ParameterException("考试id不能为空");
             throw new ParameterException("考试id不能为空");
         }
         }
-        // return this.baseMapper.subjectList(req);
-        return null;
+        return this.baseMapper.subjectList(req);
+    }
+
+    @Override
+    public List<DeviceVo> deviceList(BatchDeviceQuery req) {
+        if (req.getExamId() == null) {
+            throw new ParameterException("考试id不能为空");
+        }
+        if (StringUtils.isBlank(req.getSubjectCode())) {
+            throw new ParameterException("科目代码不能为空");
+        }
+        return this.baseMapper.deviceList(req);
+    }
+
+    @Override
+    public List<BatchVo> batchList(BatchQuery req) {
+        if (req.getExamId() == null) {
+            throw new ParameterException("考试id不能为空");
+        }
+        if (StringUtils.isBlank(req.getSubjectCode())) {
+            throw new ParameterException("科目代码不能为空");
+        }
+        if (StringUtils.isBlank(req.getDevice())) {
+            throw new ParameterException("设备不能为空");
+        }
+        return this.baseMapper.batchList(req);
+    }
+
+    @Override
+    public List<BatchStudentSimpleVo> studentList(Long batchId) {
+        if (batchId == null) {
+            throw new ParameterException("批次id不能为空");
+        }
+        return this.baseMapper.studentList(batchId);
     }
     }
 }
 }

+ 5 - 0
src/main/java/cn/com/qmth/scancentral/service/impl/PaperServiceImpl.java

@@ -448,4 +448,9 @@ public class PaperServiceImpl extends ServiceImpl<PaperDao, PaperEntity> impleme
         lw.eq(PaperEntity::getId, sp.getPaperId());
         lw.eq(PaperEntity::getId, sp.getPaperId());
         this.update(lw);
         this.update(lw);
     }
     }
+
+    @Override
+    public List<StudentPaperVo> listByBatchIdAndStudentId(Long batchId, Long studentId) {
+        return this.baseMapper.listByBatchIdAndStudentId(batchId, studentId);
+    }
 }
 }

+ 157 - 36
src/main/java/cn/com/qmth/scancentral/service/impl/StudentServiceImpl.java

@@ -1,6 +1,57 @@
 package cn.com.qmth.scancentral.service.impl;
 package cn.com.qmth.scancentral.service.impl;
 
 
-import cn.com.qmth.scancentral.bean.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import javax.validation.constraints.NotNull;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.boot.core.collection.PageResult;
+import com.qmth.boot.core.concurrent.service.ConcurrentService;
+import com.qmth.boot.core.exception.ParameterException;
+import com.qmth.boot.core.exception.StatusException;
+import com.qmth.boot.core.retrofit.utils.SignatureInfo;
+import com.qmth.boot.tools.excel.ExcelReader;
+import com.qmth.boot.tools.excel.enums.ExcelType;
+import com.qmth.boot.tools.io.IOUtils;
+import com.qmth.boot.tools.signature.SignatureType;
+
+import cn.com.qmth.scancentral.bean.AbsentQueryDomain;
+import cn.com.qmth.scancentral.bean.AnswerDeleteDomain;
+import cn.com.qmth.scancentral.bean.AnswerQueryDomain;
+import cn.com.qmth.scancentral.bean.AssignedQueryDomain;
+import cn.com.qmth.scancentral.bean.ImportCetAbsentDomain;
+import cn.com.qmth.scancentral.bean.ImportStudentDomain;
+import cn.com.qmth.scancentral.bean.PageDeleteDomain;
+import cn.com.qmth.scancentral.bean.SchoolSession;
+import cn.com.qmth.scancentral.bean.User;
 import cn.com.qmth.scancentral.bean.answersave.ArrayResult;
 import cn.com.qmth.scancentral.bean.answersave.ArrayResult;
 import cn.com.qmth.scancentral.bean.answersave.StringResult;
 import cn.com.qmth.scancentral.bean.answersave.StringResult;
 import cn.com.qmth.scancentral.bean.omredit.OmrEditDomain;
 import cn.com.qmth.scancentral.bean.omredit.OmrEditDomain;
@@ -10,18 +61,67 @@ import cn.com.qmth.scancentral.bean.refix.PageRefixDomain;
 import cn.com.qmth.scancentral.bean.refix.PaperRefixDomain;
 import cn.com.qmth.scancentral.bean.refix.PaperRefixDomain;
 import cn.com.qmth.scancentral.config.SysProperty;
 import cn.com.qmth.scancentral.config.SysProperty;
 import cn.com.qmth.scancentral.dao.StudentDao;
 import cn.com.qmth.scancentral.dao.StudentDao;
-import cn.com.qmth.scancentral.entity.*;
-import cn.com.qmth.scancentral.enums.*;
+import cn.com.qmth.scancentral.entity.AnswerCardEntity;
+import cn.com.qmth.scancentral.entity.ExamEntity;
+import cn.com.qmth.scancentral.entity.OmrGroupEntity;
+import cn.com.qmth.scancentral.entity.PaperEntity;
+import cn.com.qmth.scancentral.entity.PaperPageEntity;
+import cn.com.qmth.scancentral.entity.QuestionEntity;
+import cn.com.qmth.scancentral.entity.StudentEntity;
+import cn.com.qmth.scancentral.entity.StudentPaperEntity;
+import cn.com.qmth.scancentral.entity.SubjectEntity;
+import cn.com.qmth.scancentral.entity.UserEntity;
+import cn.com.qmth.scancentral.enums.ExamMode;
+import cn.com.qmth.scancentral.enums.ExamStatus;
+import cn.com.qmth.scancentral.enums.ExamStatusCheckMode;
+import cn.com.qmth.scancentral.enums.GroupType;
+import cn.com.qmth.scancentral.enums.LockType;
+import cn.com.qmth.scancentral.enums.OmrType;
+import cn.com.qmth.scancentral.enums.Role;
+import cn.com.qmth.scancentral.enums.ScanStatus;
+import cn.com.qmth.scancentral.enums.UploadStatus;
 import cn.com.qmth.scancentral.exception.NotFoundExceptions;
 import cn.com.qmth.scancentral.exception.NotFoundExceptions;
 import cn.com.qmth.scancentral.exception.ParameterExceptions;
 import cn.com.qmth.scancentral.exception.ParameterExceptions;
 import cn.com.qmth.scancentral.model.ManualAbsentImportDTO;
 import cn.com.qmth.scancentral.model.ManualAbsentImportDTO;
-import cn.com.qmth.scancentral.service.*;
+import cn.com.qmth.scancentral.service.AnswerCardService;
+import cn.com.qmth.scancentral.service.AnswerCardSubjectService;
+import cn.com.qmth.scancentral.service.AssignedCheckHistoryService;
+import cn.com.qmth.scancentral.service.BatchService;
+import cn.com.qmth.scancentral.service.ExamService;
+import cn.com.qmth.scancentral.service.OmrGroupService;
+import cn.com.qmth.scancentral.service.OmrTaskService;
+import cn.com.qmth.scancentral.service.PaperPageService;
+import cn.com.qmth.scancentral.service.PaperService;
+import cn.com.qmth.scancentral.service.QuestionService;
+import cn.com.qmth.scancentral.service.SessionService;
+import cn.com.qmth.scancentral.service.StudentPaperService;
+import cn.com.qmth.scancentral.service.StudentService;
+import cn.com.qmth.scancentral.service.SubjectService;
+import cn.com.qmth.scancentral.service.ToolExportService;
+import cn.com.qmth.scancentral.service.UserService;
 import cn.com.qmth.scancentral.support.TaskLock;
 import cn.com.qmth.scancentral.support.TaskLock;
 import cn.com.qmth.scancentral.support.TaskLockUtil;
 import cn.com.qmth.scancentral.support.TaskLockUtil;
 import cn.com.qmth.scancentral.util.BatchGetDataUtil;
 import cn.com.qmth.scancentral.util.BatchGetDataUtil;
 import cn.com.qmth.scancentral.util.BatchSetDataUtil;
 import cn.com.qmth.scancentral.util.BatchSetDataUtil;
 import cn.com.qmth.scancentral.util.PageUtil;
 import cn.com.qmth.scancentral.util.PageUtil;
-import cn.com.qmth.scancentral.vo.*;
+import cn.com.qmth.scancentral.vo.AbsentInfoVo;
+import cn.com.qmth.scancentral.vo.AbsentManualImportVo;
+import cn.com.qmth.scancentral.vo.AbsentQueryVo;
+import cn.com.qmth.scancentral.vo.AnswerDeleteVo;
+import cn.com.qmth.scancentral.vo.AnswerExportK12Vo;
+import cn.com.qmth.scancentral.vo.AnswerExportVo;
+import cn.com.qmth.scancentral.vo.AnswerRefixVo;
+import cn.com.qmth.scancentral.vo.CampusVo;
+import cn.com.qmth.scancentral.vo.ExamSiteVo;
+import cn.com.qmth.scancentral.vo.ExportCetMarkingQueryVo;
+import cn.com.qmth.scancentral.vo.ExportCetVo;
+import cn.com.qmth.scancentral.vo.ImportResult;
+import cn.com.qmth.scancentral.vo.ImportStudentQueryVo;
+import cn.com.qmth.scancentral.vo.ImportStudentVo;
+import cn.com.qmth.scancentral.vo.PaperDeleteVo;
+import cn.com.qmth.scancentral.vo.ScanAnswerInfoVo;
+import cn.com.qmth.scancentral.vo.StudentUploadVo;
+import cn.com.qmth.scancentral.vo.UpdateTimeVo;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerPageVo;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerPageVo;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerPaperVo;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerPaperVo;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
@@ -32,39 +132,10 @@ import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskResultPaper;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
 import cn.com.qmth.scancentral.vo.paper.PaperCetVo;
 import cn.com.qmth.scancentral.vo.paper.PaperCetVo;
 import cn.com.qmth.scancentral.vo.paper.PaperPageCetVo;
 import cn.com.qmth.scancentral.vo.paper.PaperPageCetVo;
+import cn.com.qmth.scancentral.vo.student.StudentAnswerVo;
 import cn.com.qmth.scancentral.vo.student.StudentQuery;
 import cn.com.qmth.scancentral.vo.student.StudentQuery;
 import cn.com.qmth.scancentral.vo.student.StudentVo;
 import cn.com.qmth.scancentral.vo.student.StudentVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.boot.core.collection.PageResult;
-import com.qmth.boot.core.concurrent.service.ConcurrentService;
-import com.qmth.boot.core.exception.ParameterException;
-import com.qmth.boot.core.exception.StatusException;
-import com.qmth.boot.core.retrofit.utils.SignatureInfo;
-import com.qmth.boot.tools.excel.ExcelReader;
-import com.qmth.boot.tools.excel.enums.ExcelType;
-import com.qmth.boot.tools.io.IOUtils;
-import com.qmth.boot.tools.signature.SignatureType;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.constraints.NotNull;
-import java.io.*;
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
 
 
 @Service
 @Service
 public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> implements StudentService {
 public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> implements StudentService {
@@ -1693,7 +1764,6 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
     public ImportResult importExamStatus(Long examId, ExamStatusCheckMode mode, InputStream inputStream)
     public ImportResult importExamStatus(Long examId, ExamStatusCheckMode mode, InputStream inputStream)
             throws IOException {
             throws IOException {
         try {
         try {
-            ExamEntity exam = examService.getById(examId);
             ImportResult ret = new ImportResult();
             ImportResult ret = new ImportResult();
             List<String> failRecords = new ArrayList<>();
             List<String> failRecords = new ArrayList<>();
             ret.setErrMsg(failRecords);
             ret.setErrMsg(failRecords);
@@ -2113,4 +2183,55 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
         return t;
         return t;
     }
     }
 
 
+    @Override
+    public StudentAnswerVo studentAnswer(Long batchId, Long studentId) {
+        if (batchId == null) {
+            throw new ParameterException("batchId不能为空");
+        }
+        if (studentId == null) {
+            throw new ParameterException("studentId不能为空");
+        }
+        StudentAnswerVo ret = new StudentAnswerVo();
+        ret.setStudentId(studentId);
+        ret.setPapers(new ArrayList<>());
+        List<StudentPaperVo> paperList = paperService.listByBatchIdAndStudentId(batchId, studentId);
+
+        if (CollectionUtils.isNotEmpty(paperList)) {
+            Map<Long, AnswerPaperVo> paperMap = new HashMap<>();
+            for (StudentPaperVo p : paperList) {
+                AnswerPaperVo pvo = new AnswerPaperVo();
+                pvo.setId(p.getPaperId());
+                pvo.setNumber(p.getNumber());
+                pvo.setAssigned(p.getAssigned());
+                pvo.setPages(new ArrayList<>());
+                ret.getPapers().add(pvo);
+                paperMap.put(p.getPaperId(), pvo);
+            }
+            // 查找page
+            List<Long> paperIds = paperList.stream().map(p -> p.getPaperId()).collect(Collectors.toList());
+            List<PaperPageEntity> paperPageList = paperPageService.listByPaperList(paperIds);
+
+            if (CollectionUtils.isNotEmpty(paperPageList)) {
+                for (PaperPageEntity p : paperPageList) {
+                    AnswerPaperVo pvo = paperMap.get(p.getPaperId());
+                    if (pvo == null) {
+                        continue;
+                    }
+                    AnswerPageVo pageVo = new AnswerPageVo();
+                    pageVo.setIndex(p.getPageIndex());
+                    pageVo.setSheetUri(p.getSheetPath());
+                    pageVo.setSliceUri(p.getSlicePath());
+                    pageVo.setAbsent(p.getAbsent());
+                    pageVo.setBreach(p.getBreach());
+                    pageVo.setPaperType(p.getPaperType());
+                    pageVo.setQuestion(p.getQuestion());
+                    pageVo.setSelective(p.getSelective());
+                    pageVo.setRecogData(p.getRecogData());
+                    pvo.getPages().add(pageVo);
+                }
+            }
+        }
+        return ret;
+    }
+
 }
 }

+ 45 - 0
src/main/java/cn/com/qmth/scancentral/vo/batch/BatchDeviceQuery.java

@@ -0,0 +1,45 @@
+package cn.com.qmth.scancentral.vo.batch;
+
+public class BatchDeviceQuery {
+
+    private Long examId;
+
+    private String subjectCode;
+
+    private Long startTime;
+
+    private Long endTime;
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Long startTime) {
+        this.startTime = startTime;
+    }
+
+    public Long getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Long endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getSubjectCode() {
+        return subjectCode;
+    }
+
+    public void setSubjectCode(String subjectCode) {
+        this.subjectCode = subjectCode;
+    }
+
+}

+ 55 - 0
src/main/java/cn/com/qmth/scancentral/vo/batch/BatchQuery.java

@@ -0,0 +1,55 @@
+package cn.com.qmth.scancentral.vo.batch;
+
+public class BatchQuery {
+
+    private Long examId;
+
+    private String subjectCode;
+
+    private String device;
+
+    private Long startTime;
+
+    private Long endTime;
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Long startTime) {
+        this.startTime = startTime;
+    }
+
+    public Long getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Long endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getSubjectCode() {
+        return subjectCode;
+    }
+
+    public void setSubjectCode(String subjectCode) {
+        this.subjectCode = subjectCode;
+    }
+
+    public String getDevice() {
+        return device;
+    }
+
+    public void setDevice(String device) {
+        this.device = device;
+    }
+
+}

+ 35 - 0
src/main/java/cn/com/qmth/scancentral/vo/batch/BatchStudentSimpleVo.java

@@ -0,0 +1,35 @@
+package cn.com.qmth.scancentral.vo.batch;
+
+public class BatchStudentSimpleVo {
+
+    private Long studentId;
+
+    private String examNumber;
+
+    private String studentName;
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getExamNumber() {
+        return examNumber;
+    }
+
+    public void setExamNumber(String examNumber) {
+        this.examNumber = examNumber;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+}

+ 25 - 0
src/main/java/cn/com/qmth/scancentral/vo/batch/BatchVo.java

@@ -0,0 +1,25 @@
+package cn.com.qmth.scancentral.vo.batch;
+
+public class BatchVo {
+
+    private Long batchId;
+
+    private Long createTime;
+
+    public Long getBatchId() {
+        return batchId;
+    }
+
+    public void setBatchId(Long batchId) {
+        this.batchId = batchId;
+    }
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+}

+ 25 - 0
src/main/java/cn/com/qmth/scancentral/vo/device/DeviceVo.java

@@ -0,0 +1,25 @@
+package cn.com.qmth.scancentral.vo.device;
+
+public class DeviceVo {
+
+    private String device;
+
+    private String deviceName;
+
+    public String getDevice() {
+        return device;
+    }
+
+    public void setDevice(String device) {
+        this.device = device;
+    }
+
+    public String getDeviceName() {
+        return deviceName;
+    }
+
+    public void setDeviceName(String deviceName) {
+        this.deviceName = deviceName;
+    }
+
+}

+ 29 - 0
src/main/java/cn/com/qmth/scancentral/vo/student/StudentAnswerVo.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.scancentral.vo.student;
+
+import java.util.List;
+
+import cn.com.qmth.scancentral.vo.answerquery.AnswerPaperVo;
+
+public class StudentAnswerVo {
+
+    private Long studentId;
+
+    private List<AnswerPaperVo> papers;
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+
+    public List<AnswerPaperVo> getPapers() {
+        return papers;
+    }
+
+    public void setPapers(List<AnswerPaperVo> papers) {
+        this.papers = papers;
+    }
+
+}

+ 53 - 0
src/main/resources/mapper/BatchMapper.xml

@@ -227,4 +227,57 @@
         order by b.id desc
         order by b.id desc
         limit 1
         limit 1
     </select>
     </select>
+    <select id="subjectList"
+            resultType="cn.com.qmth.scancentral.vo.SubjectVo">
+        select distinct b.subject_code,s.name subjectName
+        from sc_batch b 
+        left join sc_subject s on b.exam_id=s.exam_id and b.subject_code=s.code
+        where b.exam_id = #{req.examId}
+        <if test="req.startTime != null">
+            and b.create_time&gt;=#{req.startTime}
+        </if>
+        <if test="req.endTime != null">
+            and b.create_time&lt;=#{req.endTime}
+        </if>
+        order by b.subject_code
+    </select>
+    <select id="deviceList"
+            resultType="cn.com.qmth.scancentral.vo.device.DeviceVo">
+        select distinct b.device,d.device_name
+        from sc_batch b 
+        left join sc_device d on b.device=d.device
+        where b.exam_id = #{req.examId}
+        and b.subject_code=#{req.subjectCode}
+        <if test="req.startTime != null">
+            and b.create_time&gt;=#{req.startTime}
+        </if>
+        <if test="req.endTime != null">
+            and b.create_time&lt;=#{req.endTime}
+        </if>
+        order by b.create_time
+    </select>
+    <select id="batchList"
+            resultType="cn.com.qmth.scancentral.vo.batch.BatchVo">
+        select distinct b.id batchId,b.create_time
+        from sc_batch b 
+        left join sc_device d on b.device=d.device
+        where b.exam_id = #{req.examId}
+        and b.subject_code=#{req.subjectCode}
+        and b.device=#{req.device}
+        <if test="req.startTime != null">
+            and b.create_time&gt;=#{req.startTime}
+        </if>
+        <if test="req.endTime != null">
+            and b.create_time&lt;=#{req.endTime}
+        </if>
+        order by b.create_time
+    </select> 
+    <select id="batchList"
+            resultType="cn.com.qmth.scancentral.vo.batch.BatchStudentSimpleVo">
+        select s.id studentId,s.name studentName,s.examNumber
+        from sc_batch_paper b 
+        left join sc_student s on b.student_id=s.id
+        where b.batch_id = #{batchId}
+        order by s.examNumber
+    </select>      
 </mapper>
 </mapper>

+ 14 - 0
src/main/resources/mapper/PaperMapper.xml

@@ -96,5 +96,19 @@
           and t.id = bp.paper_id
           and t.id = bp.paper_id
           and t.assigned = 1
           and t.assigned = 1
     </select>
     </select>
+    <select id="listByBatchIdAndStudentId"
+            resultType="cn.com.qmth.scancentral.vo.answerquery.StudentPaperVo">
+        SELECT
+        p.id aper_id,
+        bp.student_id,
+        p.number,
+        p.assigned,
+        p.assigned_suspect
+        FROM sc_batch_paper bp
+                 inner join sc_paper p on bp.paper_id = p.id
+        WHERE bp.student_id = #{studentId}
+          and bp.batch_id = #{batchId}
+        order by p.number
+    </select>
 
 
 </mapper>
 </mapper>