xiaofei 6 сар өмнө
parent
commit
4ecc608ace
37 өөрчлөгдсөн 304 нэмэгдсэн , 137 устгасан
  1. 7 7
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/BasicExamStudentParam.java
  2. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/BasicCardRule.java
  3. 2 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicCardRuleService.java
  4. 10 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicCardRuleServiceImpl.java
  5. 8 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  6. 6 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java
  7. 3 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java
  8. 12 9
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  9. 9 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/DownloadLogicServiceImpl.java
  10. 9 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java
  11. 0 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PdfTaskLogicServiceImpl.java
  12. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java
  13. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java
  14. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePrintPdfUtil.java
  15. 2 1
      distributed-print/install/mysql/init/teachcloud_db.sql
  16. 3 0
      distributed-print/install/mysql/upgrade/3.4.2.sql
  17. 7 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanStudentController.java
  18. 5 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java
  19. 7 5
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/MarkQuestion.java
  20. 1 3
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ExamNumberStyleEnum.java
  21. 6 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/FileUtil.java
  22. 11 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scananswer/AnswerQueryVo.java
  23. 12 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/AbInfoVo.java
  24. 19 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentScoreDetailDto.java
  25. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java
  26. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkQuestionAnswerService.java
  27. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkQuestionService.java
  28. 7 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java
  29. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanOmrTaskService.java
  30. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java
  31. 6 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionAnswerServiceImpl.java
  32. 11 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java
  33. 96 52
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  34. 17 6
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java
  35. 0 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperServiceImpl.java
  36. 16 7
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml
  37. 1 1
      teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

+ 7 - 7
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/BasicExamStudentParam.java

@@ -50,16 +50,16 @@ public class BasicExamStudentParam {
     private String siteNumber;
     private String siteNumber;
 
 
     @ApiModelProperty("学院")
     @ApiModelProperty("学院")
-    @NotNull(message = "请输入学院")
-    @Length(min = 1, message = "请输入学院")
+//    @NotNull(message = "请输入学院")
+//    @Length(min = 1, message = "请输入学院")
     private String collegeName;
     private String collegeName;
 
 
     @ApiModelProperty("专业")
     @ApiModelProperty("专业")
     private String majorName;
     private String majorName;
 
 
     @ApiModelProperty("教学班")
     @ApiModelProperty("教学班")
-    @NotNull(message = "请输入教学班")
-    @Length(min = 1, message = "请输入教学班")
+//    @NotNull(message = "请输入教学班")
+//    @Length(min = 1, message = "请输入教学班")
     private String teachClassName;
     private String teachClassName;
     @ApiModelProperty("行政班")
     @ApiModelProperty("行政班")
     private String className;
     private String className;
@@ -74,18 +74,18 @@ public class BasicExamStudentParam {
     private String teacherCode;
     private String teacherCode;
 
 
     @ApiModelProperty("考试开始时间")
     @ApiModelProperty("考试开始时间")
-    @NotNull(message = "请选择考试时间")
+//    @NotNull(message = "请选择考试时间")
     private Long examStartTime;
     private Long examStartTime;
 
 
     @ApiModelProperty("考试结束时间")
     @ApiModelProperty("考试结束时间")
-    @NotNull(message = "请选择考试时间")
+//    @NotNull(message = "请选择考试时间")
     private Long examEndTime;
     private Long examEndTime;
 
 
     @ApiModelProperty("校区(考点)")
     @ApiModelProperty("校区(考点)")
     private String examPlace;
     private String examPlace;
 
 
     @ApiModelProperty("考试教室(考场)")
     @ApiModelProperty("考试教室(考场)")
-    @NotBlank(message = "请输入考试教室(考场)")
+//    @NotBlank(message = "请输入考试教室(考场)")
     private String examRoom;
     private String examRoom;
     @ApiModelProperty("扩展字段")
     @ApiModelProperty("扩展字段")
     private String extendFields;
     private String extendFields;

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/BasicCardRule.java

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
+import com.qmth.teachcloud.common.enums.ExamNumberStyleEnum;
 import com.qmth.teachcloud.common.enums.PaperTypeEnum;
 import com.qmth.teachcloud.common.enums.PaperTypeEnum;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;

+ 2 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicCardRuleService.java

@@ -25,4 +25,6 @@ public interface BasicCardRuleService extends IService<BasicCardRule> {
     boolean saveCardRule(BasicCardRule cardRule);
     boolean saveCardRule(BasicCardRule cardRule);
 
 
     boolean enable(Long id, Boolean enable);
     boolean enable(Long id, Boolean enable);
+
+    BasicCardRule getByExamId(Long examId);
 }
 }

+ 10 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicCardRuleServiceImpl.java

@@ -11,7 +11,7 @@ import com.qmth.distributed.print.business.entity.BasicExamRule;
 import com.qmth.distributed.print.business.entity.ExamCard;
 import com.qmth.distributed.print.business.entity.ExamCard;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.enums.CardRequiredFieldsEnum;
 import com.qmth.distributed.print.business.enums.CardRequiredFieldsEnum;
-import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
+import com.qmth.teachcloud.common.enums.ExamNumberStyleEnum;
 import com.qmth.teachcloud.common.enums.PaperTypeEnum;
 import com.qmth.teachcloud.common.enums.PaperTypeEnum;
 import com.qmth.distributed.print.business.mapper.BasicCardRuleMapper;
 import com.qmth.distributed.print.business.mapper.BasicCardRuleMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.service.*;
@@ -192,4 +192,13 @@ public class BasicCardRuleServiceImpl extends ServiceImpl<BasicCardRuleMapper, B
                 .eq(BasicCardRule::getId, id);
                 .eq(BasicCardRule::getId, id);
         return this.update(updateWrapper);
         return this.update(updateWrapper);
     }
     }
+
+    @Override
+    public BasicCardRule getByExamId(Long examId) {
+        BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(examId);
+        if (basicPrintConfig != null) {
+            return this.getById(basicPrintConfig.getCardRuleId());
+        }
+        return null;
+    }
 }
 }

+ 8 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -13,11 +13,8 @@ import com.qmth.distributed.print.business.bean.params.BasicExamStudentParam;
 import com.qmth.distributed.print.business.bean.query.BasicExamStudentPageQuery;
 import com.qmth.distributed.print.business.bean.query.BasicExamStudentPageQuery;
 import com.qmth.distributed.print.business.bean.query.BasicExamStudentQuery;
 import com.qmth.distributed.print.business.bean.query.BasicExamStudentQuery;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
-import com.qmth.distributed.print.business.entity.BasicCardRule;
-import com.qmth.distributed.print.business.entity.BasicExamRule;
-import com.qmth.distributed.print.business.entity.ExamStudent;
-import com.qmth.distributed.print.business.entity.ExamTaskDetail;
-import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
+import com.qmth.distributed.print.business.entity.*;
+import com.qmth.teachcloud.common.enums.ExamNumberStyleEnum;
 import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
 import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
 import com.qmth.distributed.print.business.mapper.BasicExamStudentMapper;
 import com.qmth.distributed.print.business.mapper.BasicExamStudentMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.service.*;
@@ -31,6 +28,7 @@ import com.qmth.teachcloud.common.enums.*;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.util.ConvertUtil;
 import com.qmth.teachcloud.common.util.ConvertUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
+import com.qmth.teachcloud.mark.dto.mark.AbInfoVo;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.service.MarkPaperService;
 import com.qmth.teachcloud.mark.service.MarkPaperService;
@@ -85,6 +83,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     @Resource
     @Resource
     private ExamStudentService examStudentService;
     private ExamStudentService examStudentService;
     @Resource
     @Resource
+    private BasicCardRuleService basicCardRuleService;
+    @Resource
     private TBTaskService tbTaskService;
     private TBTaskService tbTaskService;
     @Resource
     @Resource
     private AsyncBasicExamStudentExportService asyncBasicExamStudentExportService;
     private AsyncBasicExamStudentExportService asyncBasicExamStudentExportService;
