|
@@ -5,6 +5,7 @@ import com.google.gson.Gson;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.dto.WebsocketDto;
|
|
|
import com.qmth.themis.business.entity.TMRocketMessage;
|
|
|
+import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
|
import com.qmth.themis.business.enums.MqEnum;
|
|
|
import com.qmth.themis.business.enums.WebsocketTypeEnum;
|
|
|
import com.qmth.themis.business.service.TMRocketMessageService;
|
|
@@ -93,43 +94,43 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
|
|
|
// });
|
|
|
// } else
|
|
|
if (MqEnum.WEBSOCKET_MONITOR_FINISH_LOG.ordinal() == mqEnum.ordinal()) {//强制离线交卷
|
|
|
- JSONArray jsonArray = JSONArray.parseArray(String.valueOf(mqDto.getBody()));
|
|
|
- Set<Long> examRecordId = jsonArray.toJavaObject(Set.class);
|
|
|
+ Set examRecordId = JacksonUtil.readJson(String.valueOf(mqDto.getBody()), Set.class);
|
|
|
webSocketMap.forEach((k, v) -> {
|
|
|
examRecordId.forEach(s -> {
|
|
|
- if (v.getRecordId().longValue() == s) {
|
|
|
+ Long recordId = Long.parseLong(String.valueOf(s));
|
|
|
+ if (v.getRecordId().longValue() == recordId.longValue()) {
|
|
|
Map map = new HashMap<>();
|
|
|
- map.put("from", "监考员信息");
|
|
|
- map.put(SystemConstant.RECORD_ID, s);
|
|
|
- map.put(SystemConstant.MESSAGE, s);
|
|
|
+ map.put("form", mqDto.getObjName());
|
|
|
+ map.put(SystemConstant.RECORD_ID, recordId);
|
|
|
+ map.put(SystemConstant.MESSAGE, FinishTypeEnum.valueOf(String.valueOf(mqDto.getProperties().get("type"))).getCode());
|
|
|
WebsocketDto websocketDto = new WebsocketDto(WebsocketTypeEnum.invigilate_stop_exam.name(), map);
|
|
|
v.sendMessage(websocketDto);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
} else if (MqEnum.WEBSOCKET_HAND_FINISH_LOG.ordinal() == mqEnum.ordinal()) {//手动交卷
|
|
|
- JSONArray jsonArray = JSONArray.parseArray(String.valueOf(mqDto.getBody()));
|
|
|
- Set<Long> examRecordId = jsonArray.toJavaObject(Set.class);
|
|
|
+ Set examRecordId = JacksonUtil.readJson(String.valueOf(mqDto.getBody()), Set.class);
|
|
|
webSocketMap.forEach((k, v) -> {
|
|
|
examRecordId.forEach(s -> {
|
|
|
- if (v.getRecordId().longValue() == s) {
|
|
|
+ Long recordId = Long.parseLong(String.valueOf(s));
|
|
|
+ if (v.getRecordId().longValue() == recordId.longValue()) {
|
|
|
Map map = new HashMap<>();
|
|
|
- map.put(SystemConstant.RECORD_ID, s);
|
|
|
- map.put(SystemConstant.MESSAGE, s);
|
|
|
+ map.put(SystemConstant.RECORD_ID, recordId);
|
|
|
+ map.put(SystemConstant.MESSAGE, recordId);
|
|
|
WebsocketDto websocketDto = new WebsocketDto(WebsocketTypeEnum.invigilate_stop_exam.name(), map);
|
|
|
v.sendMessage(websocketDto);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
} else if (MqEnum.WEBSOCKET_WARNING_FINISH_LOG.ordinal() == mqEnum.ordinal()) {//预警交卷
|
|
|
- JSONArray jsonArray = JSONArray.parseArray(String.valueOf(mqDto.getBody()));
|
|
|
- Set<Long> examRecordId = jsonArray.toJavaObject(Set.class);
|
|
|
+ Set examRecordId = JacksonUtil.readJson(String.valueOf(mqDto.getBody()), Set.class);
|
|
|
webSocketMap.forEach((k, v) -> {
|
|
|
examRecordId.forEach(s -> {
|
|
|
- if (v.getRecordId().longValue() == s) {
|
|
|
+ Long recordId = Long.parseLong(String.valueOf(s));
|
|
|
+ if (v.getRecordId().longValue() == recordId.longValue()) {
|
|
|
Map map = new HashMap<>();
|
|
|
- map.put(SystemConstant.RECORD_ID, s);
|
|
|
- map.put(SystemConstant.BREACH_STATUS, s);
|
|
|
+ map.put(SystemConstant.RECORD_ID, recordId);
|
|
|
+ map.put(SystemConstant.BREACH_STATUS, recordId);
|
|
|
WebsocketDto websocketDto = new WebsocketDto(WebsocketTypeEnum.invigilate_stop_exam.name(), map);
|
|
|
v.sendMessage(websocketDto);
|
|
|
}
|