|
@@ -3,7 +3,6 @@ package com.qmth.themis.backend.api;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonProperty;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
-import com.qmth.themis.business.dto.response.TBOrgDto;
|
|
|
import com.qmth.themis.business.entity.TBUser;
|
|
|
import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
|
import com.qmth.themis.business.enums.MqEnum;
|
|
@@ -26,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.*;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* @Description: 监考信息 前端控制器
|
|
@@ -65,17 +66,17 @@ public class TIeInvigilateController {
|
|
|
@ApiJsonProperty(key = "examRecordId", description = "考试记录id"),
|
|
|
@ApiJsonProperty(key = "type", description = "收卷类型,手动/强制")
|
|
|
}) @ApiParam(value = "考试记录信息", required = true) @RequestBody Map<String, Object> mapParameter) {
|
|
|
- if (Objects.isNull(mapParameter.get("examRecordId")) || Objects.equals(mapParameter.get("examRecordId"), "")) {
|
|
|
+ if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
|
|
|
throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
- List<Long> examRecordIdList = (List<Long>) mapParameter.get("examRecordId");
|
|
|
+ List<Long> recordIdList = (List<Long>) mapParameter.get("recordId");
|
|
|
if (Objects.isNull(mapParameter.get("type")) || Objects.equals(mapParameter.get("type"), "")) {
|
|
|
throw new BusinessException(ExceptionResultEnum.FINISH_TYPE_IS_NULL);
|
|
|
}
|
|
|
FinishTypeEnum type = FinishTypeEnum.valueOf(String.valueOf(mapParameter.get("type")));
|
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
//发送mq给客户端强制收卷
|
|
|
- MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.oe.name(), JacksonUtil.parseJson(examRecordIdList), type.ordinal() == FinishTypeEnum.INTERRUPT.ordinal() ? MqEnum.WEBSOCKET_MONITOR_FINISH_LOG : MqEnum.WEBSOCKET_HAND_FINISH_LOG, String.valueOf(tbUser.getId()), mapParameter, tbUser.getName());
|
|
|
+ MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.oe.name(), JacksonUtil.parseJson(recordIdList), type.ordinal() == FinishTypeEnum.INTERRUPT.ordinal() ? MqEnum.WEBSOCKET_MONITOR_FINISH_LOG : MqEnum.WEBSOCKET_HAND_FINISH_LOG, String.valueOf(tbUser.getId()), mapParameter, tbUser.getName());
|
|
|
mqDtoService.assembleSendOneWayMsg(mqDto);
|
|
|
return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
}
|
|
@@ -87,6 +88,13 @@ public class TIeInvigilateController {
|
|
|
@ApiJsonProperty(key = "recordId", description = "考试记录id"),
|
|
|
@ApiJsonProperty(key = "type", description = "消息类型,text/audio")
|
|
|
}) @ApiParam(value = "考试记录信息", required = true) @RequestBody Map<String, Object> mapParameter) {
|
|
|
+ if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
+ }
|
|
|
+ Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
|
|
|
+ if (Objects.isNull(mapParameter.get("type")) || Objects.equals(mapParameter.get("type"), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.FINISH_TYPE_IS_NULL);
|
|
|
+ }
|
|
|
return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
}
|
|
|
}
|