| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.PowerInf; |
| | | import com.whyc.pojo.StationInf; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.BadBattMonService; |
| | | import com.whyc.service.BattInfService; |
| | | import com.whyc.service.BatttestdataInfService; |
| | | import com.whyc.service.PowerInfService; |
| | | import com.whyc.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | private static BattInfService battInfService; |
| | | |
| | | private static StationInfService stationInfService; |
| | | |
| | | private static BadBattMonService badBattMonService; |
| | | |
| | | |
| | |
| | | @Autowired |
| | | public void setBatttestdataInfService(BatttestdataInfService batttestdataInfService) { |
| | | HomeAdminSocket.batttestdataInfService = batttestdataInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setStationInfService(StationInfService stationInfService) { |
| | | HomeAdminSocket.stationInfService = stationInfService; |
| | | } |
| | | |
| | | @OnOpen |
| | |
| | | //站点信息 |
| | | Response resStationAnalysis = new Response(); |
| | | try { |
| | | List<Battinf> battinfList = battInfService.getSateAnalysis(userId); |
| | | Map<Integer, List<Battinf>> nodeStationMap = battinfList.stream().collect(Collectors.groupingBy(Battinf::getNodeStation)); |
| | | Map<String, List<Battinf>> stationTypeMap = battinfList.stream().collect(Collectors.groupingBy(Battinf::getStationType)); |
| | | //List<Battinf> battinfList = battInfService.getSateAnalysis(userId); |
| | | List<StationInf> sinfList = stationInfService.getSateAnalysis(userId); |
| | | Map<Integer, List<StationInf>> nodeStationMap = sinfList.stream().collect(Collectors.groupingBy(StationInf::getNodeStation)); |
| | | Map<String, List<StationInf>> stationTypeMap = sinfList.stream().collect(Collectors.groupingBy(StationInf::getStationType)); |
| | | Map<Integer, Object> nodeMap = new HashMap<>(); |
| | | Map<String, Object> stationMap = new HashMap<>(); |
| | | Map<String, Object> battGroupInfoMap = new HashMap<>(); |
| | | int battSize = battinfList.size(); |
| | | int battSize = sinfList.size(); |
| | | for (Integer node : nodeStationMap.keySet()) { |
| | | nodeMap.put(node, nodeStationMap.get(node).size()); |
| | | } |