|
@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.io.IOException;
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
@@ -66,7 +67,7 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void execMqOeLogic(MqDto mqDto, String key) throws NoSuchAlgorithmException {
|
|
|
+ public void execMqOeLogic(MqDto mqDto, String key) throws NoSuchAlgorithmException, IOException {
|
|
|
Gson gson = new Gson();
|
|
|
ConcurrentHashMap<String, WebSocketOeServer> webSocketMap = WebSocketOeServer.getWebSocketMap();
|
|
|
String tag = mqDto.getTag();
|
|
@@ -234,23 +235,23 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
|
|
|
ConcurrentHashMap<String, WebSocketMobileServer> webSocketMobileMap = WebSocketMobileServer.getWebSocketMap();
|
|
|
|
|
|
String mobileWebsocketId = null;
|
|
|
- WebsocketStatusEnum websocketStatusEnum = null;
|
|
|
+// WebsocketStatusEnum websocketStatusEnum = null;
|
|
|
if (source == MonitorVideoSourceEnum.MOBILE_FIRST) {
|
|
|
mobileWebsocketId = ExamRecordCacheUtil.getMobileFirstWebsocketId(recordId);
|
|
|
- websocketStatusEnum = ExamRecordCacheUtil.getMobileFirstWebsocketStatus(recordId);
|
|
|
+// websocketStatusEnum = ExamRecordCacheUtil.getMobileFirstWebsocketStatus(recordId);
|
|
|
} else if (source == MonitorVideoSourceEnum.MOBILE_SECOND) {
|
|
|
mobileWebsocketId = ExamRecordCacheUtil.getMobileSecondWebsocketId(recordId);
|
|
|
- websocketStatusEnum = ExamRecordCacheUtil.getMobileSecondWebsocketStatus(recordId);
|
|
|
+// websocketStatusEnum = ExamRecordCacheUtil.getMobileSecondWebsocketStatus(recordId);
|
|
|
}
|
|
|
- if (Objects.nonNull(websocketStatusEnum) && websocketStatusEnum == WebsocketStatusEnum.ON_LINE) {
|
|
|
- WebSocketMobileServer webSocketMobileServer = webSocketMobileMap.get(mobileWebsocketId + "-" + source.name());
|
|
|
- Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
- ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
- Optional.ofNullable(examStudentCacheBean).orElseThrow(() -> new BusinessException("考生数据为空"));
|
|
|
+// if (Objects.nonNull(websocketStatusEnum) && websocketStatusEnum == WebsocketStatusEnum.ON_LINE) {
|
|
|
+ WebSocketMobileServer webSocketMobileServer = webSocketMobileMap.get(mobileWebsocketId + "-" + source.name());
|
|
|
+ Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
+ ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
+ Optional.ofNullable(examStudentCacheBean).orElseThrow(() -> new BusinessException("考生数据为空"));
|
|
|
|
|
|
- SystemConstant.mobileMonitorStatusStop(examStudentCacheBean.getStudentId(), recordId, true);
|
|
|
- WebSocketMobileServer.close(webSocketMobileServer);
|
|
|
- }
|
|
|
+ SystemConstant.mobileMonitorStatusStop(examStudentCacheBean.getStudentId(), recordId, true);
|
|
|
+ WebSocketMobileServer.close(webSocketMobileServer);
|
|
|
+// }
|
|
|
}
|
|
|
break;
|
|
|
case "OE_WEBSOCKET_MOBILE_MONITOR_STATUS":
|
|
@@ -291,7 +292,7 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void execMqOeMobileLogic(MqDto mqDto, String key) throws NoSuchAlgorithmException {
|
|
|
+ public void execMqOeMobileLogic(MqDto mqDto, String key) throws NoSuchAlgorithmException, IOException {
|
|
|
Gson gson = new Gson();
|
|
|
String tag = mqDto.getTag();
|
|
|
ConcurrentHashMap<String, WebSocketMobileServer> webSocketMap = WebSocketMobileServer.getWebSocketMap();
|