浏览代码

识别对照任务接口

ting.yin 1 年之前
父节点
当前提交
4a3cb070e3
共有 16 个文件被更改,包括 861 次插入144 次删除
  1. 57 3
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanOmrTaskController.java
  2. 51 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/ConditionType.java
  3. 34 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/OmrField.java
  4. 28 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/OmrType.java
  5. 29 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/ArrayResult.java
  6. 27 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/BoolResult.java
  7. 27 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/StringResult.java
  8. 97 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskDto.java
  9. 89 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskPageDto.java
  10. 45 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskResultDto.java
  11. 90 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskResultPageDto.java
  12. 52 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskSaveDto.java
  13. 25 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskStatusDto.java
  14. 145 137
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/ScanPaperPage.java
  15. 19 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanOmrTaskService.java
  16. 46 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java

+ 57 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanOmrTaskController.java

@@ -1,12 +1,27 @@
 package com.qmth.distributed.print.api.mark;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import io.swagger.annotations.Api;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.util.ServletUtil;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskResultDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskSaveDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
+import com.qmth.teachcloud.mark.service.ScanOmrTaskService;
 
-import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 
 /**
  * <p>
@@ -20,5 +35,44 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_SCAN + "/task/omr")
 public class ScanOmrTaskController {
+	protected static final Logger log = LoggerFactory.getLogger(ScanOmrTaskController.class);
+
+	@Autowired
+	private ScanOmrTaskService omrTaskService;
+
+	@ApiOperation(value = "识别对照任务获取")
+	@RequestMapping(value = "/get", method = RequestMethod.POST)
+	public ScanOmrTaskDto get(@RequestParam Long examId) {
+		SysUser user = (SysUser) ServletUtil.getRequestUser();
+		return omrTaskService.getTask(examId, user.getId());
+	}
+
+	@ApiOperation(value = "识别对照任务提交")
+	@RequestMapping(value = "/save", method = RequestMethod.POST)
+	public ScanOmrTaskSaveDto save(@Validated @RequestBody ScanOmrTaskResultDto result) {
+		SysUser user = (SysUser) ServletUtil.getRequestUser();
+		return omrTaskService.submitTask(result, user);
+	}
+
+	@ApiOperation(value = "识别对照任务状态")
+	@RequestMapping(value = "/status", method = RequestMethod.POST)
+	public ScanOmrTaskStatusDto status(@RequestParam Long examId) {
+		SysUser user = (SysUser) ServletUtil.getRequestUser();
+		return omrTaskService.getStatus(examId, user.getId());
+	}
+
+	@ApiOperation(value = "识别对照任务状态")
+	@RequestMapping(value = "/release", method = RequestMethod.POST)
+	public void release(@RequestParam Long examId) {
+		SysUser user = (SysUser) ServletUtil.getRequestUser();
+		omrTaskService.releaseByUser(examId, user.getId());
+	}
 
+	@ApiOperation(value = "识别对照任务历史")
+	@RequestMapping(value = "/history", method = RequestMethod.POST)
+	public ScanOmrTaskDto history(@RequestParam Long examId, @RequestParam(required = false) Long id,
+			@RequestParam(required = false) Boolean next) {
+		SysUser user = (SysUser) ServletUtil.getRequestUser();
+		return omrTaskService.history(examId, id, user.getId(), next);
+	}
 }

+ 51 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/ConditionType.java

@@ -0,0 +1,51 @@
+package com.qmth.teachcloud.common.enums.scan;
+
+public enum ConditionType {
+
+    FILL_SUSPECT("填涂识别嫌疑", false),
+    // ABSENT_FILL("缺考已填涂"),
+    // BREACH_FILL("违纪已填涂"),
+    QUESTION_SINGLE_EXCEED("单选题多填涂", false),
+    QUESTION_SINGLE_BLANK("单选题空选题数大于", true),
+    QUESTION_MULTI_BLANK("多选题空选题数大于", true),
+    SELECTIVE_EXCEED("选做题填涂超过", true),
+    SELECTIVE_BLANK("选做题空选题数大于", true),
+    PAPER_TYPE_EXCEED("卷型多填涂", false),
+    PAPER_TYPE_BLANK("卷型空选", false);
+
+    private String name;
+
+    private boolean needValue;
+
+    ConditionType(String name, boolean needValue) {
+        this.name = name;
+        this.needValue = needValue;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public boolean isNeedValue() {
+        return needValue;
+    }
+
+    public static ConditionType getByName(String name) {
+        for (ConditionType r : ConditionType.values()) {
+            if (r.getName().equals(name)) {
+                return r;
+            }
+        }
+        return null;
+    }
+
+    public static ConditionType findByCode(String code) {
+        for (ConditionType r : ConditionType.values()) {
+            if (r.toString().equalsIgnoreCase(code)) {
+                return r;
+            }
+        }
+        return null;
+    }
+
+}

+ 34 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/OmrField.java

@@ -0,0 +1,34 @@
+package com.qmth.teachcloud.common.enums.scan;
+
+public enum OmrField {
+
+    ABSENT("缺考"),
+
+    BREACH("违纪"),
+
+    PAPER_TYPE("试卷类型"),
+
+    SELECTIVE("选做题"),
+
+    QUESTION("题目");
+
+    private String name;
+
+    OmrField(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public static OmrField getByName(String name) {
+        for (OmrField r : OmrField.values()) {
+            if (r.getName().equals(name)) {
+                return r;
+            }
+        }
+        return null;
+    }
+
+}

+ 28 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/scan/OmrType.java

@@ -0,0 +1,28 @@
+package com.qmth.teachcloud.common.enums.scan;
+
+public enum OmrType {
+
+    FILL_AREA("填涂"),
+
+    BARCODE("二维码");
+
+    private String name;
+
+    OmrType(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public static OmrType getByName(String name) {
+        for (OmrType r : OmrType.values()) {
+            if (r.getName().equals(name)) {
+                return r;
+            }
+        }
+        return null;
+    }
+
+}

+ 29 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/ArrayResult.java

@@ -0,0 +1,29 @@
+package com.qmth.teachcloud.mark.bean;
+
+import java.util.List;
+
+import com.qmth.teachcloud.common.enums.scan.OmrType;
+
+public class ArrayResult {
+    private OmrType type;
+
+    private List<String> result;
+
+	public OmrType getType() {
+		return type;
+	}
+
+	public void setType(OmrType type) {
+		this.type = type;
+	}
+
+	public List<String> getResult() {
+		return result;
+	}
+
+	public void setResult(List<String> result) {
+		this.result = result;
+	}
+    
+    
+}

+ 27 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/BoolResult.java

@@ -0,0 +1,27 @@
+package com.qmth.teachcloud.mark.bean;
+
+import com.qmth.teachcloud.common.enums.scan.OmrType;
+
+public class BoolResult {
+    private OmrType type;
+
+    private Boolean result;
+
+	public OmrType getType() {
+		return type;
+	}
+
+	public void setType(OmrType type) {
+		this.type = type;
+	}
+
+	public Boolean getResult() {
+		return result;
+	}
+
+	public void setResult(Boolean result) {
+		this.result = result;
+	}
+    
+    
+}

+ 27 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/StringResult.java

@@ -0,0 +1,27 @@
+package com.qmth.teachcloud.mark.bean;
+
+import com.qmth.teachcloud.common.enums.scan.OmrType;
+
+public class StringResult {
+
+    private OmrType type;
+
+    private String result;
+
+    public OmrType getType() {
+        return type;
+    }
+
+    public void setType(OmrType type) {
+        this.type = type;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+}

+ 97 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskDto.java

@@ -0,0 +1,97 @@
+package com.qmth.teachcloud.mark.dto;
+
+import java.util.List;
+
+public class ScanOmrTaskDto {
+
+    private Long id;
+
+    private String examNumber;
+
+    private String name;
+
+    private String subjectCode;
+
+    private String subjectName;
+
+    private Integer cardNumber;
+
+    private Long paperId;
+
+    private Integer paperNumber;
+
+    private List<ScanOmrTaskPageDto> pages;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getExamNumber() {
+        return examNumber;
+    }
+
+    public void setExamNumber(String examNumber) {
+        this.examNumber = examNumber;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSubjectCode() {
+        return subjectCode;
+    }
+
+    public void setSubjectCode(String subjectCode) {
+        this.subjectCode = subjectCode;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Integer getCardNumber() {
+        return cardNumber;
+    }
+
+    public void setCardNumber(Integer cardNumber) {
+        this.cardNumber = cardNumber;
+    }
+
+    public Long getPaperId() {
+        return paperId;
+    }
+
+    public void setPaperId(Long paperId) {
+        this.paperId = paperId;
+    }
+
+    public Integer getPaperNumber() {
+        return paperNumber;
+    }
+
+    public void setPaperNumber(Integer paperNumber) {
+        this.paperNumber = paperNumber;
+    }
+
+    public List<ScanOmrTaskPageDto> getPages() {
+        return pages;
+    }
+
+    public void setPages(List<ScanOmrTaskPageDto> pages) {
+        this.pages = pages;
+    }
+
+}

+ 89 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskPageDto.java

@@ -0,0 +1,89 @@
+package com.qmth.teachcloud.mark.dto;
+
+import java.util.List;
+import java.util.Map;
+
+public class ScanOmrTaskPageDto {
+
+    private Integer index;
+
+    private String uri;
+
+    private List<Boolean> absent;
+
+    private List<Boolean> breach;
+
+    private List<String> paperType;
+
+    private Map<Integer, List<String>> question;
+
+    private Map<Integer, List<String>> selective;
+    
+    private String recogData;
+
+    public Integer getIndex() {
+        return index;
+    }
+
+    public void setIndex(Integer index) {
+        this.index = index;
+    }
+
+    public String getUri() {
+        return uri;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+
+    public List<Boolean> getAbsent() {
+        return absent;
+    }
+
+    public void setAbsent(List<Boolean> absent) {
+        this.absent = absent;
+    }
+
+    public List<Boolean> getBreach() {
+        return breach;
+    }
+
+    public void setBreach(List<Boolean> breach) {
+        this.breach = breach;
+    }
+
+    public List<String> getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(List<String> paperType) {
+        this.paperType = paperType;
+    }
+
+    public Map<Integer, List<String>> getQuestion() {
+        return question;
+    }
+
+    public void setQuestion(Map<Integer, List<String>> question) {
+        this.question = question;
+    }
+
+    public Map<Integer, List<String>> getSelective() {
+        return selective;
+    }
+
+    public void setSelective(Map<Integer, List<String>> selective) {
+        this.selective = selective;
+    }
+
+	public String getRecogData() {
+		return recogData;
+	}
+
+	public void setRecogData(String recogData) {
+		this.recogData = recogData;
+	}
+    
+    
+}

+ 45 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskResultDto.java

@@ -0,0 +1,45 @@
+package com.qmth.teachcloud.mark.dto;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.util.List;
+
+public class ScanOmrTaskResultDto {
+
+    @NotNull(message = "任务ID不能为空")
+    private Long id;
+
+    @Valid
+    @NotNull(message = "任务pages不能为空")
+    @Size(min = 1, message = "任务pages不能为空")
+    private List<ScanOmrTaskResultPageDto> pages;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public List<ScanOmrTaskResultPageDto> getPages() {
+        return pages;
+    }
+
+    public ScanOmrTaskResultPageDto findPage(Integer index) {
+        if (pages != null) {
+            for (ScanOmrTaskResultPageDto vo : pages) {
+                if (vo.getIndex().equals(index)) {
+                    return vo;
+                }
+            }
+        }
+        return null;
+    }
+
+    public void setPages(List<ScanOmrTaskResultPageDto> pages) {
+        this.pages = pages;
+    }
+
+}

+ 90 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskResultPageDto.java

@@ -0,0 +1,90 @@
+package com.qmth.teachcloud.mark.dto;
+
+import java.util.Map;
+
+import javax.validation.constraints.NotNull;
+
+import org.apache.commons.collections4.CollectionUtils;
+
+import com.qmth.boot.core.exception.ParameterException;
+import com.qmth.teachcloud.mark.entity.ScanPaperPage;
+
+public class ScanOmrTaskResultPageDto {
+
+	@NotNull(message = "任务pageIndex不能为空")
+	private Integer index;
+
+	private Boolean absent;
+
+	private Boolean breach;
+
+	private Map<Integer, String> question;
+
+	private Map<Integer, String> selective;
+
+	public Integer getIndex() {
+		return index;
+	}
+
+	public void setIndex(Integer index) {
+		this.index = index;
+	}
+
+	public Boolean getAbsent() {
+		return absent;
+	}
+
+	public void setAbsent(Boolean absent) {
+		this.absent = absent;
+	}
+
+	public Boolean getBreach() {
+		return breach;
+	}
+
+	public void setBreach(Boolean breach) {
+		this.breach = breach;
+	}
+
+	public Map<Integer, String> getQuestion() {
+		return question;
+	}
+
+	public void setQuestion(Map<Integer, String> question) {
+		this.question = question;
+	}
+
+	public Map<Integer, String> getSelective() {
+		return selective;
+	}
+
+	public void setSelective(Map<Integer, String> selective) {
+		this.selective = selective;
+	}
+
+	public ScanPaperPage update(ScanPaperPage page) {
+		if (absent != null) {
+			page.getAbsent().setResult(absent);
+		}
+		if (breach != null) {
+			page.getBreach().setResult(breach);
+		}
+		if (question != null && !question.isEmpty()) {
+			if (page.getQuestion() == null || CollectionUtils.isEmpty(page.getQuestion().getResult())) {
+				throw new ParameterException("page[" + page.getPageIndex() + "]没有question信息");
+			}
+			for (Map.Entry<Integer, String> entry : question.entrySet()) {
+				page.getQuestion().getResult().set(entry.getKey() - 1, entry.getValue());
+			}
+		}
+		if (selective != null && !selective.isEmpty()) {
+			if (page.getSelective() == null || CollectionUtils.isEmpty(page.getSelective().getResult())) {
+				throw new ParameterException("page[" + page.getPageIndex() + "]没有selective信息");
+			}
+			for (Map.Entry<Integer, String> entry : question.entrySet()) {
+				page.getSelective().getResult().set(entry.getKey() - 1, entry.getValue());
+			}
+		}
+		return page;
+	}
+}

+ 52 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskSaveDto.java

@@ -0,0 +1,52 @@
+package com.qmth.teachcloud.mark.dto;
+
+public class ScanOmrTaskSaveDto {
+
+    private Long id;
+
+    private Long updateTime;
+
+    private ScanOmrTaskStatusDto status;
+    
+    private boolean arbitrate;
+
+    public ScanOmrTaskSaveDto() {
+        this.status = new ScanOmrTaskStatusDto();
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Long updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public ScanOmrTaskStatusDto getStatus() {
+        return status;
+    }
+
+    public void setStatus(ScanOmrTaskStatusDto status) {
+        this.status = status;
+    }
+
+    
+    public boolean isArbitrate() {
+        return arbitrate;
+    }
+
+    
+    public void setArbitrate(boolean arbitrate) {
+        this.arbitrate = arbitrate;
+    }
+
+
+}

+ 25 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskStatusDto.java

@@ -0,0 +1,25 @@
+package com.qmth.teachcloud.mark.dto;
+
+public class ScanOmrTaskStatusDto {
+
+    private Integer finishCount;
+
+    private Integer todoCount;
+
+    public Integer getFinishCount() {
+        return finishCount;
+    }
+
+    public void setFinishCount(Integer finishCount) {
+        this.finishCount = finishCount;
+    }
+
+    public Integer getTodoCount() {
+        return todoCount;
+    }
+
+    public void setTodoCount(Integer todoCount) {
+        this.todoCount = todoCount;
+    }
+
+}

+ 145 - 137
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/ScanPaperPage.java

@@ -1,14 +1,17 @@
 package com.qmth.teachcloud.mark.entity;
 
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.teachcloud.mark.bean.ArrayResult;
+import com.qmth.teachcloud.mark.bean.BoolResult;
+
 import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
 
 /**
  * <p>
@@ -19,139 +22,144 @@ import io.swagger.annotations.ApiModelProperty;
  * @since 2023-09-22
  */
 @TableName("scan_paper_page")
