| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 山西太原 |
| | | * 大屏展示 Socket |
| | | */ |
| | | @Component |
| | |
| | | private static BattInfService battInfService; |
| | | |
| | | private static BattEnduranceService battEnduranceService; |
| | | |
| | | private static BaoJiGroupService baoJiGroupService; |
| | | |
| | | @Autowired |
| | | public void setPowerAlarmService(PwrdevAlarmService powerAlarmService) { |
| | |
| | | public void setBattEnduranceService(BattEnduranceService battEnduranceService) { |
| | | ScreenSocket.battEnduranceService = battEnduranceService; |
| | | } |
| | | @Autowired |
| | | public void setBaoJiGroupService(BaoJiGroupService baoJiGroupService) { |
| | | ScreenSocket.baoJiGroupService = baoJiGroupService; |
| | | } |
| | | |
| | | @OnOpen |
| | | public void onOpen(Session session, EndpointConfig config){ |
| | |
| | | Map<String, Object> res = new HashMap<>(); |
| | | while (!currentThread().isInterrupted()) { |
| | | ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(8); |
| | | CountDownLatch latch = new CountDownLatch(9); |
| | | poolExecutor.execute(()->{ |
| | | //一体 告警:交流ABC |
| | | Response res_acABC = powerAlarmService.getAcABCAnalysis(userId); |
| | |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | //一体 统计:设备状态 |
| | | Response<Map> res_devStates = fbs9100StateService.getBTSEquipStatus(userId); |
| | | Response<Map> res_devStates = fbs9100StateService.getBTSEquipStatus2(userId,1); |
| | | res.put("devStates", res_devStates); |
| | | latch.countDown(); |
| | | }); |
| | |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | Response res_capAlarmNum = new Response(); |
| | | try { |
| | | int capAlarmNum = battAlarmDataService.getCapAlarmNum(userId); |
| | | res_capAlarmNum.setII(1,true,capAlarmNum,null); |
| | | }catch (Exception e){ |
| | | res_capAlarmNum.set(1,false,"发生异常:"+e.getCause()); |
| | | } |
| | | res.put("capAlarmNum", res_capAlarmNum); |
| | | Response res_endurance = battEnduranceService.getEnduranceTimeLong(userId,4); |
| | | res.put("enduranceLow", res_endurance); |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | Response res_groupInfo = baoJiGroupService.getGroupWithStationAndAlarmForScreen(userId); |
| | | res.put("res_groupInfo", res_groupInfo); |
| | | latch.countDown(); |
| | | }); |
| | | |