|
@@ -9,6 +9,7 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
|
+import com.google.zxing.client.result.BookmarkDoCoMoResultParser;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -337,7 +338,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
ScanPaperPage page = scanPaperPageService.findPaperIdAndIndex(paper.getId(), 1);
|
|
|
student.setOmrAbsent(page.getAbsent() == null ? false : page.getAbsent().getResult());
|
|
|
student.setOmrAbsentChecked(false);
|
|
|
- if(student.getOmrAbsent()){
|
|
|
+ if (student.getOmrAbsent()) {
|
|
|
student.setObjectiveScore(null);
|
|
|
student.setObjectiveScoreList(null);
|
|
|
}
|
|
@@ -805,7 +806,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (omrAbsent) {
|
|
|
lw.set(MarkStudent::getObjectiveScore, null);
|
|
|
lw.set(MarkStudent::getObjectiveScoreList, null);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
lw.set(MarkStudent::getOmrAbsent, false);
|
|
|
}
|
|
|
lw.eq(MarkStudent::getId, student.getId());
|
|
@@ -915,6 +916,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
|
|
|
vo.setExcellentRate(
|
|
|
Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
|
|
|
+ vo.setAvgScore(Calculator.round(vo.getAvgScore(), 2));
|
|
|
+ vo.setMinScore(Calculator.round(vo.getMinScore(), 2));
|
|
|
+ vo.setMaxScore(Calculator.round(vo.getMaxScore(), 2));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -925,6 +929,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
|
|
|
vo.setExcellentRate(
|
|
|
Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
|
|
|
+ vo.setAvgScore(Calculator.round(vo.getAvgScore(), 2));
|
|
|
+ vo.setMinScore(Calculator.round(vo.getMinScore(), 2));
|
|
|
+ vo.setMaxScore(Calculator.round(vo.getMaxScore(), 2));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -936,6 +943,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
vo.setExcellentRate(
|
|
|
Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
|
|
|
vo.setAvgScore(Calculator.round(vo.getAvgScore(), 2));
|
|
|
+ vo.setMinScore(Calculator.round(vo.getMinScore(), 2));
|
|
|
+ vo.setMaxScore(Calculator.round(vo.getMaxScore(), 2));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1107,9 +1116,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
|
|
|
private void fillObjective(ScoreReportVo ret, Long examId, String paperNumber) {
|
|
|
- List<MarkQuestion> qs = markQuestionService.listQuestionByExamIdAndPaperNumberAndPaperType(examId, paperNumber,
|
|
|
- null);
|
|
|
- List<MarkStudent> students = listByExamIdAndPaperNumberAndAbsent(examId, paperNumber, false);
|
|
|
+ List<MarkQuestion> qs = markQuestionService.listByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null, true);
|
|
|
+ List<MarkStudent> students = listByExamIdAndPaperNumberAndNotAbsent(examId, paperNumber);
|
|
|
Map<String, QuestionVo> map = new HashMap<>();
|
|
|
List<QuestionVo> list = new ArrayList<>();
|
|
|
for (MarkStudent s : students) {
|
|
@@ -1146,6 +1154,16 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ list = new ArrayList<>(map.values());
|
|
|
+ for (QuestionVo questionVo : list) {
|
|
|
+
|
|
|
+ if (questionVo.getStudentCount() == null || questionVo.getStudentCount() == 0) {
|
|
|
+ questionVo.setAvgScore(0D);
|
|
|
+ } else {
|
|
|
+ questionVo.setAvgScore(Calculator.round(Calculator.divide(questionVo.getScoreSum(), questionVo.getStudentCount()), 2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Collections.sort(list, (o1, o2) -> {
|
|
|
if (o1.getMainNumber() > o2.getMainNumber()) {
|
|
|
return 1;
|
|
@@ -1163,14 +1181,16 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
ret.setObjective(list);
|
|
|
}
|
|
|
|
|
|
- private List<MarkStudent> listByExamIdAndPaperNumberAndAbsent(Long examId, String paperNumber, Boolean absent) {
|
|
|
+ private List<MarkStudent> listByExamIdAndPaperNumberAndNotAbsent(Long examId, String paperNumber) {
|
|
|
QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
|
|
|
LambdaQueryWrapper<MarkStudent> lw = wrapper.lambda();
|
|
|
lw.eq(MarkStudent::getExamId, examId);
|
|
|
lw.eq(MarkStudent::getPaperNumber, paperNumber);
|
|
|
- if (absent != null) {
|
|
|
- lw.eq(MarkStudent::getAbsent, absent);
|
|
|
- }
|
|
|
+ lw.eq(MarkStudent::getUpload, true);
|
|
|
+ lw.eq(MarkStudent::getAbsent, false);
|
|
|
+ lw.eq(MarkStudent::getBreach, false);
|
|
|
+ lw.eq(MarkStudent::getOmrAbsent, false);
|
|
|
+
|
|
|
return this.list(wrapper);
|
|
|
}
|
|
|
|