REM:
1. 修正节点信息接口,统计reserveNetflow字段为null时异常问题
This commit is contained in:
HuangXin 2020-09-15 09:35:42 +08:00
parent 4735ca7a4b
commit 28f7af5789
1 changed files with 17 additions and 15 deletions

View File

@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
@ -59,7 +60,8 @@ public class AreaCodeManagerServiceImpl implements AreaCodeManagerService {
.filter(v -> v.getAreaCode().equals(areaCode))
.mapToInt(v -> v.getDevCapacity().stream()
.filter(k -> k.getCapacityType() == DisposeCapacityType.CLEANUP)
.mapToInt(DisposeCapacity::getReserveNetflow).sum())
.mapToInt(m -> Optional.ofNullable(m.getReserveNetflow()).orElse(0))
.sum())
.sum();
}