List merchantList = supplierOrderDto.stream().map(SupplierOrderDto::getMerchantId).distinct().collect(Collectors.toList()); Map<Long, Integer> merchantMap = merchantService.getConfigByIds(merchantList).stream().collect(Collectors.toMap(YxMerchantConfig::getId, YxMerchantConfig::getTaxpayerType));

Java 代码优化:使用 Stream API 获取商家信息

原文地址: https://www.cveoy.top/t/topic/pu9p 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录