Forráskód Böngészése

add. 卷型检查

caozixuan 8 hónapja
szülő
commit
5494785ccc
16 módosított fájl, 299 hozzáadás és 397 törlés
  1. 12 4
      distributed-print-business/src/main/resources/db/log/czx.sql
  2. 0 20
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/ExceptionPaperType.java
  3. 22 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scananswer/AnswerQueryDomain.java
  4. 83 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanPaperTypeCheckDto.java
  5. 25 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanStudentDto.java
  6. 13 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java
  7. 0 160
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/ScanPaperTypeCheck.java
  8. 20 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/enums/PaperTypeCheckStatus.java
  9. 28 23
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java
  10. 0 31
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanPaperTypeCheckMapper.java
  11. 25 17
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java
  12. 0 30
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPaperTypeCheckService.java
  13. 53 43
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  14. 0 27
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperTypeCheckServiceImpl.java
  15. 18 1
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml
  16. 0 38
      teachcloud-mark/src/main/resources/mapper/ScanPaperTypeCheckMapper.xml

+ 12 - 4
distributed-print-business/src/main/resources/db/log/czx.sql

@@ -52,9 +52,17 @@ DEFAULT CHARACTER SET = utf8mb4
 COLLATE=utf8mb4_general_ci
 COMMENT = '卷型检查记录表';
 
- ALTER TABLE scan_paper_page 
- ADD COLUMN paper_type VARCHAR(10) NULL COMMENT '卷型' AFTER recog_data;
+-- 2024-10-15
+ALTER TABLE scan_paper_page 
+ADD COLUMN paper_type VARCHAR(10) NULL COMMENT '卷型' AFTER recog_data;
  
- DROP TABLE scan_paper_type_check;
+DROP TABLE scan_paper_type_check;
  
- 
+ALTER TABLE mark_student 
+ADD COLUMN paper_type_check_status VARCHAR(32) NOT NULL COMMENT '卷型检查状态' AFTER omr_breach;
+
+UPDATE mark_student 
+SET 
+    paper_type_check_status = 'NORMAL'
+WHERE
+    paper_type_check_status = '';

+ 0 - 20
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/ExceptionPaperType.java

