|
@@ -126,25 +126,31 @@ public class UserInviteServiceImpl extends ServiceImpl<UserInviteMapper, UserInv
|
|
List<UserDTO> usersLists = this.userService.listUsers(userList);
|
|
List<UserDTO> usersLists = this.userService.listUsers(userList);
|
|
Map<Long, String> userMap = usersLists.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
Map<Long, String> userMap = usersLists.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
Map<Long, String> map = new HashMap<>();
|
|
Map<Long, String> map = new HashMap<>();
|
|
|
|
+ Map<Long,String> avatar = new HashMap<>();
|
|
if(param.getType() == null){
|
|
if(param.getType() == null){
|
|
List<Long> userIds = records.stream().filter(e -> e.getSourceType() == 1).map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<Long> userIds = records.stream().filter(e -> e.getSourceType() == 1).map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<UserDTO> users = this.userService.listUsers(userIds);
|
|
List<UserDTO> users = this.userService.listUsers(userIds);
|
|
map = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
map = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
|
|
+ avatar = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getAvatar));
|
|
List<Long> merchantIds = records.stream().filter(e -> e.getSourceType() == 2).map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<Long> merchantIds = records.stream().filter(e -> e.getSourceType() == 2).map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<MerchantDTO> merchants = this.merchantService.getMerchantByIds(merchantIds);
|
|
List<MerchantDTO> merchants = this.merchantService.getMerchantByIds(merchantIds);
|
|
map.putAll(merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getName)));
|
|
map.putAll(merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getName)));
|
|
|
|
+ avatar.putAll(merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getLogo)));
|
|
} else if(param.getType() == 1){
|
|
} else if(param.getType() == 1){
|
|
List<Long> ids = records.stream().map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<Long> ids = records.stream().map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<UserDTO> users = this.userService.listUsers(ids);
|
|
List<UserDTO> users = this.userService.listUsers(ids);
|
|
map = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
map = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
|
|
+ avatar = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getAvatar));
|
|
} else if(param.getType() == 2){
|
|
} else if(param.getType() == 2){
|
|
List<Long> ids = records.stream().map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<Long> ids = records.stream().map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
List<MerchantDTO> merchants = this.merchantService.getMerchantByIds(ids);
|
|
List<MerchantDTO> merchants = this.merchantService.getMerchantByIds(ids);
|
|
map = merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getName));
|
|
map = merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getName));
|
|
|
|
+ avatar = merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getLogo));
|
|
}
|
|
}
|
|
for(TeamDetailsDTO detailsDTO : records){
|
|
for(TeamDetailsDTO detailsDTO : records){
|
|
detailsDTO.setName(map.get(detailsDTO.getInviteUserId()));
|
|
detailsDTO.setName(map.get(detailsDTO.getInviteUserId()));
|
|
detailsDTO.setNickname(userMap.get(detailsDTO.getUserId()));
|
|
detailsDTO.setNickname(userMap.get(detailsDTO.getUserId()));
|
|
|
|
+ detailsDTO.setInviteUserAvatar(avatar.get(detailsDTO.getInviteUserId()));
|
|
BigDecimal amount = detailsDTO.getAmount();
|
|
BigDecimal amount = detailsDTO.getAmount();
|
|
if(amount == null){
|
|
if(amount == null){
|
|
detailsDTO.setAmount(BigDecimal.ZERO);
|
|
detailsDTO.setAmount(BigDecimal.ZERO);
|