浏览代码

3.4.0 update

xiaofei 11 月之前
父节点
当前提交
8b736f9a92
共有 26 个文件被更改,包括 320 次插入133 次删除
  1. 10 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskDetailDto.java
  2. 4 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java
  3. 28 15
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  4. 10 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java
  5. 10 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  6. 8 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskAssignPaperTypeServiceImpl.java
  7. 0 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  8. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentExportService.java
  9. 3 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentImportService.java
  10. 31 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/DownloadLogicServiceImpl.java
  11. 7 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java
  12. 38 34
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PdfTaskLogicServiceImpl.java
  13. 1 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java
  14. 65 0
      distributed-print-business/src/main/resources/mapper/ConditionMapper.xml
  15. 1 0
      distributed-print-business/src/main/resources/mapper/ExamTaskDetailMapper.xml
  16. 1 1
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  17. 5 1
      distributed-print/install/mysql/upgrade/3.4.0.sql
  18. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/DateDisposeUtils.java
  19. 1 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ExcelUtil.java
  20. 2 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java
  21. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanBatchPaperService.java
  22. 2 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPaperPageService.java
  23. 27 6
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  24. 6 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkUserGroupServiceImpl.java
  25. 12 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanBatchPaperServiceImpl.java
  26. 45 38
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperPageServiceImpl.java

+ 10 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskDetailDto.java

@@ -15,6 +15,8 @@ public class ExamTaskDetailDto {
     private String printPlanId;
     private String printPlanName;
     private String paperNumber;
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long courseId;
     private String courseCode;
     private String courseName;
     private String specialty;
@@ -93,6 +95,14 @@ public class ExamTaskDetailDto {
         this.paperNumber = paperNumber;
     }
 
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
     public String getCourseCode() {
         return courseCode;
     }

+ 4 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -96,4 +96,8 @@ public interface ConditionMapper {
      * @return 课程
      */
     List<BasicCourse> listCourseForGradeBatchPaper(@Param("examId") Long examId, @Param("collegeId") Long collegeId, @Param("dpr") DataPermissionRule dpr);
+
+    List<BasicCourse> listCourseForExamDetail(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("dpr") DataPermissionRule dpr);
+
+    List<String> listPaperNumberForExamDetail(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("courseId") Long courseId, @Param("dpr") DataPermissionRule dpr);
 }

+ 28 - 15
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -141,7 +141,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     @Override
     public void exportLogic(BasicExamStudentPageQuery query) {
         Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.BASIC_EXAM_STUDENT_EXPORT, null, (SysUser) ServletUtil.getRequestUser());
-        map.put("query",query);
+        map.put("query", query);
         map.put("privilegeId", ServletUtil.getCurrentPrivilegeId());
         asyncBasicExamStudentExportService.exportTask(map);
     }
@@ -152,29 +152,36 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         if (CollectionUtils.isNotEmpty(idList)) {
             List<BasicExamStudent> basicExamStudentList = this.listByIds(idList);
             for (BasicExamStudent basicExamStudent : basicExamStudentList) {
-                List<MarkStudent> markStudentList = markStudentService.listByStudentId(basicExamStudent.getId());
+                List<MarkStudent> markStudentList = markStudentService.listByBasicStudentId(basicExamStudent.getId());
                 if (CollectionUtils.isNotEmpty(markStudentList)) {
-                    StringJoiner stringJoiner = new StringJoiner(";");
                     for (MarkStudent markStudent : markStudentList) {
                         if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
                             BasicCourse basicCourse = basicCourseService.getById(markStudent.getCourseId());
-                            stringJoiner.add("课程[" + basicCourse.getName() + "(" + basicCourse.getCode() + ")],学号[" + basicExamStudent.getStudentCode() + "]考生已开始评卷,不允许删除");
+                            throw ExceptionResultEnum.ERROR.exception("课程[" + basicCourse.getName() + "(" + basicCourse.getCode() + ")],学号[" + basicExamStudent.getStudentCode() + "]考生已有评卷任务,不允许删除");
                         }
                     }
-                    if (stringJoiner.toString().length() > 0) {
-                        throw ExceptionResultEnum.ERROR.exception(stringJoiner.toString());
-                    }
                 }
                 examStudentService.deleteByBasicStudentId(basicExamStudent.getId());
                 markStudentService.deleteByBasicStudentId(basicExamStudent.getId());
-                // 更新扫描数据
-                long count = markStudentService.countByExamIdAndPaperNumber(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), null);
-                if (count == 0) {
-                    markPaperService.deleteByExamIdAndPaperNumber(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber());
-                } else {
-                    markPaperService.updateStudentCountByExamIdAndPaperNumberAndPaperType(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), null);
-                    markPaperService.updateUploadCount(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(),
-                            markStudentService.countUploadedByExamIdAndPaperNumber(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber()));
+            }
+
+            Set<String> paperNumberSet = basicExamStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperNumber())).map(BasicExamStudent::getPaperNumber).collect(Collectors.toSet());
+            if(CollectionUtils.isNotEmpty(paperNumberSet)){
+                Long examId = basicExamStudentList.get(0).getExamId();
+                for (String paperNumber : paperNumberSet) {
+                    MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
+                    if(markPaper == null){
+                        continue;
+                    }
+                    // 更新扫描数据
+                    long count = markStudentService.countByExamIdAndPaperNumber(examId, paperNumber, null);
+                    if (count == 0) {
+                        markPaperService.deleteByExamIdAndPaperNumber(examId, paperNumber);
+                    } else {
+                        markPaperService.updateStudentCountByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null);
+                        markPaperService.updateUploadCount(examId, paperNumber,
+                                markStudentService.countUploadedByExamIdAndPaperNumber(examId, paperNumber));
+                    }
                 }
             }
             this.removeByIds(idList);
