| | |
| | | //private static BatttestdataInfService testInfService; |
| | | |
| | | private static BatttestdataInfService batttestdataInfService; |
| | | |
| | | private static BattRtstateService battRtStateService; |
| | | |
| | | @Autowired |
| | | public void setPowerAlarmService(PwrdevAlarmService powerAlarmService) { |
| | | ScreenForNWKMSocket.powerAlarmService = powerAlarmService; |
| | |
| | | public void setBatttestdataInfService(BatttestdataInfService batttestdataInfService) { |
| | | ScreenForNWKMSocket.batttestdataInfService = batttestdataInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setBattRtStateService(BattRtstateService battRtStateService) { |
| | | ScreenForNWKMSocket.battRtStateService = battRtStateService; |
| | | } |
| | | |
| | | @OnOpen |
| | | public void onOpen(Session session, EndpointConfig config){ |
| | | this.session = session; |
| | |
| | | Map<String, Object> res = new HashMap<>(); |
| | | while (!currentThread().isInterrupted()) { |
| | | ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(10); |
| | | CountDownLatch latch = new CountDownLatch(8); |
| | | poolExecutor.execute(()->{ |
| | | //1.统计:电池统计 分为品牌和标称电压 |
| | | Response res_battGroupInfo = new Response(); |
| | |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | //2.统计:设备状态 |
| | | Response<Map> res_devStates = fbs9100StateService.getBTSEquipStatus2(userId); |
| | | Response<Map> res_devStates = fbs9100StateService.getBTSEquipStatus2(userId,2); |
| | | res.put("devStates", res_devStates); |
| | | latch.countDown(); |
| | | }); |
| | |
| | | latch.countDown(); |
| | | }); |
| | | |
| | | //5.统计:每个省的机房数统计 |
| | | /*//5.统计:每个省的机房数统计 |
| | | poolExecutor.execute(()->{ |
| | | Response res_stationCount = stationService.getProvinceCountMap(userId); |
| | | res.put("stationCount", res_stationCount); |
| | | latch.countDown(); |
| | | }); |
| | | });*/ |
| | | poolExecutor.execute(()->{ |
| | | //6.统计:实时告警 跟告警统计逻辑一致 |
| | | Response res_alarm = new Response(); |
| | | Map<String, Integer> devAlarmNumMap = new HashMap<>(); |
| | | try { |
| | | Response realAlarmList = battAlarmDataService.getRealAlarmListWithLevel1(userId); |
| | | res_alarm.setII(1,true,realAlarmList,null); |
| | | }catch (Exception e){ |
| | | res_alarm.set(1,false,"发生异常:"+e.getCause()); |
| | | } |
| | | res.put("realTimeAlarm", res_alarm); |
| | | //6.统计:实时放电信息 正在放电的电池信息展示 |
| | | Response dischargingList = battRtStateService.getDischargingList(userId); |
| | | res.put("dischargingBattery", dischargingList); |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | /*//8.统计:TODO 能效统计,默认取五年的能效 |
| | | /*//8.统计:能效统计,默认取五年的能效 |
| | | Response resNX = new Response(); |
| | | try { |
| | | resNX=testInfService.getEnergyStatistics_nj(5,userId); |
| | |
| | | resNX.set(1,false,"发生异常:"+e.getCause()); |
| | | } |
| | | res.put("nx", resNX);*/ |
| | | //8.统计:TODO 测试信息 |
| | | //测试信息 |
| | | Response resTestdataInfAnalysis = new Response(); |
| | | try { |
| | |
| | | res.put("resTestdataInfAnalysis", resTestdataInfAnalysis); |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | /*poolExecutor.execute(()->{ |
| | | //9.统计:告警统计 电源,设备,电池 |
| | | Response res_devAlarmNum = new Response(); |
| | | Map<String, Integer> devAlarmNumMap = new HashMap<>(); |
| | |
| | | } |
| | | res.put("devAlarmNum", res_devAlarmNum); |
| | | latch.countDown(); |
| | | }); |
| | | });*/ |
| | | poolExecutor.execute(()->{ |
| | | //9-2.统计:告警统计 级别统计 |
| | | //9-2.统计:告警统计 级别及类型统计 |
| | | Response res_alarmLevel = new Response(); |
| | | Map<String, Integer> devAlarmNumMap = new HashMap<>(); |
| | | try { |