@@ -480,6 +480,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         Map<String, List<BasicExamStudent>> stringMap = basicExamStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperNumber())).collect(Collectors.groupingBy(BasicExamStudent::getPaperNumber));
         Map<String, List<BasicExamStudent>> stringMap = basicExamStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperNumber())).collect(Collectors.groupingBy(BasicExamStudent::getPaperNumber));
         for (Map.Entry<String, List<BasicExamStudent>> entry : stringMap.entrySet()) {
         for (Map.Entry<String, List<BasicExamStudent>> entry : stringMap.entrySet()) {
             BasicExamStudent basicExamStudent = entry.getValue().get(0);
             BasicExamStudent basicExamStudent = entry.getValue().get(0);
+            AbInfoVo abInfoVo = markStudentService.findExamTaskPaperTypeOpenStatus(examId, entry.getKey());
+            boolean containPaperType = abInfoVo!= null && (ExamNumberStyleEnum.PRINT.equals(abInfoVo.getExamNumberStyle()) || (ExamNumberStyleEnum.FILL.equals(abInfoVo.getExamNumberStyle()) && !abInfoVo.getOpenAb()));
             MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, entry.getKey());
             MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, entry.getKey());
             if (markPaper == null && ExamModelEnum.MODEL4.equals(basicExam.getExamModel())) {
             if (markPaper == null && ExamModelEnum.MODEL4.equals(basicExam.getExamModel())) {
                 String paperType = SystemConstant.DEFAULT_PAPER_TYPE_A;
                 String paperType = SystemConstant.DEFAULT_PAPER_TYPE_A;
@@ -491,7 +493,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                 Set<String> secretNumberSet = new HashSet<>();
                 Set<String> secretNumberSet = new HashSet<>();
                 MarkPaper finalMarkPaper = markPaper;
                 MarkPaper finalMarkPaper = markPaper;
                 entry.getValue().forEach(m -> {
                 entry.getValue().forEach(m -> {
-                    MarkStudent markStudent = markStudentService.assembleByBasicExamStudent(m, finalMarkPaper, secretNumberSet);
+                    MarkStudent markStudent = markStudentService.assembleByBasicExamStudent(m, finalMarkPaper, secretNumberSet, containPaperType);
                     if (markStudent != null) {
                     if (markStudent != null) {
                         markStudentList.add(markStudent);
                         markStudentList.add(markStudent);
                     }
                     }

+ 6 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java

@@ -126,13 +126,13 @@ public class ClientServiceImpl implements ClientService {
                 || ExamDetailStatusEnum.READY.name().equals(examDetail.getStatus())) {
                 || ExamDetailStatusEnum.READY.name().equals(examDetail.getStatus())) {
             throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
             throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
         }
         }
+        // 更新考场进度、状态、打印结束时间
+        UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(ExamDetail::getPrintProgress, printProgress).set(ExamDetail::getPrintEndTime, System.currentTimeMillis()).set(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH).eq(ExamDetail::getId, examDetailId);
+        examDetailService.update(updateWrapper);
 
 
+        // true:打印和批量打印  false:重打
         if (isPrint) {
         if (isPrint) {
-            // 更新考场进度、状态、打印结束时间
-            UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(ExamDetail::getPrintProgress, printProgress).set(ExamDetail::getPrintEndTime, System.currentTimeMillis()).set(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH).eq(ExamDetail::getId, examDetailId);
-            examDetailService.update(updateWrapper);
-
             // 所有考场打印完成,更新印刷计划状态
             // 所有考场打印完成,更新印刷计划状态
             examPrintPlanService.updateStatusById(examDetail.getPrintPlanId(), PrintPlanStatusEnum.FINISH);
             examPrintPlanService.updateStatusById(examDetail.getPrintPlanId(), PrintPlanStatusEnum.FINISH);
             // 更新曝光卷型
             // 更新曝光卷型
@@ -151,12 +151,8 @@ public class ClientServiceImpl implements ClientService {
             clientPrintData.setCreateId(sysUser.getId());
             clientPrintData.setCreateId(sysUser.getId());
             clientPrintData.setCreateTime(System.currentTimeMillis());
             clientPrintData.setCreateTime(System.currentTimeMillis());
             clientPrintDataService.save(clientPrintData);
             clientPrintDataService.save(clientPrintData);
-        } else {
-            // 更新打印结束时间
-            UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(ExamDetail::getPrintEndTime, System.currentTimeMillis()).eq(ExamDetail::getId, examDetailId);
-            examDetailService.update(updateWrapper);
         }
         }
+
         return true;
         return true;
     }
     }
 
 

+ 3 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java

@@ -36,6 +36,7 @@ import com.qmth.teachcloud.common.enums.PageSizeEnum;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.distributed.print.business.util.ExamTaskUtil;
 import com.qmth.distributed.print.business.util.ExamTaskUtil;
+import com.qmth.teachcloud.common.util.Base64Util;
 import com.qmth.teachcloud.common.util.FileUtil;
 import com.qmth.teachcloud.common.util.FileUtil;
 import com.qmth.teachcloud.common.util.HtmlToPdfUtil;
 import com.qmth.teachcloud.common.util.HtmlToPdfUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -435,6 +436,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
 
 
     @Override
     @Override
     public void downloadCard(HttpServletResponse response, String id) {
     public void downloadCard(HttpServletResponse response, String id) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         String rootPath = null;
         String rootPath = null;
         try {
         try {
             // 题卡详细信息
             // 题卡详细信息
@@ -491,7 +493,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
             }
             }
 
 
             String zipFileName = examCard.getTitle() + SystemConstant.ZIP_PREFIX;
             String zipFileName = examCard.getTitle() + SystemConstant.ZIP_PREFIX;
-            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName);
+            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, new String(Base64Util.decode(sysUser.getPassword())));
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         } finally {
         } finally {

+ 12 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -896,13 +896,15 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             List<PaperInfoVo> filePathVoList = examTaskDetail.getPaperInfoVoList();
             List<PaperInfoVo> filePathVoList = examTaskDetail.getPaperInfoVoList();
             for (PaperInfoVo paperInfoVo : filePathVoList) {
             for (PaperInfoVo paperInfoVo : filePathVoList) {
                 BasicAttachment basicAttachment = basicAttachmentService.getById(paperInfoVo.getAttachmentId());
                 BasicAttachment basicAttachment = basicAttachmentService.getById(paperInfoVo.getAttachmentId());
-                FilePathVo filePathVo = JSON.parseObject(basicAttachment.getPath(), FilePathVo.class);
-                InputStream inputStream = fileUploadService.downloadFile(filePathVo.getPath(), filePathVo.getUploadType(), filePathVo.getType());
-                List<ConvertJpgStorage> convertJpgStorageList = htmlToJpgUtil.convertPdfToJpg(Long.valueOf(paperInfoVo.getAttachmentId()), inputStream, sysUser.getId());
-                if (convertJpgStorageList.size() > 0) {
-                    paperInfoVo.setJpgAttachmentId(JSON.toJSONString(convertJpgStorageList));
-                } else {
-                    paperInfoVo.setJpgAttachmentId(null);
+                if (basicAttachment != null) {
+                    FilePathVo filePathVo = JSON.parseObject(basicAttachment.getPath(), FilePathVo.class);
+                    InputStream inputStream = fileUploadService.downloadFile(filePathVo.getPath(), filePathVo.getUploadType(), filePathVo.getType());
+                    List<ConvertJpgStorage> convertJpgStorageList = htmlToJpgUtil.convertPdfToJpg(Long.valueOf(paperInfoVo.getAttachmentId()), inputStream, sysUser.getId());
+                    if (convertJpgStorageList.size() > 0) {
+                        paperInfoVo.setJpgAttachmentId(JSON.toJSONString(convertJpgStorageList));
+                    } else {
+                        paperInfoVo.setJpgAttachmentId(null);
+                    }
                 }
                 }
             }
             }
             examTaskDetail.setPaperAttachmentIds(JSON.toJSONString(filePathVoList));
             examTaskDetail.setPaperAttachmentIds(JSON.toJSONString(filePathVoList));
@@ -1011,6 +1013,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
 
     @Override
     @Override
     public void paperDownload(HttpServletResponse response, Long examTaskId) {
     public void paperDownload(HttpServletResponse response, Long examTaskId) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         ExamTaskDetailPdfDownloadDto examTaskDetailPdfDownloadDto = examTaskDetailService.findPdfDownload(examTaskId);
         ExamTaskDetailPdfDownloadDto examTaskDetailPdfDownloadDto = examTaskDetailService.findPdfDownload(examTaskId);
         Optional.ofNullable(examTaskDetailPdfDownloadDto).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("数据异常"));
         Optional.ofNullable(examTaskDetailPdfDownloadDto).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("数据异常"));
 
 
@@ -1076,7 +1079,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 }
                 }
             }
             }
             String zipFileName = downloadPathFile.getName() + SystemConstant.ZIP_PREFIX;
             String zipFileName = downloadPathFile.getName() + SystemConstant.ZIP_PREFIX;
-            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName);
+            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, new String(Base64Util.decode(sysUser.getPassword())));
         } catch (Exception e) {
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception("文件下载失败");
             throw ExceptionResultEnum.ERROR.exception("文件下载失败");
         } finally {
         } finally {
@@ -1336,7 +1339,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 if (StringUtils.isNotBlank(paperInfoVoList.get(0).getUuid())) {
                 if (StringUtils.isNotBlank(paperInfoVoList.get(0).getUuid())) {
                     // 删除临时数据
                     // 删除临时数据
                     List<Long> paperIdList = paperInfoVoList.stream().filter(m -> m.getPaperId() != null).map(PaperInfoVo::getPaperId).collect(Collectors.toList());
                     List<Long> paperIdList = paperInfoVoList.stream().filter(m -> m.getPaperId() != null).map(PaperInfoVo::getPaperId).collect(Collectors.toList());
-                    if(CollectionUtils.isNotEmpty(paperIdList)) {
+                    if (CollectionUtils.isNotEmpty(paperIdList)) {
                         QueryWrapper<ExamTaskPaperData> deleteWrapper = new QueryWrapper<>();
                         QueryWrapper<ExamTaskPaperData> deleteWrapper = new QueryWrapper<>();
                         deleteWrapper.lambda().eq(ExamTaskPaperData::getExamId, examTask.getExamId())
                         deleteWrapper.lambda().eq(ExamTaskPaperData::getExamId, examTask.getExamId())
                                 .eq(ExamTaskPaperData::getPaperNumber, paperInfoVoList.get(0).getUuid())
                                 .eq(ExamTaskPaperData::getPaperNumber, paperInfoVoList.get(0).getUuid())

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

@@ -69,6 +69,8 @@ import java.util.stream.Stream;
 public class DownloadLogicServiceImpl implements DownloadLogicService {
 public class DownloadLogicServiceImpl implements DownloadLogicService {
     private final static Logger log = LoggerFactory.getLogger(DownloadLogicServiceImpl.class);
     private final static Logger log = LoggerFactory.getLogger(DownloadLogicServiceImpl.class);
 
 
+    @Resource
+    private SysUserService sysUserService;
     @Resource
     @Resource
     ExamTaskDetailService examTaskDetailService;
     ExamTaskDetailService examTaskDetailService;
     @Resource
     @Resource
@@ -216,7 +218,8 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
                     stringJoiner = SystemConstant.getDirName(stringJoiner, UploadFileEnum.FILE, true);
                     stringJoiner = SystemConstant.getDirName(stringJoiner, UploadFileEnum.FILE, true);
                     stringJoiner.add("印刷任务管理_批量下载PDF_" + time).add(SystemConstant.ZIP_PREFIX);
                     stringJoiner.add("印刷任务管理_批量下载PDF_" + time).add(SystemConstant.ZIP_PREFIX);
                     String zipDirName = FileUtil.replaceSplit(stringJoiner.toString());
                     String zipDirName = FileUtil.replaceSplit(stringJoiner.toString());
-                    JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName);
+                    SysUser sysUser = sysUserService.getById(tbTask.getCreateId());
+                    JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName, new String(Base64Util.decode(sysUser.getPassword())));
                     tbTask.setResultFilePath(jsonObject.toJSONString());
                     tbTask.setResultFilePath(jsonObject.toJSONString());
                 }
                 }
             }
             }
@@ -327,7 +330,8 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
                     }
                     }
                 }
                 }
             }
             }
