From 2cb95a87ab7f14fdfeefd1e079307e47d011a317 Mon Sep 17 00:00:00 2001 From: whycxzp <glperry@163.com> Date: 星期四, 07 三月 2024 17:26:22 +0800 Subject: [PATCH] 南网昆明首页接口 --- src/main/java/com/whyc/webSocket/ScreenForNWKMSocket.java | 32 +++++++++++++++++--------------- 1 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/whyc/webSocket/ScreenForNWKMSocket.java b/src/main/java/com/whyc/webSocket/ScreenForNWKMSocket.java index bc712e0..5bedadb 100644 --- a/src/main/java/com/whyc/webSocket/ScreenForNWKMSocket.java +++ b/src/main/java/com/whyc/webSocket/ScreenForNWKMSocket.java @@ -46,6 +46,8 @@ private static BaoJiGroupService baoJiGroupService; + private static StationInfService stationService; + @Autowired public void setPowerAlarmService(PwrdevAlarmService powerAlarmService) { ScreenForNWKMSocket.powerAlarmService = powerAlarmService; @@ -74,6 +76,11 @@ @Autowired public void setBaoJiGroupService(BaoJiGroupService baoJiGroupService) { ScreenForNWKMSocket.baoJiGroupService = baoJiGroupService; + } + + @Autowired + public void setStationService(StationInfService stationService) { + ScreenForNWKMSocket.stationService = stationService; } @OnOpen @@ -138,32 +145,27 @@ latch.countDown(); }); - //5.缁熻:TODO 姣忎釜鐪佺殑鏈烘埧鏁扮粺璁� + //5.缁熻:姣忎釜鐪佺殑鏈烘埧鏁扮粺璁� poolExecutor.execute(()->{ - Response res_stationCount = null; + Response res_stationCount = stationService.getProvinceCountMap(userId); res.put("stationCount", res_stationCount); latch.countDown(); }); poolExecutor.execute(()->{ - //6.缁熻:TODO 瀹炴椂鍛婅 - Response res_devAlarmNum = new Response(); + //6.缁熻:瀹炴椂鍛婅 璺熷憡璀︾粺璁¢�昏緫涓�鑷� + Response res_alarm = new Response(); Map<String, Integer> devAlarmNumMap = new HashMap<>(); try { - int battAlarmNum = battAlarmDataService.getRealTimeWithLevel1(userId).getCode(); - int devAlarmNum = devAlarmDataService.getRealTimeWithLevel1(userId); - int powerAlarmNum = powerAlarmService.getRealTimeWithLevel1(userId); - devAlarmNumMap.put("battAlarmNum",battAlarmNum); - devAlarmNumMap.put("devAlarmNum",devAlarmNum); - devAlarmNumMap.put("powerAlarmNum",powerAlarmNum); - res_devAlarmNum.setII(1,true,devAlarmNumMap,null); + Response realAlarmList = battAlarmDataService.getRealAlarmListWithLevel1(userId); + res_alarm.setII(1,true,realAlarmList,null); }catch (Exception e){ - res_devAlarmNum.set(1,false,"鍙戠敓寮傚父:"+e.getCause()); + res_alarm.set(1,false,"鍙戠敓寮傚父:"+e.getCause()); } - res.put("devAlarmNum", res_devAlarmNum); + res.put("res_alarm", res_alarm); latch.countDown(); }); poolExecutor.execute(()->{ - //7.缁熻:TODO 璧勪骇缁熻 + //7.缁熻:TODO 鐢垫簮缁熻 Response res_asset = new Response(); try { @@ -174,7 +176,7 @@ latch.countDown(); }); poolExecutor.execute(()->{ - //8.缁熻:鑳芥晥缁熻 + //8.缁熻:TODO 鑳芥晥缁熻 Response resNX = new Response(); Map<String, Integer> devAlarmNumMap = new HashMap<>(); try { -- Gitblit v1.9.1