|
@@ -491,6 +491,7 @@ public class TIeInvigilateController {
|
|
|
if (Objects.isNull(mapParameter.get("status")) || Objects.equals(mapParameter.get("status"), "")) {
|
|
|
throw new BusinessException(ExceptionResultEnum.BREACH_STATUS_IS_NULL);
|
|
|
}
|
|
|
+ List<TOeExamRecord> tOeExamRecordList = new ArrayList<>();
|
|
|
if (recordIdList.size() > 0) {
|
|
|
Integer status = Integer.parseInt(String.valueOf(mapParameter.get("status")));
|
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
@@ -503,8 +504,9 @@ public class TIeInvigilateController {
|
|
|
Long examId = ExamRecordCacheUtil.getExamId(l);
|
|
|
Long examStudentId = null;
|
|
|
Long examActivityId = null;
|
|
|
+ TOeExamRecord tOeExamRecord = null;
|
|
|
if (Objects.isNull(examId)) {
|
|
|
- TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(l);
|
|
|
+ tOeExamRecord = tOeExamRecordService.getById(l);
|
|
|
examId = tOeExamRecord.getExamId();
|
|
|
examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
examActivityId = tOeExamRecord.getExamActivityId();
|
|
@@ -516,8 +518,13 @@ public class TIeInvigilateController {
|
|
|
TEExamBreachLog teExamBreachLog = new TEExamBreachLog(examId, examActivityId, l, examStudentId, type.name(), description, status);
|
|
|
teExamBreachLog.setCreateId(tbUser.getId());
|
|
|
finalTeExamBreachLogList.add(teExamBreachLog);
|
|
|
- ExamRecordCacheUtil.setBreachStatus(l, 0);
|
|
|
- tOeExamRecordService.sendExamRecordDataSaveMq(l, System.currentTimeMillis());
|
|
|
+ if (Objects.nonNull(ExamRecordCacheUtil.getId(l)) && Objects.nonNull(tOeExamRecord)) {
|
|
|
+ ExamRecordCacheUtil.setBreachStatus(l, 0);
|
|
|
+ tOeExamRecordService.sendExamRecordDataSaveMq(l, System.currentTimeMillis());
|
|
|
+ } else {
|
|
|
+ tOeExamRecord.setBreachStatus(0);
|
|
|
+ tOeExamRecordList.add(tOeExamRecord);
|
|
|
+ }
|
|
|
}
|
|
|
} else {//撤销违纪
|
|
|
BreachCancelTypeEnum type = BreachCancelTypeEnum.valueOf(String.valueOf(mapParameter.get("type")));
|
|
@@ -526,14 +533,24 @@ public class TIeInvigilateController {
|
|
|
.eq(TEExamBreachLog::getStatus, 0);
|
|
|
teExamBreachLogList = teExamBreachLogService.list(teExamBreachLogQueryWrapper);
|
|
|
teExamBreachLogList.forEach(s -> {
|
|
|
+ TOeExamRecord tOeExamRecord = null;
|
|
|
s.setType(type.name());
|
|
|
s.setDescription(description);
|
|
|
s.setStatus(status);
|
|
|
s.setUpdateId(tbUser.getId());
|
|
|
- ExamRecordCacheUtil.setBreachStatus(s.getExamRecordId(), 1);
|
|
|
- tOeExamRecordService.sendExamRecordDataSaveMq(s.getExamRecordId(), System.currentTimeMillis());
|
|
|
+ if (Objects.nonNull(ExamRecordCacheUtil.getId(s.getExamRecordId()))) {
|
|
|
+ tOeExamRecord = tOeExamRecordService.getById(s.getExamRecordId());
|
|
|
+ tOeExamRecord.setBreachStatus(1);
|
|
|
+ tOeExamRecordList.add(tOeExamRecord);
|
|
|
+ } else {
|
|
|
+ ExamRecordCacheUtil.setBreachStatus(s.getExamRecordId(), 1);
|
|
|
+ tOeExamRecordService.sendExamRecordDataSaveMq(s.getExamRecordId(), System.currentTimeMillis());
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
+ if (Objects.nonNull(tOeExamRecordList) && tOeExamRecordList.size() > 0) {
|
|
|
+ tOeExamRecordService.saveOrUpdateBatch(tOeExamRecordList);
|
|
|
+ }
|
|
|
for (TEExamBreachLog eb : teExamBreachLogList) {
|
|
|
Map<String, Object> properties = new HashMap<>();
|
|
|
properties.put("type", eb.getDescription());
|