@@ -280,6 +287,12 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                     .eq(BasicExamStudent::getStudentCode, basicExamStudent.getStudentCode())) > 0) {
                 throw ExceptionResultEnum.ERROR.exception(String.format("学号[%s]考生已存在", basicExamStudent.getStudentCode()));
             }
+            // 试卷编号绑定其它课程
+            if (this.count(new QueryWrapper<BasicExamStudent>().lambda()
+                    .eq(BasicExamStudent::getExamId, basicExamStudent.getExamId()).eq(BasicExamStudent::getPaperNumber, basicExamStudent.getPaperNumber())
+                    .ne(BasicExamStudent::getCourseId, basicExamStudent.getCourseId())) > 0) {
+                throw ExceptionResultEnum.ERROR.exception(String.format("试卷编号[%s]已绑定其它课程", basicExamStudent.getPaperNumber()));
+            }
             basicExamStudent.insertInfo(requestUserId);
         }
 

+ 10 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java

@@ -112,6 +112,10 @@ public class ConditionServiceImpl implements ConditionService {
         else if ("42".equals(privilegeIdString)) {
             return conditionMapper.listCourseForQuery(examId, dpr);
         }
+        // 考务明细查询(45)
+        else if ("45".equals(privilegeIdString)) {
+            return conditionMapper.listCourseForExamDetail(semesterId, examId, printPlanIds, dpr);
+        }
         // 印刷任务管理(47)
         else if ("47".equals(privilegeIdString)) {
             return conditionMapper.listCourseForPlanTask(semesterId, examId, printPlanIds, dpr);
@@ -185,6 +189,10 @@ public class ConditionServiceImpl implements ConditionService {
         else if ("42".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberForQuery(examId, courseId, dpr);
         }
+        // 考务明细查询(45)
+        else if ("45".equals(privilegeIdString)) {
+            return conditionMapper.listPaperNumberForExamDetail(semesterId, examId, printPlanIds, courseId, dpr);
+        }
         // 印刷任务管理(47)
         else if ("47".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberPlanTask(semesterId, examId, printPlanIds, courseId, dpr);
@@ -227,8 +235,8 @@ public class ConditionServiceImpl implements ConditionService {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
 
         if ("client".equals(source)) {
-            String[] examDetailStatus = new String[] { ExamDetailStatusEnum.NEW.name(),
-                    PrintPlanStatusEnum.READY.name() };
+            String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(),
+                    PrintPlanStatusEnum.READY.name()};
             return conditionMapper.listPrintPlanForClient(semesterId, examId, examDetailStatus);
         } else {
             // 如果byAssignUser为true时,不能通过层级关系查询

+ 10 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -135,6 +135,12 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     private MarkPaperPackageService markPaperPackageService;
     @Resource
     private ScanAnswerCardService scanAnswerCardService;
+    @Resource
+    private MarkUserGroupService markUserGroupService;
+    @Resource
+    private MarkUserClassService markUserClassService;
+    @Resource
+    private TBTaskPdfService tbTaskPdfService;
 
     @Transactional(rollbackFor = Exception.class)
     @Override
@@ -736,6 +742,8 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         }
         //删除exam_detail
         this.removeById(id);
+        // 删除pdf生成任务
+        tbTaskPdfService.removeById(id);
         // 删除exam_detail_course
         QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
         examDetailCourseQueryWrapper.lambda().eq(ExamDetailCourse::getExamDetailId, id);
@@ -764,6 +772,8 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
                             markPaperPackageService.deleteByExamIdAndPaperNumber(examDetail.getExamId(), examDetailCourse.getPaperNumber());
                             markQuestionService.deleteByExamIdAndPaperNumber(examDetail.getExamId(), examDetailCourse.getPaperNumber());
                             scanAnswerCardService.deleteByExamIdAndPaperNumber(examDetail.getExamId(), examDetailCourse.getPaperNumber());
+                            markUserGroupService.deleteByExamIdAndPaperNumberAndGroupNumber(examDetail.getExamId(), examDetailCourse.getPaperNumber(), null);
+                            markUserClassService.deleteByExamIdAndPaperNumber(examDetail.getExamId(), examDetailCourse.getPaperNumber());
                         } else {
                             for (String paperType : examDetailCourse.getPaperNumber().split(",")) {
                                 markPaperService.updateStudentCountByExamIdAndPaperNumberAndPaperType(examDetail.getExamId(), examDetailCourse.getPaperNumber(), paperType);

+ 8 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskAssignPaperTypeServiceImpl.java

@@ -8,6 +8,7 @@ import com.qmth.distributed.print.business.mapper.ExamTaskAssignPaperTypeMapper;
 import com.qmth.distributed.print.business.service.ExamDetailService;
 import com.qmth.distributed.print.business.service.ExamTaskAssignPaperTypeService;
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -40,9 +41,13 @@ public class ExamTaskAssignPaperTypeServiceImpl extends MppServiceImpl<ExamTaskA
         }
         ExamTaskAssignPaperType examTaskAssignPaperType = this.selectByMultiId(new ExamTaskAssignPaperType(tbTaskPdf.getExamId(), examDetailCourse.getPaperNumber(), examDetail.getExamStartTime(), examDetail.getExamEndTime()));
         if (examTaskAssignPaperType == null) {
-            String paperType = createPdfUtil.getPaperType(examDetail.getPrintPlanId(), examDetail.getExamId(), examDetailCourse.getPaperNumber());
-            examTaskAssignPaperType = new ExamTaskAssignPaperType(tbTaskPdf.getExamId(), examDetailCourse.getPaperNumber(), examDetail.getExamStartTime(), examDetail.getExamEndTime(), paperType, AssignModeEnum.AUTO);
-            this.saveOrUpdateByMultiId(examTaskAssignPaperType);
+            try {
+                String paperType = createPdfUtil.getPaperType(examDetail.getPrintPlanId(), examDetail.getExamId(), examDetailCourse.getPaperNumber());
+                examTaskAssignPaperType = new ExamTaskAssignPaperType(tbTaskPdf.getExamId(), examDetailCourse.getPaperNumber(), examDetail.getExamStartTime(), examDetail.getExamEndTime(), paperType, AssignModeEnum.AUTO);
+                this.saveOrUpdateByMultiId(examTaskAssignPaperType);
+            } catch (Exception e) {
+                throw ExceptionResultEnum.ERROR.exception(e.getMessage());
+            }
         }
         return examTaskAssignPaperType;
     }

+ 0 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -1107,16 +1107,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     examCardService.updateUsedById(true, Arrays.asList(new Long[]{Long.valueOf(paperInfoVo.getCardId())}));
                 }
             }
-            // 删除临时题卡
-            for (PaperInfoVo paperInfoVo : paperInfoVoList) {
-                if (paperInfoVo.getPaperId() != null) {
-                    QueryWrapper<ExamCard> deleteWrapper = new QueryWrapper<>();
-                    deleteWrapper.lambda().eq(ExamCard::getCreateId, sysUser.getId())
-                            .eq(ExamCard::getPaperId, paperInfoVo.getPaperId())
-                            .eq(ExamCard::getUsed, false);
-                    examCardService.remove(deleteWrapper);
-                }
-            }
             // 更新题库试卷表
             for (PaperInfoVo paperInfoVo : paperInfoVoList) {
                 if (StringUtils.isNotBlank(paperInfoVo.getUuid())) {

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentExportService.java

@@ -29,7 +29,7 @@ import java.util.StringJoiner;
 @Service
 public class AsyncBasicExamStudentExportService extends AsyncExportTaskTemplete {
 
-    public static final String OBJ_TITLE = "试卷、题卡pdf导出";
+    public static final String OBJ_TITLE = "考生管理导出";
     private final static Logger log = LoggerFactory.getLogger(AsyncBasicExamStudentExportService.class);
 
     @Override

+ 3 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentImportService.java

@@ -63,8 +63,6 @@ public class AsyncBasicExamStudentImportService extends AsyncImportTaskTemplete
     @Resource
     private BasicExamStudentService basicExamStudentService;
     @Resource
-    private MarkPaperService markPaperService;
-    @Resource
     private FileUploadService fileUploadService;
 
     @Override
@@ -78,9 +76,9 @@ public class AsyncBasicExamStudentImportService extends AsyncImportTaskTemplete
         tbTask.setStatus(TaskStatusEnum.RUNNING);
         TBTaskService tbTaskService = SpringContextHolder.getBean(TBTaskService.class);
         tbTaskService.updateById(tbTask);
-        int dataCount = 0;
-        int successCount = 0;
-        int errorCount = 0;
+        int dataCount;
+        int successCount;
+        int errorCount;
         boolean hasError;
         List<BasicExamStudentImport> errorDataList;
 

+ 31 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/DownloadLogicServiceImpl.java

@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.google.common.reflect.TypeToken;
 import com.google.gson.Gson;
 import com.qmth.boot.api.exception.ApiException;
+import com.qmth.boot.tools.excel.ExcelWriter;
+import com.qmth.boot.tools.excel.enums.ExcelType;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.params.DownloadPaperFileParam;
 import com.qmth.distributed.print.business.bean.query.BasicExamStudentPageQuery;
@@ -21,7 +23,6 @@ import com.qmth.distributed.print.business.enums.PaperFileDownloadExposureStatus
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.templete.service.DownloadLogicService;
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
-import com.qmth.distributed.print.business.util.PdfUtil;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.bean.params.ArraysParams;
 import com.qmth.teachcloud.common.bean.result.DictionaryResult;
@@ -49,10 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.FileCopyUtils;
 
 import javax.annotation.Resource;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.InputStream;
+import java.io.*;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -669,6 +667,7 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
         SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
         Long privilegeId = (Long) map.get("privilegeId");
         File file = null;
+        FileOutputStream outputStream = null;
         try {
             BasicExamStudentPageQuery query = (BasicExamStudentPageQuery) map.get("query");
             List<BasicExamStudentResult> list = basicExamStudentService.exportList(query, sysUser, privilegeId);
@@ -680,7 +679,25 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
 
             file = SystemConstant.getFileTempDirVar(SystemConstant.EXCEL_PREFIX);
             // 生成excel文件
-            ExcelUtil.excelExportLocal(file, BasicExamStudentDto.class, examStudentDtoList);
+            outputStream = new FileOutputStream(file);
+            ExcelWriter writer = ExcelWriter.create(ExcelType.XLSX);
+
+            List<BasicExamStudentDto> collection = new ArrayList();
+            int sheetCount = 1;
+            for (BasicExamStudentDto s : examStudentDtoList) {
+                collection.add(s);
+                if (collection.size() == ExcelUtil.DEFAULT_SHEET_COUNT) {
+                    writer.writeObjects("sheet" + sheetCount, null, BasicExamStudentDto.class, collection.listIterator());
+                    collection.clear();
+                    sheetCount++;
+                }
+            }
+            if (collection.size() > 0) {
+                writer.writeObjects("sheet" + sheetCount, null, BasicExamStudentDto.class, collection.listIterator());
+                collection.clear();
+            }
+            writer.output(outputStream);
+
             String fileName = SystemConstant.getNanoId() + SystemConstant.EXCEL_PREFIX;
             FilePathVo filePathVo = fileUploadService.uploadFile(file, UploadFileEnum.FILE, fileName);
             tbTask.setResultFilePath(JSON.toJSONString(filePathVo));
@@ -691,6 +708,14 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
             if (Objects.nonNull(file)) {
                 file.delete();
             }
+            if (outputStream != null) {
+                try {
+                    outputStream.flush();
+                    outputStream.close();
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
         }
     }
 

+ 7 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java

@@ -125,7 +125,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
         }
 
         List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(new QueryWrapper<BasicExamStudent>().lambda()
-                .select(BasicExamStudent::getId, BasicExamStudent::getCourseId, BasicExamStudent::getStudentCode, BasicExamStudent::getPaperNumber)
+                .select(BasicExamStudent::getId, BasicExamStudent::getCourseId, BasicExamStudent::getStudentCode, BasicExamStudent::getPaperNumber, BasicExamStudent::getPaperType)
                 .eq(BasicExamStudent::getSchoolId, schoolId).eq(BasicExamStudent::getExamId, examId));
         Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), Function.identity()));
 
@@ -253,7 +253,12 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                             stringJoiner.add("试卷编号[" + basicExamStudent.getPaperNumber() + "]不能绑定多个课程");
                         }
                     } else {
-                        paperNumberCourseIdMap.put(basicExamStudent.getPaperNumber(), basicExamStudent.getCourseId());
+                        long count = basicExamStudentList.stream().filter(m -> m.getPaperNumber() != null && m.getPaperNumber().equals(basicExamStudent.getPaperNumber()) && !Objects.equals(m.getCourseId(), basicExamStudent.getCourseId())).count();
+                        if (count > 0) {
+                            stringJoiner.add("试卷编号[" + basicExamStudent.getPaperNumber() + "]已绑定其它课程");
+                        } else {
+                            paperNumberCourseIdMap.put(basicExamStudent.getPaperNumber(), basicExamStudent.getCourseId());
+                        }
                     }
                 }
 

