| | |
| | | @OnOpen |
| | | 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(); |
| | | //final int urole = user.getUrole(); |
| | | final int userId = 10001; |
| | | final int urole = 1; |
| | | HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession"); |
| | | UserInf user = (UserInf) httpSession.getAttribute("user"); |
| | | final int userId = user.getUid(); |
| | | final int urole = user.getUrole(); |
| | | /*final int userId = 10001; |
| | | final int urole = 1;*/ |
| | | Thread thread = new Thread("Thread_HomeSocket") { |
| | | @Override |
| | | public void run() { |
| | |
| | | Map<String, Object> res = new HashMap<>(); |
| | | try { |
| | | ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(5); |
| | | CountDownLatch latch = new CountDownLatch(6); |
| | | poolExecutor.execute(() -> { |
| | | //锁的工作状态 |
| | | Response resLockState = ainfService.getLockState(userId,urole); |
| | |
| | | res.put("resAllCtlLog", resAllCtlLog); |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(() -> { |
| | | //地图顶部的管理的区域包含子区域 |
| | | Response resAllAinf = ainfService.getHomeAllAinf(userId,urole); |
| | | res.put("resAllAinf", resAllAinf); |
| | | latch.countDown(); |
| | | }); |
| | | latch.await(4, TimeUnit.MINUTES); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |