|
@@ -27,16 +27,13 @@ import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
|
|
import com.qmth.teachcloud.common.bean.examRule.FieldsDto;
|
|
import com.qmth.teachcloud.common.bean.examRule.FieldsDto;
|
|
import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
|
|
import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
-import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
|
|
-import com.qmth.teachcloud.common.entity.BasicExamStudent;
|
|
|
|
-import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
|
-import com.qmth.teachcloud.common.entity.TBTask;
|
|
|
|
|
|
+import com.qmth.teachcloud.common.entity.*;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
-import com.qmth.teachcloud.common.service.BasicAttachmentService;
|
|
|
|
-import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
|
|
|
|
-import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
|
|
-import com.qmth.teachcloud.common.service.TeachcloudCommonService;
|
|
|
|
-import com.qmth.teachcloud.common.util.*;
|
|
|
|
|
|
+import com.qmth.teachcloud.common.service.*;
|
|
|
|
+import com.qmth.teachcloud.common.util.ConvertUtil;
|
|
|
|
+import com.qmth.teachcloud.common.util.RedisCounterUtil;
|
|
|
|
+import com.qmth.teachcloud.common.util.RedisUtil;
|
|
|
|
+import com.qmth.teachcloud.common.util.ServletUtil;
|
|
import com.qmth.teachcloud.mark.entity.MarkStudent;
|
|
import com.qmth.teachcloud.mark.entity.MarkStudent;
|
|
import com.qmth.teachcloud.mark.service.*;
|
|
import com.qmth.teachcloud.mark.service.*;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
@@ -143,6 +140,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
@Resource
|
|
@Resource
|
|
private TBTaskPdfService tbTaskPdfService;
|
|
private TBTaskPdfService tbTaskPdfService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ BasicSemesterService basicSemesterService;
|
|
|
|
+
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public double calculateTotalSubjects(Long printPlanId) {
|
|
public double calculateTotalSubjects(Long printPlanId) {
|
|
@@ -1188,4 +1188,42 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
.eq(ExamDetail::getId, id);
|
|
.eq(ExamDetail::getId, id);
|
|
this.update(updateWrapper);
|
|
this.update(updateWrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据考试id和条码查找
|
|
|
|
+ *
|
|
|
|
+ * @param examId
|
|
|
|
+ * @param packageCode
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public ExamDetail findByExamIdAndPackageCode(Long examId, String packageCode) {
|
|
|
|
+ QueryWrapper<ExamDetail> examDetailQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ examDetailQueryWrapper.lambda().eq(ExamDetail::getExamId, examId).eq(ExamDetail::getPackageCode, packageCode);
|
|
|
|
+ return this.getOne(examDetailQueryWrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 条码校验
|
|
|
|
+ *
|
|
|
|
+ * @param semesterId
|
|
|
|
+ * @param examId
|
|
|
|
+ * @param packageCodeStart
|
|
|
|
+ * @param packageCodeEnd
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean packageCodeVerify(Long semesterId, Long examId, String packageCodeStart, String packageCodeEnd) {
|
|
|
|
+ BasicSemester basicSemester = basicSemesterService.getById(semesterId);
|
|
|
|
+ Objects.requireNonNull(basicSemester, "未找到学期信息");
|
|
|
|
+
|
|
|
|
+ ExamDetail examDetail = this.findByExamIdAndPackageCode(examId, packageCodeStart);
|
|
|
|
+ Objects.requireNonNull(examDetail, "起始条码有误,请重新扫描");
|
|
|
|
+
|
|
|
|
+ String tempCode = StringUtils.substring(packageCodeEnd, 0, packageCodeEnd.length() - 2);
|
|
|
|
+ if (!Objects.equals(tempCode, examDetail.getPackageCode())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("结束条码有误,请重新扫描");
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|