ting.yin 1 год назад
Родитель
Сommit
2d5f2568d8

+ 5 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/ScanOmrTaskDto.java

@@ -2,11 +2,13 @@ package com.qmth.teachcloud.mark.dto;
 
 import java.util.List;
 
+import com.qmth.teachcloud.common.enums.scan.ConditionType;
+
 public class ScanOmrTaskDto {
 
 	private Long id;
 
-	private String conditions;
+	private ConditionType conditions;
 
 	private Long paperId;
 
@@ -22,11 +24,11 @@ public class ScanOmrTaskDto {
 		this.id = id;
 	}
 
-	public String getConditions() {
+	public ConditionType getConditions() {
 		return conditions;
 	}
 
-	public void setConditions(String conditions) {
+	public void setConditions(ConditionType conditions) {
 		this.conditions = conditions;
 	}
 

+ 4 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/ScanOmrTask.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.teachcloud.common.enums.scan.ConditionType;
 import com.qmth.teachcloud.mark.bean.OmrTaskPage;
 import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
 import com.qmth.teachcloud.mark.handle.OmrTaskPageListTypeHandler;
@@ -38,7 +39,7 @@ public class ScanOmrTask implements Serializable {
 	private Long examId;
 
 	@ApiModelProperty(value = "条件")
-	private String conditions;
+	private ConditionType conditions;
 
 	@JsonSerialize(using = ToStringSerializer.class)
 	@ApiModelProperty(value = "考生ID")
@@ -89,11 +90,11 @@ public class ScanOmrTask implements Serializable {
 		this.examId = examId;
 	}
 
-	public String getConditions() {
+	public ConditionType getConditions() {
 		return conditions;
 	}
 
-	public void setConditions(String conditions) {
+	public void setConditions(ConditionType conditions) {
 		this.conditions = conditions;
 	}
 

+ 5 - 4
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java

@@ -107,7 +107,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
 			ScanOmrTask task = new ScanOmrTask();
 			task.setCardNumber(paper.getCardNumber());
 			task.setExamId(paper.getExamId());
-			task.setConditions(c.toString());
+			task.setConditions(c);
 			task.setPaperId(paperId);
 			task.setPaperIndex(spe.getPaperIndex());
 			task.setStatus(OmrTaskStatus.WAITING);
@@ -302,7 +302,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
 	private List<ScanOmrTask> getByStudent(ConditionType c, Long studentId) {
 		QueryWrapper<ScanOmrTask> wrapper = new QueryWrapper<>();
 		LambdaQueryWrapper<ScanOmrTask> lw = wrapper.lambda();
-		lw.eq(ScanOmrTask::getConditions, c.toString());
+		lw.eq(ScanOmrTask::getConditions, c);
 		lw.eq(ScanOmrTask::getStudentId, studentId);
 		return baseMapper.selectList(wrapper);
 	}
@@ -310,7 +310,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
 	private void delete(ConditionType c, Long studentId, Long paperId) {
 		UpdateWrapper<ScanOmrTask> wrapper = new UpdateWrapper<>();
 		LambdaUpdateWrapper<ScanOmrTask> lw = wrapper.lambda();
-		lw.eq(ScanOmrTask::getConditions, c.toString());
+		lw.eq(ScanOmrTask::getConditions, c);
 		lw.eq(ScanOmrTask::getStudentId, studentId);
 		lw.eq(ScanOmrTask::getPaperId, paperId);
 		this.baseMapper.delete(wrapper);
@@ -319,7 +319,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
 	private void delete(ConditionType c, Long studentId) {
 		UpdateWrapper<ScanOmrTask> wrapper = new UpdateWrapper<>();
 		LambdaUpdateWrapper<ScanOmrTask> lw = wrapper.lambda();
-		lw.eq(ScanOmrTask::getConditions, c.toString());
+		lw.eq(ScanOmrTask::getConditions, c);
 		lw.eq(ScanOmrTask::getStudentId, studentId);
 		this.baseMapper.delete(wrapper);
 	}
@@ -564,6 +564,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
 	public void deleteByStudentId(Long examId, Long studentId) {
 		QueryWrapper<ScanOmrTask> wrapper = new QueryWrapper<>();
 		LambdaQueryWrapper<ScanOmrTask> lw = wrapper.lambda();
+		lw.eq(ScanOmrTask::getExamId, examId);
 		lw.eq(ScanOmrTask::getStudentId, studentId);
 		List<ScanOmrTask> tasks = baseMapper.selectList(wrapper);
 		if (CollectionUtils.isEmpty(tasks)) {