|
@@ -14,12 +14,14 @@ import cn.com.qmth.scancentral.util.PageUtil;
|
|
import cn.com.qmth.scancentral.vo.ExamConfigVo;
|
|
import cn.com.qmth.scancentral.vo.ExamConfigVo;
|
|
import cn.com.qmth.scancentral.vo.ExamVo;
|
|
import cn.com.qmth.scancentral.vo.ExamVo;
|
|
import cn.com.qmth.scancentral.vo.checkimage.RatioVo;
|
|
import cn.com.qmth.scancentral.vo.checkimage.RatioVo;
|
|
|
|
+import cn.com.qmth.scancentral.vo.examinfo.ExamEdit;
|
|
import cn.com.qmth.scancentral.vo.examinfo.ExamInfoVo;
|
|
import cn.com.qmth.scancentral.vo.examinfo.ExamInfoVo;
|
|
import cn.com.qmth.scancentral.vo.examinfo.ExamQuery;
|
|
import cn.com.qmth.scancentral.vo.examinfo.ExamQuery;
|
|
import cn.com.qmth.scancentral.vo.scanexaminfo.ScanExamInfoVo;
|
|
import cn.com.qmth.scancentral.vo.scanexaminfo.ScanExamInfoVo;
|
|
import cn.com.qmth.scancentral.vo.scanexamlist.ScanExamListQuery;
|
|
import cn.com.qmth.scancentral.vo.scanexamlist.ScanExamListQuery;
|
|
import cn.com.qmth.scancentral.vo.scanexamlist.ScanExamListVo;
|
|
import cn.com.qmth.scancentral.vo.scanexamlist.ScanExamListVo;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
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.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -27,6 +29,7 @@ import com.qmth.boot.core.collection.PageResult;
|
|
import com.qmth.boot.core.concurrent.service.ConcurrentService;
|
|
import com.qmth.boot.core.concurrent.service.ConcurrentService;
|
|
import com.qmth.boot.core.exception.ParameterException;
|
|
import com.qmth.boot.core.exception.ParameterException;
|
|
import com.qmth.boot.core.security.exception.AuthorizationException;
|
|
import com.qmth.boot.core.security.exception.AuthorizationException;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -87,6 +90,60 @@ public class ExamServiceImpl extends ServiceImpl<ExamDao, ExamEntity> implements
|
|
return list(new LambdaQueryWrapper<ExamEntity>().eq(ExamEntity::getEnable, true));
|
|
return list(new LambdaQueryWrapper<ExamEntity>().eq(ExamEntity::getEnable, true));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Long save(ExamEdit exam) {
|
|
|
|
+ if (StringUtils.isBlank(exam.getName())) {
|
|
|
|
+ throw new ParameterException("考试名称不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.length(exam.getName()) > 100) {
|
|
|
|
+ throw new ParameterException("考试名称限制100字以内");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 新增考试
|
|
|
|
+ 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.setImageTransferMode(ImageTransferMode.CET);
|
|
|
|
+ examEntity.setImageCheckRatio(1d);
|
|
|
|
+ // examEntity.setPaperTypeBarcodeContent(null);
|
|
|
|
+ // examEntity.setAbsentBarcodeContent(null);
|
|
|
|
+ // examEntity.setDataSyncTime(null);
|
|
|
|
+ // examEntity.setCardSyncTime(null);
|
|
|
|
+ // examEntity.setExamNumberFillCount(null);
|
|
|
|
+ this.save(examEntity);
|
|
|
|
+
|
|
|
|
+ return examEntity.getId();
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public ExamInfoVo getExamInfoVo(Long examId, User accessUser) {
|
|
public ExamInfoVo getExamInfoVo(Long examId, User accessUser) {
|
|
ExamEntity exam = this.getById(examId);
|
|
ExamEntity exam = this.getById(examId);
|