Commit dd2a0fe0 sunke

WebSocket

1 个父辈 ea5628f1
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</parent> </parent>
<groupId>com.neotel</groupId> <groupId>com.neotel</groupId>
<artifactId>smf-core</artifactId> <artifactId>smf-core</artifactId>
<version>1.7.1</version> <version>1.8.1312</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>smf-core</name> <name>smf-core</name>
<description>SMF project for Spring Boot</description> <description>SMF project for Spring Boot</description>
......
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
*/ */
package com.neotel.smfcore.core.system.websocket; package com.neotel.smfcore.core.system.websocket;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter; import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev")
@Configuration @Configuration
public class WebSocketConfig { public class WebSocketConfig {
......
...@@ -17,6 +17,7 @@ package com.neotel.smfcore.core.system.websocket; ...@@ -17,6 +17,7 @@ package com.neotel.smfcore.core.system.websocket;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.websocket.*; import javax.websocket.*;
...@@ -30,6 +31,7 @@ import java.util.concurrent.CopyOnWriteArraySet; ...@@ -30,6 +31,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
/** /**
* WebSocket与客户端通信 * WebSocket与客户端通信
*/ */
@ConditionalOnClass(value = WebSocketConfig.class)
@ServerEndpoint("/webSocket/{sid}") @ServerEndpoint("/webSocket/{sid}")
@Slf4j @Slf4j
@Component @Component
......
...@@ -104,7 +104,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -104,7 +104,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
commandMap.put(command.getEventId(),command); commandMap.put(command.getEventId(),command);
log.info("发送检查物料条码请求:" + command.toReqMsg()); log.info("发送检查物料条码请求:" + command.toReqMsg());
ResultBean resultBean = HellaTcpClient.sendMsg(command.toReqMsg()); ResultBean resultBean = HellaTcpClient.sendMsg(command.toReqMsg());
testCheckOK(command); //testCheckOK(command);
resultBean.setMsg("Check Material result:"+resultBean.getMsg()); resultBean.setMsg("Check Material result:"+resultBean.getMsg());
return resultBean; return resultBean;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!