-@ApiModel(value="ScanPaperPage对象", description="")
+@ApiModel(value = "ScanPaperPage对象", description = "")
 public class ScanPaperPage implements Serializable {
 
-    private static final long serialVersionUID = 1L;
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableId(value = "paper_id")
-    private Long paperId;
-
-    private Integer pageIndex;
-
-    private String absent;
-
-    private String breach;
-
-    private String question;
-
-    private String selective;
-
-    private String sheetPath;
-
-    private String recogData;
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long creatorId;
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long updaterId;
-
-    private Long createTime;
-
-    private Long updateTime;
-
-    public Long getPaperId() {
-        return paperId;
-    }
-
-    public void setPaperId(Long paperId) {
-        this.paperId = paperId;
-    }
-    public Integer getPageIndex() {
-        return pageIndex;
-    }
-
-    public void setPageIndex(Integer pageIndex) {
-        this.pageIndex = pageIndex;
-    }
-    public String getAbsent() {
-        return absent;
-    }
-
-    public void setAbsent(String absent) {
-        this.absent = absent;
-    }
-    public String getBreach() {
-        return breach;
-    }
-
-    public void setBreach(String breach) {
-        this.breach = breach;
-    }
-    public String getQuestion() {
-        return question;
-    }
-
-    public void setQuestion(String question) {
-        this.question = question;
-    }
-    public String getSelective() {
-        return selective;
-    }
-
-    public void setSelective(String selective) {
-        this.selective = selective;
-    }
-    public String getSheetPath() {
-        return sheetPath;
-    }
-
-    public void setSheetPath(String sheetPath) {
-        this.sheetPath = sheetPath;
-    }
-    public String getRecogData() {
-        return recogData;
-    }
-
-    public void setRecogData(String recogData) {
-        this.recogData = recogData;
-    }
-    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;
-    }
-    public Long getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Long createTime) {
-        this.createTime = createTime;
-    }
-    public Long getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Long updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    @Override
-    public String toString() {
-        return "ScanPaperPage{" +
-            "paperId=" + paperId +
-            ", pageIndex=" + pageIndex +
-            ", absent=" + absent +
-            ", breach=" + breach +
-            ", question=" + question +
-            ", selective=" + selective +
-            ", sheetPath=" + sheetPath +
-            ", recogData=" + recogData +
-            ", creatorId=" + creatorId +
-            ", updaterId=" + updaterId +
-            ", createTime=" + createTime +
-            ", updateTime=" + updateTime +
-        "}";
-    }
+	private static final long serialVersionUID = 1L;
+
+	@JsonSerialize(using = ToStringSerializer.class)
+	@TableId(value = "paper_id")
+	private Long paperId;
+
+	private Integer pageIndex;
+
+	@TableField(value = "absent", typeHandler = JacksonTypeHandler.class)
+	private BoolResult absent;
+
+	@TableField(value = "breach", typeHandler = JacksonTypeHandler.class)
+	private BoolResult breach;
+
+	@TableField(value = "question", typeHandler = JacksonTypeHandler.class)
+	private ArrayResult question;
+
+	@TableField(value = "selective", typeHandler = JacksonTypeHandler.class)
+	private ArrayResult selective;
+
+	private String sheetPath;
+
+	private String recogData;
+
+	@JsonSerialize(using = ToStringSerializer.class)
+	private Long creatorId;
+
+	@JsonSerialize(using = ToStringSerializer.class)
+	private Long updaterId;
+
+	private Long createTime;
+
+	private Long updateTime;
+
+	public Long getPaperId() {
+		return paperId;
+	}
+
+	public void setPaperId(Long paperId) {
+		this.paperId = paperId;
+	}
+
+	public Integer getPageIndex() {
+		return pageIndex;
+	}
+
+	public void setPageIndex(Integer pageIndex) {
+		this.pageIndex = pageIndex;
+	}
+
+	public BoolResult getAbsent() {
+		return absent;
+	}
+
+	public void setAbsent(BoolResult absent) {
+		this.absent = absent;
+	}
+
+	public BoolResult getBreach() {
+		return breach;
+	}
+
+	public void setBreach(BoolResult breach) {
+		this.breach = breach;
+	}
+
+	public ArrayResult getQuestion() {
+		return question;
+	}
+
+	public void setQuestion(ArrayResult question) {
+		this.question = question;
+	}
+
+	public ArrayResult getSelective() {
+		return selective;
+	}
+
+	public void setSelective(ArrayResult selective) {
+		this.selective = selective;
+	}
+
+	public String getSheetPath() {
+		return sheetPath;
+	}
+
+	public void setSheetPath(String sheetPath) {
+		this.sheetPath = sheetPath;
+	}
+
+	public String getRecogData() {
+		return recogData;
+	}
+
+	public void setRecogData(String recogData) {
+		this.recogData = recogData;
+	}
+
+	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;
+	}
+
+	public Long getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Long createTime) {
+		this.createTime = createTime;
+	}
+
+	public Long getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Long updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	@Override
+	public String toString() {
+		return "ScanPaperPage{" + "paperId=" + paperId + ", pageIndex=" + pageIndex + ", absent=" + absent + ", breach="
+				+ breach + ", question=" + question + ", selective=" + selective + ", sheetPath=" + sheetPath
+				+ ", recogData=" + recogData + ", creatorId=" + creatorId + ", updaterId=" + updaterId + ", createTime="
+				+ createTime + ", updateTime=" + updateTime + "}";
+	}
 }

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