-            JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName);
+            SysUser sysUser = sysUserService.getById(tbTask.getCreateId());
+            JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName, new String(Base64Util.decode(sysUser.getPassword())));
             tbTask.setResultFilePath(jsonObject.toJSONString());
             tbTask.setResultFilePath(jsonObject.toJSONString());
             map.put(SystemConstant.DATA_COUNT, examTasks.size());
             map.put(SystemConstant.DATA_COUNT, examTasks.size());
         } catch (Exception e) {
         } catch (Exception e) {
@@ -396,11 +400,10 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
      *
      *
      * @param map
      * @param map
      * @return
      * @return
-     * @throws Exception
      */
      */
     @Override
     @Override
     @Transactional
     @Transactional
-    public Map<String, Object> executeDownloadScoreLogic(Map<String, Object> map) throws Exception {
+    public Map<String, Object> executeDownloadScoreLogic(Map<String, Object> map) {
         File zipFile = null;
         File zipFile = null;
         List<File> sourceFiles = null;
         List<File> sourceFiles = null;
         List<TSyncExamStudentScore> errorTSyncExamStudentScoreList = null;
         List<TSyncExamStudentScore> errorTSyncExamStudentScoreList = null;
@@ -661,7 +664,8 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
             String excelLocalPath = zipLocalRootPath + File.separator + "下载清单" + "." + SystemConstant.XLSX;
             String excelLocalPath = zipLocalRootPath + File.separator + "下载清单" + "." + SystemConstant.XLSX;
             FileUtils.copyInputStreamToFile(in, new File(excelLocalPath));
             FileUtils.copyInputStreamToFile(in, new File(excelLocalPath));
             // 所有文件
             // 所有文件
-            JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName);
+            SysUser sysUser = sysUserService.getById(tbTask.getCreateId());
+            JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName, new String(Base64Util.decode(sysUser.getPassword())));
             tbTask.setResultFilePath(jsonObject.toJSONString());
             tbTask.setResultFilePath(jsonObject.toJSONString());
             map.put("count", examTaskDetailDtoList.size());
             map.put("count", examTaskDetailDtoList.size());
         } catch (Exception e) {
         } catch (Exception e) {

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

@@ -34,6 +34,7 @@ import com.qmth.teachcloud.mark.dto.mark.setting.MarkGroupSingleDto;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.service.MarkGroupService;
 import com.qmth.teachcloud.mark.service.MarkGroupService;
 import com.qmth.teachcloud.mark.service.MarkPaperService;
 import com.qmth.teachcloud.mark.service.MarkPaperService;
+import com.qmth.teachcloud.mark.service.MarkQuestionAnswerService;
 import com.qmth.teachcloud.mark.service.MarkQuestionService;
 import com.qmth.teachcloud.mark.service.MarkQuestionService;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -96,7 +97,8 @@ public class ImportLogicServiceImpl implements ImportLogicService {
     private ExamTaskService examTaskService;
     private ExamTaskService examTaskService;
     @Resource
     @Resource
     private ExamStudentService examStudentService;
     private ExamStudentService examStudentService;
-
+    @Resource
+    private MarkQuestionAnswerService markQuestionAnswerService;
 
 
     @Transactional
     @Transactional
     @Override
     @Override
@@ -1039,7 +1041,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                 markQuestion.setSubNumber(subNumber);
                 markQuestion.setSubNumber(subNumber);
                 markQuestion.setMainTitle(mainTitle);
                 markQuestion.setMainTitle(mainTitle);
                 // todo 2024-10-16
                 // todo 2024-10-16
-//                markQuestion.setAnswer(answer);
+                markQuestion.setAnswer(answer);
                 markQuestion.setOptionCount(optionCount);
                 markQuestion.setOptionCount(optionCount);
                 markQuestion.setTotalScore(totalScore);
                 markQuestion.setTotalScore(totalScore);
                 // todo 2024-10-16
                 // todo 2024-10-16
@@ -1058,11 +1060,14 @@ public class ImportLogicServiceImpl implements ImportLogicService {
             Map<String, List<MarkQuestion>> markQuestionMap = markQuestionList.stream().collect(Collectors.groupingBy(MarkQuestion::getPaperNumber));
             Map<String, List<MarkQuestion>> markQuestionMap = markQuestionList.stream().collect(Collectors.groupingBy(MarkQuestion::getPaperNumber));
             markQuestionMap.forEach((k, v) -> {
             markQuestionMap.forEach((k, v) -> {
                 // 优先删除该试卷编号下的客观题
                 // 优先删除该试卷编号下的客观题
-                markQuestionService.remove(new QueryWrapper<MarkQuestion>().lambda().eq(MarkQuestion::getExamId, examId)
-                        .eq(MarkQuestion::getPaperNumber, k).eq(MarkQuestion::getObjective, true));
+                markQuestionService.deleteByExamIdAndPaperNumberAndObjective(examId, k, true);
                 // 保存客观题
                 // 保存客观题
                 markQuestionService.saveBatch(v);
                 markQuestionService.saveBatch(v);
                 markQuestionService.updateMarkPaperScore(examId, k);
                 markQuestionService.updateMarkPaperScore(examId, k);
+
+                // 增加客观题
+                markQuestionAnswerService.deleteByExamIdAndPaperNumber(examId, k);
+                markQuestionAnswerService.saveByMarkQuestion(examId, k, v, true);
             });
             });
             // 更改试卷结构状态为已提交
             // 更改试卷结构状态为已提交
             Set<String> paperNumberSet = markQuestionMap.keySet();
             Set<String> paperNumberSet = markQuestionMap.keySet();

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

@@ -3,7 +3,6 @@ package com.qmth.distributed.print.business.templete.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.qmth.distributed.print.business.bean.dto.CreatePdfDto;
 import com.qmth.distributed.print.business.bean.dto.CreatePdfDto;

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

@@ -224,7 +224,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     stringJoiner = SystemConstant.getDirName(stringJoiner, UploadFileEnum.FILE, true);
                     stringJoiner = SystemConstant.getDirName(stringJoiner, UploadFileEnum.FILE, true);
                     stringJoiner.add("印刷任务管理_批量下载PDF_" + time).add(SystemConstant.ZIP_PREFIX);
                     stringJoiner.add("印刷任务管理_批量下载PDF_" + time).add(SystemConstant.ZIP_PREFIX);
                     String zipDirName = FileUtil.replaceSplit(stringJoiner.toString());
                     String zipDirName = FileUtil.replaceSplit(stringJoiner.toString());
-                    JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName);
+                    SysUser sysUser = sysUserService.getById(tbTask.getCreateId());
+                    JSONObject jsonObject = SystemConstant.createZip(zipFile, zipLocalRootPath, zipDirName, new String(Base64Util.decode(sysUser.getPassword())));
                     tbTask.setResultFilePath(jsonObject.toJSONString());
                     tbTask.setResultFilePath(jsonObject.toJSONString());
                 }
                 }
             }
             }

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

@@ -10,7 +10,7 @@ import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.dto.pdf.ExamStudentInfo;
 import com.qmth.distributed.print.business.bean.dto.pdf.ExamStudentInfo;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
-import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
+import com.qmth.teachcloud.common.enums.ExamNumberStyleEnum;
 import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
 import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
 import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
 import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.service.*;

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

@@ -188,7 +188,7 @@ public class CreatePrintPdfUtil {
                 }
                 }
             }
             }
 
 
