使用 Stream 流简化全省使用情况数据收集
//使用stream流来简化代码 List<Map<String, Object>> usageThroughoutTheProvince = Arrays.stream(CompanyEnum.values()) .filter(companyEnum -> companyEnum != CompanyEnum.ZMCC) .map(companyEnum -> { String companyDN = companyEnum.getValue(); Integer totalUserNumber = comMap.get(companyDN); return getCompanyReportFormsMap(accountMonthVO, companyDN, totalUserNumber); }) .collect(Collectors.toList());
原文地址: https://www.cveoy.top/t/topic/qdVS 著作权归作者所有。请勿转载和采集!