| | |
| | | staticTypeMap.put(1,0); |
| | | staticTypeMap.put(2,0); |
| | | |
| | | Map<Integer,Integer> staticStateMap=new HashMap<>(); |
| | | staticStateMap.put(0,0); |
| | | staticStateMap.put(1,0); |
| | | |
| | | Map<Integer,Integer> a200staticStateMap=new HashMap<>(); |
| | | a200staticStateMap.put(0,0); |
| | | a200staticStateMap.put(1,0); |
| | | Map<Integer,Integer> actmstaticStateMap=new HashMap<>(); |
| | | actmstaticStateMap.put(0,0); |
| | | actmstaticStateMap.put(1,0); |
| | | Map<String,Object> typestateMap=new HashMap<>(); |
| | | typestateMap.put("a200",a200staticStateMap); |
| | | typestateMap.put("actm",actmstaticStateMap); |
| | | List<DevInf> list=mapper.getDevStaticByType(userId); |
| | | |
| | | |
| | | Map<Integer, List<DevInf>> typeMap = list.stream().collect(Collectors.groupingBy(DevInf::getDevType)); |
| | | for (Integer type : typeMap.keySet()) { |
| | | staticTypeMap.put(type, typeMap.get(type).size()); |
| | | } |
| | | |
| | | Map<Integer, List<DevInf>> stateMap = list.stream().collect(Collectors.groupingBy(DevInf::getDevOnline)); |
| | | for (Integer state : stateMap.keySet()) { |
| | | staticStateMap.put(state, stateMap.get(state).size()); |
| | | List<DevInf> typeList= typeMap.get(type); |
| | | Map<Integer, List<DevInf>> stateMap = typeList.stream().collect(Collectors.groupingBy(DevInf::getDevOnline)); |
| | | if(type==1){ |
| | | for (Integer state : stateMap.keySet()) { |
| | | a200staticStateMap.put(state, stateMap.get(state).size()); |
| | | } |
| | | typestateMap.put("a200", a200staticStateMap); |
| | | } |
| | | if(type==2){ |
| | | for (Integer state : stateMap.keySet()) { |
| | | actmstaticStateMap.put(state, stateMap.get(state).size()); |
| | | } |
| | | typestateMap.put("actm", actmstaticStateMap); |
| | | } |
| | | } |
| | | map.put("dinf",list!=null?list:null); |
| | | map.put("type",staticTypeMap); |
| | | map.put("state",staticStateMap); |
| | | map.put("state",typestateMap); |
| | | return map; |
| | | } |
| | | } |