其他分享
首页 > 其他分享> > 单表存ID单表存name列表展示昵称,调接口

单表存ID单表存name列表展示昵称,调接口

作者:互联网

public IPage<ContractCodeRuleVo> listAll(ContractCodeRuleFindDto findDto, ContractCodeRuleSearchDto contractCodeRuleSearchDto) {
IPage<ContractCodeRuleVo> contractCodeRuleAll = contractCodeRuleMapper.findContractCodeRuleAll(findDto.toPage(), contractCodeRuleSearchDto);
List<ContractCodeRuleVo> records = contractCodeRuleAll.getRecords();
Set<String> collect = records.stream().map(ContractCodeRuleVo::getOperationManager).collect(Collectors.toSet());
ResponseBean<List<SysUserDictVo>> byUserIdList = userQueryFeignClient.findByUserIdList(collect);
Map<String, String> userMap = byUserIdList.getData().stream()
.collect(Collectors.toMap(SysUserDictVo::getUserId, SysUserDictVo::getName));

for (ContractCodeRuleVo contractCodeRuleVo : records) {
contractCodeRuleVo.setOperationManager(userMap.get(contractCodeRuleVo.getOperationManager()));
}

return contractCodeRuleAll;
}

 

标签:name,stream,records,collect,getOperationManager,contractCodeRuleVo,contractCodeR
来源: https://www.cnblogs.com/dsds/p/16382600.html