| | |
| | | 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(); |
| | |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | //4.统计:各种设备类型总数 电池 设备 电源 站点 TODO 新增电池单体数 |
| | | Response<Map> res_devCountMap = battInfService.getDevCountMap(userId); |
| | | //4.统计:各种设备类型总数 电池 设备 电源 站点 新增电池单体数 |
| | | Response<Map> res_devCountMap = battInfService.getDevCountMapForSZ(userId); |
| | | res.put("devCountMap", res_devCountMap); |
| | | latch.countDown(); |
| | | }); |
| | |
| | | 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(()->{ |