whycxzp
2024-03-09 f31c226385b545d744cee20165a34a115e371d82
src/main/java/com/whyc/webSocket/ScreenForNWKMSocket.java
@@ -105,7 +105,7 @@
                    Map<String, Object> res = new HashMap<>();
                    while (!currentThread().isInterrupted()) {
                        ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor();
                        CountDownLatch latch = new CountDownLatch(10);
                        CountDownLatch latch = new CountDownLatch(9);
                        poolExecutor.execute(()->{
                            //1.统计:电池统计 分为品牌和标称电压
                            Response res_battGroupInfo = new Response();
@@ -160,16 +160,10 @@
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //6.统计:实时告警 跟告警统计逻辑一致
                            //6.统计:实时放电信息 TODO 正在放电的电池信息展示
                            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);
                            res.put("dischargingBattery", res_alarm);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
@@ -203,7 +197,7 @@
                            res.put("resTestdataInfAnalysis", resTestdataInfAnalysis);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                        /*poolExecutor.execute(()->{
                            //9.统计:告警统计 电源,设备,电池
                            Response res_devAlarmNum = new Response();
                            Map<String, Integer> devAlarmNumMap = new HashMap<>();
@@ -220,9 +214,9 @@
                            }
                            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 {