From cf749931d6a26160a3e0fbfe36eaea956679fb3a Mon Sep 17 00:00:00 2001 From: whycxzp <perryhsu@163.com> Date: 星期一, 27 三月 2023 15:52:44 +0800 Subject: [PATCH] 更新大屏socket --- src/main/java/com/whyc/webSocket/ScreenSocket.java | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/whyc/webSocket/ScreenSocket.java b/src/main/java/com/whyc/webSocket/ScreenSocket.java index 5748e97..dc5c7e7 100644 --- a/src/main/java/com/whyc/webSocket/ScreenSocket.java +++ b/src/main/java/com/whyc/webSocket/ScreenSocket.java @@ -64,11 +64,11 @@ @OnOpen public void onOpen(Session session, EndpointConfig config){ - this.session = session; + /*this.session = session; HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession"); UserInf user = (UserInf) httpSession.getAttribute("user"); - final int userId = user.getUId().intValue(); - //final int userId = 1001; + final int userId = user.getUId().intValue();*/ + final int userId = 1001; Thread thread = new Thread() { @Override public void run() { @@ -153,13 +153,21 @@ latch.countDown(); }); poolExecutor.execute(()->{ - //缁埅妫�娴�:鎸夌収鐢垫睜缁勪负鍗曚綅杩涜妫�娴�,鍛婅鍒ゅ畾:瀹為檯瀹归噺/鏍囩О瀹归噺<=鏌愪釜鐧惧垎姣� TODO 缁埅琛ㄤ腑璇诲彇闇�瑕佽闂潕鍐涚‘璁� + //寮冪敤 + /*//缁埅妫�娴�:鎸夌収鐢垫睜缁勪负鍗曚綅杩涜妫�娴�,鍛婅鍒ゅ畾:瀹為檯瀹归噺/鏍囩О瀹归噺<=鏌愪釜鐧惧垎姣� TODO 缁埅琛ㄤ腑璇诲彇闇�瑕佽闂潕鍐涚‘璁� Response res_capAlarmNum = new Response(); try { int capAlarmNum = battInfService.getCapAlarmNum(userId); res_capAlarmNum.setII(1,true,capAlarmNum,null); }catch (Exception e){ res_capAlarmNum.set(1,false,"鍙戠敓寮傚父:"+e.getCause()); + }*/ + Response res_capAlarmNum = new Response(); + try { + int capAlarmNum = battAlarmDataService.getCapAlarmNum(userId); + res_capAlarmNum.setII(1,true,capAlarmNum,null); + }catch (Exception e){ + res_capAlarmNum.set(1,false,"鍙戠敓寮傚父:"+e.getCause()); } res.put("capAlarmNum", res_capAlarmNum); latch.countDown(); -- Gitblit v1.9.1