@@ -1,7 +1,13 @@
 package com.qmth.teachcloud.mark.service;
 
-import com.qmth.teachcloud.mark.entity.ScanOmrTask;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.scan.ConditionType;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskResultDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskSaveDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
+import com.qmth.teachcloud.mark.entity.ScanOmrTask;
 
 /**
  * <p>
@@ -12,5 +18,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2023-09-22
  */
 public interface ScanOmrTaskService extends IService<ScanOmrTask> {
+	
+	ScanOmrTask buildTask(ConditionType c, Long studentId);
+
+	ScanOmrTaskDto getTask(Long examId, Long userId);
+
+	ScanOmrTaskSaveDto submitTask(ScanOmrTaskResultDto result, SysUser user);
+
+	ScanOmrTaskStatusDto getStatus(Long examId, Long userId);
+
+	void releaseByUser(Long examId, Long userId);
+
+	ScanOmrTaskDto history(Long examId, Long taskId, Long userId, Boolean next);
 
 }

+ 46 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java

@@ -1,14 +1,21 @@
 package com.qmth.teachcloud.mark.service.impl;
 
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.scan.ConditionType;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskResultDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskSaveDto;
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
 import com.qmth.teachcloud.mark.entity.ScanOmrTask;
 import com.qmth.teachcloud.mark.mapper.ScanOmrTaskMapper;
 import com.qmth.teachcloud.mark.service.ScanOmrTaskService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
 
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
  * @author xf
@@ -17,4 +24,40 @@ import org.springframework.stereotype.Service;
 @Service
 public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanOmrTask> implements ScanOmrTaskService {
 
+	@Override
+	public ScanOmrTask buildTask(ConditionType c, Long studentId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public ScanOmrTaskDto getTask(Long examId, Long userId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public ScanOmrTaskSaveDto submitTask(ScanOmrTaskResultDto result, SysUser user) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public ScanOmrTaskStatusDto getStatus(Long examId, Long userId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void releaseByUser(Long examId, Long userId) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public ScanOmrTaskDto history(Long examId, Long taskId, Long userId, Boolean next) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
 }