parent
b522f17b18
commit
8466081cac
|
@ -99,6 +99,7 @@ public class DisposeInfoController {
|
|||
.nodeId(areaCode.toString())
|
||||
.totalNetflow(areaCodeManagerService.getAreaCodeGroupReserveNetflow(areaCode))
|
||||
.onlineDevices(areaCodeManagerService.getAreaCodeOnlineDeviceNum(areaCode))
|
||||
.totalDevices(areaCodeManagerService.getAreaCodeTotalDeviceNum(areaCode))
|
||||
.capacityType(Arrays.stream(areaCodeManagerService.getAreaCodeSupportCapacity(areaCode))
|
||||
.map(DisposeCapacityType::getValue)
|
||||
.toArray(Integer[]::new))
|
||||
|
|
|
@ -35,4 +35,8 @@ public class AreaInfoDetail {
|
|||
* The Online devices.
|
||||
*/
|
||||
private Integer onlineDevices;
|
||||
/**
|
||||
* The Total devices.
|
||||
*/
|
||||
private Integer totalDevices;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,14 @@ public interface AreaCodeManagerService {
|
|||
*/
|
||||
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.
|
||||
*
|
||||
|
|
|
@ -82,6 +82,20 @@ public class AreaCodeManagerServiceImpl implements AreaCodeManagerService {
|
|||
.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 [ ].
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue