|
@@ -1,5 +1,25 @@
|
|
package cn.com.qmth.scancentral.service.impl;
|
|
package cn.com.qmth.scancentral.service.impl;
|
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
+import org.apache.commons.lang.math.RandomUtils;
|
|
|
|
+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.web.multipart.MultipartFile;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.qmth.boot.core.collection.PageResult;
|
|
|
|
+import com.qmth.boot.core.concurrent.service.ConcurrentService;
|
|
|
|
+import com.qmth.boot.core.exception.ParameterException;
|
|
|
|
+import com.qmth.boot.core.exception.StatusException;
|
|
|
|
+
|
|
import cn.com.qmth.scancentral.bean.BatchCreateDomain;
|
|
import cn.com.qmth.scancentral.bean.BatchCreateDomain;
|
|
import cn.com.qmth.scancentral.bean.BatchQueryDomain;
|
|
import cn.com.qmth.scancentral.bean.BatchQueryDomain;
|
|
import cn.com.qmth.scancentral.bean.User;
|
|
import cn.com.qmth.scancentral.bean.User;
|
|
@@ -26,24 +46,6 @@ import cn.com.qmth.scancentral.vo.paper.PaperVo;
|
|
import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
|
|
import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
|
|
import cn.com.qmth.scancentral.vo.verify.VerifyStudentVo;
|
|
import cn.com.qmth.scancentral.vo.verify.VerifyStudentVo;
|
|
import cn.com.qmth.scancentral.vo.verify.VerifyTaskVo;
|
|
import cn.com.qmth.scancentral.vo.verify.VerifyTaskVo;
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
-import com.qmth.boot.core.collection.PageResult;
|
|
|
|
-import com.qmth.boot.core.concurrent.service.ConcurrentService;
|
|
|
|
-import com.qmth.boot.core.exception.ParameterException;
|
|
|
|
-import com.qmth.boot.core.exception.StatusException;
|
|
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
-import org.apache.commons.lang.math.RandomUtils;
|
|
|
|
-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.web.multipart.MultipartFile;
|
|
|
|
-
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> implements BatchService {
|
|
public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> implements BatchService {
|
|
@@ -663,10 +665,11 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public VerifyTaskVo getCheckImageTask(Long examId, User user) {
|
|
public VerifyTaskVo getCheckImageTask(Long examId, User user) {
|
|
|
|
+ ExamEntity exam = examService.getById(examId);
|
|
int retry = 1;
|
|
int retry = 1;
|
|
VerifyTaskVo task = null;
|
|
VerifyTaskVo task = null;
|
|
while (task == null) {
|
|
while (task == null) {
|
|
- List<BatchEntity> list = this.findUnCheck(examId, retry, 20, BatchStatus.FINISH, CheckStatus.WAITING)
|
|
|
|
|
|
+ List<BatchEntity> list = this.findUnCheck(examId, retry, 20, BatchStatus.FINISH, CheckStatus.WAITING,exam.getImageCheckOrder())
|
|
.getRecords();
|
|
.getRecords();
|
|
if (list.isEmpty()) {
|
|
if (list.isEmpty()) {
|
|
break;
|
|
break;
|
|
@@ -682,7 +685,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (task == null) {
|
|
if (task == null) {
|
|
- throw NotFoundExceptions.NO_SYNC_VERIFY_TASK;
|
|
|
|
|
|
+ throw NotFoundExceptions.NO_CHECK_IMAGE_TASK;
|
|
}
|
|
}
|
|
return task;
|
|
return task;
|
|
}
|
|
}
|
|
@@ -745,7 +748,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void releaseCheckImageTask(Long examId, User user) {
|
|
public void releaseCheckImageTask(Long examId, User user) {
|
|
- TaskLock taskLock = TaskLockUtil.getCheckTask(examId.toString());
|
|
|
|
|
|
+ TaskLock taskLock = TaskLockUtil.getImageCheckTask(examId.toString());
|
|
taskLock.clear(user.getAccount());
|
|
taskLock.clear(user.getAccount());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -765,19 +768,19 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void releaseCheckImageTask(BatchEntity t) {
|
|
public void releaseCheckImageTask(BatchEntity t) {
|
|
- TaskLock taskLock = TaskLockUtil.getCheckTask(t.getExamId().toString());
|
|
|
|
|
|
+ TaskLock taskLock = TaskLockUtil.getImageCheckTask(t.getExamId().toString());
|
|
taskLock.remove(t.getId().toString());
|
|
taskLock.remove(t.getId().toString());
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public IPage<BatchEntity> findUnCheck(Long examId, int pageNumber, int pageSize, BatchStatus batchStatus,
|
|
public IPage<BatchEntity> findUnCheck(Long examId, int pageNumber, int pageSize, BatchStatus batchStatus,
|
|
- CheckStatus checkStatus) {
|
|
|
|
- return this.baseMapper.findUnCheck(new Page<>(pageNumber, pageSize), examId, batchStatus, checkStatus);
|
|
|
|
|
|
+ CheckStatus checkStatus,String order) {
|
|
|
|
+ return this.baseMapper.findUnCheck(new Page<>(pageNumber, pageSize), examId, batchStatus, checkStatus,order);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public boolean applyCheckImageTask(BatchEntity t, String user) {
|
|
public boolean applyCheckImageTask(BatchEntity t, String user) {
|
|
- TaskLock taskLock = TaskLockUtil.getCheckTask(t.getExamId().toString());
|
|
|
|
|
|
+ TaskLock taskLock = TaskLockUtil.getImageCheckTask(t.getExamId().toString());
|
|
boolean lock = taskLock.add(t.getId(), user);
|
|
boolean lock = taskLock.add(t.getId(), user);
|
|
// 上锁失败直接返回
|
|
// 上锁失败直接返回
|
|
if (!lock) {
|
|
if (!lock) {
|