|
@@ -1,57 +1,6 @@
|
|
package cn.com.qmth.scancentral.service.impl;
|
|
package cn.com.qmth.scancentral.service.impl;
|
|
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.io.IOException;
|
|
|
|
-import java.io.InputStream;
|
|
|
|
-import java.io.InputStreamReader;
|
|
|
|
-import java.io.LineNumberReader;
|
|
|
|
-import java.math.BigDecimal;
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.LinkedHashSet;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Set;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
-
|
|
|
|
-import javax.validation.constraints.NotNull;
|
|
|
|
-
|
|
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.slf4j.Logger;
|
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
|
-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.conditions.update.LambdaUpdateWrapper;
|
|
|
|
-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 com.qmth.boot.core.retrofit.utils.SignatureInfo;
|
|
|
|
-import com.qmth.boot.tools.excel.ExcelReader;
|
|
|
|
-import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
|
|
-import com.qmth.boot.tools.io.IOUtils;
|
|
|
|
-import com.qmth.boot.tools.signature.SignatureType;
|
|
|
|
-
|
|
|
|
-import cn.com.qmth.scancentral.bean.AbsentQueryDomain;
|
|
|
|
-import cn.com.qmth.scancentral.bean.AnswerDeleteDomain;
|
|
|
|
-import cn.com.qmth.scancentral.bean.AnswerQueryDomain;
|
|
|
|
-import cn.com.qmth.scancentral.bean.AssignedQueryDomain;
|
|
|
|
-import cn.com.qmth.scancentral.bean.ImportCetAbsentDomain;
|
|
|
|
-import cn.com.qmth.scancentral.bean.ImportStudentDomain;
|
|
|
|
-import cn.com.qmth.scancentral.bean.PageDeleteDomain;
|
|
|
|
-import cn.com.qmth.scancentral.bean.SchoolSession;
|
|
|
|
-import cn.com.qmth.scancentral.bean.User;
|
|
|
|
|
|
+import cn.com.qmth.scancentral.bean.*;
|
|
import cn.com.qmth.scancentral.bean.answersave.ArrayResult;
|
|
import cn.com.qmth.scancentral.bean.answersave.ArrayResult;
|
|
import cn.com.qmth.scancentral.bean.answersave.StringResult;
|
|
import cn.com.qmth.scancentral.bean.answersave.StringResult;
|
|
import cn.com.qmth.scancentral.bean.omredit.OmrEditDomain;
|
|
import cn.com.qmth.scancentral.bean.omredit.OmrEditDomain;
|
|
@@ -61,67 +10,18 @@ import cn.com.qmth.scancentral.bean.refix.PageRefixDomain;
|
|
import cn.com.qmth.scancentral.bean.refix.PaperRefixDomain;
|
|
import cn.com.qmth.scancentral.bean.refix.PaperRefixDomain;
|
|
import cn.com.qmth.scancentral.config.SysProperty;
|
|
import cn.com.qmth.scancentral.config.SysProperty;
|
|
import cn.com.qmth.scancentral.dao.StudentDao;
|
|
import cn.com.qmth.scancentral.dao.StudentDao;
|
|
-import cn.com.qmth.scancentral.entity.AnswerCardEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.ExamEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.OmrGroupEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.PaperEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.PaperPageEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.QuestionEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.StudentEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.StudentPaperEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.SubjectEntity;
|
|
|
|
-import cn.com.qmth.scancentral.entity.UserEntity;
|
|
|
|
-import cn.com.qmth.scancentral.enums.ExamMode;
|
|
|
|
-import cn.com.qmth.scancentral.enums.ExamStatus;
|
|
|
|
-import cn.com.qmth.scancentral.enums.ExamStatusCheckMode;
|
|
|
|
-import cn.com.qmth.scancentral.enums.GroupType;
|
|
|
|
-import cn.com.qmth.scancentral.enums.LockType;
|
|
|
|
-import cn.com.qmth.scancentral.enums.OmrType;
|
|
|
|
-import cn.com.qmth.scancentral.enums.Role;
|
|
|
|
-import cn.com.qmth.scancentral.enums.ScanStatus;
|
|
|
|
-import cn.com.qmth.scancentral.enums.UploadStatus;
|
|
|
|
|
|
+import cn.com.qmth.scancentral.entity.*;
|
|
|
|
+import cn.com.qmth.scancentral.enums.*;
|
|
import cn.com.qmth.scancentral.exception.NotFoundExceptions;
|
|
import cn.com.qmth.scancentral.exception.NotFoundExceptions;
|
|
import cn.com.qmth.scancentral.exception.ParameterExceptions;
|
|
import cn.com.qmth.scancentral.exception.ParameterExceptions;
|
|
import cn.com.qmth.scancentral.model.ManualAbsentImportDTO;
|
|
import cn.com.qmth.scancentral.model.ManualAbsentImportDTO;
|
|
-import cn.com.qmth.scancentral.service.AnswerCardService;
|
|
|
|
-import cn.com.qmth.scancentral.service.AnswerCardSubjectService;
|
|
|
|
-import cn.com.qmth.scancentral.service.AssignedCheckHistoryService;
|
|
|
|
-import cn.com.qmth.scancentral.service.BatchService;
|
|
|
|
-import cn.com.qmth.scancentral.service.ExamService;
|
|
|
|
-import cn.com.qmth.scancentral.service.OmrGroupService;
|
|
|
|
-import cn.com.qmth.scancentral.service.OmrTaskService;
|
|
|
|
-import cn.com.qmth.scancentral.service.PaperPageService;
|
|
|
|
-import cn.com.qmth.scancentral.service.PaperService;
|
|
|
|
-import cn.com.qmth.scancentral.service.QuestionService;
|
|
|
|
-import cn.com.qmth.scancentral.service.SessionService;
|
|
|
|
-import cn.com.qmth.scancentral.service.StudentPaperService;
|
|
|
|
-import cn.com.qmth.scancentral.service.StudentService;
|
|
|
|
-import cn.com.qmth.scancentral.service.SubjectService;
|
|
|
|
-import cn.com.qmth.scancentral.service.ToolExportService;
|
|
|
|
-import cn.com.qmth.scancentral.service.UserService;
|
|
|
|
|
|
+import cn.com.qmth.scancentral.service.*;
|
|
import cn.com.qmth.scancentral.support.TaskLock;
|
|
import cn.com.qmth.scancentral.support.TaskLock;
|
|
import cn.com.qmth.scancentral.support.TaskLockUtil;
|
|
import cn.com.qmth.scancentral.support.TaskLockUtil;
|
|
import cn.com.qmth.scancentral.util.BatchGetDataUtil;
|
|
import cn.com.qmth.scancentral.util.BatchGetDataUtil;
|
|
import cn.com.qmth.scancentral.util.BatchSetDataUtil;
|
|
import cn.com.qmth.scancentral.util.BatchSetDataUtil;
|
|
import cn.com.qmth.scancentral.util.PageUtil;
|
|
import cn.com.qmth.scancentral.util.PageUtil;
|
|
-import cn.com.qmth.scancentral.vo.AbsentInfoVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.AbsentManualImportVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.AbsentQueryVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.AnswerDeleteVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.AnswerExportK12Vo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.AnswerExportVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.AnswerRefixVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.CampusVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.ExamSiteVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.ExportCetMarkingQueryVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.ExportCetVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.ImportResult;
|
|
|
|
-import cn.com.qmth.scancentral.vo.ImportStudentQueryVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.ImportStudentVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.PaperDeleteVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.ScanAnswerInfoVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.StudentUploadVo;
|
|
|
|
-import cn.com.qmth.scancentral.vo.UpdateTimeVo;
|
|
|
|
|
|
+import cn.com.qmth.scancentral.vo.*;
|
|
import cn.com.qmth.scancentral.vo.answerquery.AnswerPageVo;
|
|
import cn.com.qmth.scancentral.vo.answerquery.AnswerPageVo;
|
|
import cn.com.qmth.scancentral.vo.answerquery.AnswerPaperVo;
|
|
import cn.com.qmth.scancentral.vo.answerquery.AnswerPaperVo;
|
|
import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
|
|
import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
|
|
@@ -136,6 +36,36 @@ import cn.com.qmth.scancentral.vo.student.StudentAnswerVo;
|
|
import cn.com.qmth.scancentral.vo.student.StudentQuery;
|
|
import cn.com.qmth.scancentral.vo.student.StudentQuery;
|
|
import cn.com.qmth.scancentral.vo.student.StudentVo;
|
|
import cn.com.qmth.scancentral.vo.student.StudentVo;
|
|
import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
|
|
import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+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 com.qmth.boot.core.retrofit.utils.SignatureInfo;
|
|
|
|
+import com.qmth.boot.tools.excel.ExcelReader;
|
|
|
|
+import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
|
|
+import com.qmth.boot.tools.io.IOUtils;
|
|
|
|
+import com.qmth.boot.tools.signature.SignatureType;
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
|
+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 javax.validation.constraints.NotNull;
|
|
|
|
+import java.io.*;
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> implements StudentService {
|
|
public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> implements StudentService {
|
|
@@ -203,7 +133,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
@Transactional
|
|
@Transactional
|
|
// @Lockable(name = LockType.STUDENT, key = "#id")
|
|
// @Lockable(name = LockType.STUDENT, key = "#id")
|
|
public void updateStudentAndPaper(@NotNull User user, @NotNull Long id,
|
|
public void updateStudentAndPaper(@NotNull User user, @NotNull Long id,
|
|
- @NotNull List<StudentPaperEntity> studentPaperList) {
|
|
|
|
|
|
+ @NotNull List<StudentPaperEntity> studentPaperList) {
|
|
for (StudentPaperEntity studentPaper : studentPaperList) {
|
|
for (StudentPaperEntity studentPaper : studentPaperList) {
|
|
studentPaper.setStudentId(id);
|
|
studentPaper.setStudentId(id);
|
|
}
|
|
}
|
|
@@ -741,7 +671,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public void updateUploadStatus(@NotNull Long id, @NotNull UploadStatus fileUploadStatus,
|
|
public void updateUploadStatus(@NotNull Long id, @NotNull UploadStatus fileUploadStatus,
|
|
- @NotNull UploadStatus dataUploadStatus) {
|
|
|
|
|
|
+ @NotNull UploadStatus dataUploadStatus) {
|
|
LambdaUpdateWrapper<StudentEntity> lw = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<StudentEntity> lw = new LambdaUpdateWrapper<>();
|
|
lw.set(StudentEntity::getDataUploadStatus, dataUploadStatus);
|
|
lw.set(StudentEntity::getDataUploadStatus, dataUploadStatus);
|
|
lw.set(StudentEntity::getFileUploadStatus, fileUploadStatus);
|
|
lw.set(StudentEntity::getFileUploadStatus, fileUploadStatus);
|
|
@@ -1212,8 +1142,8 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
}
|
|
}
|
|
|
|
|
|
private void disposeStudent(ExportCetVo student, ExamEntity exam, List<PaperPageCetVo> pages,
|
|
private void disposeStudent(ExportCetVo student, ExamEntity exam, List<PaperPageCetVo> pages,
|
|
- List<PaperCetVo> papers, String imageTransferDir, Map<String, List<QuestionEntity>> structs,
|
|
|
|
- Map<Integer, AnswerCardEntity> cardMap) {
|
|
|
|
|
|
+ List<PaperCetVo> papers, String imageTransferDir, Map<String, List<QuestionEntity>> structs,
|
|
|
|
+ Map<Integer, AnswerCardEntity> cardMap) {
|
|
int subject = Integer.valueOf(student.getSubjectCode());
|
|
int subject = Integer.valueOf(student.getSubjectCode());
|
|
if (subject > 2) {
|
|
if (subject > 2) {
|
|
if (student.getExamStatus().equals(ExamStatus.ABSENT)) {
|
|
if (student.getExamStatus().equals(ExamStatus.ABSENT)) {
|
|
@@ -1294,7 +1224,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
}
|
|
}
|
|
|
|
|
|
private void setCardStatus(ExportCetVo student, AnswerCardEntity card, List<PaperPageCetVo> pages,
|
|
private void setCardStatus(ExportCetVo student, AnswerCardEntity card, List<PaperPageCetVo> pages,
|
|
- Map<Long, PaperCetVo> pmap) {
|
|
|
|
|
|
+ Map<Long, PaperCetVo> pmap) {
|
|
int subject = Integer.valueOf(student.getSubjectCode());
|
|
int subject = Integer.valueOf(student.getSubjectCode());
|
|
if (subject > 2) {
|
|
if (subject > 2) {
|
|
setCardStatusSmall(student, card, pages, pmap);
|
|
setCardStatusSmall(student, card, pages, pmap);
|
|
@@ -1304,7 +1234,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
}
|
|
}
|
|
|
|
|
|
private void setCardStatusSmall(ExportCetVo student, AnswerCardEntity card, List<PaperPageCetVo> pages,
|
|
private void setCardStatusSmall(ExportCetVo student, AnswerCardEntity card, List<PaperPageCetVo> pages,
|
|
- Map<Long, PaperCetVo> pmap) {
|
|
|
|
|
|
+ Map<Long, PaperCetVo> pmap) {
|
|
PaperPageCetVo p = pages.get(0);
|
|
PaperPageCetVo p = pages.get(0);
|
|
if (ExamStatus.ABSENT.equals(student.getExamStatus())) {
|
|
if (ExamStatus.ABSENT.equals(student.getExamStatus())) {
|
|
if (pmap.get(p.getPaperId()).getQuestionFilled()) {
|
|
if (pmap.get(p.getPaperId()).getQuestionFilled()) {
|
|
@@ -1319,7 +1249,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
}
|
|
}
|
|
|
|
|
|
private void setCardStatusCet(ExportCetVo student, AnswerCardEntity card, List<PaperPageCetVo> pages,
|
|
private void setCardStatusCet(ExportCetVo student, AnswerCardEntity card, List<PaperPageCetVo> pages,
|
|
- Map<Long, PaperCetVo> pmap) {
|
|
|
|
|
|
+ Map<Long, PaperCetVo> pmap) {
|
|
if (card.getPaperCount() == 1) {
|
|
if (card.getPaperCount() == 1) {
|
|
PaperPageCetVo p = pages.get(0);
|
|
PaperPageCetVo p = pages.get(0);
|
|
if (ExamStatus.ABSENT.equals(student.getExamStatus())) {
|
|
if (ExamStatus.ABSENT.equals(student.getExamStatus())) {
|
|
@@ -1412,7 +1342,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
}
|
|
}
|
|
|
|
|
|
private String getCetAnswer(Map<String, List<QuestionEntity>> structs, List<PaperPageCetVo> pages, Long examId,
|
|
private String getCetAnswer(Map<String, List<QuestionEntity>> structs, List<PaperPageCetVo> pages, Long examId,
|
|
- String subjectCode) {
|
|
|
|
|
|
+ String subjectCode) {
|
|
List<String> answers = new ArrayList<String>();
|
|
List<String> answers = new ArrayList<String>();
|
|
List<QuestionEntity> struct = structs.get(examId + "-" + subjectCode);
|
|
List<QuestionEntity> struct = structs.get(examId + "-" + subjectCode);
|
|
if (struct == null) {
|
|
if (struct == null) {
|
|
@@ -1877,12 +1807,31 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public int getCountByExamAndAssignedCheckCount(Long examId, int assignedCheckCount) {
|
|
|
|
- QueryWrapper<StudentEntity> wrapper = new QueryWrapper<>();
|
|
|
|
- LambdaQueryWrapper<StudentEntity> lw = wrapper.lambda();
|
|
|
|
- lw.eq(StudentEntity::getExamId, examId);
|
|
|
|
- lw.eq(StudentEntity::getAssigned, true);
|
|
|
|
- lw.eq(StudentEntity::getAssignedCheckCount, assignedCheckCount);
|
|
|
|
|
|
+ public int getCountByExamAndAssignedCheckCount(Long examId, int assignedCheckCount, OP op) {
|
|
|
|
+ LambdaQueryWrapper<StudentEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(StudentEntity::getExamId, examId);
|
|
|
|
+ wrapper.eq(StudentEntity::getAssigned, true);
|
|
|
|
+
|
|
|
|
+ if (OP.EQ == op) {
|
|
|
|
+ wrapper.eq(StudentEntity::getAssignedCheckCount, assignedCheckCount);
|
|
|
|
+ } else if (OP.GT == op) {
|
|
|
|
+ wrapper.gt(StudentEntity::getAssignedCheckCount, assignedCheckCount);
|
|
|
|
+ } else if (OP.GE == op) {
|
|
|
|
+ wrapper.ge(StudentEntity::getAssignedCheckCount, assignedCheckCount);
|
|
|
|
+ } else if (OP.LE == op) {
|
|
|
|
+ wrapper.le(StudentEntity::getAssignedCheckCount, assignedCheckCount);
|
|
|
|
+ } else if (OP.LT == op) {
|
|
|
|
+ wrapper.lt(StudentEntity::getAssignedCheckCount, assignedCheckCount);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return this.count(wrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int countByExamIdAndExamStatus(Long examId, ExamStatus examStatus) {
|
|
|
|
+ LambdaQueryWrapper<StudentEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(StudentEntity::getExamId, examId);
|
|
|
|
+ wrapper.eq(StudentEntity::getExamStatus, examStatus);
|
|
return this.count(wrapper);
|
|
return this.count(wrapper);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2020,23 +1969,14 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
TaskStatusVo status = new TaskStatusVo();
|
|
TaskStatusVo status = new TaskStatusVo();
|
|
if (Role.AUDITOR.equals(user.getRole())) {
|
|
if (Role.AUDITOR.equals(user.getRole())) {
|
|
status.setFinishCount(assignedCheckHistoryService.getCountByUserId(user.getId(), examId));
|
|
status.setFinishCount(assignedCheckHistoryService.getCountByUserId(user.getId(), examId));
|
|
- status.setTodoCount(this.getCountByExamAndAssignedCheckCount(examId, 0));
|
|
|
|
|
|
+ status.setTodoCount(this.getCountByExamAndAssignedCheckCount(examId, 0, OP.EQ));
|
|
} else {
|
|
} else {
|
|
- status.setFinishCount(this.getCountByExamAndAssignedCheckCountGe(examId, 2));
|
|
|
|
- status.setTodoCount(this.getCountByExamAndAssignedCheckCount(examId, 1));
|
|
|
|
|
|
+ status.setFinishCount(this.getCountByExamAndAssignedCheckCount(examId, 2, OP.GE));
|
|
|
|
+ status.setTodoCount(this.getCountByExamAndAssignedCheckCount(examId, 1, OP.EQ));
|
|
}
|
|
}
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
|
|
|
|
- private Integer getCountByExamAndAssignedCheckCountGe(Long examId, int assignedCheckCount) {
|
|
|
|
- QueryWrapper<StudentEntity> wrapper = new QueryWrapper<>();
|
|
|
|
- LambdaQueryWrapper<StudentEntity> lw = wrapper.lambda();
|
|
|
|
- lw.eq(StudentEntity::getExamId, examId);
|
|
|
|
- lw.eq(StudentEntity::getAssigned, true);
|
|
|
|
- lw.ge(StudentEntity::getAssignedCheckCount, assignedCheckCount);
|
|
|
|
- return this.count(wrapper);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public void releaseAssignedCheckTaskByUser(Long examId, String account) {
|
|
public void releaseAssignedCheckTaskByUser(Long examId, String account) {
|
|
TaskLock taskLock = TaskLockUtil.getAssignedCheckTask(examId.toString());
|
|
TaskLock taskLock = TaskLockUtil.getAssignedCheckTask(examId.toString());
|