转发消息类推送问题

dev
anthonywj 2 years ago
parent e263c8febd
commit b4dbd61563

@ -17,4 +17,9 @@ public class SocketMsgService {
public void sendNoticeMsg(String message) {
spsSyncWebSocket.sendMessage(message, "2:" + token);
}
public void sendDeleteMsg(String message) {
spsSyncWebSocket.sendMessage(message, "2:" + token);
}
}

@ -55,15 +55,14 @@ public class SpsWebSocketClient extends WebSocketClient {
if (s.contains(SocketMsgType.DL_ALL_DATA)) {
this.excptMessage = s;
} else if (s.contains(SocketMsgType.BASIC_DATA_DELETE)) {
this.excptMessage = s;
socketMsgService.sendDeleteMsg(s);
} else if (s.contains(SocketMsgType.BASIC_MANAGE_DELETE)) {
this.excptMessage = s;
socketMsgService.sendDeleteMsg(s);
} else if (s.contains(SocketMsgType.BASIC_CORP_MAINTAIN_DELETE)) {
this.excptMessage = s;
socketMsgService.sendDeleteMsg(s);
} else if (s.contains(SocketMsgType.BASIC_BUSINESS_TYPE_DELETE)) {
this.excptMessage = s;
}
else {
socketMsgService.sendDeleteMsg(s);
} else {
//通知类消息则需转发
socketMsgService.sendNoticeMsg(s);
}

@ -27,8 +27,7 @@ public class WebSocketComponent implements CommandLineRunner {
HeartTaskService heartTaskService;
@Resource
SocketMsgService socketMsgService;
@Resource
SpsSyncWebSocket spsSyncWebSocket;
@Override
public void run(String... args) throws Exception {
@ -50,16 +49,7 @@ public class WebSocketComponent implements CommandLineRunner {
}
if (message.contains(SocketMsgType.DL_ALL_DATA)) {
heartTaskService.dlAllData();
} else if(message.contains(SocketMsgType.BASIC_DATA_DELETE)){
spsSyncWebSocket.sendMessage(message,"2:"+socketToken);
}else if(message.contains(SocketMsgType.BASIC_MANAGE_DELETE)){
spsSyncWebSocket.sendMessage(message,"2:"+socketToken);
}else if(message.contains(SocketMsgType.BASIC_CORP_MAINTAIN_DELETE)){
spsSyncWebSocket.sendMessage(message,"2:"+socketToken);
}else if(message.contains(SocketMsgType.BASIC_BUSINESS_TYPE_DELETE)){
spsSyncWebSocket.sendMessage(message,"2:"+socketToken);
}
//打印服务端返回的数据
log.info("成功获取数据:" + message);
}

Loading…
Cancel
Save