| | |
| | | public Map<String, Object> getStatic(Integer userId) throws InterruptedException { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(3); |
| | | CountDownLatch latch = new CountDownLatch(4); |
| | | poolExecutor.execute(()->{ |
| | | //1统计机房个数,设备个数,电池组个数 |
| | | Response<Map> res_inf = battInfService.getAllInfInSz2(userId); |
| | |
| | | res.put("res_battState", res_battState); |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | //4.中间地图 |
| | | Response<Map> res_station = battInfService.getAllStationInSz2(userId); |
| | | res.put("res_station", res_station); |
| | | latch.countDown(); |
| | | }); |
| | | |
| | | latch.await(10, TimeUnit.MINUTES); |
| | | return res; |