-            // 少于40行,默认补齐
+            // 少于30行,默认补齐
             if (forCount < 30) {
             if (forCount < 30) {
                 for (int i = 0; i < 30 - forCount; i++) {
                 for (int i = 0; i < 30 - forCount; i++) {
                     for (String headKey : headKeys) {
                     for (String headKey : headKeys) {
@@ -223,7 +223,7 @@ public class CreatePrintPdfUtil {
                 }
                 }
             }
             }
 
 
-            // 少于40行,默认补齐
+            // 少于30行,默认补齐
             if (studentPlateCount < 30) {
             if (studentPlateCount < 30) {
                 for (int i = 0; i < 30 - studentPlateCount; i++) {
                 for (int i = 0; i < 30 - studentPlateCount; i++) {
                     for (String headKey : headKeys) {
                     for (String headKey : headKeys) {

+ 2 - 1
distributed-print/install/mysql/init/teachcloud_db.sql

@@ -3551,7 +3551,7 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (967, '评卷质量给分曲线', '/api/admin/mark/quality/chart', 'URL', 917, 23, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (967, '评卷质量给分曲线', '/api/admin/mark/quality/chart', 'URL', 917, 23, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (968, '绑定评卷员-已绑定评卷员集合', '/api/admin/mark/marker/list_bind_marker', 'URL', 917, 20, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (968, '绑定评卷员-已绑定评卷员集合', '/api/admin/mark/marker/list_bind_marker', 'URL', 917, 20, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (969, '客观题统分', '/api/admin/mark/student/objective/calculate', 'URL', 946, 11, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (969, '客观题统分', '/api/admin/mark/student/objective/calculate', 'URL', 946, 11, 'AUTH', NULL, 1, 1, 1);
-INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (970, '扫描端', 'scan', 'MENU', NULL, 11, NULL, '971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1007,1009,1010,1148,3072,3073,3074', 1, 0, 0);
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (970, '扫描端', 'scan', 'MENU', NULL, 11, NULL, '971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1007,1009,1010,1148,3072,3073,3074,3075', 1, 0, 0);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (971, '心跳接口', '/api/scan/server/heartbeat', 'URL', 970, 1, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (971, '心跳接口', '/api/scan/server/heartbeat', 'URL', 970, 1, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (972, '登出接口', '/api/scan/logout', 'URL', 970, 2, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (972, '登出接口', '/api/scan/logout', 'URL', 970, 2, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (973, '获取学期、考试列表', '/api/admin/basic/condition/scan/semester/list', 'URL', 970, 3, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (973, '获取学期、考试列表', '/api/admin/basic/condition/scan/semester/list', 'URL', 970, 3, 'AUTH', NULL, 1, 1, 1);
@@ -3827,6 +3827,7 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3072, '查询学号字母映射关系', '/api/scan/config/student_number_letter_relation', 'URL', 970, 40, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3072, '查询学号字母映射关系', '/api/scan/config/student_number_letter_relation', 'URL', 970, 40, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3073, '卷型检查任务-状态数量', '/api/scan/student/paper_type_check/status/count', 'URL', 970, 41, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3073, '卷型检查任务-状态数量', '/api/scan/student/paper_type_check/status/count', 'URL', 970, 41, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3074, '卷型检查任务-任务确认', '/api/scan/student/paper_type_check/confirm', 'URL', 970, 42, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3074, '卷型检查任务-任务确认', '/api/scan/student/paper_type_check/confirm', 'URL', 970, 42, 'AUTH', NULL, 1, 1, 1);
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3075, '修改违纪状态', '/api/scan/student/breach/update', 'URL', '970', '43', 'AUTH', NULL, '1', '1', '1');
 
 
 -- ----------------------------
 -- ----------------------------
 -- Table structure for sys_role
 -- Table structure for sys_role

+ 3 - 0
distributed-print/install/mysql/upgrade/3.4.2.sql

@@ -185,3 +185,6 @@ update mark_student set is_manual_absent = 1, scan_status = 'UNEXIST' where scan
 ALTER TABLE `mark_student`
 ALTER TABLE `mark_student`
     CHANGE COLUMN `is_manual_absent` `is_manual_absent` TINYINT(4) NULL DEFAULT NULL COMMENT '是否人工指定缺考' ,
     CHANGE COLUMN `is_manual_absent` `is_manual_absent` TINYINT(4) NULL DEFAULT NULL COMMENT '是否人工指定缺考' ,
     CHANGE COLUMN `is_manual_breach` `is_manual_breach` TINYINT(1) NULL DEFAULT NULL COMMENT '人工指定缺考' ;
     CHANGE COLUMN `is_manual_breach` `is_manual_breach` TINYINT(1) NULL DEFAULT NULL COMMENT '人工指定缺考' ;
+
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('3075', '修改违纪状态', '/api/scan/student/breach/update', 'URL', '970', '43', 'AUTH', '1', '1', '1');
+UPDATE `sys_privilege` SET `related` = '971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1007,1009,1010,1148,3072,3073,3074,3075' WHERE (`id` = '970');

+ 7 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanStudentController.java

@@ -102,4 +102,11 @@ public class ScanStudentController extends BaseController {
             @ApiParam(value = "卷型", required = true) @RequestParam String paperType) {
             @ApiParam(value = "卷型", required = true) @RequestParam String paperType) {
         return ResultUtil.ok(markStudentService.disposePaperTypeCheck(studentId, paperType));
         return ResultUtil.ok(markStudentService.disposePaperTypeCheck(studentId, paperType));
     }
     }
+
+    @ApiOperation(value = "违纪状态更新")
+    @PostMapping("/breach/update")
+    public Result breachUpdate(@ApiParam(value = "考生id", required = true) @RequestParam Long studentId,
+                                        @ApiParam(value = "违纪状态", required = true) @RequestParam Boolean breach) {
+        return ResultUtil.ok(markStudentService.breachUpdate(studentId, breach));
+    }
 }
 }

+ 5 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -1153,10 +1153,13 @@ public class SystemConstant {
      * @return
      * @return
      * @throws Exception
      * @throws Exception
      */
      */
-    public static JSONObject createZip(File zipFile, String zipLocalRootPath, String zipDirName) throws Exception {
+    public static JSONObject createZip(File zipFile, String zipLocalRootPath, String zipDirName, String password) throws Exception {
+        if(StringUtils.isBlank(password)){
+            password = SystemConstant.ZIP_ENCRYPT_PWD;
+        }
         FileStoreUtil fileStoreUtil = SpringContextHolder.getBean(FileStoreUtil.class);
         FileStoreUtil fileStoreUtil = SpringContextHolder.getBean(FileStoreUtil.class);
         DictionaryConfig dictionaryConfig = SpringContextHolder.getBean(DictionaryConfig.class);
         DictionaryConfig dictionaryConfig = SpringContextHolder.getBean(DictionaryConfig.class);
-        Zip4jUtil.zipEncryptFile(zipFile.getPath(), zipLocalRootPath, SystemConstant.ZIP_ENCRYPT_PWD);
+        Zip4jUtil.zipEncryptFile(zipFile.getPath(), zipLocalRootPath, password);
 
 
         boolean oss = dictionaryConfig.sysDomain().isOss();
         boolean oss = dictionaryConfig.sysDomain().isOss();
         JSONObject jsonObject = new JSONObject();
         JSONObject jsonObject = new JSONObject();

+ 7 - 5
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/MarkQuestion.java

@@ -54,9 +54,6 @@ public class MarkQuestion extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "大题名称")
     @ApiModelProperty(value = "大题名称")
     private String mainTitle;
     private String mainTitle;
 
 
-    @ApiModelProperty(value = "正确答案")
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private String answer;
     @ApiModelProperty(value = "客观题答案数量")
     @ApiModelProperty(value = "客观题答案数量")
     private Integer optionCount;
     private Integer optionCount;
 
 
@@ -67,12 +64,17 @@ public class MarkQuestion extends BaseEntity implements Serializable {
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Double intervalScore;
     private Double intervalScore;
 
 
+
+    @ApiModelProperty(value = "正确答案")
+    @TableField(exist = false)
+    private String answer;
+
     @ApiModelProperty(value = "客观题判分策略")
     @ApiModelProperty(value = "客观题判分策略")
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(exist = false)
     private ObjectivePolicy objectivePolicy;
     private ObjectivePolicy objectivePolicy;
 
 
     @ApiModelProperty(value = "客观题判分策略计分")
     @ApiModelProperty(value = "客观题判分策略计分")
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(exist = false)
     private Double objectivePolicyScore;
     private Double objectivePolicyScore;
 
 
     @ApiModelProperty(value = "题型")
     @ApiModelProperty(value = "题型")

+ 1 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/ExamNumberStyleEnum.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ExamNumberStyleEnum.java

@@ -1,6 +1,4 @@
-package com.qmth.distributed.print.business.enums;
-
-import com.qmth.teachcloud.common.enums.EnumResult;
+package com.qmth.teachcloud.common.enums;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;

+ 6 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/FileUtil.java

@@ -5,6 +5,7 @@ import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
@@ -665,7 +666,10 @@ public class FileUtil {
      * @param downloadPathFile 压缩文件所在文件夹路径
      * @param downloadPathFile 压缩文件所在文件夹路径
      * @param zipFileName      压缩zip文件路径+文件名
      * @param zipFileName      压缩zip文件路径+文件名
      */
      */
-    public static void downloadEncryptZip(HttpServletResponse response, File downloadPathFile, String zipFileName) {
+    public static void downloadEncryptZip(HttpServletResponse response, File downloadPathFile, String zipFileName, String password) {
+        if(StringUtils.isBlank(password)){
+            password = SystemConstant.ZIP_ENCRYPT_PWD;
+        }
         // 压缩zip文件和图片保存文件夹放在同一级
         // 压缩zip文件和图片保存文件夹放在同一级
         File zipFile = new File(downloadPathFile.getParent(), zipFileName);
         File zipFile = new File(downloadPathFile.getParent(), zipFileName);
         try {
         try {
@@ -673,7 +677,7 @@ public class FileUtil {
             String zipFilePath = zipFile.getPath();
             String zipFilePath = zipFile.getPath();
             // 待压缩文件所在文件夹
             // 待压缩文件所在文件夹
             String zipFilesPath = downloadPathFile.getPath();
             String zipFilesPath = downloadPathFile.getPath();
-            Zip4jUtil.zipEncryptFile(zipFilePath, zipFilesPath, SystemConstant.ZIP_ENCRYPT_PWD);
+            Zip4jUtil.zipEncryptFile(zipFilePath, zipFilesPath, password);
             FileUtil.outputFile(response, zipFile, zipFile.getName());
             FileUtil.outputFile(response, zipFile, zipFile.getName());
         } catch (Exception e) {
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception("下载失败");
             throw ExceptionResultEnum.ERROR.exception("下载失败");

+ 11 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scananswer/AnswerQueryVo.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 
 import com.qmth.teachcloud.common.enums.ScanStatus;
 import com.qmth.teachcloud.common.enums.ScanStatus;
 import com.qmth.teachcloud.mark.enums.ExamStatus;
 import com.qmth.teachcloud.mark.enums.ExamStatus;
+import com.qmth.teachcloud.mark.enums.PaperTypeCheckStatus;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
 public class AnswerQueryVo {
 public class AnswerQueryVo {
@@ -54,6 +55,8 @@ public class AnswerQueryVo {
 	@ApiModelProperty("识别卷型")
 	@ApiModelProperty("识别卷型")
 	private String paperType;
 	private String paperType;
 
 
+	private PaperTypeCheckStatus paperTypeCheckStatus;
+
 	private List<AnswerPaperVo> papers;
 	private List<AnswerPaperVo> papers;
 
 
 	public Long getId() {
 	public Long getId() {
@@ -271,4 +274,12 @@ public class AnswerQueryVo {
 	public void setPaperType(String paperType) {
 	public void setPaperType(String paperType) {
 		this.paperType = paperType;
 		this.paperType = paperType;
 	}
 	}
+
+	public PaperTypeCheckStatus getPaperTypeCheckStatus() {
+		return paperTypeCheckStatus;
+	}
+
+	public void setPaperTypeCheckStatus(PaperTypeCheckStatus paperTypeCheckStatus) {
+		this.paperTypeCheckStatus = paperTypeCheckStatus;
+	}
 }
 }

+ 12 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/AbInfoVo.java

@@ -1,5 +1,6 @@
 package com.qmth.teachcloud.mark.dto.mark;
 package com.qmth.teachcloud.mark.dto.mark;
 
 
+import com.qmth.teachcloud.common.enums.ExamNumberStyleEnum;
 import com.qmth.teachcloud.common.enums.PaperTypeEnum;
 import com.qmth.teachcloud.common.enums.PaperTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
@@ -23,6 +24,9 @@ public class AbInfoVo implements Serializable {
     @ApiModelProperty(value = "Ab卷版式")
     @ApiModelProperty(value = "Ab卷版式")
     private PaperTypeEnum paperTypeStyle;
     private PaperTypeEnum paperTypeStyle;
 
 
+    @ApiModelProperty(value = "考号版式")
+    private ExamNumberStyleEnum examNumberStyle;
+
     public Boolean getOpenAb() {
     public Boolean getOpenAb() {
         return openAb;
         return openAb;
     }
     }
@@ -38,4 +42,12 @@ public class AbInfoVo implements Serializable {
     public void setPaperTypeStyle(PaperTypeEnum paperTypeStyle) {
     public void setPaperTypeStyle(PaperTypeEnum paperTypeStyle) {
         this.paperTypeStyle = paperTypeStyle;
         this.paperTypeStyle = paperTypeStyle;
     }
     }
+
+    public ExamNumberStyleEnum getExamNumberStyle() {
+        return examNumberStyle;
+    }
+
+    public void setExamNumberStyle(ExamNumberStyleEnum examNumberStyle) {
+        this.examNumberStyle = examNumberStyle;
+    }
 }
 }

+ 19 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentScoreDetailDto.java

@@ -59,6 +59,9 @@ public class StudentScoreDetailDto {
     private String collegeName;
     private String collegeName;
     private Boolean breach;
     private Boolean breach;
     private Boolean omrBreach;
     private Boolean omrBreach;
+    private Boolean manualBreach;
+
+    private String breachDisplay;
 
 
     public String getCollegeName() {
     public String getCollegeName() {
         return collegeName;
         return collegeName;
@@ -380,6 +383,22 @@ public class StudentScoreDetailDto {
         this.studentStatusDisplay = studentStatusDisplay;
         this.studentStatusDisplay = studentStatusDisplay;
     }
     }
 
 
+    public Boolean getManualBreach() {
+        return manualBreach;
+    }
+
+    public void setManualBreach(Boolean manualBreach) {
+        this.manualBreach = manualBreach;
+    }
+
+    public String getBreachDisplay() {
+        return breachDisplay;
+    }
+
+    public void setBreachDisplay(String breachDisplay) {
+        this.breachDisplay = breachDisplay;
+    }
+
     public List<ScoreItem> getScoreList(boolean objective, List<MarkQuestion> questionList) {
     public List<ScoreItem> getScoreList(boolean objective, List<MarkQuestion> questionList) {
         List<ScoreItem> scoreList = new LinkedList<ScoreItem>();
         List<ScoreItem> scoreList = new LinkedList<ScoreItem>();
         try {
         try {

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java

@@ -128,7 +128,7 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
     int countOmrAbsentStudent(@Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("isOmrAbsentConfirm") boolean isOmrAbsentConfirm,
     int countOmrAbsentStudent(@Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("isOmrAbsentConfirm") boolean isOmrAbsentConfirm,
             @Param("teachClassName") String teachClassName);
             @Param("teachClassName") String teachClassName);
 
 
-    void updateBasicExamStudentStatus(@Param("status") String status, @Param("basicStudentId") Long basicStudentId);
+    void updateBasicExamStudentPaperType(@Param("paperType") String paperType, @Param("basicStudentId") Long basicStudentId);
 
 
     MarkStudentVo getDetailById(Long studentId);
     MarkStudentVo getDetailById(Long studentId);
 
 

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

@@ -25,6 +25,6 @@ public interface MarkQuestionAnswerService extends IService<MarkQuestionAnswer>
 
 
     void deleteByExamIdAndPaperNumber(Long examId, String paperNumber);
     void deleteByExamIdAndPaperNumber(Long examId, String paperNumber);
 
 
-    void saveByMarkQuestion(Long examId, String paperNumber, List<MarkQuestion> markQuestions);
+    void saveByMarkQuestion(Long examId, String paperNumber, List<MarkQuestion> markQuestions, boolean containAnswer);
 
 
 }
 }

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

@@ -99,4 +99,5 @@ public interface MarkQuestionService extends IService<MarkQuestion> {
 
 
     List<MarkQuestion> listByExamIdAndPaperNumber(Long examId, String paperNumber);
     List<MarkQuestion> listByExamIdAndPaperNumber(Long examId, String paperNumber);
 
 
+    void deleteByExamIdAndPaperNumberAndObjective(Long examId, String paperNumber, boolean objective);
 }
 }

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

@@ -25,6 +25,7 @@ import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
 import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
+import com.qmth.teachcloud.mark.dto.mark.AbInfoVo;
 import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.manage.Task;
 import com.qmth.teachcloud.mark.dto.mark.manage.Task;
 import com.qmth.teachcloud.mark.dto.mark.score.SheetUrlDto;
 import com.qmth.teachcloud.mark.dto.mark.score.SheetUrlDto;
@@ -211,7 +212,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
 
     void sheetExport(Long examId, String paperNumber, HttpServletResponse response);
     void sheetExport(Long examId, String paperNumber, HttpServletResponse response);
 
 
-    MarkStudent assembleByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper markPaper, Set<String> secretNumberSet);
+    MarkStudent assembleByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper markPaper, Set<String> secretNumberSet, boolean containPaperType);
 
 
     void deleteByBasicStudentId(List<Long> basicExamStudentIds);
     void deleteByBasicStudentId(List<Long> basicExamStudentIds);
 
 
@@ -229,7 +230,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
 
     MarkStudent findByBasicStudentId(Long basicStudentId);
     MarkStudent findByBasicStudentId(Long basicStudentId);
 
 
-    void updateBasicExamStudentStatus(Long markStudentId);
+    void updateBasicExamStudentPaperType(Long markStudentId);
 
 
     boolean calcBatchObjectiveScore(List<Long> ids);
     boolean calcBatchObjectiveScore(List<Long> ids);
 
 
@@ -257,4 +258,8 @@ public interface MarkStudentService extends IService<MarkStudent> {
      * @return 更新时间
      * @return 更新时间
      */
      */
     UpdateTimeVo disposePaperTypeCheck(Long studentId, String paperType);
     UpdateTimeVo disposePaperTypeCheck(Long studentId, String paperType);
+
+    AbInfoVo findExamTaskPaperTypeOpenStatus(Long examId, String paperNumber);
+
+    UpdateTimeVo breachUpdate(Long studentId, Boolean breach);
 }
 }

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

@@ -44,4 +44,5 @@ public interface ScanOmrTaskService extends IService<ScanOmrTask> {
 
 
 	void saveTask(Long studentId);
 	void saveTask(Long studentId);
 
 
+    int getStudentTaskCount(Long studentId, OmrTaskStatus status);
 }
 }

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java

@@ -191,7 +191,7 @@ public class MarkGroupServiceImpl extends MppServiceImpl<MarkGroupMapper, MarkGr
         markGroupTotalProgressDto.setAbsentCount(markPaper.getAbsentCount());
         markGroupTotalProgressDto.setAbsentCount(markPaper.getAbsentCount());
 
 
         int totalCount = markTaskService.countByExamIdAndPaperNumber(examId, paperNumber);
         int totalCount = markTaskService.countByExamIdAndPaperNumber(examId, paperNumber);
-        int markedCount = markTaskService.countByExamIdAndPaperNumberAndStatusIn(examId, paperNumber, Arrays.asList(MarkTaskStatus.MARKED));
+        int markedCount = markTaskService.countByExamIdAndPaperNumberAndStatusIn(examId, paperNumber, Arrays.asList(MarkTaskStatus.MARKED, MarkTaskStatus.ARBITRATED));
         markGroupTotalProgressDto.setPercent(Calculator.divide2String(Calculator.multiply(markedCount, 100), Double.valueOf(totalCount), 2));
         markGroupTotalProgressDto.setPercent(Calculator.divide2String(Calculator.multiply(markedCount, 100), Double.valueOf(totalCount), 2));
         markGroupSummaryProgressDto.setTotalInfo(markGroupTotalProgressDto);
         markGroupSummaryProgressDto.setTotalInfo(markGroupTotalProgressDto);
 
 

+ 6 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionAnswerServiceImpl.java

@@ -77,7 +77,7 @@ public class MarkQuestionAnswerServiceImpl extends ServiceImpl<MarkQuestionAnswe
     }
     }
 
 
     @Override
     @Override
-    public void saveByMarkQuestion(Long examId, String paperNumber, List<MarkQuestion> markQuestions) {
+    public void saveByMarkQuestion(Long examId, String paperNumber, List<MarkQuestion> markQuestions, boolean containAnswer) {
         MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
         MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
         List<MarkQuestionAnswer> markQuestionAnswers = new ArrayList<>();
         List<MarkQuestionAnswer> markQuestionAnswers = new ArrayList<>();
         for (String paperType : markPaper.getPaperTypeList()) {
         for (String paperType : markPaper.getPaperTypeList()) {
@@ -90,6 +90,11 @@ public class MarkQuestionAnswerServiceImpl extends ServiceImpl<MarkQuestionAnswe
                         findFirst().orElse(null);
                         findFirst().orElse(null);
                 if (questionAnswer == null) {
                 if (questionAnswer == null) {
                     MarkQuestionAnswer markQuestionAnswer = new MarkQuestionAnswer(examId, paperNumber, paperType, markQuestion.getMainNumber(), markQuestion.getSubNumber());
                     MarkQuestionAnswer markQuestionAnswer = new MarkQuestionAnswer(examId, paperNumber, paperType, markQuestion.getMainNumber(), markQuestion.getSubNumber());
+                    // 添加答案
+                    if (containAnswer) {
+                        markQuestionAnswer.setAnswer(markQuestion.getAnswer());
+                        markQuestionAnswer.setObjectivePolicy(ObjectivePolicy.NONE);
+                    }
                     markQuestionAnswers.add(markQuestionAnswer);
                     markQuestionAnswers.add(markQuestionAnswer);
                 }
                 }
             }
             }

+ 11 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java

@@ -117,7 +117,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
             }
             }
             this.saveBatch(questions);
             this.saveBatch(questions);
             markQuestionAnswerService.deleteByExamIdAndPaperNumber(examId, paperNumber);
             markQuestionAnswerService.deleteByExamIdAndPaperNumber(examId, paperNumber);
-            markQuestionAnswerService.saveByMarkQuestion(examId, paperNumber, questions);
+            markQuestionAnswerService.saveByMarkQuestion(examId, paperNumber, questions, false);
         } else {
         } else {
             List<MarkQuestion> saveOrUpdateList = new ArrayList<>();
             List<MarkQuestion> saveOrUpdateList = new ArrayList<>();
             for (MarkQuestion question : questions) {
             for (MarkQuestion question : questions) {
@@ -199,7 +199,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                 });
                 });
             }
             }
             this.saveOrUpdateBatch(saveOrUpdateList);
             this.saveOrUpdateBatch(saveOrUpdateList);
-            markQuestionAnswerService.saveByMarkQuestion(examId, paperNumber, saveOrUpdateList);
+            markQuestionAnswerService.saveByMarkQuestion(examId, paperNumber, saveOrUpdateList, false);
         }
         }
         // 更新客观题满分、主观题满分、总分
         // 更新客观题满分、主观题满分、总分
         List<MarkQuestion> markQuestions = this.listQuestionByExamIdAndPaperNumber(examId, paperNumber);
         List<MarkQuestion> markQuestions = this.listQuestionByExamIdAndPaperNumber(examId, paperNumber);
@@ -548,4 +548,13 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         return this.list(queryWrapper);
         return this.list(queryWrapper);
     }
     }
 
 
+    @Override
+    public void deleteByExamIdAndPaperNumberAndObjective(Long examId, String paperNumber, boolean objective) {
+        UpdateWrapper<MarkQuestion> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().eq(MarkQuestion::getExamId, examId)
+                .eq(MarkQuestion::getPaperNumber, paperNumber)
+                .eq(MarkQuestion::getObjective, objective);
+        this.remove(updateWrapper);
+    }
+
 }
 }

+ 96 - 52
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -266,10 +266,18 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
 //                scoreDetailDto.setStatusDisplay("正常");
 //                scoreDetailDto.setStatusDisplay("正常");
 //            }
 //            }
 
 
-            if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus()) && BasicExamStudentStatusEnum.N.equals(scoreDetailDto.getStudentStatus())) {
+            // 扫描状态
+            if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus())) {
                 scoreDetailDto.setStudentStatusDisplay(ScanStatus.UNEXIST.getName());
                 scoreDetailDto.setStudentStatusDisplay(ScanStatus.UNEXIST.getName());
+            } else if (BasicExamStudentStatusEnum.M.equals(scoreDetailDto.getStudentStatus()) || scoreDetailDto.getAbsent() || scoreDetailDto.getOmrAbsent() || scoreDetailDto.getManualAbsent()) {
+                scoreDetailDto.setStudentStatusDisplay("缺考");
             } else {
             } else {
-                scoreDetailDto.setStudentStatusDisplay(scoreDetailDto.getStudentStatus() != null ? scoreDetailDto.getStudentStatus().getName() : null);
+                scoreDetailDto.setStudentStatusDisplay("正常");
+            }
+
+            // 违纪状态
+            if (BasicExamStudentStatusEnum.B.equals(scoreDetailDto.getStudentStatus()) || scoreDetailDto.getBreach() || scoreDetailDto.getOmrBreach() || scoreDetailDto.getManualBreach()) {
+                scoreDetailDto.setBreachDisplay("违纪");
             }
             }
 
 
             // 主观题检查标记
             // 主观题检查标记
@@ -292,30 +300,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
 
 
     /**
     /**
      * 评卷管理/成绩检查/成绩详情导出
      * 评卷管理/成绩检查/成绩详情导出
-     *
-     * @param examId
-     * @param paperNumber
-     * @param college
-     * @param majorName
-     * @param teachClassName
-     * @param className
-     * @param teacher
-     * @param filter
-     * @param status
-     * @param breach
-     * @param startScore
-     * @param endScore
-     * @param subjectiveStartScore
-     * @param subjectiveEndScore
-     * @param objectiveStartScore
-     * @param objectiveEndScore
-     * @param subScore
-     * @param objectiveScoreRateLt
-     * @param studentName
-     * @param studentCode
-     * @param orderType
-     * @param orderField
-     * @return
      */
      */
     @Override
     @Override
     public List<StudentScoreDetailDto> pageStudentScoreExport(Long examId, String paperNumber, String college, String majorName, String teachClassName, String className, String teacher, Integer filter, String status, Boolean breach, Double startScore, Double endScore, Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore, Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode, String secretNumber, String orderType, String orderField) {
     public List<StudentScoreDetailDto> pageStudentScoreExport(Long examId, String paperNumber, String college, String majorName, String teachClassName, String className, String teacher, Integer filter, String status, Boolean breach, Double startScore, Double endScore, Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore, Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode, String secretNumber, String orderType, String orderField) {
@@ -370,8 +354,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
 
 
         HttpServletResponse response = ServletUtil.getResponse();
         HttpServletResponse response = ServletUtil.getResponse();
         //生成表头
         //生成表头
-        String[] columnName = new String[]{"学生姓名", "学号", "学院", "班级", "课程代码", "课程名称", "状态", "客观分", "主观分",
-                "成绩"};
+        String[] columnName = new String[]{"姓名", "学号", "学院", "教学班", "行政班", "课程代码", "课程名称", "状态", "违纪状态", "客观分", "主观分", "成绩"};
         List<MarkQuestion> oQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, true);
         List<MarkQuestion> oQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, true);
         List<MarkQuestion> sQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, false);
         List<MarkQuestion> sQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, false);
         List<String> columnNameList = new ArrayList<>(Arrays.asList(columnName));
         List<String> columnNameList = new ArrayList<>(Arrays.asList(columnName));
@@ -390,10 +373,25 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             valueList.add(s.getStudentName());
             valueList.add(s.getStudentName());
             valueList.add(s.getStudentCode());
             valueList.add(s.getStudentCode());
             valueList.add(s.getCollegeName());
             valueList.add(s.getCollegeName());
+            valueList.add(s.getTeachClassName());
             valueList.add(s.getClassName());
             valueList.add(s.getClassName());
             valueList.add(s.getCourseCode());
             valueList.add(s.getCourseCode());
             valueList.add(s.getCourseName());
             valueList.add(s.getCourseName());
-            valueList.add(Objects.nonNull(s.getStudentStatus()) ? s.getStudentStatus().getName() : null);
+            // 扫描状态
+            if (ScanStatus.UNEXIST.equals(s.getScanStatus())) {
+                valueList.add(ScanStatus.UNEXIST.getName());
+            } else if (BasicExamStudentStatusEnum.M.equals(s.getStudentStatus()) || s.getAbsent() || s.getOmrAbsent() || s.getManualAbsent()) {
+                valueList.add("缺考");
+            } else {
+                valueList.add("正常");
+            }
+
+            // 违纪状态
+            if (BasicExamStudentStatusEnum.B.equals(s.getStudentStatus()) || s.getBreach() || s.getOmrBreach() || s.getManualBreach()) {
+                valueList.add("违纪");
+            } else {
+                valueList.add("");
+            }
             valueList.add(s.getObjectiveScore() == null ? "" : s.getObjectiveScore().toString());
             valueList.add(s.getObjectiveScore() == null ? "" : s.getObjectiveScore().toString());
             valueList.add(s.getSubjectiveScore() == null ? "" : s.getSubjectiveScore().toString());
             valueList.add(s.getSubjectiveScore() == null ? "" : s.getSubjectiveScore().toString());
             valueList.add(s.getTotalScore() == null ? "" : s.getTotalScore().toString());
             valueList.add(s.getTotalScore() == null ? "" : s.getTotalScore().toString());
@@ -546,9 +544,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         if (student == null) {
         if (student == null) {
             throw new ParameterException("找不到对应的考生");
             throw new ParameterException("找不到对应的考生");
         }
         }
+
         Long examId = student.getExamId();
         Long examId = student.getExamId();
         String paperNumber = student.getPaperNumber();
         String paperNumber = student.getPaperNumber();
-        AbInfoVo abInfoVo = this.baseMapper.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
+        AbInfoVo abInfoVo = this.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
 
 
         // 重置状态
         // 重置状态
         student.setIncomplete(false);
         student.setIncomplete(false);
@@ -562,7 +561,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             // 获取paper详情更新考生状态
             // 获取paper详情更新考生状态
             ScanPaper paper = scanPaperService.getById(studentPaper.getPaperId());
             ScanPaper paper = scanPaperService.getById(studentPaper.getPaperId());
             // 二次识别不进人工绑定检查
             // 二次识别不进人工绑定检查
-            if(omrAssigned) {
+            if (omrAssigned) {
                 student.setAssigned(paper.getAssigned());
                 student.setAssigned(paper.getAssigned());
                 student.setAssignConfirmed(false);
                 student.setAssignConfirmed(false);
             }
             }
@@ -584,12 +583,32 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                         student.setObjectiveScoreList(null);
                         student.setObjectiveScoreList(null);
                     }
                     }
                 } else {
                 } else {
+                    // 缺考时,校验缺考检查任务是否做完
+                    if(page.getAbsent().getResult() ) {
+                        if (student.getOmrAbsent() && !student.getOmrAbsentChecked()){
+                            throw ExceptionResultEnum.ERROR.exception("缺考检查任务未完成,不能更新为缺考");
+                        }
+                        // 缺考时,校验人工绑定任务是否做完
+                        if (student.getAssigned() && !student.getAssignConfirmed()) {
+                            throw ExceptionResultEnum.ERROR.exception("人工绑定任务未完成,不能更新为缺考");
+                        }
+                        // 缺考时,校验卷型检查任务是否做完
+                        if (PaperTypeCheckStatus.WAITING.equals(student.getPaperTypeCheckStatus())) {
+                            throw ExceptionResultEnum.ERROR.exception("卷型检查任务未完成,不能更新为缺考");
+                        }
+                        // 缺考时,校验客观题检查任务是否全部做完
+                        if (page.getAbsent() != null && page.getAbsent().getResult()) {
+                            if (scanOmrTaskService.getStudentTaskCount(studentId, OmrTaskStatus.WAITING) > 0) {
+                                throw ExceptionResultEnum.ERROR.exception("客观题检查任务未完成,不能更新为缺考");
+                            }
+                        }
+                    }
+
                     // 人工指定后,识别缺考未处理的数据,不再处理,已处理的,不变
                     // 人工指定后,识别缺考未处理的数据,不再处理,已处理的,不变
                     if (!student.getOmrAbsentChecked()) {
                     if (!student.getOmrAbsentChecked()) {
                         student.setOmrAbsent(false);
                         student.setOmrAbsent(false);
                     }
                     }
                     student.setManualAbsent(page.getAbsent() != null && page.getAbsent().getResult());
                     student.setManualAbsent(page.getAbsent() != null && page.getAbsent().getResult());
-                    student.setManualBreach(page.getBreach() != null && page.getBreach().getResult());
                 }
                 }
                 student.setAbsent(student.getOmrAbsent() || (student.getManualAbsent() != null && student.getManualAbsent()));
                 student.setAbsent(student.getOmrAbsent() || (student.getManualAbsent() != null && student.getManualAbsent()));
                 student.setBreach(student.getOmrBreach() || (student.getManualBreach() != null && student.getManualBreach()));
                 student.setBreach(student.getOmrBreach() || (student.getManualBreach() != null && student.getManualBreach()));
@@ -676,13 +695,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 this.countUploadedByExamIdAndPaperNumber(student.getExamId(), student.getPaperNumber()));
                 this.countUploadedByExamIdAndPaperNumber(student.getExamId(), student.getPaperNumber()));
         markPaperService.updateAbsentCount(student.getExamId(), student.getPaperNumber(),
         markPaperService.updateAbsentCount(student.getExamId(), student.getPaperNumber(),
                 this.countAbsentByExamIdAndPaperNumber(student.getExamId(), student.getPaperNumber()));
                 this.countAbsentByExamIdAndPaperNumber(student.getExamId(), student.getPaperNumber()));
-        // 更新考生管理中考生状态
-        this.updateBasicExamStudentStatus(student.getId());
         if (updateOmrTask) {
         if (updateOmrTask) {
             // 清除识别对照任务
             // 清除识别对照任务
             scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
             scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
             // 重新生成识别对照任务
             // 重新生成识别对照任务
-            scanOmrTaskService.saveTask(student.getId());
+            if (!student.getManualAbsent()) {
+                scanOmrTaskService.saveTask(student.getId());
+            }
         }
         }
     }
     }
 
 
