Commit 2041eaa7 authored by qizhiqiang's avatar qizhiqiang

称重小程序开发修改war包名称

parent ece83525
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>metage</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -138,7 +138,7 @@ public class RxtxUtils extends Thread implements SerialPortEventListener { ...@@ -138,7 +138,7 @@ public class RxtxUtils extends Thread implements SerialPortEventListener {
// 如果堵塞队列中存在数据就将其输出 // 如果堵塞队列中存在数据就将其输出
if (msgQueue.size() > 0) { if (msgQueue.size() > 0) {
weightings = Double.parseDouble(msgQueue.take()); weightings = Double.parseDouble(msgQueue.take());
System.out.println(weightings); System.out.println("接收到的消息:"+weightings);
WebSocket webSocket = new WebSocket(); WebSocket webSocket = new WebSocket();
webSocket.sendAllToUserMessage(String.valueOf(weightings)); webSocket.sendAllToUserMessage(String.valueOf(weightings));
// sendDate(weightings); // sendDate(weightings);
......
...@@ -31,6 +31,7 @@ public class WebSocket { ...@@ -31,6 +31,7 @@ public class WebSocket {
for (WebSocket item: for (WebSocket item:
webSocketSet) { webSocketSet) {
item.session.getBasicRemote().sendText(message); item.session.getBasicRemote().sendText(message);
System.out.println("服务端发送的消息:"+message);
} }
} }
}catch (Exception e){ }catch (Exception e){
...@@ -42,6 +43,7 @@ public class WebSocket { ...@@ -42,6 +43,7 @@ public class WebSocket {
@OnClose @OnClose
public void onClose(Session session){ public void onClose(Session session){
webSocketSet.remove(this); webSocketSet.remove(this);
System.out.println("建立连接:"+webSocketSet.size());
} }
//接收前端发送的消息 //接收前端发送的消息
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment