|
@@ -26,10 +26,7 @@ import com.qmth.teachcloud.common.entity.*;
|
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
|
import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
|
|
|
import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
|
|
|
-import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
|
-import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
|
|
|
-import com.qmth.teachcloud.common.service.FileUploadService;
|
|
|
-import com.qmth.teachcloud.common.service.TeachcloudCommonService;
|
|
|
+import com.qmth.teachcloud.common.service.*;
|
|
|
import com.qmth.teachcloud.common.util.*;
|
|
|
import com.qmth.teachcloud.mark.bean.StringResult;
|
|
|
import com.qmth.teachcloud.mark.bean.UpdateTimeVo;
|
|
@@ -96,6 +93,8 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Service
|
|
|
public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkStudent> implements MarkStudentService {
|
|
|
+ @Resource
|
|
|
+ private SysUserService sysUserService;
|
|
|
|
|
|
@Resource
|
|
|
private MarkPaperService markPaperService;
|
|
@@ -584,30 +583,26 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
} else {
|
|
|
// 缺考时,校验缺考检查任务是否做完
|
|
|
- if(page.getAbsent().getResult() ) {
|
|
|
- if (student.getOmrAbsent() && !student.getOmrAbsentChecked()){
|
|
|
- throw ExceptionResultEnum.ERROR.exception("缺考检查任务未完成,不能更新为缺考");
|
|
|
- }
|
|
|
- // 缺考时,校验人工绑定任务是否做完
|
|
|
- if (student.getAssigned() && !student.getAssignConfirmed()) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("人工绑定任务未完成,不能更新为缺考");
|
|
|
- }
|
|
|
- // 缺考时,校验卷型检查任务是否做完
|
|
|
- if (PaperTypeCheckStatus.WAITING.equals(student.getPaperTypeCheckStatus())) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("卷型检查任务未完成,不能更新为缺考");
|
|
|
- }
|
|
|
- // 缺考时,校验客观题检查任务是否全部做完
|
|
|
- if (page.getAbsent() != null && page.getAbsent().getResult()) {
|
|
|
- if (scanOmrTaskService.getStudentTaskCount(studentId, OmrTaskStatus.WAITING) > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("客观题检查任务未完成,不能更新为缺考");
|
|
|
- }
|
|
|
+ if (student.getOmrAbsent() && !student.getOmrAbsentChecked()) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("缺考检查任务未完成,不能更新为缺考");
|
|
|
+ }
|
|
|
+ // 缺考时,校验人工绑定任务是否做完
|
|
|
+ if (student.getAssigned() && !student.getAssignConfirmed()) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("人工绑定任务未完成,不能更新为缺考");
|
|
|
+ }
|
|
|
+ // 缺考时,校验卷型检查任务是否做完
|
|
|
+ if (PaperTypeCheckStatus.WAITING.equals(student.getPaperTypeCheckStatus())) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("卷型检查任务未完成,不能更新为缺考");
|
|
|
+ }
|
|
|
+ // 缺考时,校验客观题检查任务是否全部做完
|
|
|
+ if (page.getAbsent() != null && page.getAbsent().getResult()) {
|
|
|
+ if (scanOmrTaskService.getStudentTaskCount(studentId, OmrTaskStatus.WAITING) > 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("客观题检查任务未完成,不能更新为缺考");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 人工指定后,识别缺考未处理的数据,不再处理,已处理的,不变
|
|
|
- if (!student.getOmrAbsentChecked()) {
|
|
|
- student.setOmrAbsent(false);
|
|
|
- }
|
|
|
+ student.setOmrAbsent(false);
|
|
|
student.setManualAbsent(page.getAbsent() != null && page.getAbsent().getResult());
|
|
|
}
|
|
|
student.setAbsent(student.getOmrAbsent() || (student.getManualAbsent() != null && student.getManualAbsent()));
|
|
@@ -1095,25 +1090,25 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public AbsentManualUpdateVo absentManualUpdate(Long examId, String coursePaperId, String studentCode,
|
|
|
- ScanStatus status) {
|
|
|
+ Boolean manualAbsent) {
|
|
|
MarkStudent student = findByExamIdAndCoursePaperIdAndStudentCode(examId, coursePaperId, studentCode);
|
|
|
if (student == null) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("考生未找到");
|
|
|
}
|
|
|
- if (ScanStatus.MANUAL_ABSENT.equals(status) && !ScanStatus.UNEXIST.equals(student.getScanStatus())) {
|
|
|
+ if (manualAbsent && !ScanStatus.UNEXIST.equals(student.getScanStatus())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("考生不是未扫描状态");
|
|
|
}
|
|
|
LambdaUpdateWrapper<MarkStudent> lw = new LambdaUpdateWrapper<>();
|
|
|
lw.set(MarkStudent::getScanStatus, ScanStatus.UNEXIST);
|
|
|
- lw.set(MarkStudent::getManualAbsent, ScanStatus.MANUAL_ABSENT.equals(status));
|
|
|
- lw.set(MarkStudent::getAbsent, student.getOmrAbsent() || ScanStatus.MANUAL_ABSENT.equals(status));
|
|
|
+ lw.set(MarkStudent::getManualAbsent, manualAbsent);
|
|
|
+ lw.set(MarkStudent::getAbsent, student.getOmrAbsent() || manualAbsent);
|
|
|
lw.set(MarkStudent::getMissScan, false);
|
|
|
lw.eq(MarkStudent::getId, student.getId());
|
|
|
update(lw);
|
|
|
markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
|
|
|
this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
|
|
|
|
|
|
- return AbsentManualUpdateVo.create(status);
|
|
|
+ return AbsentManualUpdateVo.create(manualAbsent);
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@@ -1124,6 +1119,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
|
|
|
lw.set(MarkStudent::getOmrAbsentChecked, true);
|
|
|
lw.set(MarkStudent::getOmrAbsent, omrAbsent);
|
|
|
+ lw.set(MarkStudent::getAbsent, omrAbsent && student.getManualAbsent() != null && student.getManualAbsent());
|
|
|
if (omrAbsent) {
|
|
|
lw.set(MarkStudent::getObjectiveScore, null);
|
|
|
lw.set(MarkStudent::getObjectiveScoreList, null);
|
|
@@ -1338,7 +1334,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
log.debug("导出Excel结束");
|
|
|
|
|
|
String zipFileName = downloadPathFile.getName() + SystemConstant.ZIP_PREFIX;
|
|
|
- FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, new String(Base64Util.decode(sysUser.getPassword())));
|
|
|
+ SysUser sysUser1 = sysUserService.getById(ServletUtil.getRequestUserId());
|
|
|
+ FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, new String(Base64Util.decode(sysUser1.getPassword())));
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
} finally {
|