@@ -1085,7 +1104,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             throw ExceptionResultEnum.ERROR.exception("考生不是未扫描状态");
             throw ExceptionResultEnum.ERROR.exception("考生不是未扫描状态");
         }
         }
         LambdaUpdateWrapper<MarkStudent> lw = new LambdaUpdateWrapper<>();
         LambdaUpdateWrapper<MarkStudent> lw = new LambdaUpdateWrapper<>();
-        lw.set(MarkStudent::getScanStatus, status);
+        lw.set(MarkStudent::getScanStatus, ScanStatus.UNEXIST);
         lw.set(MarkStudent::getManualAbsent, ScanStatus.MANUAL_ABSENT.equals(status));
         lw.set(MarkStudent::getManualAbsent, ScanStatus.MANUAL_ABSENT.equals(status));
         lw.set(MarkStudent::getAbsent, student.getOmrAbsent() || ScanStatus.MANUAL_ABSENT.equals(status));
         lw.set(MarkStudent::getAbsent, student.getOmrAbsent() || ScanStatus.MANUAL_ABSENT.equals(status));
         lw.set(MarkStudent::getMissScan, false);
         lw.set(MarkStudent::getMissScan, false);
@@ -1094,8 +1113,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
         markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
                 this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
                 this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
 
 
