|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.Update;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -272,16 +273,20 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (paperCount > 0) {
|
|
|
ScanAnswerCard answerCard = answerCardService.findByExamAndNumber(student.getExamId(),
|
|
|
student.getCardNumber());
|
|
|
+ student.setUpload(true);
|
|
|
student.setIncomplete(paperCount != answerCard.getPaperCount());
|
|
|
student.setScanStatus(ScanStatus.SCANNED);
|
|
|
// 更新图片数量和图片地址
|
|
|
- updateStudentSheetInfo(studentId, studentPaperList);
|
|
|
+ updateStudentSheetInfo(student, studentPaperList);
|
|
|
} else {
|
|
|
student.setScanStatus(ScanStatus.UNEXIST);
|
|
|
}
|
|
|
// student.setUpdaterId(userId);
|
|
|
// student.setUpdateTime(System.currentTimeMillis());
|
|
|
this.saveOrUpdate(student);
|
|
|
+
|
|
|
+ // 更新课程表中上传人数
|
|
|
+ updateMarkPaperUploadCount(student.getExamId(), student.getPaperNumber());
|
|
|
if (updateOmrTask) {
|
|
|
// 清除识别对照任务
|
|
|
scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
|
|
@@ -290,7 +295,21 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void updateStudentSheetInfo(Long studentId, List<ScanStudentPaper> studentPaperList) {
|
|
|
+ private void updateMarkPaperUploadCount(Long examId, String paperNumber) {
|
|
|
+ QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().eq(MarkStudent::getExamId, examId)
|
|
|
+ .eq(MarkStudent::getPaperNumber, paperNumber)
|
|
|
+ .eq(MarkStudent::getUpload, true);
|
|
|
+ int count = this.count(queryWrapper);
|
|
|
+
|
|
|
+ UpdateWrapper<MarkPaper> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.lambda().set(MarkPaper::getUploadCount, count)
|
|
|
+ .eq(MarkPaper::getExamId, examId)
|
|
|
+ .eq(MarkPaper::getPaperNumber, paperNumber);
|
|
|
+ markPaperService.update(updateWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ private MarkStudent updateStudentSheetInfo(MarkStudent student, List<ScanStudentPaper> studentPaperList) {
|
|
|
List<FilePathVo> filePathVoList = new ArrayList<>();
|
|
|
for (ScanStudentPaper scanStudentPaper : studentPaperList) {
|
|
|
List<ScanPaperPage> scanPaperPages = scanPaperPageService.listByPaperId(scanStudentPaper.getPaperId());
|
|
@@ -301,10 +320,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- UpdateWrapper<MarkStudent> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.lambda().set(MarkStudent::getSheetCount, filePathVoList.size())
|
|
|
- .set(MarkStudent::getSheetPath, JSON.toJSONString(filePathVoList)).eq(MarkStudent::getId, studentId);
|
|
|
- this.update(updateWrapper);
|
|
|
+ student.setSheetCount(filePathVoList.size());
|
|
|
+ student.setSheetPath(JSON.toJSONString(filePathVoList));
|
|
|
+ return student;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -394,11 +412,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
@Override
|
|
|
public boolean updateScanInfo(MarkStudent student) {
|
|
|
UpdateWrapper<MarkStudent> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.lambda().set(MarkStudent::getSheetCount, student.getSheetCount())
|
|
|
- .set(MarkStudent::getAnswers, student.getAnswers())
|
|
|
+ updateWrapper.lambda().set(MarkStudent::getAnswers, student.getAnswers())
|
|
|
.set(MarkStudent::getBatchCode, student.getBatchCode())
|
|
|
.set(MarkStudent::getAbsent, student.getAbsent())
|
|
|
- .set(MarkStudent::getUpload, true)
|
|
|
.set(MarkStudent::getUploadTime, System.currentTimeMillis())
|
|
|
.set(MarkStudent::getObjectiveScore, student.getObjectiveScore())
|
|
|
.set(MarkStudent::getObjectiveScoreList, student.getObjectiveScoreList())
|
|
@@ -754,11 +770,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (ret.getOverview() != null) {
|
|
|
double total = ret.getOverview().getStudentCount() - ret.getOverview().getAbsentCount();
|
|
|
ret.getOverview().setPassRate(
|
|
|
- Calculator.divide2String(Calculator.multiply(ret.getOverview().getPassCount(), 100), total, 2)
|
|
|
- + "%");
|
|
|
+ Calculator.divide2String(Calculator.multiply(ret.getOverview().getPassCount(), 100), total, 2));
|
|
|
ret.getOverview().setExcellentRate(
|
|
|
- Calculator.divide2String(Calculator.multiply(ret.getOverview().getExcellentCount(), 100), total, 2)
|
|
|
- + "%");
|
|
|
+ Calculator.divide2String(Calculator.multiply(ret.getOverview().getExcellentCount(), 100), total, 2));
|
|
|
}
|
|
|
|
|
|
fillScoreRange(ret, examId, paperNumber);
|
|
@@ -767,9 +781,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (CollectionUtils.isNotEmpty(ret.getCollege())) {
|
|
|
for (CollegeVo vo : ret.getCollege()) {
|
|
|
double total = vo.getStudentCount() - vo.getAbsentCount();
|
|
|
- vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2) + "%");
|
|
|
+ vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
|
|
|
vo.setExcellentRate(
|
|
|
- Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2) + "%");
|
|
|
+ Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -777,9 +791,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (CollectionUtils.isNotEmpty(ret.getClassData())) {
|
|
|
for (ClassVo vo : ret.getClassData()) {
|
|
|
double total = vo.getStudentCount() - vo.getAbsentCount();
|
|
|
- vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2) + "%");
|
|
|
+ vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
|
|
|
vo.setExcellentRate(
|
|
|
- Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2) + "%");
|
|
|
+ Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -787,9 +801,19 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (CollectionUtils.isNotEmpty(ret.getTeacher())) {
|
|
|
for (TeacherVo vo : ret.getTeacher()) {
|
|
|
double total = vo.getStudentCount() - vo.getAbsentCount();
|
|
|
- vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2) + "%");
|
|
|
+ vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
|
|
|
+ vo.setExcellentRate(
|
|
|
+ Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ret.setTeacherClass(baseMapper.teacherClass(examId, paperNumber));
|
|
|
+ if (CollectionUtils.isNotEmpty(ret.getTeacherClass())) {
|
|
|
+ for (TeacherClassVo vo : ret.getTeacherClass()) {
|
|
|
+ double total = vo.getStudentCount() - vo.getAbsentCount();
|
|
|
+ vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
|
|
|
vo.setExcellentRate(
|
|
|
- Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2) + "%");
|
|
|
+ Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
|
|
|
}
|
|
|
}
|
|
|
|