|
@@ -9,9 +9,11 @@ import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.dto.MqDto;
|
|
|
import com.qmth.themis.business.entity.TBUser;
|
|
|
import com.qmth.themis.business.entity.TEExamBreachLog;
|
|
|
+import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
import com.qmth.themis.business.enums.*;
|
|
|
import com.qmth.themis.business.service.MqDtoService;
|
|
|
import com.qmth.themis.business.service.TEExamBreachLogService;
|
|
|
+import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
import com.qmth.themis.business.util.JacksonUtil;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
import com.qmth.themis.business.util.ServletUtil;
|
|
@@ -55,6 +57,9 @@ public class TIeInvigilateController {
|
|
|
@Resource
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TOeExamRecordService tOeExamRecordService;
|
|
|
+
|
|
|
@ApiOperation(value = "实时监控台列表接口")
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
|
public Result list(@RequestBody InvigilateListQueryBean param) {
|
|
@@ -119,17 +124,28 @@ public class TIeInvigilateController {
|
|
|
Integer status = Integer.parseInt(String.valueOf(mapParameter.get("status")));
|
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
List<TEExamBreachLog> teExamBreachLogList = new ArrayList<>();
|
|
|
- if (status == 1) {//新建违纪
|
|
|
+ if (status == 0) {//新建违纪
|
|
|
List<TEExamBreachLog> finalTeExamBreachLogList = teExamBreachLogList;
|
|
|
- recordIdList.forEach(s -> {
|
|
|
- Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(s));
|
|
|
- Long examId = Long.parseLong(String.valueOf(objectMap.get("examId")));
|
|
|
- Long examStudentId = Long.parseLong(String.valueOf(objectMap.get("examStudentId")));
|
|
|
- Long examActivityId = Long.parseLong(String.valueOf(objectMap.get("examActivityId")));
|
|
|
- TEExamBreachLog teExamBreachLog = new TEExamBreachLog(examId, examActivityId, s, examStudentId, type, description, status);
|
|
|
+ for (int i = 0; i < recordIdList.size(); i++) {
|
|
|
+ Long l = Long.parseLong(String.valueOf(recordIdList.get(i)));
|
|
|
+ Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(l));
|
|
|
+ Long examId = null;
|
|
|
+ Long examStudentId = null;
|
|
|
+ Long examActivityId = null;
|
|
|
+ if (Objects.isNull(objectMap) || objectMap.size() == 0) {
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(l);
|
|
|
+ examId = tOeExamRecord.getExamId();
|
|
|
+ examStudentId = tOeExamRecord.getExamStudentId();
|
|
|
+ examActivityId = tOeExamRecord.getExamActivityId();
|
|
|
+ } else {
|
|
|
+ examId = Long.parseLong(String.valueOf(objectMap.get("examId")));
|
|
|
+ examStudentId = Long.parseLong(String.valueOf(objectMap.get("examStudentId")));
|
|
|
+ examActivityId = Long.parseLong(String.valueOf(objectMap.get("examActivityId")));
|
|
|
+ }
|
|
|
+ TEExamBreachLog teExamBreachLog = new TEExamBreachLog(examId, examActivityId, l, examStudentId, type, description, status);
|
|
|
teExamBreachLog.setCreateId(tbUser.getId());
|
|
|
finalTeExamBreachLogList.add(teExamBreachLog);
|
|
|
- });
|
|
|
+ }
|
|
|
} else {//撤销违纪
|
|
|
QueryWrapper<TEExamBreachLog> teExamBreachLogQueryWrapper = new QueryWrapper<>();
|
|
|
teExamBreachLogQueryWrapper.lambda().in(TEExamBreachLog::getExamRecordId, recordIdList);
|