REM:
1.获取节点信息接口中层架统计所有设备的字段
This commit is contained in:
chenlinghy 2020-09-21 16:07:28 +08:00
parent b522f17b18
commit 8466081cac
4 changed files with 27 additions and 0 deletions

View File

@ -99,6 +99,7 @@ public class DisposeInfoController {
.nodeId(areaCode.toString()) .nodeId(areaCode.toString())
.totalNetflow(areaCodeManagerService.getAreaCodeGroupReserveNetflow(areaCode)) .totalNetflow(areaCodeManagerService.getAreaCodeGroupReserveNetflow(areaCode))
.onlineDevices(areaCodeManagerService.getAreaCodeOnlineDeviceNum(areaCode)) .onlineDevices(areaCodeManagerService.getAreaCodeOnlineDeviceNum(areaCode))
.totalDevices(areaCodeManagerService.getAreaCodeTotalDeviceNum(areaCode))
.capacityType(Arrays.stream(areaCodeManagerService.getAreaCodeSupportCapacity(areaCode)) .capacityType(Arrays.stream(areaCodeManagerService.getAreaCodeSupportCapacity(areaCode))
.map(DisposeCapacityType::getValue) .map(DisposeCapacityType::getValue)
.toArray(Integer[]::new)) .toArray(Integer[]::new))

View File

@ -35,4 +35,8 @@ public class AreaInfoDetail {
* The Online devices. * The Online devices.
*/ */
private Integer onlineDevices; private Integer onlineDevices;
/**
* The Total devices.
*/
private Integer totalDevices;
} }

View File

@ -35,6 +35,14 @@ public interface AreaCodeManagerService {
*/ */
int getAreaCodeOnlineDeviceNum(Integer areaCode); int getAreaCodeOnlineDeviceNum(Integer areaCode);
/**
* Gets area code total device num.
*
* @param areaCode the area code
* @return the area code total device num
*/
int getAreaCodeTotalDeviceNum(Integer areaCode);
/** /**
* Gets area code support capacity. * Gets area code support capacity.
* *

View File

@ -82,6 +82,20 @@ public class AreaCodeManagerServiceImpl implements AreaCodeManagerService {
.count(); .count();
} }
/**
* Gets area code total device num.
*
* @param areaCode the area code
* @return the area code total device num
*/
@Override
public int getAreaCodeTotalDeviceNum(Integer areaCode) {
List<DisposeDevice> disposeDevices = disposeDeviceManagerService.getAllDisposeDevice();
return (int) disposeDevices.stream()
.filter(v -> v.getAreaCode().equals(areaCode))
.count();
}
/** /**
* Get area code support capacity dispose capacity type [ ]. * Get area code support capacity dispose capacity type [ ].
* *