+ 38 - 34
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PdfTaskLogicServiceImpl.java

@@ -181,47 +181,51 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
 
     @Transactional
     public void updateAssignPaperType(TBTaskPdf tbTaskPdf, CreatePdfDto createPdfDto) {
-        for (ExamDetailCourse examDetailCourse : createPdfDto.getExamDetailCourseList()) {
-            ExamTaskAssignPaperType examTaskAssignPaperType = examTaskAssignPaperTypeService.extractPaperType(tbTaskPdf, examDetailCourse);
-            List<ExamStudent> examStudentList = examStudentService.listByExamDetailCourseId1(examDetailCourse.getId());
-            // 考生实际关联试卷类型
-            List<String> relatePaperTypes = new ArrayList<>();
-            List<String> paperTypes = Arrays.stream(examTaskAssignPaperType.getPaperType().split(",")).sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
-            if (CollectionUtils.isNotEmpty(examStudentList)) {
-                AtomicInteger atomicInteger = new AtomicInteger(0);
-                for (ExamStudent examStudent : examStudentList) {
-                    int i1 = atomicInteger.getAndIncrement();
-                    int mod = i1 % paperTypes.size();
-                    examStudent.setPaperType(paperTypes.get(mod));
-                    if (!relatePaperTypes.contains(examStudent.getPaperType())) {
-                        relatePaperTypes.add(examStudent.getPaperType());
+        try {
+            for (ExamDetailCourse examDetailCourse : createPdfDto.getExamDetailCourseList()) {
+                ExamTaskAssignPaperType examTaskAssignPaperType = examTaskAssignPaperTypeService.extractPaperType(tbTaskPdf, examDetailCourse);
+                List<ExamStudent> examStudentList = examStudentService.listByExamDetailCourseId1(examDetailCourse.getId());
+                // 考生实际关联试卷类型
+                List<String> relatePaperTypes = new ArrayList<>();
+                List<String> paperTypes = Arrays.stream(examTaskAssignPaperType.getPaperType().split(",")).sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
+                if (CollectionUtils.isNotEmpty(examStudentList)) {
+                    AtomicInteger atomicInteger = new AtomicInteger(0);
+                    for (ExamStudent examStudent : examStudentList) {
+                        int i1 = atomicInteger.getAndIncrement();
+                        int mod = i1 % paperTypes.size();
+                        examStudent.setPaperType(paperTypes.get(mod));
+                        if (!relatePaperTypes.contains(examStudent.getPaperType())) {
+                            relatePaperTypes.add(examStudent.getPaperType());
+                        }
                     }
-                }
-            } else if (examDetailCourse.getTotalSubjects() != null) {
-                if (examDetailCourse.getTotalSubjects().intValue() - paperTypes.size() >= 0) {
-                    relatePaperTypes.addAll(paperTypes);
-                } else {
-                    for (int i = 0; i < examDetailCourse.getTotalSubjects().intValue(); i++) {
-                        relatePaperTypes.add(paperTypes.get(i));
+                } else if (examDetailCourse.getTotalSubjects() != null) {
+                    if (examDetailCourse.getTotalSubjects().intValue() - paperTypes.size() >= 0) {
+                        relatePaperTypes.addAll(paperTypes);
+                    } else {
+                        for (int i = 0; i < examDetailCourse.getTotalSubjects().intValue(); i++) {
+                            relatePaperTypes.add(paperTypes.get(i));
+                        }
                     }
+                } else {
+                    relatePaperTypes.addAll(paperTypes);
                 }
-            } else {
-                relatePaperTypes.addAll(paperTypes);
-            }
 
-            // 更新卷型数据
-            if (!CollectionUtils.isEqualCollection(paperTypes, relatePaperTypes)) {
-                examTaskAssignPaperType.setPaperType(String.join(",", relatePaperTypes));
-                examTaskAssignPaperTypeService.updateByMultiId(examTaskAssignPaperType);
-            }
+                // 更新卷型数据
+                if (!CollectionUtils.isEqualCollection(paperTypes, relatePaperTypes)) {
+                    examTaskAssignPaperType.setPaperType(String.join(",", relatePaperTypes));
+                    examTaskAssignPaperTypeService.updateByMultiId(examTaskAssignPaperType);
+                }
 
-            examDetailCourse.setPaperType(String.join(",", relatePaperTypes));
-            examDetailCourseService.updateById(examDetailCourse);
+                examDetailCourse.setPaperType(String.join(",", relatePaperTypes));
+                examDetailCourseService.updateById(examDetailCourse);
 
-            examStudentService.updateBatchById(examStudentList);
+                examStudentService.updateBatchById(examStudentList);
 
-            // 更新考生管理表中试卷编号和卷型
-            basicExamStudentService.updatePaperNumberAndPaperTypeById(examStudentList);
+                // 更新考生管理表中试卷编号和卷型
+                basicExamStudentService.updatePaperNumberAndPaperTypeById(examStudentList);
+            }
+        } catch (Exception e) {
+            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
         }
     }
 

+ 1 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java

@@ -709,7 +709,6 @@ public class CreatePdfUtil {
             //未曝光卷型
             String unexposedPaperType = examTaskDetail.getUnexposedPaperType();
             //已曝光卷型
-            String exposedPaperType = examTaskDetail.getExposedPaperType();
             String totalPaperType = examTaskDetail.getPaperType();
             String[] paperTypes;
             if (drawRule == DrawRuleEnum.ONE) {
@@ -736,7 +735,7 @@ public class CreatePdfUtil {
             }
             paperType = randomPaperType(paperTypes, drawCount);
         } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
+            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
         }
         return paperType;
     }

+ 65 - 0
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -1076,4 +1076,69 @@
             </if>
         </where>
     </select>
+    <select id="listCourseForExamDetail" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
+        select distinct bc.id, bc.code, bc.name
+        from exam_detail ed
+        JOIN
+        exam_detail_course edc on ed.id = edc.exam_detail_id
+         JOIN
+        basic_course bc ON edc.course_id = bc.id
+         JOIN
+        (select * from basic_exam where enable = true) be ON be.id = ed.exam_id
+        <where>
+                and be.semester_id = #{semesterId}
+                and be.id = #{examId}
+            <if test="printPlanIds != null and printPlanIds != '' and printPlanIds.size() > 0">
+                AND ed.print_plan_id IN
+                <foreach collection="printPlanIds" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND ed.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND bc.teaching_room_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+    </select>
+    <select id="listPaperNumberForExamDetail" resultType="java.lang.String">
+        select distinct edc.paper_number
+        from exam_detail ed
+        JOIN
+        exam_detail_course edc on ed.id = edc.exam_detail_id
+         JOIN
+        basic_course bc ON edc.course_id = bc.id
+         JOIN
+        (select * from basic_exam where enable = true) be ON be.id = ed.exam_id
+        <where>
+                and be.semester_id = #{semesterId}
+                and be.id = #{examId}
+            <if test="printPlanIds != null and printPlanIds != '' and printPlanIds.size() > 0">
+                AND ed.print_plan_id IN
+                <foreach collection="printPlanIds" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="courseId != null">
+                AND edc.course_id = #{courseId}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND ed.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND bc.teaching_room_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+    </select>
 </mapper>

+ 1 - 0
distributed-print-business/src/main/resources/mapper/ExamTaskDetailMapper.xml

@@ -24,6 +24,7 @@
             c.id,
             a.school_id schoolId,
             a.print_plan_id printPlanId,
+            c.course_id courseId,
             bc.code courseCode,
             bc.name courseName,
             c.paper_number paperNumber,

+ 1 - 1
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -555,7 +555,7 @@
         bc.name courseName,
         et.paper_number paperNumber
         FROM
-        exam_task et let join basic_course bc on et.course_id = bc.id
+        exam_task et left join basic_course bc on et.course_id = bc.id
         <where>
             et.school_id = #{schoolId} and et.course_id = #{courseId} and et.status = #{status} and et.enable = true
             <if test="dpr != null">

+ 5 - 1
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -403,4 +403,8 @@ VALUES(2108, '重新计算', 'Calculate', 'LINK', 2002, 2, 'AUTH', '2109', 1, 0,
 
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
-VALUES(2109, '重新计算接口', '/api/admin/course/degree/report/again/calculate', 'URL', 2108, 1, 'AUTH', NULL, 1, 1, 1);
+VALUES(2109, '重新计算接口', '/api/admin/course/degree/report/again/calculate', 'URL', 2108, 1, 'AUTH', NULL, 1, 1, 1);
+
+ALTER TABLE `scan_omr_task` ADD INDEX `index1` (`student_id` ASC);
+ALTER TABLE `scan_student_paper` ADD INDEX `index1` (`student_id` ASC);
+ALTER TABLE `scan_batch_paper` ADD INDEX `idx_student_id` (`student_id` ASC);

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/DateDisposeUtils.java

@@ -142,7 +142,7 @@ public class DateDisposeUtils extends DateUtils {
             } catch (Exception e) {
             }
             try {
-                dateTime = DateUtil.parse(str.toString(), "dd/MM/yy HH:mm");
+                dateTime = DateUtil.parse(str.toString(), "MM/dd/yy HH:mm");
             } catch (Exception e) {
             }
             try {

+ 1 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ExcelUtil.java

@@ -36,6 +36,7 @@ public class ExcelUtil {
     private final static Logger log = LoggerFactory.getLogger(ExcelUtil.class);
     public static final String DEFALUT_CONTENT_TYPE = "application/vnd.ms-excel";
     public static final String DEFALUT_EXT = ".xlsx";
+    public static final int DEFAULT_SHEET_COUNT = 64000;
 
     /**
      * excel多sheet

+ 2 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java

@@ -228,4 +228,6 @@ public interface MarkStudentService extends IService<MarkStudent> {
     void updateBasicExamStudentStatus(Long markStudentId);
 
     boolean calcBatchObjectiveScore(List<Long> ids);
+
+    List<MarkStudent> listByBasicStudentId(Long basicStudentId);
 }

+ 1 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanBatchPaperService.java

@@ -19,4 +19,5 @@ public interface ScanBatchPaperService extends IService<ScanBatchPaper> {
 
 	void update(ScanBatch batch, ScanPaper paper, Long studentId, Integer paperNumber);
 
+    void removeByStudentId(Long studentId);
 }

+ 2 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPaperPageService.java

@@ -23,4 +23,6 @@ public interface ScanPaperPageService extends IMppService<ScanPaperPage> {
 	List<ScanPaperPage> listByPaperList(List<Long> paperIds);
 
 	List<ScanPaperPageVo> listByStudentIds(List<Long> studentIds);
+
+    void removeByPaperId(Long paperId);
 }

+ 27 - 6
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -163,7 +163,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     private MarkTrackService markTrackService;
 
     @Resource
-    MarkTaskService markTaskService;
+    private MarkTaskService markTaskService;
+    @Resource
+    private ScanStudentPaperService scanStudentPaperService;
+    @Resource
+    private ScanBatchPaperService scanBatchPaperService;
 
     @Override
     public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
@@ -694,8 +698,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 studentObjectiveAnswerDto.setStandardAnswer(q != null ? q.getAnswer() : null);
                 studentObjectiveAnswerDto.setAnswer(answer);
                 studentObjectiveAnswerDto.setScore(Double.valueOf(answerScore));
-                studentObjectiveAnswerDto.setTotalScore(q != null ? q.getTotalScore() : 0);
-                studentObjectiveAnswerDto.setExist(q != null && q.getTotalScore() > 0);
+                studentObjectiveAnswerDto.setTotalScore(q != null && q.getTotalScore() != null ? q.getTotalScore() : 0);
+                studentObjectiveAnswerDto.setExist(q != null && q.getTotalScore() != null && q.getTotalScore() > 0);
                 studentObjectiveAnswerDto.setQuestionType(q != null ? q.getQuestionType() : 0);
                 answerDtoList.add(studentObjectiveAnswerDto);
 
@@ -1792,9 +1796,19 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
 
     @Override
     public void deleteByBasicStudentId(Long basicStudentId) {
-        UpdateWrapper<MarkStudent> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().eq(MarkStudent::getBasicStudentId, basicStudentId);
-        this.remove(updateWrapper);
+        List<MarkStudent> markStudentList = this.listByBasicStudentId(basicStudentId);
+        for (MarkStudent markStudent : markStudentList) {
+            List<ScanStudentPaper> scanStudentPaperList = scanStudentPaperService.findByStudentId(markStudent.getId());
+            scanStudentPaperService.removeByStudentId(markStudent.getId());
+            scanBatchPaperService.removeByStudentId(markStudent.getId());
+            scanOmrTaskService.deleteByStudentId(markStudent.getExamId(), markStudent.getId());
+            if (CollectionUtils.isNotEmpty(scanStudentPaperList)) {
+                for (ScanStudentPaper scanStudentPaper : scanStudentPaperList) {
+                    scanPaperPageService.removeByPaperId(scanStudentPaper.getPaperId());
+                    scanPaperService.removeById(scanStudentPaper.getPaperId());
+                }
+            }
+        }
     }
 
     @Override
@@ -1934,4 +1948,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         }
         return true;
     }
+
+    @Override
+    public List<MarkStudent> listByBasicStudentId(Long basicStudentId) {
+        QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(MarkStudent::getBasicStudentId, basicStudentId);
+        return this.list(queryWrapper);
+    }
 }

+ 6 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkUserGroupServiceImpl.java

@@ -315,9 +315,12 @@ public class MarkUserGroupServiceImpl extends ServiceImpl<MarkUserGroupMapper, M
     @Override
     public void deleteByExamIdAndPaperNumberAndGroupNumber(Long examId, String paperNumber, Integer groupNumber) {
         UpdateWrapper<MarkUserGroup> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().eq(MarkUserGroup::getExamId, examId)
-                .eq(MarkUserGroup::getPaperNumber, paperNumber)
-                .eq(MarkUserGroup::getGroupNumber, groupNumber);
+        LambdaUpdateWrapper<MarkUserGroup> lambda = updateWrapper.lambda();
+        lambda.eq(MarkUserGroup::getExamId, examId)
+                .eq(MarkUserGroup::getPaperNumber, paperNumber);
+        if (groupNumber != null) {
+            lambda.eq(MarkUserGroup::getGroupNumber, groupNumber);
+        }
         this.remove(updateWrapper);
     }
 

+ 12 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanBatchPaperServiceImpl.java

@@ -2,6 +2,7 @@ package com.qmth.teachcloud.mark.service.impl;
 
 import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.mark.entity.ScanStudentPaper;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -16,7 +17,7 @@ import com.qmth.teachcloud.mark.service.ScanBatchPaperService;
 
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
  * @author xf
@@ -34,11 +35,11 @@ public class ScanBatchPaperServiceImpl extends MppServiceImpl<ScanBatchPaperMapp
         lw.eq(ScanBatchPaper::getPaperIndex, paperIndex);
         return baseMapper.selectOne(wrapper);
     }
-    
+
     @Override
     @Transactional
     public void update(ScanBatch batch, ScanPaper paper, Long studentId, Integer paperNumber) {
-    	ScanBatchPaper batchPaperEntity = new ScanBatchPaper();
+        ScanBatchPaper batchPaperEntity = new ScanBatchPaper();
         batchPaperEntity.setBatchId(batch.getId());
         batchPaperEntity.setStudentId(studentId);
         batchPaperEntity.setPaperIndex(paperNumber);
@@ -47,4 +48,12 @@ public class ScanBatchPaperServiceImpl extends MppServiceImpl<ScanBatchPaperMapp
         batchPaperEntity.setAssigned(paper.getAssigned());
         saveOrUpdateByMultiId(batchPaperEntity);
     }
+
+    @Override
+    public void removeByStudentId(Long studentId) {
+        QueryWrapper<ScanBatchPaper> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanBatchPaper> lw = wrapper.lambda();
+        lw.eq(ScanBatchPaper::getStudentId, studentId);
+        this.remove(wrapper);
+    }
 }

+ 45 - 38
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperPageServiceImpl.java

@@ -23,47 +23,54 @@ import com.qmth.teachcloud.mark.service.ScanPaperPageService;
  */
 @Service
 public class ScanPaperPageServiceImpl extends MppServiceImpl<ScanPaperPageMapper, ScanPaperPage>
-		implements ScanPaperPageService {
+        implements ScanPaperPageService {
 
-	@Override
-	public ScanPaperPage findPaperIdAndIndex(Long paperId, Integer index) {
-		if (paperId == null) {
-			throw new ParameterException("paperId不能为空");
-		}
-		if (index == null) {
-			throw new ParameterException("index不能为空");
-		}
-		QueryWrapper<ScanPaperPage> wrapper = new QueryWrapper<>();
-		LambdaQueryWrapper<ScanPaperPage> lw = wrapper.lambda();
-		lw.eq(ScanPaperPage::getPaperId, paperId);
-		lw.eq(ScanPaperPage::getPageIndex, index);
-		return this.getOne(wrapper);
-	}
+    @Override
+    public ScanPaperPage findPaperIdAndIndex(Long paperId, Integer index) {
+        if (paperId == null) {
+            throw new ParameterException("paperId不能为空");
+        }
+        if (index == null) {
+            throw new ParameterException("index不能为空");
+        }
+        QueryWrapper<ScanPaperPage> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanPaperPage> lw = wrapper.lambda();
+        lw.eq(ScanPaperPage::getPaperId, paperId);
+        lw.eq(ScanPaperPage::getPageIndex, index);
+        return this.getOne(wrapper);
+    }
 
-	@Override
-	public List<ScanPaperPage> listByPaperId(Long paperId) {
-		if (paperId == null) {
-			throw new ParameterException("paperId不能为空");
-		}
-		QueryWrapper<ScanPaperPage> wrapper = new QueryWrapper<>();
-		LambdaQueryWrapper<ScanPaperPage> lw = wrapper.lambda();
-		lw.eq(ScanPaperPage::getPaperId, paperId);
-		lw.orderByAsc(ScanPaperPage::getPageIndex);
-		return baseMapper.selectList(wrapper);
-	}
+    @Override
+    public List<ScanPaperPage> listByPaperId(Long paperId) {
+        if (paperId == null) {
+            throw new ParameterException("paperId不能为空");
+        }
+        QueryWrapper<ScanPaperPage> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanPaperPage> lw = wrapper.lambda();
+        lw.eq(ScanPaperPage::getPaperId, paperId);
+        lw.orderByAsc(ScanPaperPage::getPageIndex);
+        return baseMapper.selectList(wrapper);
+    }
 
-	@Override
-	public List<ScanPaperPage> listByPaperList(List<Long> paperIds) {
-		QueryWrapper<ScanPaperPage> wrapper = new QueryWrapper<>();
-		LambdaQueryWrapper<ScanPaperPage> lw = wrapper.lambda();
-		lw.in(ScanPaperPage::getPaperId, paperIds);
-		wrapper.orderByAsc("paper_id", "page_index");
-		return this.list(wrapper);
-	}
+    @Override
+    public List<ScanPaperPage> listByPaperList(List<Long> paperIds) {
+        QueryWrapper<ScanPaperPage> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanPaperPage> lw = wrapper.lambda();
+        lw.in(ScanPaperPage::getPaperId, paperIds);
+        wrapper.orderByAsc("paper_id", "page_index");
+        return this.list(wrapper);
+    }
 
-	@Override
-	public List<ScanPaperPageVo> listByStudentIds(List<Long> studentIds) {
-		return baseMapper.listByStudentIds(studentIds);
-	}
+    @Override
+    public List<ScanPaperPageVo> listByStudentIds(List<Long> studentIds) {
+        return baseMapper.listByStudentIds(studentIds);
+    }
+
+    @Override
+    public void removeByPaperId(Long paperId) {
+        QueryWrapper<ScanPaperPage> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(ScanPaperPage::getPaperId, paperId);
+        this.remove(queryWrapper);
+    }
 
 }