|
@@ -59,7 +59,7 @@ public class TEExamSummaryServiceImpl extends ServiceImpl<TEExamSummaryMapper, T
|
|
|
if ((Objects.nonNull(l) && System.currentTimeMillis() - l.longValue() <= 1000 * 60 * 1) || freshen) {
|
|
|
//根据考试批次、场次、考场编码统计信息
|
|
|
TEExamSummary teExamSummary = this.baseMapper.examSummary(examId, examActivityId, s);
|
|
|
- this.examSummaryCommon(examId, examActivityId, s, teExamSummary);
|
|
|
+ this.examSummaryCommon(examId, examActivityId, s, teExamSummary, freshen);
|
|
|
updateCache = true;
|
|
|
} else {
|
|
|
themisCacheService.getExamSummaryCache(examId, examActivityId, s);
|
|
@@ -92,8 +92,9 @@ public class TEExamSummaryServiceImpl extends ServiceImpl<TEExamSummaryMapper, T
|
|
|
* @param examActivityId
|
|
|
* @param s
|
|
|
* @param teExamSummary
|
|
|
+ * @param freshen
|
|
|
*/
|
|
|
- protected void examSummaryCommon(Long examId, Long examActivityId, String s, TEExamSummary teExamSummary) {
|
|
|
+ protected void examSummaryCommon(Long examId, Long examActivityId, String s, TEExamSummary teExamSummary, boolean freshen) {
|
|
|
if (Objects.nonNull(teExamSummary) && teExamSummary.getTotalCount().intValue() > 0) {
|
|
|
teExamSummary.setExamId(examId);
|
|
|
teExamSummary.setExamActivityId(examActivityId);
|
|
@@ -106,8 +107,6 @@ public class TEExamSummaryServiceImpl extends ServiceImpl<TEExamSummaryMapper, T
|
|
|
Integer absentCount = teExamStudentService.getAbsentCount(examId, examActivityId, s);
|
|
|
teExamSummary.setAbsentCount(Objects.nonNull(absentCount) ? absentCount : 0);
|
|
|
}
|
|
|
- Integer finishCount = tOeExamRecordService.findExamRecordByFinish(examId, examActivityId, s);
|
|
|
- teExamSummary.setFinishCount(finishCount);
|
|
|
TEExamSummary teExamSummaryDb = this.getOne(new QueryWrapper<TEExamSummary>().lambda()
|
|
|
.eq(TEExamSummary::getExamId, examId)
|
|
|
.eq(TEExamSummary::getExamActivityId, examActivityId)
|
|
@@ -116,10 +115,19 @@ public class TEExamSummaryServiceImpl extends ServiceImpl<TEExamSummaryMapper, T
|
|
|
teExamSummaryDb = new TEExamSummary();
|
|
|
BeanUtils.copyProperties(teExamSummary, teExamSummaryDb);
|
|
|
teExamSummaryDb.setId(UidUtil.nextId());
|
|
|
+ Integer finishCount = tOeExamRecordService.findExamRecordByFinish(examId, examActivityId, s);
|
|
|
+ teExamSummary.setFinishCount(finishCount);
|
|
|
} else {
|
|
|
Long id = teExamSummaryDb.getId();
|
|
|
+ Integer finishCount = null;
|
|
|
+ if (freshen) {
|
|
|
+ finishCount = tOeExamRecordService.findExamRecordByFinish(examId, examActivityId, s);
|
|
|
+ } else {
|
|
|
+ finishCount = teExamSummaryDb.getFinishCount();
|
|
|
+ }
|
|
|
BeanUtils.copyProperties(teExamSummary, teExamSummaryDb);
|
|
|
teExamSummaryDb.setId(id);
|
|
|
+ teExamSummaryDb.setFinishCount(finishCount);
|
|
|
}
|
|
|
this.saveOrUpdate(teExamSummaryDb);
|
|
|
themisCacheService.updateExamSummaryCache(examId, examActivityId, s);
|