-        // 更新考生管理中考生状态
-        this.updateBasicExamStudentStatus(student.getId());
         return AbsentManualUpdateVo.create(status);
         return AbsentManualUpdateVo.create(status);
     }
     }
 
 
@@ -1122,18 +1139,16 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
             scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
         }
         }
         // 更新识别缺考值
         // 更新识别缺考值
-        updatePaperPageData(student.getId(), omrAbsent, null);
+        updatePaperPageData(student.getId(), omrAbsent, null, null);
 
 
         markPaperService.updateUploadCount(examId, student.getPaperNumber(),
         markPaperService.updateUploadCount(examId, student.getPaperNumber(),
                 this.countUploadedByExamIdAndPaperNumber(examId, student.getPaperNumber()));
                 this.countUploadedByExamIdAndPaperNumber(examId, student.getPaperNumber()));
         markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
         markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
                 this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
                 this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
-        // 更新考生管理状态
-        this.updateBasicExamStudentStatus(student.getId());
         return UpdateTimeVo.create();
         return UpdateTimeVo.create();
     }
     }
 
 
-    private void updatePaperPageData(Long studentId, Boolean omrAbsent, String paperType) {
+    private void updatePaperPageData(Long studentId, Boolean omrAbsent, Boolean breach, String paperType) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         // 更改试卷和考生绑定关系的卷型
         // 更改试卷和考生绑定关系的卷型
         ScanStudentPaper scanStudentPaper = scanStudentPaperService.findByStudentIdAndPaperNumber(studentId, 1);
         ScanStudentPaper scanStudentPaper = scanStudentPaperService.findByStudentIdAndPaperNumber(studentId, 1);
@@ -1151,6 +1166,12 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 scanPaperPage.getAbsent().setResult(omrAbsent);
                 scanPaperPage.getAbsent().setResult(omrAbsent);
             }
             }
         }
         }
