|
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -578,6 +579,73 @@ public class CdExamRoomServiceImpl extends ServiceImpl<CdExamRoomMapper, CdExamR
|
|
|
return cdUserSubscribeService.updateById(userSubscribe);
|
|
return cdUserSubscribeService.updateById(userSubscribe);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean addExamResult(List<ExamApplyResultExportBo> bo) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(bo)){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ //补充学员成绩
|
|
|
|
|
+ bo.forEach(exportBo -> {
|
|
|
|
|
+ Long newTenantId = getNewTenantId(exportBo.getTenantId(), 1);
|
|
|
|
|
+ exportBo.setTenantId(newTenantId);
|
|
|
|
|
+ CdExamSubscribe subscribe = cdExamSubscribeService.getExamSubByBo(exportBo);
|
|
|
|
|
+ if (ObjectUtils.isNull(subscribe)){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ switch (exportBo.getApplyStatus()){
|
|
|
|
|
+ case "正常":
|
|
|
|
|
+ //补充考试成绩
|
|
|
|
|
+ BigDecimal bigDecimal = new BigDecimal(exportBo.getScore());
|
|
|
|
|
+ subscribe.setExamStatus(1);
|
|
|
|
|
+ subscribe.setPerformance(bigDecimal);
|
|
|
|
|
+ if (bigDecimal.compareTo(new BigDecimal("60.00")) >= 0){
|
|
|
|
|
+ subscribe.setResult(1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ subscribe.setResult(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "缺考":
|
|
|
|
|
+ //补充考试成绩
|
|
|
|
|
+ BigDecimal bigDecimal2 = new BigDecimal(exportBo.getScore());
|
|
|
|
|
+ subscribe.setExamStatus(2);
|
|
|
|
|
+ subscribe.setPerformance(bigDecimal2);
|
|
|
|
|
+ subscribe.setResult(0);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "作弊":
|
|
|
|
|
+ //补充考试成绩
|
|
|
|
|
+ BigDecimal bigDecimal3 = new BigDecimal(exportBo.getScore());
|
|
|
|
|
+ subscribe.setExamStatus(3);
|
|
|
|
|
+ subscribe.setPerformance(bigDecimal3);
|
|
|
|
|
+ subscribe.setResult(0);
|
|
|
|
|
+ break;
|
|
|
|
|
+ default :
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ cdExamSubscribeService.updateById(subscribe);
|
|
|
|
|
+ });
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean addExamResultCertificate(List<ExamApplyCertificateBo> bo) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(bo)){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ //补充学员成绩
|
|
|
|
|
+ bo.forEach(certificateBo -> {
|
|
|
|
|
+ Long newTenantId = getNewTenantId(certificateBo.getTenantId(), 1);
|
|
|
|
|
+ certificateBo.setTenantId(newTenantId);
|
|
|
|
|
+ CdExamSubscribe subscribe = cdExamSubscribeService.getExamCertificateByBo(certificateBo);
|
|
|
|
|
+ if (ObjectUtils.isNull(subscribe)){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ subscribe.setCertificateCode(certificateBo.getCertificateCode());
|
|
|
|
|
+ subscribe.setCertificateUrl(certificateBo.getCertificateUrl());
|
|
|
|
|
+ cdExamSubscribeService.updateById(subscribe);
|
|
|
|
|
+ });
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//预约校验
|
|
//预约校验
|
|
|
private void subscribeVerify(BatchSubscribeBo bo) {
|
|
private void subscribeVerify(BatchSubscribeBo bo) {
|
|
|
CdExamRoom courseRoom = getById(bo.getExamId());
|
|
CdExamRoom courseRoom = getById(bo.getExamId());
|