From 43a19a4424f67c379934ed0d70e0d1b3512cd769 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期四, 27 三月 2025 09:31:44 +0800 Subject: [PATCH] 灌溉计划表中增加项目ID字段,计划列表返回值中增加项目名称,项目状态改为整数表示 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketServer.java | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketServer.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketServer.java index 9bcf52c..1f2d1c9 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketServer.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketServer.java @@ -27,7 +27,8 @@ // 瀹㈡埛绔繛鎺ヤ細璇濓紝閫氳繃瀹冪粰瀹㈡埛绔彂閫佹暟鎹� private Session session; - + // 瀹㈡埛绔笂绾挎椂鍒� + //private String onLineDt ; // 瀹㈡埛绔痠d private String id = ""; @@ -39,7 +40,11 @@ @OnOpen public void onOpen(Session session, @PathParam("id") String id) { this.session = session; + //this.onLineDt = DateTime.yyyy_MM_dd_HH_mm_ss() ; this.id = id; + if(this.id == null || this.id.length() == 0){ + this.id = "" + System.nanoTime() ; + } this.sendMessage(WebSocketHeartBeat.getHeartBeatMessage()); if (webSocketMap.containsKey(id)) { @@ -98,7 +103,7 @@ /** * 鏈嶅姟鍣ㄤ富鍔ㄧ兢鎺ㄩ�佹秷鎭� */ - public static void sendAllMessage(String message) throws IOException { + public static void sendMessage2AllClient(String message) throws IOException { ConcurrentHashMap.KeySetView<String, WebSocketServer> ids = webSocketMap.keySet(); for (String id : ids) { WebSocketServer webSocketServer = webSocketMap.get(id); @@ -109,7 +114,7 @@ /** * 鏈嶅姟鍣ㄦ寚瀹氬鎴风鎺ㄩ�佹秷鎭� */ - public static void sendOneMessage(String message, String id) throws IOException { + public static void sendMessage2OneClient(String message, String id) throws IOException { if (message != null && message.length() != 0 && webSocketMap.containsKey(id)) { webSocketMap.get(id).sendMessage(message); } else { -- Gitblit v1.8.0