|  |  |  | @ -2,15 +2,23 @@ package com.glxp.sale.admin.socket.server; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import cn.hutool.json.JSONUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.sale.admin.entity.sync.SocketMsgEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.sale.admin.service.param.SystemParamConfigService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.sale.admin.socket.client.SocketMsgService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.sale.admin.socket.client.SpsWebSocketClient; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.sale.admin.socket.client.WebSocketComponent; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.sale.admin.util.ByteArraySplitter; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.sale.common.res.BaseResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.beans.factory.annotation.Value; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.stereotype.Component; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
			
				
					|  |  |  |  | import javax.websocket.*; | 
			
		
	
		
			
				
					|  |  |  |  | import javax.websocket.server.PathParam; | 
			
		
	
		
			
				
					|  |  |  |  | import javax.websocket.server.ServerEndpoint; | 
			
		
	
		
			
				
					|  |  |  |  | import java.io.IOException; | 
			
		
	
		
			
				
					|  |  |  |  | import java.net.URISyntaxException; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.concurrent.ConcurrentHashMap; | 
			
		
	
	
		
			
				
					|  |  |  | @ -33,6 +41,7 @@ public class SpsSyncWebSocket { | 
			
		
	
		
			
				
					|  |  |  |  |     private String key = ""; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * 建立连接 | 
			
		
	
		
			
				
					|  |  |  |  |      * | 
			
		
	
	
		
			
				
					|  |  |  | @ -58,11 +67,19 @@ public class SpsSyncWebSocket { | 
			
		
	
		
			
				
					|  |  |  |  |         log.info("online number:{}", getOnlineCount()); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |  |     WebSocketComponent webSocketComponent; | 
			
		
	
		
			
				
					|  |  |  |  |     @OnMessage | 
			
		
	
		
			
				
					|  |  |  |  |     public void onMessage(String message, Session session) { | 
			
		
	
		
			
				
					|  |  |  |  |         //收到管理系统响应的信息
 | 
			
		
	
		
			
				
					|  |  |  |  |         log.info("来自客户端的消息->>message:{};sessionId:{}", message, session.getId()); | 
			
		
	
		
			
				
					|  |  |  |  |         //TODO 已经接受到消息 准备转发给spms 自助平台
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @OnClose | 
			
		
	
		
			
				
					|  |  |  |  |     public void onClose() { | 
			
		
	
		
			
				
					|  |  |  |  |         log.info("onClose : {}" + key); | 
			
		
	
	
		
			
				
					|  |  |  | @ -85,7 +102,8 @@ public class SpsSyncWebSocket { | 
			
		
	
		
			
				
					|  |  |  |  |      * @param message   数据推送 | 
			
		
	
		
			
				
					|  |  |  |  |      * @param sessionId token | 
			
		
	
		
			
				
					|  |  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |  |     public synchronized void sendMessage(String message, String sessionId) { | 
			
		
	
		
			
				
					|  |  |  |  |     public synchronized void | 
			
		
	
		
			
				
					|  |  |  |  |     sendMessage(String message, String sessionId) { | 
			
		
	
		
			
				
					|  |  |  |  |         synchronized (this.getClass()) { | 
			
		
	
		
			
				
					|  |  |  |  |             for (Map.Entry<String, SpsSyncWebSocket> stringMyWebSocketEntry : socketServersMap.entrySet()) { | 
			
		
	
		
			
				
					|  |  |  |  |                 try { | 
			
		
	
	
		
			
				
					|  |  |  | 
 |