转发消息类推送问题

dev
anthonywj 2 years ago
parent e263c8febd
commit b4dbd61563

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

@ -54,18 +54,17 @@ public class SpsWebSocketClient extends WebSocketClient {
//收到更新下载数据则赋值由外部处理,多个任务只处理一次避免重复处理 //收到更新下载数据则赋值由外部处理,多个任务只处理一次避免重复处理
if (s.contains(SocketMsgType.DL_ALL_DATA)) { if (s.contains(SocketMsgType.DL_ALL_DATA)) {
this.excptMessage = s; this.excptMessage = s;
} else if(s.contains(SocketMsgType.BASIC_DATA_DELETE)) { } else if (s.contains(SocketMsgType.BASIC_DATA_DELETE)) {
this.excptMessage = s; socketMsgService.sendDeleteMsg(s);
}else if(s.contains(SocketMsgType.BASIC_MANAGE_DELETE)){ } else if (s.contains(SocketMsgType.BASIC_MANAGE_DELETE)) {
this.excptMessage = s; socketMsgService.sendDeleteMsg(s);
}else if(s.contains(SocketMsgType.BASIC_CORP_MAINTAIN_DELETE)){ } else if (s.contains(SocketMsgType.BASIC_CORP_MAINTAIN_DELETE)) {
this.excptMessage = s; socketMsgService.sendDeleteMsg(s);
}else if(s.contains(SocketMsgType.BASIC_BUSINESS_TYPE_DELETE)){ } else if (s.contains(SocketMsgType.BASIC_BUSINESS_TYPE_DELETE)) {
this.excptMessage = s; socketMsgService.sendDeleteMsg(s);
} } else {
else { //通知类消息则需转发
//通知类消息则需转发 socketMsgService.sendNoticeMsg(s);
socketMsgService.sendNoticeMsg(s);
} }
} }

@ -27,8 +27,7 @@ public class WebSocketComponent implements CommandLineRunner {
HeartTaskService heartTaskService; HeartTaskService heartTaskService;
@Resource @Resource
SocketMsgService socketMsgService; SocketMsgService socketMsgService;
@Resource
SpsSyncWebSocket spsSyncWebSocket;
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
@ -50,16 +49,7 @@ public class WebSocketComponent implements CommandLineRunner {
} }
if (message.contains(SocketMsgType.DL_ALL_DATA)) { if (message.contains(SocketMsgType.DL_ALL_DATA)) {
heartTaskService.dlAllData(); 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); log.info("成功获取数据:" + message);
} }

Loading…
Cancel
Save