|
|
@ -167,7 +167,7 @@ public class StatusController extends BaseController { |
|
|
|
List<Status> lastEntry = ipMap.get(lastKey); |
|
|
|
Map<String, List<Status>> typeMap = lastEntry.stream().filter(iteam -> iteam.getType() != null).collect(Collectors.groupingBy(Status::getType)); |
|
|
|
Map<String,Map<String,String>> subMap=new HashMap<>(); |
|
|
|
|
|
|
|
Long sumUseState = 0L; |
|
|
|
for (Map.Entry<String, List<Status>> entrys : typeMap.entrySet()) { |
|
|
|
Map<String, String> maps=new HashMap<>(); |
|
|
|
List<Status> groupItems = entrys.getValue(); |
|
|
@ -185,9 +185,12 @@ public class StatusController extends BaseController { |
|
|
|
//离线率
|
|
|
|
maps.put("failRate",failRate); |
|
|
|
//已使用数量
|
|
|
|
maps.put("sum",String.valueOf(groupItems.size())); |
|
|
|
List<String> collect = dcDeviceList.stream().filter(item -> Objects.equals(item.getDeviceType(), entrys.getKey())).map(DcDevice::getSumAll).collect(Collectors.toList()); |
|
|
|
String useStateNum = collect.size() > 0 ? String.valueOf(collect.get(0)) : "0"; |
|
|
|
sumUseState += Long.valueOf(useStateNum); |
|
|
|
maps.put("sumUseState",useStateNum); |
|
|
|
//总数
|
|
|
|
maps.put("sumUseState", String.valueOf(dcDeviceList.stream().filter(item -> Objects.equals(item.getDeviceType(), entrys.getKey())).map(DcDevice::getSumAll).collect(Collectors.toList()).get(0))); |
|
|
|
maps.put("sum",String.valueOf(groupItems.size())); |
|
|
|
if(itemTypeMap.get(entrys.getKey())!=null) { |
|
|
|
subMap.put(itemTypeMap.get(entrys.getKey()), maps); |
|
|
|
} |
|
|
@ -207,10 +210,9 @@ public class StatusController extends BaseController { |
|
|
|
//离线率
|
|
|
|
maps.put("failRate",failRate); |
|
|
|
//已使用数量
|
|
|
|
List<DcDevice> list = dcDeviceService.list(); |
|
|
|
maps.put("sumUseState",String.valueOf(lastEntry.size())); |
|
|
|
maps.put("sumUseState", String.valueOf(sumUseState)); |
|
|
|
//总数
|
|
|
|
maps.put("sum",String.valueOf(list.size())); |
|
|
|
maps.put("sum",String.valueOf(lastEntry.size())); |
|
|
|
subMap.put("全部设备",maps); |
|
|
|
|
|
|
|
return AjaxResult.success(subMap); |
|
|
|