yin 8 ماه پیش
والد
کامیت
06f4b68f4d

+ 5 - 5
src/main/java/cn/com/qmth/scancentral/controller/scan/ScanBatchController.java

@@ -66,11 +66,11 @@ public class ScanBatchController extends BaseController {
         return batchService.sliceUpload(batchId, examNumber, paperNumber, pageIndex, index, file, md5);
     }
 
-//    @ApiOperation(value = "答题卡扫描批次提交审核/查询审核结果")
-//    @RequestMapping(value = "/verify", method = RequestMethod.POST)
-//    public BatchVerifyVo batchVerify(@RequestParam Long id) {
-//        return batchService.batchVerify(id);
-//    }
+    @ApiOperation(value = "答题卡扫描批次提交审核/查询审核结果")
+    @RequestMapping(value = "/verify", method = RequestMethod.POST)
+    public BatchVerifyVo batchVerify(@RequestParam Long id) {
+        return batchService.batchVerify(id);
+    }
 
     @ApiOperation(value = "答题卡扫描批次完成")
     @RequestMapping(value = "/finish", method = RequestMethod.POST)

+ 3 - 1
src/main/java/cn/com/qmth/scancentral/service/BatchService.java

@@ -41,7 +41,9 @@ public interface BatchService extends IService<BatchEntity> {
 
     AnswerSaveVo batchSave(AnswerDomain domain, User user);
 
-    BatchVerifyVo verify(Long batchId, Boolean comfirm, User user);
+    void verify(Long batchId, Boolean comfirm, User user);
+
+    BatchVerifyVo batchVerify(Long id);
 
     BatchFinishVo batchFinish(Long id);
 

+ 22 - 14
src/main/java/cn/com/qmth/scancentral/service/impl/BatchServiceImpl.java

@@ -380,23 +380,11 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
 
     @Transactional
     @Override
-    public BatchVerifyVo verify(Long batchId, Boolean comfirm, User user) {
+    public void verify(Long batchId, Boolean comfirm, User user) {
         BatchEntity entity = this.getById(batchId);
         if (entity == null) {
             throw new ParameterException("批次不存在");
         }
-        Integer count = findStudentCountByBatch(batchId);
-        if (count == null || count == 0) {
-            throw new ParameterException("该批次未上传图片");
-        }
-        if (entity.getVerifyStatus() == null) {
-            ExamEntity exam = examService.getById(entity.getExamId());
-            if (exam.getEnableSyncVerify() == null || !exam.getEnableSyncVerify()) {
-                throw new ParameterException("考试未启用实时审核");
-            }
-            entity.setVerifyStatus(VerifyStatus.WAITING);
-            this.saveOrUpdate(entity);
-        }
         if (!VerifyStatus.WAITING.equals(entity.getVerifyStatus())) {
             throw new ParameterException("批次已被处理");
         }
@@ -408,7 +396,27 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
         }
         entity.setUpdateTime(System.currentTimeMillis());
         this.saveOrUpdate(entity);
-        this.releaseVerifyTask(entity);
+    }
+
+    @Transactional
+    @Override
+    public BatchVerifyVo batchVerify(Long id) {
+        BatchEntity entity = this.getById(id);
+        if (entity == null) {
+            throw new ParameterException("批次不存在");
+        }
+        Integer count = findStudentCountByBatch(id);
+        if (count == null || count == 0) {
+            throw new ParameterException("该批次未上传图片");
+        }
+        if (entity.getVerifyStatus() == null) {
+            ExamEntity exam = examService.getById(entity.getExamId());
+            if (exam.getEnableSyncVerify() == null || !exam.getEnableSyncVerify()) {
+                throw new ParameterException("考试未启用实时审核");
+            }
+            entity.setVerifyStatus(VerifyStatus.WAITING);
+            this.saveOrUpdate(entity);
+        }
         BatchVerifyVo vo = new BatchVerifyVo();
         vo.setStatus(entity.getVerifyStatus());
         vo.setUpdateTime(entity.getUpdateTime());