|
@@ -120,8 +120,8 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public Long saveByPrepare(Long examId, Long examActivityId, Long examStudentId, Long paperId,
|
|
|
|
- Integer serialNumber, Long studentId, Integer mobilePhotoUpload) {
|
|
|
|
|
|
+ public TOeExamRecord saveByPrepare(Long examId, Long examActivityId, Long examStudentId, Long paperId,
|
|
|
|
+ Integer serialNumber, Long studentId, Integer mobilePhotoUpload) {
|
|
ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(examActivityId);
|
|
ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(examActivityId);
|
|
ExamCacheBean exam = examService.getExamCacheBean(examId);
|
|
ExamCacheBean exam = examService.getExamCacheBean(examId);
|
|
TOeExamRecord er = new TOeExamRecord();
|
|
TOeExamRecord er = new TOeExamRecord();
|
|
@@ -168,7 +168,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
|
|
|
//2022-04-15新增
|
|
//2022-04-15新增
|
|
ExamingDataCacheUtil.setExamingRecordId(studentId, er.getId());
|
|
ExamingDataCacheUtil.setExamingRecordId(studentId, er.getId());
|
|
- return er.getId();
|
|
|
|
|
|
+ return er;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -428,14 +428,21 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
//更新考生信息
|
|
//更新考生信息
|
|
teExamStudentService.updateExamStudentByCache(er.getExamStudentId());
|
|
teExamStudentService.updateExamStudentByCache(er.getExamStudentId());
|
|
ExamStudentCacheBean examStudentCache = (ExamStudentCacheBean) redisUtil.get(RedisKeyHelper.examStudentCacheKey(er.getExamStudentId()));
|
|
ExamStudentCacheBean examStudentCache = (ExamStudentCacheBean) redisUtil.get(RedisKeyHelper.examStudentCacheKey(er.getExamStudentId()));
|
|
|
|
+ ExamCacheBean examCacheBean = examService.getExamCacheBean(ExamRecordCacheUtil.getExamId(recordId));
|
|
if (Objects.nonNull(examStudentCache.getAlreadyExamCount()) &&
|
|
if (Objects.nonNull(examStudentCache.getAlreadyExamCount()) &&
|
|
examStudentCache.getAlreadyExamCount().longValue() == 1) {
|
|
examStudentCache.getAlreadyExamCount().longValue() == 1) {
|
|
- teOrgSummaryService.updateOrgZeroSummary(1);
|
|
|
|
|
|
+ teOrgSummaryService.updateOrgZeroSummary(examCacheBean.getOrgId(), 1);
|
|
|
|
+ teOrgSummaryService.updateOrgZeroSummary(0L, 1);
|
|
} else {
|
|
} else {
|
|
- teOrgSummaryService.updateOrgZeroSummary(0);
|
|
|
|
|
|
+ teOrgSummaryService.updateOrgZeroSummary(examCacheBean.getOrgId(), 0);
|
|
|
|
+ teOrgSummaryService.updateOrgZeroSummary(0L, 0);
|
|
}
|
|
}
|
|
themisCacheService.updateOrgSummaryCache(0L);
|
|
themisCacheService.updateOrgSummaryCache(0L);
|
|
|
|
|
|
|
|
+ Long examActivityId = ExamRecordCacheUtil.getExamActivityId(recordId);
|
|
|
|
+ String examRecordChangeKey = examActivityId + "_" + examStudentCache.getRoomCode();
|
|
|
|
+ themisCacheService.addExamRecordChangeCache(examRecordChangeKey, timestamp);
|
|
|
|
+
|
|
//上传个人试卷结构
|
|
//上传个人试卷结构
|
|
if (Objects.nonNull(struct)) {
|
|
if (Objects.nonNull(struct)) {
|
|
ossUtil.upload(false, structFilePath, struct.getContent());
|
|
ossUtil.upload(false, structFilePath, struct.getContent());
|
|
@@ -499,30 +506,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
if (Objects.nonNull(o) && o instanceof BreachStatusBean) {
|
|
if (Objects.nonNull(o) && o instanceof BreachStatusBean) {
|
|
record.put(ExamRecordFieldEnum.breach_status.getCode(), ((BreachStatusBean) o).getStatus());
|
|
record.put(ExamRecordFieldEnum.breach_status.getCode(), ((BreachStatusBean) o).getStatus());
|
|
}
|
|
}
|
|
- o = redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_count.getCode());
|
|
|
|
- if (Objects.nonNull(o) && o instanceof WarningCountBean) {
|
|
|
|
- record.put(ExamRecordFieldEnum.warning_count.getCode(), ((WarningCountBean) o).getNumber());
|
|
|
|
- }
|
|
|
|
- o = redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_unread.getCode());
|
|
|
|
- if (Objects.nonNull(o) && o instanceof WarningUnreadBean) {
|
|
|
|
- record.put(ExamRecordFieldEnum.warning_unread.getCode(), ((WarningUnreadBean) o).getNumber());
|
|
|
|
- }
|
|
|
|
- o = redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_multiple_face_count.getCode());
|
|
|
|
- if (Objects.nonNull(o) && o instanceof WarningMultipleFaceCountBean) {
|
|
|
|
- record.put(ExamRecordFieldEnum.warning_multiple_face_count.getCode(), ((WarningMultipleFaceCountBean) o).getNumber());
|
|
|
|
- }
|
|
|
|
- o = redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.exception_count.getCode());
|
|
|
|
- if (Objects.nonNull(o) && o instanceof ExceptionCountBean) {
|
|
|
|
- record.put(ExamRecordFieldEnum.exception_count.getCode(), ((ExceptionCountBean) o).getNumber());
|
|
|
|
- }
|
|
|
|
- o = redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.already_break_count.getCode());
|
|
|
|
- if (Objects.nonNull(o) && o instanceof AlreadyBreakCountBean) {
|
|
|
|
- record.put(ExamRecordFieldEnum.already_break_count.getCode(), ((AlreadyBreakCountBean) o).getNumber());
|
|
|
|
- }
|
|
|
|
- o = redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_liveness_verify_count.getCode());
|
|
|
|
- if (Objects.nonNull(o) && o instanceof InProcessLivenessVerifyCountBean) {
|
|
|
|
- record.put(ExamRecordFieldEnum.in_process_liveness_verify_count.getCode(), ((InProcessLivenessVerifyCountBean) o).getNumber());
|
|
|
|
- }
|
|
|
|
er = GsonUtil.fromJson(GsonUtil.toJson(record), TOeExamRecord.class);
|
|
er = GsonUtil.fromJson(GsonUtil.toJson(record), TOeExamRecord.class);
|
|
}
|
|
}
|
|
return er;
|
|
return er;
|
|
@@ -576,26 +559,15 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void updateWarningCountCache(Long id, TIeInvigilateWarnInfo tIeInvigilateWarnInfo) {
|
|
public void updateWarningCountCache(Long id, TIeInvigilateWarnInfo tIeInvigilateWarnInfo) {
|
|
- Integer warningCount = ExamRecordCacheUtil.getWarningCount(id);
|
|
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
- long timestamp = System.currentTimeMillis();
|
|
|
|
- if (Objects.nonNull(warningCount)) {
|
|
|
|
- ExamRecordCacheUtil.setWarningCount(id, warningCount + 1, timestamp);
|
|
|
|
- } else {
|
|
|
|
- ExamRecordCacheUtil.setWarningCount(id, 1, timestamp);
|
|
|
|
- }
|
|
|
|
- Integer warningUnread = ExamRecordCacheUtil.getWarningUnread(id);
|
|
|
|
- if (Objects.nonNull(warningUnread)) {
|
|
|
|
- ExamRecordCacheUtil.setWarningUnread(id, warningUnread + 1, timestamp);
|
|
|
|
- } else {
|
|
|
|
- ExamRecordCacheUtil.setWarningUnread(id, 1, timestamp);
|
|
|
|
- }
|
|
|
|
|
|
+ ExamRecordCacheUtil.setWarningCount(id, 1);
|
|
|
|
+ ExamRecordCacheUtil.setWarningUnread(id, 1);
|
|
if (Objects.nonNull(tIeInvigilateWarnInfo) && tIeInvigilateWarnInfo.getType() == VerifyExceptionEnum.FACE_COUNT_ERROR
|
|
if (Objects.nonNull(tIeInvigilateWarnInfo) && tIeInvigilateWarnInfo.getType() == VerifyExceptionEnum.FACE_COUNT_ERROR
|
|
&& Objects.equals(tIeInvigilateWarnInfo.getLevel(), "D8")) {
|
|
&& Objects.equals(tIeInvigilateWarnInfo.getLevel(), "D8")) {
|
|
this.updateWarningMultipleFaceCountCache(id);
|
|
this.updateWarningMultipleFaceCountCache(id);
|
|
}
|
|
}
|
|
- this.sendExamRecordDataSaveMq(id, timestamp);
|
|
|
|
|
|
+ this.sendExamRecordDataSaveMq(id, System.currentTimeMillis());
|
|
} else {
|
|
} else {
|
|
//已经结束了直接更新数据库
|
|
//已经结束了直接更新数据库
|
|
this.sendExamRecordDataUpdateWarningCountMq(id);
|
|
this.sendExamRecordDataUpdateWarningCountMq(id);
|
|
@@ -607,24 +579,28 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
*
|
|
*
|
|
* @param id
|
|
* @param id
|
|
* @param number
|
|
* @param number
|
|
|
|
+ * @param updateDb
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void updateWarningUnreadCache(Long id, Integer number) {
|
|
|
|
|
|
+ public void updateWarningUnreadCache(Long id, Integer number, Boolean updateDb) {
|
|
Integer warningUnread = ExamRecordCacheUtil.getWarningUnread(id);
|
|
Integer warningUnread = ExamRecordCacheUtil.getWarningUnread(id);
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
- long timestamp = System.currentTimeMillis();
|
|
|
|
if (Objects.nonNull(warningUnread) && number.intValue() == 0) {
|
|
if (Objects.nonNull(warningUnread) && number.intValue() == 0) {
|
|
- ExamRecordCacheUtil.setWarningUnread(id, number, timestamp);
|
|
|
|
|
|
+ ExamRecordCacheUtil.setWarningUnread(id, -warningUnread);
|
|
} else if (Objects.nonNull(warningUnread) && number.intValue() > 0) {
|
|
} else if (Objects.nonNull(warningUnread) && number.intValue() > 0) {
|
|
- ExamRecordCacheUtil.setWarningUnread(id, warningUnread - number, timestamp);
|
|
|
|
|
|
+ ExamRecordCacheUtil.setWarningUnread(id, -(warningUnread - number));
|
|
} else {
|
|
} else {
|
|
- ExamRecordCacheUtil.setWarningUnread(id, 0, timestamp);
|
|
|
|
|
|
+ ExamRecordCacheUtil.setWarningUnread(id, 0);
|
|
|
|
+ }
|
|
|
|
+ if (Objects.nonNull(updateDb) && updateDb) {
|
|
|
|
+ this.sendExamRecordDataSaveMq(id, System.currentTimeMillis());
|
|
}
|
|
}
|
|
- this.sendExamRecordDataSaveMq(id, timestamp);
|
|
|
|
} else {
|
|
} else {
|
|
- //已经结束了直接更新数据库
|
|
|
|
- this.sendExamRecordDataUpdateWarningUnreadMq(id, number);
|
|
|
|
|
|
+ if (Objects.nonNull(updateDb) && updateDb) {
|
|
|
|
+ //已经结束了直接更新数据库
|
|
|
|
+ this.sendExamRecordDataUpdateWarningUnreadMq(id, number);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -635,15 +611,9 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void updateWarningMultipleFaceCountCache(Long id) {
|
|
public void updateWarningMultipleFaceCountCache(Long id) {
|
|
- Integer warningMultipleFaceCount = ExamRecordCacheUtil.getWarningMultipleFaceCount(id);
|
|
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
- long timestamp = System.currentTimeMillis();
|
|
|
|
- if (Objects.nonNull(warningMultipleFaceCount)) {
|
|
|
|
- ExamRecordCacheUtil.setWarningMultipleFaceCount(id, warningMultipleFaceCount + 1, timestamp);
|
|
|
|
- } else {
|
|
|
|
- ExamRecordCacheUtil.setWarningMultipleFaceCount(id, 1, timestamp);
|
|
|
|
- }
|
|
|
|
|
|
+ ExamRecordCacheUtil.setWarningMultipleFaceCount(id, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -654,18 +624,35 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void updateExceptionCountCache(Long id) {
|
|
public void updateExceptionCountCache(Long id) {
|
|
- Integer exceptionCount = ExamRecordCacheUtil.getExceptionCount(id);
|
|
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(id);
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
if (Objects.nonNull(status) && status != ExamRecordStatusEnum.PERSISTED) {
|
|
- long timestamp = System.currentTimeMillis();
|
|
|
|
- if (Objects.nonNull(exceptionCount)) {
|
|
|
|
- ExamRecordCacheUtil.setExceptionCount(id, exceptionCount + 1, timestamp);
|
|
|
|
- } else {
|
|
|
|
- ExamRecordCacheUtil.setExceptionCount(id, 1, timestamp);
|
|
|
|
- }
|
|
|
|
|
|
+ ExamRecordCacheUtil.setExceptionCount(id, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 根据预警条件清除未阅
|
|
|
|
+ *
|
|
|
|
+ * @param examId
|
|
|
|
+ * @param examActivityId
|
|
|
|
+ * @param roomCode
|
|
|
|
+ * @param name
|
|
|
|
+ * @param identity
|
|
|
|
+ * @param minMultipleFaceCount
|
|
|
|
+ * @param maxMultipleFaceCount
|
|
|
|
+ * @param minExceptionCount
|
|
|
|
+ * @param maxExceptionCount
|
|
|
|
+ * @param minWarningCount
|
|
|
|
+ * @param maxWarningCount
|
|
|
|
+ * @param userId
|
|
|
|
+ * @param orgId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<TOeExamRecord> findExamRecordByWarning(Long examId, Long examActivityId, String roomCode, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, Long userId, Long orgId) {
|
|
|
|
+ return this.baseMapper.findExamRecordByWarning(examId, examActivityId, roomCode, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId, orgId);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void saveFaceVerify(ExamTypeEnum type, Long recordId, Long entryAuthenticationId,
|
|
public void saveFaceVerify(ExamTypeEnum type, Long recordId, Long entryAuthenticationId,
|
|
VerifyExceptionEnum entryAuthenticationResult) {
|
|
VerifyExceptionEnum entryAuthenticationResult) {
|
|
@@ -683,8 +670,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
ExamRecordCacheUtil.setEntryAuthenticationId(recordId, entryAuthenticationId);
|
|
ExamRecordCacheUtil.setEntryAuthenticationId(recordId, entryAuthenticationId);
|
|
ExamRecordCacheUtil.setEntryAuthenticationResult(recordId, entryAuthenticationResult);
|
|
ExamRecordCacheUtil.setEntryAuthenticationResult(recordId, entryAuthenticationResult);
|
|
} else if (LivenessTypeEnum.IN_PROCESS.equals(type)) {
|
|
} else if (LivenessTypeEnum.IN_PROCESS.equals(type)) {
|
|
- Integer count = Objects.isNull(ExamRecordCacheUtil.getInProcessLivenessVerifyCount(recordId)) ? 0 : ExamRecordCacheUtil.getInProcessLivenessVerifyCount(recordId);
|
|
|
|
- ExamRecordCacheUtil.setInProcessLivenessVerifyCount(recordId, count + 1, System.currentTimeMillis());
|
|
|
|
|
|
+ ExamRecordCacheUtil.setInProcessLivenessVerifyCount(recordId, 1);
|
|
}
|
|
}
|
|
this.sendExamRecordDataSaveMq(recordId, System.currentTimeMillis());
|
|
this.sendExamRecordDataSaveMq(recordId, System.currentTimeMillis());
|
|
}
|
|
}
|
|
@@ -1093,11 +1079,11 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
log.info("no ObjectiveAnswer for calculateObjectiveScore recordId:" + recordId);
|
|
log.info("no ObjectiveAnswer for calculateObjectiveScore recordId:" + recordId);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- BigDecimal tatolscore = new BigDecimal(0.0);
|
|
|
|
|
|
+ BigDecimal tatolscore = BigDecimal.valueOf(0.0);
|
|
for (TOeExamAnswer answer : answers) {
|
|
for (TOeExamAnswer answer : answers) {
|
|
Double score = calculateScoreForQuestion(answer, map);
|
|
Double score = calculateScoreForQuestion(answer, map);
|
|
if (score != null) {
|
|
if (score != null) {
|
|
- tatolscore = tatolscore.add(new BigDecimal(score));
|
|
|
|
|
|
+ tatolscore = tatolscore.add(BigDecimal.valueOf(score));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1142,7 +1128,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
if (r == 1) {
|
|
if (r == 1) {
|
|
answer.setScore(cb.getScore());
|
|
answer.setScore(cb.getScore());
|
|
} else if (r == 0) {
|
|
} else if (r == 0) {
|
|
- BigDecimal b = new BigDecimal(cb.getScore()).divide(new BigDecimal("2"), 1, BigDecimal.ROUND_UP);
|
|
|
|
|
|
+ BigDecimal b = BigDecimal.valueOf(cb.getScore()).divide(new BigDecimal("2"), 1, BigDecimal.ROUND_UP);
|
|
answer.setScore(b.doubleValue());
|
|
answer.setScore(b.doubleValue());
|
|
} else {
|
|
} else {
|
|
answer.setScore(0.0);
|
|
answer.setScore(0.0);
|
|
@@ -1287,12 +1273,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
return tOeExamRecord;
|
|
return tOeExamRecord;
|
|
}
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- Integer i = 0;
|
|
|
|
-// System.out.println(i++);
|
|
|
|
- System.out.println(i + 1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 设置断点信息
|
|
* 设置断点信息
|
|
*
|
|
*
|
|
@@ -1313,7 +1293,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
ExamRecordCacheUtil.setLastBreakId(recordId, breakId);
|
|
ExamRecordCacheUtil.setLastBreakId(recordId, breakId);
|
|
ExamRecordCacheUtil.setStatus(recordId, ExamRecordStatusEnum.BREAK_OFF, lastBreakTimeNow);
|
|
ExamRecordCacheUtil.setStatus(recordId, ExamRecordStatusEnum.BREAK_OFF, lastBreakTimeNow);
|
|
ExamRecordCacheUtil.setLastBreakTime(recordId, lastBreakTimeNow);
|
|
ExamRecordCacheUtil.setLastBreakTime(recordId, lastBreakTimeNow);
|
|
- ExamRecordCacheUtil.setAlreadyBreakCount(recordId, alreadyBreakCount + 1, lastBreakTimeNow);
|
|
|
|
|
|
+ ExamRecordCacheUtil.setAlreadyBreakCount(recordId, 1);
|
|
|
|
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
@@ -1759,10 +1739,10 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<Long> dataCount() {
|
|
public List<Long> dataCount() {
|
|
- TEOrgSummary teOrgSummary = themisCacheService.addOrgSummaryCache(0L);
|
|
|
|
|
|
+ TEOrgSummary teOrgSummary = themisCacheService.getOrgSummaryCache(0L);
|
|
if (Objects.isNull(teOrgSummary)) {
|
|
if (Objects.isNull(teOrgSummary)) {
|
|
teOrgSummaryService.orgSummary(0L, null);//第一次进来没数据,强制统计一次
|
|
teOrgSummaryService.orgSummary(0L, null);//第一次进来没数据,强制统计一次
|
|
- teOrgSummary = themisCacheService.addOrgSummaryCache(0L);
|
|
|
|
|
|
+ teOrgSummary = themisCacheService.getOrgSummaryCache(0L);
|
|
}
|
|
}
|
|
List<Long> list = new ArrayList<>();
|
|
List<Long> list = new ArrayList<>();
|
|
list.add(Objects.nonNull(teOrgSummary) && Objects.nonNull(teOrgSummary.getOnlineCount()) ? Long.parseLong(teOrgSummary.getOnlineCount().toString()) : 0L);
|
|
list.add(Objects.nonNull(teOrgSummary) && Objects.nonNull(teOrgSummary.getOnlineCount()) ? Long.parseLong(teOrgSummary.getOnlineCount().toString()) : 0L);
|
|
@@ -1779,7 +1759,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<OrgDataCountBean> orgDataCount() {
|
|
public List<OrgDataCountBean> orgDataCount() {
|
|
- Set<String> examIdSetSet = redisUtil.getHashKeys(SystemConstant.TODAY_EXAM_LIST_MAP_CACHE);
|
|
|
|
|
|
+ Set<String> examIdSetSet = redisUtil.getHashKeys(SystemConstant.CURRENT_EXAM_LIST_MAP_CACHE);
|
|
if (!CollectionUtils.isEmpty(examIdSetSet)) {
|
|
if (!CollectionUtils.isEmpty(examIdSetSet)) {
|
|
Set<Long> examIdSet = examIdSetSet.stream().map(s -> Long.parseLong(s)).collect(Collectors.toSet());
|
|
Set<Long> examIdSet = examIdSetSet.stream().map(s -> Long.parseLong(s)).collect(Collectors.toSet());
|
|
LinkedMultiValueMap<Long, Long> orgExamIdMap = tbOrgService.mergeOrgId(examIdSet);
|
|
LinkedMultiValueMap<Long, Long> orgExamIdMap = tbOrgService.mergeOrgId(examIdSet);
|
|
@@ -1787,7 +1767,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
List<OrgDataCountBean> orgDataCountBeanList = new ArrayList<>();
|
|
List<OrgDataCountBean> orgDataCountBeanList = new ArrayList<>();
|
|
//统计机构信息
|
|
//统计机构信息
|
|
orgExamIdMap.forEach((k, v) -> {
|
|
orgExamIdMap.forEach((k, v) -> {
|
|
- TEOrgSummary teOrgSummary = themisCacheService.addOrgSummaryCache(k);
|
|
|
|
|
|
+ TEOrgSummary teOrgSummary = themisCacheService.getOrgSummaryCache(k);
|
|
if (Objects.nonNull(teOrgSummary) && ((Objects.nonNull(teOrgSummary.getExamCount()) &&
|
|
if (Objects.nonNull(teOrgSummary) && ((Objects.nonNull(teOrgSummary.getExamCount()) &&
|
|
teOrgSummary.getExamCount().intValue() > 0)
|
|
teOrgSummary.getExamCount().intValue() > 0)
|
|
|| (Objects.nonNull(teOrgSummary) && Objects.nonNull(teOrgSummary.getOnlineCount()) &&
|
|
|| (Objects.nonNull(teOrgSummary) && Objects.nonNull(teOrgSummary.getOnlineCount()) &&
|
|
@@ -1809,7 +1789,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<MapDataCountBean> mapDataCount() {
|
|
public List<MapDataCountBean> mapDataCount() {
|
|
- List<TERegionSummary> teRegionSummaryList = themisCacheService.addRegionSummaryCache();
|
|
|
|
|
|
+ List<TERegionSummary> teRegionSummaryList = themisCacheService.getRegionSummaryCache();
|
|
if (!CollectionUtils.isEmpty(teRegionSummaryList)) {
|
|
if (!CollectionUtils.isEmpty(teRegionSummaryList)) {
|
|
return GsonUtil.fromJson(GsonUtil.toJson(teRegionSummaryList), new TypeToken<List<MapDataCountBean>>() {
|
|
return GsonUtil.fromJson(GsonUtil.toJson(teRegionSummaryList), new TypeToken<List<MapDataCountBean>>() {
|
|
}.getType());
|
|
}.getType());
|