123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 |
- package cn.com.qmth.scancentral.service.impl;
- import java.util.List;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.baomidou.mybatisplus.core.toolkit.Wrappers;
- 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.exception.ParameterException;
- import com.qmth.boot.core.security.exception.AuthorizationException;
- import cn.com.qmth.scancentral.bean.User;
- import cn.com.qmth.scancentral.dao.ExamDao;
- import cn.com.qmth.scancentral.entity.ExamEntity;
- import cn.com.qmth.scancentral.entity.ExamSummaryEntity;
- import cn.com.qmth.scancentral.entity.SubjectEntity;
- import cn.com.qmth.scancentral.enums.CheckStatus;
- import cn.com.qmth.scancentral.enums.ExamMode;
- import cn.com.qmth.scancentral.enums.OP;
- import cn.com.qmth.scancentral.enums.Role;
- import cn.com.qmth.scancentral.enums.TaskStatus;
- import cn.com.qmth.scancentral.exception.ParameterExceptions;
- import cn.com.qmth.scancentral.service.AnswerCardService;
- import cn.com.qmth.scancentral.service.BatchService;
- import cn.com.qmth.scancentral.service.ExamService;
- import cn.com.qmth.scancentral.service.ExamSummaryService;
- import cn.com.qmth.scancentral.service.MarkSiteService;
- import cn.com.qmth.scancentral.service.OmrGroupService;
- import cn.com.qmth.scancentral.service.OmrTaskService;
- import cn.com.qmth.scancentral.service.PackageCardService;
- import cn.com.qmth.scancentral.service.PackageTaskService;
- import cn.com.qmth.scancentral.service.StudentService;
- import cn.com.qmth.scancentral.service.SubjectService;
- import cn.com.qmth.scancentral.util.MathUtil;
- import cn.com.qmth.scancentral.util.PageUtil;
- import cn.com.qmth.scancentral.vo.ExamConfigVo;
- import cn.com.qmth.scancentral.vo.ExamVo;
- import cn.com.qmth.scancentral.vo.auditor.AuditorOverview;
- import cn.com.qmth.scancentral.vo.checkimage.RatioVo;
- import cn.com.qmth.scancentral.vo.examinfo.ExamEdit;
- import cn.com.qmth.scancentral.vo.examinfo.ExamOverview;
- import cn.com.qmth.scancentral.vo.examinfo.ExamQuery;
- import cn.com.qmth.scancentral.vo.omr.OmrTaskOverview;
- import cn.com.qmth.scancentral.vo.scanexaminfo.ScanExamInfoVo;
- import cn.com.qmth.scancentral.vo.scanexamlist.ScanExamListQuery;
- import cn.com.qmth.scancentral.vo.scanexamlist.ScanExamListVo;
- import cn.com.qmth.scancentral.vo.studentimport.StudentImportConfigVo;
- @Service
- public class ExamServiceImpl extends ServiceImpl<ExamDao, ExamEntity> implements ExamService {
- private static final Logger log = LoggerFactory.getLogger(ExamServiceImpl.class);
- @Autowired
- private AnswerCardService answerCardService;
- @Autowired
- private PackageCardService packageCardService;
- @Autowired
- private OmrTaskService omrTaskService;
- @Autowired
- private PackageTaskService packageTaskService;
- @Autowired
- private StudentService studentService;
- @Autowired
- private SubjectService subjectService;
- @Autowired
- private BatchService batchService;
- @Autowired
- private OmrGroupService omrGroupService;
- @Autowired
- private ExamSummaryService examSummaryService;
- @Autowired
- private MarkSiteService markSiteService;
- @Override
- public PageResult<ExamVo> pageQuery(ExamQuery query, User user) {
- query.setEnable(true);
- IPage<ExamVo> iPage = this.baseMapper.pageExam(new Page<>(query.getPageNumber(), query.getPageSize()), query);
- return PageUtil.of(iPage);
- }
- @Override
- public List<ExamEntity> listEnable() {
- return list(new LambdaQueryWrapper<ExamEntity>().eq(ExamEntity::getEnable, true));
- }
- @Transactional
- @Override
- public Long save(ExamEdit exam) {
- if (StringUtils.isBlank(exam.getName())) {
- throw new ParameterException("考试名称不能为空");
- }
- if (StringUtils.length(exam.getName()) > 100) {
- throw new ParameterException("考试名称限制100字以内");
- }
- boolean isCreate = false;
- if (exam.getId() != null) {
- // 修改考试
- ExamEntity examEntity = this.getById(exam.getId());
- if (examEntity == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- LambdaUpdateWrapper<ExamEntity> updateWrapper = new LambdaUpdateWrapper<>();
- updateWrapper.set(ExamEntity::getUpdateTime, System.currentTimeMillis());
- updateWrapper.set(ExamEntity::getUpdaterId, exam.getOperateUserId());
- updateWrapper.set(ExamEntity::getName, exam.getName());
- updateWrapper.eq(ExamEntity::getId, exam.getId());
- this.update(updateWrapper);
- return exam.getId();
- } else {
- isCreate = true;
- }
- // 新增考试
- ExamEntity examEntity = new ExamEntity();
- examEntity.setName(exam.getName());
- examEntity.setEnable(true);
- examEntity.setCreatorId(exam.getOperateUserId());
- examEntity.setUpdaterId(exam.getOperateUserId());
- examEntity.setCreateTime(System.currentTimeMillis());
- examEntity.setUpdateTime(System.currentTimeMillis());
- examEntity.setMode(ExamMode.CET);
- examEntity.setScanByPackage(true);
- examEntity.setAllowUnexistPaper(false);
- examEntity.setAnswerFrontCardType(1);
- examEntity.setEnableSinglePageAnswer(false);
- examEntity.setEnableUpload(false);
- examEntity.setEnableSyncVerify(true);
- examEntity.setImageCheckRatio(0.05);
- examEntity.setExamNumberFillCount(10);
- examEntity.setImageCheckOrder("ASC");
- examEntity.setScannerAssignedVerifyPassword("87863577");
- examEntity.setScannerAssignedMaxCount(5);
- // examEntity.setPaperTypeBarcodeContent(null);
- // examEntity.setAbsentBarcodeContent(null);
- // examEntity.setDataSyncTime(null);
- // examEntity.setCardSyncTime(null);
- this.save(examEntity);
- if (isCreate) {
- subjectService.initSubject(examEntity.getId());
- List<SubjectEntity> subjects = subjectService.listByExamId(examEntity.getId());
- for (SubjectEntity subject : subjects) {
- omrGroupService.addFixOmrCondition(1L, examEntity.getId(), subject.getCode());
- }
- }
- log.warn("新增考试成功! examId:{}", examEntity.getId());
- return examEntity.getId();
- }
- @Override
- public ExamOverview getExamOverview(Long examId, User accessUser) {
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- ExamOverview vo = new ExamOverview();
- vo.setId(examId);
- vo.setName(exam.getName());
- ExamSummaryEntity summary = examSummaryService.find(examId);
- vo.getBasic().setStudentCount(studentService.getCountByExam(examId));
- vo.getBasic().setSubjectCount(summary.getSubjectCount());
- vo.getBasic().setCardCount(answerCardService.getCountByExam(examId));
- int scannedTotalCount = summary.getAnswerScannedCount() + summary.getAnswerUnexistCount();
- double scannedRate = MathUtil.percentage(summary.getAnswerScannedCount(), scannedTotalCount);
- vo.getScan().setScannedRate(scannedRate);
- vo.getScan().setScannedCount(summary.getAnswerScannedCount());
- vo.getScan().setUnexistCount(summary.getAnswerUnexistCount());
- int imageCheckCount = batchService.getCheckCountByExamId(examId, CheckStatus.FINISH, accessUser);
- int imageCheckTodoCount = batchService.getCheckCountByExamId(examId, CheckStatus.WAITING, accessUser);
- int imageCheckTotalCount = imageCheckCount + imageCheckTodoCount;
- double imageCheckRate = MathUtil.percentage(imageCheckCount, imageCheckTotalCount);
- vo.getScan().setImageCheckRate(imageCheckRate);
- vo.getScan().setImageCheckCount(imageCheckCount);
- vo.getScan().setImageCheckTodoCount(imageCheckTodoCount);
- int auditorTodoCount = studentService.getCountByExamAndAssignedCheckCount(examId, null, 0, OP.EQ);
- int auditorFinishCount = studentService.getCountByExamAndAssignedCheckCount(examId, null, 0, OP.GT);
- int auditorTotalCount = auditorTodoCount + auditorFinishCount;
- double auditorFinishRate = MathUtil.percentage(auditorFinishCount, auditorTotalCount);
- vo.getAssignedCheck().setAuditorTodoCount(auditorTodoCount);
- vo.getAssignedCheck().setAuditorFinishCount(auditorFinishCount);
- vo.getAssignedCheck().setAuditorFinishRate(auditorFinishRate);
- int adminTodoCount = studentService.getCountByExamAndAssignedCheckCount(examId, null, 1, OP.EQ);
- int adminFinishCount = studentService.getCountByExamAndAssignedCheckCount(examId, null, 2, OP.GE);
- int adminTotalCount = adminTodoCount + adminFinishCount;
- double adminFinishRate = MathUtil.percentage(adminFinishCount, adminTotalCount);
- vo.getAssignedCheck().setAdminTodoCount(adminTodoCount);
- vo.getAssignedCheck().setAdminFinishCount(adminFinishCount);
- vo.getAssignedCheck().setAdminFinishRate(adminFinishRate);
- OmrTaskOverview suspectOverview = omrTaskService.countByExamIdAndFixed(examId, true);
- OmrTaskOverview customizeOverview = omrTaskService.countByExamIdAndFixed(examId, false);
- int suspectFinishCount = suspectOverview.getProcessedCount() + suspectOverview.getArbitrateCount();
- int suspectTodoCount = suspectOverview.getWaitingCount() + suspectOverview.getWaitArbitrateCount();
- double suspectFinishRate = MathUtil.percentage(suspectFinishCount, suspectOverview.getTotalCount());
- int customizeFinishCount = customizeOverview.getProcessedCount() + customizeOverview.getArbitrateCount();
- int customizeTodoCount = customizeOverview.getWaitingCount() + customizeOverview.getWaitArbitrateCount();
- double customizeFinishRate = MathUtil.percentage(customizeFinishCount, customizeOverview.getTotalCount());
- vo.getOmr().setSuspectFinishCount(suspectFinishCount);
- vo.getOmr().setSuspectTodoCount(suspectTodoCount);
- vo.getOmr().setSuspectFinishRate(suspectFinishRate);
- vo.getOmr().setCustomizeFinishCount(customizeFinishCount);
- vo.getOmr().setCustomizeTodoCount(customizeTodoCount);
- vo.getOmr().setCustomizeFinishRate(customizeFinishRate);
- vo.getAbsentCheck().setAbsentCount(summary.getAbsentCount());
- vo.getAbsentCheck().setOkCount(summary.getOkCount());
- vo.getAbsentCheck().setTodoCount(summary.getTodoCount());
- return vo;
- }
- @Override
- public ScanExamInfoVo getScanExamInfo(Long id, User accessUser) {
- ExamEntity exam = this.getById(id);
- if (exam == null || (exam.getEnable() != null && !exam.getEnable())) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- ExamSummaryEntity es = examSummaryService.find(exam.getId());
- ScanExamInfoVo vo = new ScanExamInfoVo();
- vo.setId(id);
- vo.setName(exam.getName());
- vo.getExamConfig().setAllowUnexistPaper(exam.getAllowUnexistPaper());
- vo.getExamConfig().setAnswerFrontCardType(exam.getAnswerFrontCardType());
- vo.getExamConfig().setEnableSinglePageAnswer(exam.getEnableSinglePageAnswer());
- vo.getExamConfig().setMode(exam.getMode());
- vo.getExamConfig().setScanByPackage(exam.getScanByPackage());
- vo.getExamConfig().setEnableSyncVerify(exam.getEnableSyncVerify());
- vo.getExamConfig().setAbsentBarcodeContent(exam.getAbsentBarcodeContent());
- // vo.getExamConfig().setPaperTypeBarcodeContent(exam.getPaperTypeBarcodeContent());
- vo.getExamConfig().setScannerAssignedMaxCount(exam.getScannerAssignedMaxCount());
- vo.getAnswerScan().setCardCount(answerCardService.getCountByExam(id));
- vo.getAnswerScan().setTotalCount(es.getStudentCount());
- vo.getAnswerScan().setScannedCount(es.getAnswerScannedCount());
- vo.getPackageScan().setCardCount(packageCardService.getCountByExam(id));
- vo.getPackageScan().setTotalCount(es.getPackageTotalCount());
- vo.getPackageScan().setScannedCount(es.getPackageScannedCount());
- vo.getOmrTask().setTodoCount(omrTaskService.getCountByExamAndStatus(id, TaskStatus.WAITING));
- vo.getOmrTask().setFinishCount(omrTaskService.getCountByExamAndStatus(id, TaskStatus.PROCESSED));
- vo.getPackageTask().setTodoCount(packageTaskService.getCountByExamAndStatus(id, TaskStatus.WAITING));
- vo.getPackageTask().setFinishCount(packageTaskService.getCountByExamAndStatus(id, TaskStatus.PROCESSED));
- vo.setSubjectConfig(markSiteService.findByExam(id));
- return vo;
- }
- @Override
- public List<ScanExamListVo> getScanExamList() {
- ScanExamListQuery query = new ScanExamListQuery();
- query.setEnable(true);
- return this.baseMapper.getExamList(query);
- }
- @Override
- public ExamConfigVo getConfigInfo(Long examId) {
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- ExamConfigVo vo = new ExamConfigVo();
- vo.setExamId(exam.getId());
- vo.setPaperTypeBarcodeContent(markSiteService.findByExam(examId));
- vo.setImageCheckRatio(exam.getImageCheckRatio());
- vo.setImageCheckOrder(exam.getImageCheckOrder());
- vo.setEnableSyncVerify(exam.getEnableSyncVerify());
- vo.setScannerAssignedMaxCount(exam.getScannerAssignedMaxCount());
- vo.setScannerAssignedVerifyPassword(exam.getScannerAssignedVerifyPassword());
- return vo;
- }
- @Transactional
- @Override
- public void saveConfig(ExamConfigVo config, User user) {
- if (!Role.SCHOOL_ADMIN.equals(user.getRole())) {
- throw AuthorizationException.NO_PERMISSION;
- }
- ExamEntity exam = this.getById(config.getExamId());
- if (exam == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- LambdaUpdateWrapper<ExamEntity> updateWrapper = Wrappers.lambdaUpdate(ExamEntity.class);
- if (config.getImageCheckRatio() != null) {
- updateWrapper.set(ExamEntity::getImageCheckRatio, config.getImageCheckRatio());
- }
- if (StringUtils.isNotBlank(config.getImageCheckOrder())) {
- updateWrapper.set(ExamEntity::getImageCheckOrder, config.getImageCheckOrder());
- }
- if (config.getEnableSyncVerify() != null) {
- updateWrapper.set(ExamEntity::getEnableSyncVerify, config.getEnableSyncVerify());
- }
- if (config.getScannerAssignedMaxCount() != null) {
- updateWrapper.set(ExamEntity::getScannerAssignedMaxCount, config.getScannerAssignedMaxCount());
- }
- if (StringUtils.isNotBlank(config.getScannerAssignedVerifyPassword())) {
- updateWrapper.set(ExamEntity::getScannerAssignedVerifyPassword, config.getScannerAssignedVerifyPassword());
- }
- if (config.getPaperTypeBarcodeContent() != null && !config.getPaperTypeBarcodeContent().isEmpty()) {
- markSiteService.saveByExamIdAndSubjectCode(config.getExamId(), config.getPaperTypeBarcodeContent());
- }
- updateWrapper.set(ExamEntity::getUpdateTime, System.currentTimeMillis());
- updateWrapper.set(ExamEntity::getUpdaterId, user.getId());
- updateWrapper.eq(ExamEntity::getId, config.getExamId());
- this.update(updateWrapper);
- if (config.getEnableSyncVerify() != null && !config.getEnableSyncVerify()) {
- batchService.batchVerifyCancel(user, config.getExamId());
- }
- }
- @Override
- public StudentImportConfigVo getStudentImportConfig(Long examId) {
- if (examId == null) {
- throw new ParameterException("examId不能为空");
- }
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- StudentImportConfigVo config = new StudentImportConfigVo();
- config.setExamId(examId);
- config.setYear(exam.getYear());
- config.setYearHalf(exam.getYearHalf());
- return config;
- }
- @Override
- public void saveStudentImportConfig(StudentImportConfigVo config) {
- if (config.getExamId() == null) {
- throw new ParameterException("examId不能为空");
- }
- if (config.getYear() == null) {
- throw new ParameterException("考试年度不能为空");
- }
- if (config.getYearHalf() == null) {
- throw new ParameterException("考次不能为空");
- }
- ExamEntity exam = this.getById(config.getExamId());
- if (exam == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- LambdaUpdateWrapper<ExamEntity> updateWrapper = new LambdaUpdateWrapper<>();
- updateWrapper.set(ExamEntity::getYear, config.getYear());
- updateWrapper.set(ExamEntity::getYearHalf, config.getYearHalf());
- updateWrapper.set(ExamEntity::getUpdateTime, System.currentTimeMillis());
- updateWrapper.eq(ExamEntity::getId, exam.getId());
- this.update(updateWrapper);
- }
- // @Transactional
- // @Override
- // public ExamEntity save(ImportExamDomain domain) {
- // // if (SystemMode.MARKINGCLOUD.equals(SystemMode.current())) {
- // // throw new ParameterException("非本地模式不支持此功能");
- // // }
- // if (domain.getAllowUnexistPaper() == null) {
- // throw new ParameterException("AllowUnexistPaper 不能为空");
- // }
- // if (domain.getEnableSinglePageAnswer() == null) {
- // throw new ParameterException("EnableSinglePageAnswer 不能为空");
- // }
- // if (domain.getEnableSyncVerify() == null) {
- // throw new ParameterException("EnableSyncVerify 不能为空");
- // }
- // if (domain.getScanByPackage() == null) {
- // throw new ParameterException("ScanByPackage 不能为空");
- // }
- // if (domain.getAbsentBarcodeContent() == null) {
- // throw new ParameterException("AbsentBarcodeContent 不能为空");
- // }
- // if (domain.getAnswerFrontCardType() == null) {
- // throw new ParameterException("AnswerFrontCardType 不能为空");
- // }
- // if (domain.getMode() == null) {
- // throw new ParameterException("ExamMode 不能为空");
- // }
- // if (domain.getPaperTypeBarcodeContent() == null) {
- // throw new ParameterException("PaperTypeBarcodeContent 不能为空");
- // }
- // if (domain.getExamNumberFillCount() == null) {
- // throw new ParameterException("ExamNumberFillCount 不能为空");
- // }
- // ExamEntity exam = new ExamEntity();
- // exam.setId(domain.getId());
- // exam.setName(domain.getName());
- // exam.setEnable(true);
- // exam.setEnableUpload(false);
- // exam.setImageCheckRatio(0d);
- // exam.setAllowUnexistPaper(domain.getAllowUnexistPaper());
- // exam.setEnableSinglePageAnswer(domain.getEnableSinglePageAnswer());
- // exam.setEnableSyncVerify(domain.getEnableSyncVerify());
- // exam.setScanByPackage(domain.getScanByPackage());
- // exam.setAbsentBarcodeContent(domain.getAbsentBarcodeContent());
- // exam.setAnswerFrontCardType(domain.getAnswerFrontCardType());
- // exam.setMode(domain.getMode());
- // exam.setPaperTypeBarcodeContent(domain.getPaperTypeBarcodeContent());
- // if (getById(domain.getId()) == null) {
- // List<SubjectEntity> subjects = subjectService.listByExamId(exam.getId());
- // for (SubjectEntity subject : subjects) {
- // omrGroupService.addFixOmrCondition(1L, exam.getId(), subject.getCode());
- // }
- // }
- // exam.setExamNumberFillCount(domain.getExamNumberFillCount());
- // this.saveOrUpdate(exam);
- // return exam;
- // }
- @Override
- public RatioVo updateRatio(Long examId, Double ratio) {
- if (ratio == null || ratio < 0 || ratio > 1) {
- throw new ParameterException("ratio 不符合");
- }
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw new ParameterException("Exam 不能为空");
- }
- exam.setImageCheckRatio(ratio);
- this.updateById(exam);
- return new RatioVo(ratio);
- }
- @Transactional
- @Override
- public void updateDataSyncTime(Long examId) {
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw new ParameterException("Exam 不能为空");
- }
- exam.setDataSyncTime(System.currentTimeMillis());
- this.updateById(exam);
- }
- @Override
- public void updateExamNumberFillCount(Long examId, Integer examNumberFillCount) {
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw new ParameterException("Exam 不能为空");
- }
- exam.setExamNumberFillCount(examNumberFillCount);
- this.updateById(exam);
- }
- @Override
- @Transactional
- public ExamEntity updateEnableSyncVerify(User user, Long examId, Boolean enableSyncVerify) {
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- if (enableSyncVerify == false) {
- batchService.batchVerifyCancel(user, examId);
- }
- exam.setEnableSyncVerify(enableSyncVerify);
- this.saveOrUpdate(exam);
- return exam;
- }
- @Override
- public AuditorOverview getAuditorOverview(Long examId, User user) {
- if (!user.getRole().equals(Role.AUDITOR)) {
- throw new ParameterException("user 不是审核员");
- }
- ExamEntity exam = this.getById(examId);
- if (exam == null) {
- throw ParameterExceptions.EXAM_NOT_FOUND;
- }
- AuditorOverview vo = new AuditorOverview();
- vo.setId(examId);
- vo.setName(exam.getName());
- vo.setEnableSyncVerify(exam.getEnableSyncVerify());
- vo.getVerifyTask().setTodoCount(batchService.getVerifyCount(examId));
- vo.getImageCheckTask().setCheckRatio(exam.getImageCheckRatio());
- vo.getImageCheckTask().setFinishCount(batchService.getCheckCountByExamId(examId, CheckStatus.FINISH, user));
- vo.getImageCheckTask().setTodoCount(batchService.getCheckCountByExamId(examId, CheckStatus.WAITING, user));
- vo.getAssignedCheck().setTodoCount(studentService.getCountByExamAndAssignedCheckCount(examId, null, 0, OP.EQ));
- return vo;
- }
- @Transactional
- @Override
- public void scanSiteSave(Long examId, String scanStie) {
- LambdaUpdateWrapper<ExamEntity> updateWrapper = new LambdaUpdateWrapper<>();
- updateWrapper.set(ExamEntity::getScanSite, scanStie);
- updateWrapper.eq(ExamEntity::getId, examId);
- this.update(updateWrapper);
- }
- @Override
- public String getScanSite(Long examId) {
- return this.getById(examId).getScanSite();
- }
- @Override
- public Integer getexamNumberFillCount(Long examId) {
- return this.getById(examId).getExamNumberFillCount();
- }
- }
|