+        // 更新识别违纪结果
+        if (breach != null) {
+            if (scanPaperPage.getBreach() != null) {
+                scanPaperPage.getBreach().setResult(breach);
+            }
+        }
         // 更新识别卷型结果
         // 更新识别卷型结果
         if (StringUtils.isNotBlank(paperType)) {
         if (StringUtils.isNotBlank(paperType)) {
             if (scanPaperPage.getPaperType() != null) {
             if (scanPaperPage.getPaperType() != null) {
@@ -1317,7 +1338,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             log.debug("导出Excel结束");
             log.debug("导出Excel结束");
 
 
             String zipFileName = downloadPathFile.getName() + SystemConstant.ZIP_PREFIX;
             String zipFileName = downloadPathFile.getName() + SystemConstant.ZIP_PREFIX;
-            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName);
+            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, new String(Base64Util.decode(sysUser.getPassword())));
         } catch (Exception e) {
         } catch (Exception e) {
             throw new RuntimeException(e);
             throw new RuntimeException(e);
         } finally {
         } finally {
@@ -2051,13 +2072,15 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
 
 
     @Override
     @Override
     public MarkStudent assembleByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper
     public MarkStudent assembleByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper
-            markPaper, Set<String> secretNumberSet) {
+            markPaper, Set<String> secretNumberSet, boolean containPaperType) {
         MarkStudent markStudent = this.findByBasicStudentId(basicExamStudent.getId());
         MarkStudent markStudent = this.findByBasicStudentId(basicExamStudent.getId());
         if (markStudent == null) {
         if (markStudent == null) {
             if (MarkPaperStatus.FINISH.equals(markPaper.getStatus())) {
             if (MarkPaperStatus.FINISH.equals(markPaper.getStatus())) {
                 throw ExceptionResultEnum.ERROR.exception("试卷编号[" + markPaper.getPaperNumber() + "]已结束阅卷,不允许新增考生");
                 throw ExceptionResultEnum.ERROR.exception("试卷编号[" + markPaper.getPaperNumber() + "]已结束阅卷,不允许新增考生");
             }
             }
-            if (StringUtils.isNotBlank(basicExamStudent.getPaperType())) {
+            if (containPaperType && StringUtils.isBlank(basicExamStudent.getPaperType())) {
+                throw ExceptionResultEnum.ERROR.exception("卷型必须");
+            } else {
                 markStudent = new MarkStudent(SystemConstant.getDbUuid(), basicExamStudent.getExamId(), basicExamStudent.getId(), basicExamStudent.getCourseId(), basicExamStudent.getPaperNumber(), markPaper.getCoursePaperId(), markPaper.getSerialNumber(), basicExamStudent.getPaperType(), basicExamStudent.getStudentCode(), "", basicExamStudent.getExamPlace(), basicExamStudent.getExamRoom(), basicExamStudent.getExamStartTime(), basicExamStudent.getExamEndTime(), markPaper.getUserId());
                 markStudent = new MarkStudent(SystemConstant.getDbUuid(), basicExamStudent.getExamId(), basicExamStudent.getId(), basicExamStudent.getCourseId(), basicExamStudent.getPaperNumber(), markPaper.getCoursePaperId(), markPaper.getSerialNumber(), basicExamStudent.getPaperType(), basicExamStudent.getStudentCode(), "", basicExamStudent.getExamPlace(), basicExamStudent.getExamRoom(), basicExamStudent.getExamStartTime(), basicExamStudent.getExamEndTime(), markPaper.getUserId());
                 if (markStudent.getSecretNumber() == null) {
                 if (markStudent.getSecretNumber() == null) {
                     markStudent.randomSecretNumber();
                     markStudent.randomSecretNumber();
@@ -2180,8 +2203,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         lw.eq(MarkStudent::getId, student.getId());
         lw.eq(MarkStudent::getId, student.getId());
         this.update(lw);
         this.update(lw);
 
 
-        // 更新考生管理状态
-        this.updateBasicExamStudentStatus(student.getId());
         return true;
         return true;
     }
     }
 
 
@@ -2211,11 +2232,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
     }
 
 
     @Override
     @Override
-    public void updateBasicExamStudentStatus(Long markStudentId) {
+    public void updateBasicExamStudentPaperType(Long markStudentId) {
         MarkStudent markStudent = this.getById(markStudentId);
         MarkStudent markStudent = this.getById(markStudentId);
-        if (markStudent != null && markStudent.getBasicStudentId() != null) {
-            BasicExamStudentStatusEnum status = markStudent.getAbsent() || markStudent.getOmrAbsent() ? BasicExamStudentStatusEnum.M : BasicExamStudentStatusEnum.N;
-            this.baseMapper.updateBasicExamStudentStatus(status.name(), markStudent.getBasicStudentId());
+        if (markStudent != null && StringUtils.isNotBlank(markStudent.getPaperType()) && markStudent.getBasicStudentId() != null) {
+            this.baseMapper.updateBasicExamStudentPaperType(markStudent.getPaperType(), markStudent.getBasicStudentId());
         }
         }
     }
     }
 
 
@@ -2288,13 +2308,37 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     @Override
     @Override
     public UpdateTimeVo disposePaperTypeCheck(Long studentId, String paperType) {
     public UpdateTimeVo disposePaperTypeCheck(Long studentId, String paperType) {
         // 更新识别缺考值
         // 更新识别缺考值
-        updatePaperPageData(studentId, null, paperType);
+        updatePaperPageData(studentId, null, null, paperType);
 
 
         // 更改考生卷型和卷型检查状态
         // 更改考生卷型和卷型检查状态
         UpdateWrapper<MarkStudent> markStudentUpdateWrapper = new UpdateWrapper<>();
         UpdateWrapper<MarkStudent> markStudentUpdateWrapper = new UpdateWrapper<>();
         markStudentUpdateWrapper.lambda().eq(MarkStudent::getId, studentId).set(MarkStudent::getPaperType, paperType)
         markStudentUpdateWrapper.lambda().eq(MarkStudent::getId, studentId).set(MarkStudent::getPaperType, paperType)
                 .set(MarkStudent::getPaperTypeCheckStatus, PaperTypeCheckStatus.PROCESSED);
                 .set(MarkStudent::getPaperTypeCheckStatus, PaperTypeCheckStatus.PROCESSED);
         this.update(markStudentUpdateWrapper);
         this.update(markStudentUpdateWrapper);
+        // 更新考生管理卷型
+        updateBasicExamStudentPaperType(studentId);
+        // 客观题统分
+        this.calculateObjectiveScore(this.getById(studentId));
+        return UpdateTimeVo.create();
+    }
+
+    @Override
+    public AbInfoVo findExamTaskPaperTypeOpenStatus(Long examId, String paperNumber) {
+        return this.baseMapper.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
+    }
+
+    @Override
+    public UpdateTimeVo breachUpdate(Long studentId, Boolean breach) {
+        // 更新识别缺考值
+        updatePaperPageData(studentId, null, breach, null);
+
+        // 更改考生卷型和卷型检查状态(更新人工指定违纪状态时,识别违纪改为false)
+        UpdateWrapper<MarkStudent> markStudentUpdateWrapper = new UpdateWrapper<>();
+        markStudentUpdateWrapper.lambda().eq(MarkStudent::getId, studentId).set(MarkStudent::getManualBreach, breach)
+                .set(MarkStudent::getOmrBreach, false)
+                .set(MarkStudent::getBreach, breach)
+                .set(MarkStudent::getPaperTypeCheckStatus, PaperTypeCheckStatus.PROCESSED);
+        this.update(markStudentUpdateWrapper);
         return UpdateTimeVo.create();
         return UpdateTimeVo.create();
     }
     }
 
 

+ 17 - 6
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java

@@ -92,13 +92,16 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
         if (CollectionUtils.isEmpty(paperIds)) {
         if (CollectionUtils.isEmpty(paperIds)) {
             return null;
             return null;
         }
         }
-        MarkStudent student = studentService.getById(studentId);
+
         // 所有客观题空白
         // 所有客观题空白
         boolean allObjectiveBlank = isAllBlank(paperIds);
         boolean allObjectiveBlank = isAllBlank(paperIds);
+
         // 非缺考,空白卷需要进客观题检查(2024-11-11 add)
         // 非缺考,空白卷需要进客观题检查(2024-11-11 add)
-        if ((student.getAbsent() || (student.getManualAbsent()!= null && student.getManualAbsent()) || student.getOmrAbsent()) && allObjectiveBlank) {
+        MarkStudent student = studentService.getById(studentId);
+        if ((student.getAbsent() || (student.getManualAbsent() != null && student.getManualAbsent()) || student.getOmrAbsent()) && allObjectiveBlank) {
             return null;
             return null;
         }
         }
+
         List<OmrTaskDto> retList = new ArrayList<>();
         List<OmrTaskDto> retList = new ArrayList<>();
         boolean multi_blank = false;
         boolean multi_blank = false;
         boolean single_blank = false;
         boolean single_blank = false;
@@ -375,10 +378,10 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
             }
             }
             List<ScanPaperPage> pageList = pageService.listByPaperId(spe.getPaperId());
             List<ScanPaperPage> pageList = pageService.listByPaperId(spe.getPaperId());
             for (ScanPaperPage pageEntity : pageList) {
             for (ScanPaperPage pageEntity : pageList) {
-                if (pageEntity.getAbsent() == null ||
-                        (pageEntity.getAbsent() != null && !pageEntity.getAbsent().getResult())) {
-                    return false;
-                }
+//                if (pageEntity.getAbsent() == null ||
+//                        (pageEntity.getAbsent() != null && !pageEntity.getAbsent().getResult())) {
+//                    return false;
+//                }
                 for (int i = 0; pageEntity.getQuestion() != null && pageEntity.getQuestion().getResult() != null
                 for (int i = 0; pageEntity.getQuestion() != null && pageEntity.getQuestion().getResult() != null
                         && i < pageEntity.getQuestion().getResult().size(); i++) {
                         && i < pageEntity.getQuestion().getResult().size(); i++) {
                     String result = pageEntity.getQuestion().getResult().get(i);
                     String result = pageEntity.getQuestion().getResult().get(i);
@@ -701,4 +704,12 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
             this.saveBatch(omrTaskList);
             this.saveBatch(omrTaskList);
         }
         }
     }
     }
+
+    @Override
+    public int getStudentTaskCount(Long studentId, OmrTaskStatus status) {
+        QueryWrapper<ScanOmrTask> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanOmrTask> lw = wrapper.lambda();
+        lw.eq(ScanOmrTask::getStudentId, studentId).eq(ScanOmrTask::getStatus, status);
+        return this.count(wrapper);
+    }
 }
 }

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

@@ -181,7 +181,6 @@ public class ScanPaperServiceImpl extends ServiceImpl<ScanPaperMapper, ScanPaper
                 // 重置考生状态
                 // 重置考生状态
                 resetStudent(previousStudent);
                 resetStudent(previousStudent);
                 markStudentService.updateStudentAndPaper(user, previousStudent.getId(), null, true);
                 markStudentService.updateStudentAndPaper(user, previousStudent.getId(), null, true);
-                markStudentService.updateBasicExamStudentStatus(previousStudent.getId());
             }
             }
             for (PaperMigratePaper vp : domain.getPapers()) {
             for (PaperMigratePaper vp : domain.getPapers()) {
                 ScanPaper paper = getById(vp.getPaperId());
                 ScanPaper paper = getById(vp.getPaperId());

+ 16 - 7
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -75,7 +75,8 @@
         ms.is_upload upload,
         ms.is_upload upload,
         bes.status studentStatus,
         bes.status studentStatus,
         ms.is_breach breach,
         ms.is_breach breach,
-        ms.omr_breach omrBreach
+        ms.omr_breach omrBreach,
+        ifnull(ms.is_manual_breach,0) manualBreach
         FROM
         FROM
         (select * from mark_student where exam_id = #{examId} and paper_number = #{paperNumber}) ms
         (select * from mark_student where exam_id = #{examId} and paper_number = #{paperNumber}) ms
         LEFT JOIN
         LEFT JOIN
@@ -118,10 +119,10 @@
             <if test="status != null">
             <if test="status != null">
                 <choose>
                 <choose>
                     <when test="status == 'ABSENT'">
                     <when test="status == 'ABSENT'">
-                        AND (ms.is_absent = 1 OR ms.omr_absent = 1 OR ms.scan_status = 'MANUAL_ABSENT')
+                        AND (ms.is_absent = 1 OR ms.omr_absent = 1 OR ms.is_manual_absent = 1 OR bes.status = 'M')
                     </when>
                     </when>
                     <when test="status == 'NORMAL'">
                     <when test="status == 'NORMAL'">
-                        AND (ms.is_absent = 0 and ms.omr_absent = 0 and ms.scan_status = 'SCANNED' AND ms.is_upload = 1)
+                        AND (ms.is_absent = 0 and ms.omr_absent = 0 and ms.is_manual_absent = 0 and bes.status != 'M' and ms.scan_status = 'SCANNED' AND ms.is_upload = 1)
                     </when>
                     </when>
                     <otherwise>
                     <otherwise>
                         AND (ms.scan_status = 'UNEXIST')
                         AND (ms.scan_status = 'UNEXIST')
@@ -129,7 +130,14 @@
                 </choose>
                 </choose>
             </if>
             </if>
             <if test="breach != null">
             <if test="breach != null">
-                AND ms.is_breach = #{breach}
+                <choose>
+                    <when test="breach == true">
+                        AND (ms.is_breach = 1 OR ms.omr_breach = 1 OR ms.is_manual_breach = 1 OR bes.status = 'B')
+                    </when>
+                    <otherwise>
+                        AND (ms.is_breach = 0 AND ms.omr_breach = 0 AND ms.is_manual_breach = 0 OR bes.status != 'B')
+                    </otherwise>
+                </choose>
             </if>
             </if>
             <if test="startScore != null">
             <if test="startScore != null">
                 <choose>
                 <choose>
@@ -223,8 +231,8 @@
             order by bes.student_code
             order by bes.student_code
         </if>
         </if>
     </sql>
     </sql>
-    <update id="updateBasicExamStudentStatus">
-        update basic_exam_student set status = #{status} where id = #{basicStudentId}
+    <update id="updateBasicExamStudentPaperType">
+        update basic_exam_student set paper_type = #{paperType} where id = #{basicStudentId}
     </update>
     </update>
 
 
     <select id="pageStudentScore" resultType="com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto">
     <select id="pageStudentScore" resultType="com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto">
@@ -368,7 +376,8 @@
                t.scan_status status,
                t.scan_status status,
                t.paper_number coursePaperNumber,
                t.paper_number coursePaperNumber,
                c.paper_count cardPaperCount,
                c.paper_count cardPaperCount,
-               t.paper_type paperType
+               t.paper_type paperType,
+               t.paper_type_check_status paperTypeCheckStatus
         from mark_student t
         from mark_student t
         inner join basic_exam_student bes on t.basic_student_id = bes.id
         inner join basic_exam_student bes on t.basic_student_id = bes.id
         left join scan_answer_card c on t.exam_id=c.exam_id and t.card_number=c.number
         left join scan_answer_card c on t.exam_id=c.exam_id and t.card_number=c.number

+ 1 - 1
teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

@@ -7,7 +7,7 @@ import com.qmth.distributed.print.business.bean.dto.initMarkData.ExamDetailCours
 import com.qmth.distributed.print.business.bean.dto.initMarkData.InitExamDetailDto;
 import com.qmth.distributed.print.business.bean.dto.initMarkData.InitExamDetailDto;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.CardTypeEnum;
 import com.qmth.distributed.print.business.enums.CardTypeEnum;
-import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
+import com.qmth.teachcloud.common.enums.ExamNumberStyleEnum;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.teachcloud.common.bean.tiku.paperData.answer.TikuAnswer;
 import com.qmth.teachcloud.common.bean.tiku.paperData.answer.TikuAnswer;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;