@@ -1,20 +0,0 @@
-package com.qmth.teachcloud.common.enums.scan;
-
-/**
- * @Description: 异常卷型类型
- * @Author: CaoZixuan
- * @Date: 2024-10-12
- */
-public enum ExceptionPaperType {
-    NONE("没有识别到卷型"), MULTIPLE("多卷型");;
-
-    private final String name;
-
-    ExceptionPaperType(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-}

+ 22 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scananswer/AnswerQueryDomain.java

@@ -5,8 +5,9 @@ import java.util.List;
 import javax.validation.constraints.NotNull;
 
 import com.qmth.teachcloud.common.enums.ScanStatus;
+import com.qmth.teachcloud.mark.enums.PaperTypeCheckStatus;
 import com.qmth.teachcloud.mark.utils.PagerQuery;
-
+import io.swagger.annotations.ApiModelProperty;
 
 public class AnswerQueryDomain extends PagerQuery {
 
@@ -53,6 +54,10 @@ public class AnswerQueryDomain extends PagerQuery {
 	private String markPaperStatus;
 	private Boolean missScan;
 	private String studentCodeOrName;
+	@ApiModelProperty("试卷编号")
+	private String paperType;
+	@ApiModelProperty("卷型检查类型")
+	private PaperTypeCheckStatus paperTypeCheckStatus;
 	public Long getExamId() {
 		return examId;
 	}
@@ -217,4 +222,20 @@ public class AnswerQueryDomain extends PagerQuery {
 	public void setStudentCodeOrName(String studentCodeOrName) {
 		this.studentCodeOrName = studentCodeOrName;
 	}
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+	public PaperTypeCheckStatus getPaperTypeCheckStatus() {
+		return paperTypeCheckStatus;
+	}
+
+	public void setPaperTypeCheckStatus(PaperTypeCheckStatus paperTypeCheckStatus) {
+		this.paperTypeCheckStatus = paperTypeCheckStatus;
+	}
 }

+ 83 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanPaperTypeCheckDto.java

@@ -0,0 +1,83 @@
+package com.qmth.teachcloud.mark.dto;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.teachcloud.mark.bean.scananswer.AnswerPaperVo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: CaoZixuan
+ * @Date:
+ */
+public class ScanPaperTypeCheckDto {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty("考生id(mark_student)")
+    private Long studentId;
+
+    @ApiModelProperty("学号")
+    private String studentCode;
+
+    @ApiModelProperty("学生姓名")
+    private String studentName;
+
+    @ApiModelProperty("识别卷型")
+    private String paperType;
+
+    @ApiModelProperty("识别卷型")
+    private Integer paperIndex;
+
+    @ApiModelProperty("绑定试卷信息")
+    private List<AnswerPaperVo> papers;
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getStudentCode() {
+        return studentCode;
+    }
+
+    public void setStudentCode(String studentCode) {
+        this.studentCode = studentCode;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
+    public Integer getPaperIndex() {
+        return paperIndex;
+    }
+
+    public void setPaperIndex(Integer paperIndex) {
+        this.paperIndex = paperIndex;
+    }
+
+    public List<AnswerPaperVo> getPapers() {
+        return papers;
+    }
+
+    public void setPapers(List<AnswerPaperVo> papers) {
+        this.papers = papers;
+    }
+}

+ 25 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanStudentDto.java

@@ -1,28 +1,51 @@
 package com.qmth.teachcloud.mark.dto;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
 public class ScanStudentDto {
+
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long studentId;
+
 	private String studentCode;
+
 	private String studentName;
+
+	@ApiModelProperty("识别卷型")
+	private String paperType;
+
 	public Long getStudentId() {
 		return studentId;
 	}
+
 	public void setStudentId(Long studentId) {
 		this.studentId = studentId;
 	}
+
 	public String getStudentCode() {
 		return studentCode;
 	}
+
 	public void setStudentCode(String studentCode) {
 		this.studentCode = studentCode;
 	}
+
 	public String getStudentName() {
 		return studentName;
 	}
+
 	public void setStudentName(String studentName) {
 		this.studentName = studentName;
 	}
-	
-	
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
 }
 

+ 13 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java

@@ -5,6 +5,7 @@ import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 
+import com.qmth.teachcloud.mark.enums.PaperTypeCheckStatus;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -192,6 +193,9 @@ public class MarkStudent implements Serializable {
     @TableField(exist = false)
     private String markPaperStatus;
 
+    @ApiModelProperty(value = "卷型检查状态")
+    private PaperTypeCheckStatus paperTypeCheckStatus;
+
     public MarkStudent() {
     }
 
@@ -222,6 +226,7 @@ public class MarkStudent implements Serializable {
         this.scanStatus = ScanStatus.UNEXIST;
         this.omrAbsent = false;
         this.omrAbsentChecked = false;
+        this.paperTypeCheckStatus = PaperTypeCheckStatus.NORMAL;
         this.examStartTime = examStartTime;
         this.examEndTime = examEndTime;
         this.createId = createId;
@@ -551,6 +556,14 @@ public class MarkStudent implements Serializable {
         this.coursePaperId = coursePaperId;
     }
 
+    public PaperTypeCheckStatus getPaperTypeCheckStatus() {
+        return paperTypeCheckStatus;
+    }
+
+    public void setPaperTypeCheckStatus(PaperTypeCheckStatus paperTypeCheckStatus) {
+        this.paperTypeCheckStatus = paperTypeCheckStatus;
+    }
+
     public double getTotalScore() {
         double score = 0;
         if (objectiveScore != null) {

+ 0 - 160
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/ScanPaperTypeCheck.java

@@ -1,160 +0,0 @@
-package com.qmth.teachcloud.mark.entity;
-
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.enums.scan.ExceptionPaperType;
-import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * <p>
- * 卷型检查记录表
- * </p>
- *
- * @author CaoZixuan
- * @since 2024-10-12
- */
-@ApiModel(value="ScanPaperTypeCheck对象", description="卷型检查记录表")
-public class ScanPaperTypeCheck {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long id;
-
-    @ApiModelProperty(value = "考试ID")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long examId;
-
-    @ApiModelProperty(value = "异常卷型类型")
-    private ExceptionPaperType exceptionPaperType;
-
-    @ApiModelProperty(value = "识别卷型")
-    private String paperType;
-
-    @ApiModelProperty(value = "考生ID")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long studentId;
-
-    @ApiModelProperty(value = "试卷页数")
-    private Integer paperIndex;
-
-    @ApiModelProperty(value = "试卷ID")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long paperId;
-
-    @ApiModelProperty(value = "题卡编号")
-    private Integer cardNumber;
-
-    @ApiModelProperty(value = "状态")
-    private OmrTaskStatus status;
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long userId;
-
-    @ApiModelProperty(value = "创建人")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long creatorId;
-
-    @ApiModelProperty(value = "更新人")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long updaterId;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    public ExceptionPaperType getExceptionPaperType() {
-        return exceptionPaperType;
-    }
-
-    public void setExceptionPaperType(ExceptionPaperType exceptionPaperType) {
-        this.exceptionPaperType = exceptionPaperType;
-    }
-
-    public String getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(String paperType) {
-        this.paperType = paperType;
-    }
-
-    public Long getStudentId() {
-        return studentId;
-    }
-
-    public void setStudentId(Long studentId) {
-        this.studentId = studentId;
-    }
-
-    public Integer getPaperIndex() {
-        return paperIndex;
-    }
-
-    public void setPaperIndex(Integer paperIndex) {
-        this.paperIndex = paperIndex;
-    }
-
-    public Long getPaperId() {
-        return paperId;
-    }
-
-    public void setPaperId(Long paperId) {
-        this.paperId = paperId;
-    }
-
-    public Integer getCardNumber() {
-        return cardNumber;
-    }
-
-    public void setCardNumber(Integer cardNumber) {
-        this.cardNumber = cardNumber;
-    }
-
-    public OmrTaskStatus getStatus() {
-        return status;
-    }
-
-    public void setStatus(OmrTaskStatus status) {
-        this.status = status;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public Long getCreatorId() {
-        return creatorId;
-    }
-
-    public void setCreatorId(Long creatorId) {
-        this.creatorId = creatorId;
-    }
-
-    public Long getUpdaterId() {
-        return updaterId;
-    }
-
-    public void setUpdaterId(Long updaterId) {
-        this.updaterId = updaterId;
-    }
-}

+ 20 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/enums/PaperTypeCheckStatus.java

@@ -0,0 +1,20 @@
+package com.qmth.teachcloud.mark.enums;
+
+/**
+ * @Description: 卷型检查状态
+ * @Author: CaoZixuan
+ * @Date: 2024-10-15
+ */
+public enum PaperTypeCheckStatus {
+    WAITING("待处理"), PROCESSED("已处理"), NORMAL("正常");
+
+    private final String name;
+
+    PaperTypeCheckStatus(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

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

@@ -31,13 +31,12 @@ import java.util.List;
 public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 
     IPage<StudentScoreDetailDto> pageStudentScore(@Param("page") Page<StudentScoreDetailDto> page, @Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("college") String college,
-                                                  @Param("majorName") String majorName, @Param("teachClassName") String teachClassName, @Param("className") String className, @Param("teacher") String teacher, @Param("filter") Integer filter,
-                                                  @Param("status") String status, @Param("breach") Boolean breach, @Param("startScore") Double startScore, @Param("endScore") Double endScore,
-                                                  @Param("subjectiveStartScore") Double subjectiveStartScore, @Param("subjectiveEndScore") Double subjectiveEndScore,
-                                                  @Param("objectiveStartScore") Double objectiveStartScore,
-                                                  @Param("objectiveEndScore") Double objectiveEndScore, @Param("subScore") Double subScore, @Param("objectiveScoreLt") Double objectiveScoreLt,
-                                                  @Param("studentName") String studentName, @Param("studentCode") String studentCode, @Param("secretNumber") String secretNumber, @Param("orderType") String orderType,
-                                                  @Param("orderField") String orderField, @Param("dpr") DataPermissionRule dpr);
+            @Param("majorName") String majorName, @Param("teachClassName") String teachClassName, @Param("className") String className, @Param("teacher") String teacher, @Param("filter") Integer filter,
+            @Param("status") String status, @Param("breach") Boolean breach, @Param("startScore") Double startScore, @Param("endScore") Double endScore,
+            @Param("subjectiveStartScore") Double subjectiveStartScore, @Param("subjectiveEndScore") Double subjectiveEndScore,
+            @Param("objectiveStartScore") Double objectiveStartScore, @Param("objectiveEndScore") Double objectiveEndScore, @Param("subScore") Double subScore,
+            @Param("objectiveScoreLt") Double objectiveScoreLt, @Param("studentName") String studentName, @Param("studentCode") String studentCode, @Param("secretNumber") String secretNumber,
+            @Param("orderType") String orderType, @Param("orderField") String orderField, @Param("dpr") DataPermissionRule dpr);
 
     /**
      * 评卷管理/成绩检查/成绩详情导出
@@ -68,19 +67,16 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
      * @return
      */
     List<StudentScoreDetailDto> pageStudentScoreExport(@Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("college") String college,
-                                                       @Param("majorName") String majorName, @Param("teachClassName") String teachClassName, @Param("className") String className, @Param("teacher") String teacher, @Param("filter") Integer filter,
-                                                       @Param("status") String status, @Param("breach") Boolean breach, @Param("startScore") Double startScore, @Param("endScore") Double endScore,
-                                                       @Param("subjectiveStartScore") Double subjectiveStartScore, @Param("subjectiveEndScore") Double subjectiveEndScore,
-                                                       @Param("objectiveStartScore") Double objectiveStartScore,
-                                                       @Param("objectiveEndScore") Double objectiveEndScore, @Param("subScore") Double subScore, @Param("objectiveScoreLt") Double objectiveScoreLt,
-                                                       @Param("studentName") String studentName, @Param("studentCode") String studentCode, @Param("secretNumber") String secretNumber, @Param("orderType") String orderType,
-                                                       @Param("orderField") String orderField, @Param("dpr") DataPermissionRule dpr);
+            @Param("majorName") String majorName, @Param("teachClassName") String teachClassName, @Param("className") String className, @Param("teacher") String teacher, @Param("filter") Integer filter,
+            @Param("status") String status, @Param("breach") Boolean breach, @Param("startScore") Double startScore, @Param("endScore") Double endScore,
+            @Param("subjectiveStartScore") Double subjectiveStartScore, @Param("subjectiveEndScore") Double subjectiveEndScore,
+            @Param("objectiveStartScore") Double objectiveStartScore, @Param("objectiveEndScore") Double objectiveEndScore, @Param("subScore") Double subScore,
+            @Param("objectiveScoreLt") Double objectiveScoreLt, @Param("studentName") String studentName, @Param("studentCode") String studentCode, @Param("secretNumber") String secretNumber,
+            @Param("orderType") String orderType, @Param("orderField") String orderField, @Param("dpr") DataPermissionRule dpr);
 
-    List<MarkStudent> listAbsentOrBreachMarkTaskStudent(@Param("examId") Long examId,
-                                                        @Param("paperNumber") String paperNumber);
+    List<MarkStudent> listAbsentOrBreachMarkTaskStudent(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 
-    IPage<MarkStudent> listUnMarkTaskStudent(@Param("page") Page<MarkStudent> page, @Param("examId") Long examId,
-                                             @Param("paperNumber") String paperNumber, @Param("groupNumber") Integer groupNumber);
+    IPage<MarkStudent> listUnMarkTaskStudent(@Param("page") Page<MarkStudent> page, @Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("groupNumber") Integer groupNumber);
 
     StudentVo findOne(@Param("query") StudentQuery query);
 
@@ -94,8 +90,7 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 
     OverViewVo overview(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-    int getCountByScoreRange(@Param("examId") Long examId, @Param("paperNumber") String paperNumber,
-                             @Param("start") Double start, @Param("end") Double end);
+    int getCountByScoreRange(@Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("start") Double start, @Param("end") Double end);
 
     List<CollegeVo> college(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
@@ -104,7 +99,7 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
     List<TeacherVo> teacher(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
     List<UnexistStudentDto> listUnexistStudentByExamIdAndCoursePaperId(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId,
-                                                                       @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
+            @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
     IPage<ArchiveStudentVo> studentList(@Param("page") Page<ArchiveStudentVo> page, @Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
@@ -117,7 +112,7 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
     int countAssignedNew(@Param("markStudent") MarkStudent markStudent, @Param("dpr") DataPermissionRule dpr, @Param("teachClassName") String teachClassName);
 
     List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId,
-                                                                           @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
+            @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
     BasicTeachClazz getBasicTeachClazzById(Long clazzId);
 
@@ -129,9 +124,19 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 
     IPage<MarkStudentVo> listMarkStudentVo(@Param("page") Page<MarkStudentVo> page, @Param("markStudentQuery") MarkStudentQuery markStudentQuery);
 
-    int countOmrAbsentStudent(@Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("paperType") String paperType, @Param("isOmrAbsentConfirm") boolean isOmrAbsentConfirm, @Param("teachClassName") String teachClassName);
+    int countOmrAbsentStudent(@Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("paperType") String paperType, @Param("isOmrAbsentConfirm") boolean isOmrAbsentConfirm,
+            @Param("teachClassName") String teachClassName);
 
     void updateBasicExamStudentStatus(@Param("status") String status, @Param("basicStudentId") Long basicStudentId);
 
     MarkStudentVo getDetailById(Long studentId);
+
+    /**
+     * 查询卷型开启状态
+     *
+     * @param examId      考试id
+     * @param paperNumber 试卷编号
+     * @return 是否开启
+     */
+    Boolean findExamTaskPaperTypeOpenStatus(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 }

+ 0 - 31
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanPaperTypeCheckMapper.java

@@ -1,31 +0,0 @@
-package com.qmth.teachcloud.mark.mapper;
-
-import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
-import com.qmth.teachcloud.mark.entity.ScanPaperTypeCheck;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * <p>
- * 卷型检查记录表 Mapper 接口
- * </p>
- *
- * @author CaoZixuan
- * @since 2024-10-12
- */
-public interface ScanPaperTypeCheckMapper extends BaseMapper<ScanPaperTypeCheck> {
-
-    /**
-     * 卷型检查数量
-     *
-     * @param examId        考试id
-     * @param courseId      课程id
-     * @param coursePaperId 试卷id
-     * @param status        处理状态
-     * @param dpr           数据权限
-     * @return 数量
-     */
-    int getPaperTypeCheckCount(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId, @Param("status") OmrTaskStatus status,
-            @Param("dpr") DataPermissionRule dpr);
-}

+ 25 - 17
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java

@@ -24,6 +24,7 @@ import com.qmth.teachcloud.mark.bean.student.AbsentManualUpdateVo;
 import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentVo;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
 import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.manage.Task;
 import com.qmth.teachcloud.mark.dto.mark.score.SheetUrlDto;
@@ -37,7 +38,6 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotNull;
-import java.io.OutputStream;
 import java.util.List;
 import java.util.Set;
 
@@ -55,16 +55,15 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
     void updateSubjectiveStatusAndScore(Long studentId, SubjectiveStatus status, Double score, String scoreList);
 
-    void updateSubjectiveStatusAndScore(Long examId, String paperNumber, SubjectiveStatus status, Double score,
-                                        String scoreList);
+    void updateSubjectiveStatusAndScore(Long examId, String paperNumber, SubjectiveStatus status, Double score, String scoreList);
 
     ScanExamInfoVo getScanExamInfo(BasicExam exam, Long courseId, String coursePaperId);
 
-    IPage<StudentScoreDetailDto> pageStudentScore(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, Integer pageNumber, Integer pageSize);
+    IPage<StudentScoreDetailDto> pageStudentScore(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, Integer pageNumber, Integer pageSize);
 
     /**
      * 评卷管理/成绩检查/成绩详情导出
@@ -94,11 +93,10 @@ public interface MarkStudentService extends IService<MarkStudent> {
      * @return
      */
     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);
-
+            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);
 
     List<SheetUrlDto> buildSheetUrls(Long studentId);
 
@@ -186,15 +184,14 @@ public interface MarkStudentService extends IService<MarkStudent> {
     boolean updateAssignConfirm(Long studentId, boolean assignConfirm);
 
     int getAssignedCount(Long examId, Boolean checked, Long courseId, String coursePaperId, MarkPaperStatus status,
-                         DataPermissionRule dpr);
+            DataPermissionRule dpr);
 
     int getAssignedCount(Long examId, Boolean checked, Long courseId, String coursePaperId, MarkPaperStatus status,
-                         DataPermissionRule dpr, String teachClassName);
+            DataPermissionRule dpr, String teachClassName);
 
     int countAbsentByExamIdAndPaperNumber(Long examId, String paperNumber);
 
-    List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(Long examId, Long courseId,
-                                                                           String coursePaperId, String status, DataPermissionRule dpr);
+    List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(Long examId, Long courseId, String coursePaperId, String status, DataPermissionRule dpr);
 
     int countUnexistByExamIdAndPaperNumberAndPaperType(Long examId, String paperNumber, String paperType);
 
@@ -209,6 +206,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
     MarkStudent assembleByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper markPaper, Set<String> secretNumberSet);
 
     void deleteByExamIdAndPaperNumberAndStudentCode(Long examId, String paperNumber, String studentCode);
+
     void deleteByBasicStudentId(List<Long> basicExamStudentIds);
 
     Integer maxCardNumber(Long examId, String paperNumber, String paperType);
@@ -234,4 +232,14 @@ public interface MarkStudentService extends IService<MarkStudent> {
     void confirmSubjectiveInspectedTask(Long studentId);
 
     MarkStudentVo getDetailById(Long studentId);
+
+    /**
+     * 获取卷型检查状态数量
+     *
+     * @param examId        考试id
+     * @param courseId      课程id
+     * @param coursePaperId 特殊试卷编号
+     * @return 已办和待办数量
+     */
+    ScanOmrTaskStatusDto getStatus(Long examId, Long courseId, String coursePaperId);
 }

+ 0 - 30
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPaperTypeCheckService.java

@@ -1,30 +0,0 @@
-package com.qmth.teachcloud.mark.service;
-
-import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
-import com.qmth.teachcloud.mark.entity.ScanPaperTypeCheck;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
-
-/**
- * <p>
- * 卷型检查记录表 服务类
- * </p>
- *
- * @author CaoZixuan
- * @since 2024-10-12
- */
-public interface ScanPaperTypeCheckService extends IService<ScanPaperTypeCheck> {
-
-    /**
-     * 卷型检查数量
-     *
-     * @param examId        考试id
-     * @param courseId      课程id
-     * @param coursePaperId 试卷id
-     * @param status        处理状态
-     * @param dpr           数据权限
-     * @return 数量
-     */
-    int getPaperTypeCheckCount(Long examId, Long courseId, String coursePaperId, OmrTaskStatus status,
-            DataPermissionRule dpr);
-}

+ 53 - 43
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -29,7 +29,6 @@ import com.qmth.teachcloud.common.enums.PageSizeEnum;
 import com.qmth.teachcloud.common.enums.ScanStatus;
 import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
-import com.qmth.teachcloud.common.enums.scan.ExceptionPaperType;
 import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
 import com.qmth.teachcloud.common.service.FileUploadService;
@@ -47,6 +46,7 @@ import com.qmth.teachcloud.mark.bean.student.AbsentManualUpdateVo;
 import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentVo;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
 import com.qmth.teachcloud.mark.dto.UnexistStudentDto;
 import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.ScoreInfo;
@@ -54,10 +54,7 @@ import com.qmth.teachcloud.mark.dto.mark.ScoreItem;
 import com.qmth.teachcloud.mark.dto.mark.manage.Task;
 import com.qmth.teachcloud.mark.dto.mark.score.*;
 import com.qmth.teachcloud.mark.entity.*;
-import com.qmth.teachcloud.mark.enums.ExamStatus;
-import com.qmth.teachcloud.mark.enums.LockType;
-import com.qmth.teachcloud.mark.enums.MarkTaskStatus;
-import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
+import com.qmth.teachcloud.mark.enums.*;
 import com.qmth.teachcloud.mark.lock.LockService;
 import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
 import com.qmth.teachcloud.mark.params.MarkHeaderResult;
@@ -168,8 +165,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     private ScanBatchPaperService scanBatchPaperService;
     @Resource
     private BasicCourseService basicCourseService;
-    @Resource
-    private ScanPaperTypeCheckService scanPaperTypeCheckService;
 
     @Override
     public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
@@ -492,6 +487,15 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         return baseMapper.selectCountByQuery(markStudent, dpr);
     }
 
+    private int getPaperTypeCheckCount(Long examId, Long courseId, String coursePaperId, PaperTypeCheckStatus status, DataPermissionRule dpr) {
+        MarkStudent markStudent = new MarkStudent();
+        markStudent.setExamId(examId);
+        markStudent.setCourseId(courseId);
+        markStudent.setCoursePaperId(coursePaperId);
+        markStudent.setPaperTypeCheckStatus(status);
+        return baseMapper.selectCountByQuery(markStudent, dpr);
+    }
+
     @Override
     public ScanExamCheckInfoVo checkInfo(BasicExam exam, Long courseId, String coursePaperId) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
@@ -517,10 +521,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId, OmrTaskStatus.PROCESSED.name(), dpr));
         ct.setIncompleteCount(getIncompleteCount(examId, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
 
-        ct.setPaperTypeCheckCount(
-                scanPaperTypeCheckService.getPaperTypeCheckCount(examId, courseId, coursePaperId, OmrTaskStatus.WAITING, dpr));
-        ct.setPaperTypeCheckedCount(
-                scanPaperTypeCheckService.getPaperTypeCheckCount(examId, courseId, coursePaperId, OmrTaskStatus.PROCESSED, dpr));
+        ct.setPaperTypeCheckCount(getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.WAITING, dpr));
+        ct.setPaperTypeCheckedCount(getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.PROCESSED, dpr));
         return vo;
     }
 
@@ -534,6 +536,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         if (student == null) {
             throw new ParameterException("找不到对应的考生");
         }
+        Long examId = student.getExamId();
+        String paperNumber = student.getPaperNumber();
+        Boolean openAb = this.baseMapper.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
+
         // 重置状态
         student.setIncomplete(false);
         student.setAssigned(false);
@@ -563,42 +569,34 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                     student.setObjectiveScoreList(null);
                 }
                 // student.setDevice(batchService.findByPaperId(paper.getId()).getDevice());
-                ExceptionPaperType exceptionPaperType = null;
+
+                PaperTypeCheckStatus paperTypeCheckStatus = PaperTypeCheckStatus.NORMAL;
                 // 根据卷型识别结果更新考生卷型,如果卷型识别结果异常则添加到卷型检查中
                 String paperType = page.getPaperType();
-                student.setPaperType(paperType);
-                if (!SystemConstant.strNotNull(paperType)) {
-                    // 卷型为空
-                    exceptionPaperType = ExceptionPaperType.NONE;
-                } else if (!paperType.matches("[A-Z#]+")) {
-                    // 未识别到卷型
-                    exceptionPaperType = ExceptionPaperType.NONE;
-                } else if (paperType.length() > 1) {
-                    // 多卷型
-                    exceptionPaperType = ExceptionPaperType.MULTIPLE;
-                } else if ("#".equals(paperType)) {
-                    // 没有识别到卷型
-                    exceptionPaperType = ExceptionPaperType.NONE;
-                }
+                if (!openAb) {
+                    // 不开启卷型默认A卷 正常
+                    paperType = "A";
+                } else {
+                    if (!SystemConstant.strNotNull(paperType)) {
+                        // 卷型为空 (正常不会出现这种情况)
+                        throw ExceptionResultEnum.ERROR.exception("开启卷型的试卷未检测到识别的卷型");
+                    }
+                    if (!paperType.matches("[A-Z#]+")) {
+                        // 未识别到卷型 (正常不会出现这种情况)
+                        throw ExceptionResultEnum.ERROR.exception("卷型识别错误");
+                    }
+                    if (paperType.length() > 1) {
+                        // 多卷型
+                        paperTypeCheckStatus = PaperTypeCheckStatus.WAITING;
+                    }
+                    if ("#".equals(paperType)) {
+                        // 没有识别到卷型
+                        paperTypeCheckStatus = PaperTypeCheckStatus.WAITING;
+                    }
 
-                scanPaperTypeCheckService.remove(new QueryWrapper<ScanPaperTypeCheck>().lambda().eq(ScanPaperTypeCheck::getStudentId, student.getId()));
-                if (Objects.nonNull(exceptionPaperType)) {
-                    ScanPaperTypeCheck check = new ScanPaperTypeCheck();
-
-                    check.setExamId(paper.getExamId());
-                    check.setExceptionPaperType(exceptionPaperType);
-                    check.setPaperType(paperType);
-                    check.setStudentId(studentId);
-                    check.setPaperIndex(1);
-                    check.setPaperId(paper.getId());
-                    check.setCardNumber(paper.getCardNumber());
-                    check.setStatus(OmrTaskStatus.WAITING);
-                    check.setUserId(userId);
-                    check.setId(SystemConstant.getDbUuid());
-                    check.setCreatorId(userId);
-
-                    scanPaperTypeCheckService.save(check);
                 }
+                student.setPaperType(paperType);
+                student.setPaperTypeCheckStatus(paperTypeCheckStatus);
             }
 
             List<ScanPaperPage> scanPaperPages = scanPaperPageService.listByPaperId(studentPaper.getPaperId());
@@ -2192,4 +2190,16 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     public MarkStudentVo getDetailById(Long studentId) {
         return this.baseMapper.getDetailById(studentId);
     }
+
+    @Override
+    public ScanOmrTaskStatusDto getStatus(Long examId, Long courseId, String coursePaperId) {
+        DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission();
+        Integer todoCount = this.getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.WAITING,
+                dpr);
+        Integer finishCount = this.getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.PROCESSED, dpr);
+        ScanOmrTaskStatusDto result = new ScanOmrTaskStatusDto();
+        result.setTodoCount(todoCount);
+        result.setFinishCount(finishCount);
+        return result;
+    }
 }

+ 0 - 27
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperTypeCheckServiceImpl.java

@@ -1,27 +0,0 @@
-package com.qmth.teachcloud.mark.service.impl;
-
-import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
-import com.qmth.teachcloud.mark.entity.ScanPaperTypeCheck;
-import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
-import com.qmth.teachcloud.mark.mapper.ScanPaperTypeCheckMapper;
-import com.qmth.teachcloud.mark.service.ScanPaperTypeCheckService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 卷型检查记录表 服务实现类
- * </p>
- *
- * @author CaoZixuan
- * @since 2024-10-12
- */
-@Service
-public class ScanPaperTypeCheckServiceImpl extends ServiceImpl<ScanPaperTypeCheckMapper, ScanPaperTypeCheck> implements ScanPaperTypeCheckService {
-
-    @Override
-    public int getPaperTypeCheckCount(Long examId, Long courseId, String coursePaperId, OmrTaskStatus status,
-            DataPermissionRule dpr) {
-        return baseMapper.getPaperTypeCheckCount(examId, courseId, coursePaperId, status, dpr);
-    }
-}

+ 18 - 1
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -712,7 +712,7 @@
                                             and mp.status = #{markStudent.markPaperStatus}
         </if>
         <where>
-            ms.exam_id = #{markStudent.examId}
+            and ms.exam_id = #{markStudent.examId}
             <if test="markStudent.courseId != null">
                 and ms.course_id = #{markStudent.courseId}
             </if>
@@ -740,6 +740,9 @@
             <if test="markStudent.missScan != null">
                 and ms.miss_scan = #{markStudent.missScan}
             </if>
+            <if test="markStudent.paperTypeCheckStatus != null">
+                and ms.paper_type_check_status = #{markStudent.paperTypeCheckStatus}
+            </if>
             <if test="dpr != null and dpr.requestUserId != null">
                 AND ms.create_id = #{dpr.requestUserId}
             </if>
@@ -978,4 +981,18 @@
         where
             ms.id = #{studentId}
     </select>
+    <select id="findExamTaskPaperTypeOpenStatus" resultType="java.lang.Boolean">
+        SELECT
+            open_ab
+        FROM
+            exam_task
+        <where>
+            <if test="examId != null">
+                AND exam_id = #{examId}
+            </if>
+            <if test="paperNumber != null and paperNumber != ''">
+                AND paper_number = #{paperNumber}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 0 - 38
teachcloud-mark/src/main/resources/mapper/ScanPaperTypeCheckMapper.xml

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qmth.teachcloud.mark.mapper.ScanPaperTypeCheckMapper">
-
-    <select id="getPaperTypeCheckCount" resultType="java.lang.Integer">
-        SELECT
-            COUNT(1)
-        FROM
-            scan_paper_type_check sptc
-                LEFT JOIN
-            mark_student ms ON sptc.student_id = ms.id
-                LEFT JOIN
-            basic_course bc ON ms.course_id = bc.id
-            <if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                AND bc.teaching_room_id IN
-                <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-        <where>
-            <if test="examId != null">
-                and sptc.exam_id = #{examId}
-            </if>
-            <if test="status != null">
-                and sptc.status = #{status}
-            </if>
-            <if test="courseId != null">
-                and bc.id = #{courseId}
-            </if>
-            <if test="coursePaperId != null and coursePaperId != ''">
-                and ms.course_paper_id = #{coursePaperId}
-            </if>
-            <if test="dpr != null and dpr.requestUserId != null">
-                AND sptc.creator_id = #{dpr.requestUserId}
-            </if>
-        </where>
-    </select>
-</mapper>