Browse Source

3.3.0 确认缺考删除识别对照任务;确认不缺考统计客观题分数

yin 1 year ago
parent
commit
0c99f8c9da

+ 21 - 14
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -1,5 +1,21 @@
 package com.qmth.teachcloud.mark.service.impl;
 
+import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotNull;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.FileCopyUtils;
+
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -52,20 +68,6 @@ import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.utils.BatchGetDataUtil;
 import com.qmth.teachcloud.mark.utils.Calculator;
 import com.qmth.teachcloud.mark.utils.ScoreCalculateUtil;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.FileCopyUtils;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.NotNull;
-import java.io.File;
-import java.nio.charset.StandardCharsets;
-import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -797,6 +799,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         }
         lw.eq(MarkStudent::getId, student.getId());
         update(lw);
+        if (omrAbsent) {
+            scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
+        } else {
+            calculateObjectiveScore(student);
+        }
         markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
                 this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
         return UpdateTimeVo.create();