|
@@ -24,6 +24,7 @@ import com.chelvc.framework.common.function.Executor;
|
|
|
import com.chelvc.framework.common.model.Paging;
|
|
|
import com.chelvc.framework.database.context.DatabaseContextHolder;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -124,7 +125,7 @@ public class UserInviteServiceImpl extends ServiceImpl<UserInviteMapper, UserInv
|
|
|
List<Long> userIds = records.stream().filter(e -> e.getSourceType() == 1).map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
|
List<UserDTO> users = this.userService.listUsers(userIds);
|
|
|
map = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
|
- avatar = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getAvatar));
|
|
|
+ avatar = users.stream().filter(e -> StringUtils.isNotBlank(e.getAvatar())).collect(Collectors.toMap(UserDTO::getId, UserDTO::getAvatar));
|
|
|
List<Long> merchantIds = records.stream().filter(e -> e.getSourceType() == 2).map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
|
List<MerchantDTO> merchants = this.merchantService.getMerchantByIds(merchantIds);
|
|
|
map.putAll(merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getName)));
|
|
@@ -133,12 +134,12 @@ public class UserInviteServiceImpl extends ServiceImpl<UserInviteMapper, UserInv
|
|
|
List<Long> ids = records.stream().map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
|
List<UserDTO> users = this.userService.listUsers(ids);
|
|
|
map = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getNickname));
|
|
|
- avatar = users.stream().collect(Collectors.toMap(UserDTO::getId, UserDTO::getAvatar));
|
|
|
+ avatar = users.stream().filter(e -> StringUtils.isNotBlank(e.getAvatar())).collect(Collectors.toMap(UserDTO::getId, UserDTO::getAvatar));
|
|
|
} else if(param.getType() == 2){
|
|
|
List<Long> ids = records.stream().map(TeamDetailsDTO::getInviteUserId).collect(Collectors.toList());
|
|
|
List<MerchantDTO> merchants = this.merchantService.getMerchantByIds(ids);
|
|
|
map = merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getName));
|
|
|
- avatar = merchants.stream().collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getLogo));
|
|
|
+ avatar = merchants.stream().filter(e -> StringUtils.isNotBlank(e.getLogo())).collect(Collectors.toMap(MerchantDTO::getId, MerchantDTO::getLogo));
|
|
|
}
|
|
|
for(TeamDetailsDTO detailsDTO : records){
|
|
|
detailsDTO.setName(map.get(detailsDTO.getInviteUserId()));
|