From 78bdbf03741d03e047d034a1418a240e10b75c9f Mon Sep 17 00:00:00 2001 From: whycxzp <glperry@163.com> Date: 星期五, 28 二月 2025 10:20:49 +0800 Subject: [PATCH] 苏州地铁大屏提交 --- src/main/java/com/whyc/webSocket/ScreenForSZSocket.java | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/whyc/webSocket/ScreenForSZSocket.java b/src/main/java/com/whyc/webSocket/ScreenForSZSocket.java index a27c498..d8fd994 100644 --- a/src/main/java/com/whyc/webSocket/ScreenForSZSocket.java +++ b/src/main/java/com/whyc/webSocket/ScreenForSZSocket.java @@ -104,9 +104,9 @@ public void onOpen(Session session, EndpointConfig config){ 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; + //UserInf user = (UserInf) httpSession.getAttribute("user"); + //final int userId = user.getUId().intValue(); + final int userId = 1001; Thread thread = new Thread() { @Override public void run() { @@ -114,7 +114,7 @@ Map<String, Object> res = new HashMap<>(); while (!currentThread().isInterrupted()) { ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor(); - CountDownLatch latch = new CountDownLatch(8); + CountDownLatch latch = new CountDownLatch(5); /*poolExecutor.execute(()->{ //1.缁熻:鐢垫睜缁熻 鍒嗕负鍝佺墝鍜屾爣绉扮數鍘� Response res_battGroupInfo = new Response(); @@ -205,17 +205,16 @@ latch.countDown(); });*/ poolExecutor.execute(()->{ - //9-1.缁熻:鍖哄幙(StationName5)鐨� 鍛婅缁熻 绾у埆鍙婄被鍨嬬粺璁� TODO + //9-1.缁熻:鍖哄幙(StationName5)鐨� 鍛婅缁熻 绾у埆鍙婄被鍨嬬粺璁� //鏌ヨ鍑烘墍鏈夌殑鍖哄幙,骞舵寜鐓у尯鍘挎潵杩涜鍛婅鐨勫垎绫荤粺璁� Response res_alarmLevel = new Response(); - Map<String, Integer> devAlarmNumMap = new HashMap<>(); try { - Response alarmsCountByLevel = battAlarmDataService.getByLevel(userId); + Response alarmsCountByLevel = battAlarmDataService.getByLevelAndStationName5(userId); res_alarmLevel.setII(1,true,alarmsCountByLevel,null); }catch (Exception e){ res_alarmLevel.set(1,false,"鍙戠敓寮傚父:"+e.getCause()); } - res.put("alarmsLevel", res_alarmLevel); + res.put("alarmsLevelWithStationName5", res_alarmLevel); latch.countDown(); }); poolExecutor.execute(()->{ -- Gitblit v1.9.1