mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
bugfix
This commit is contained in:
@@ -55,10 +55,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -406,13 +403,23 @@ public class UserService extends BaseService<UserEntity, UserRepository> {
|
||||
|
||||
strings = Stream.ofAll(strings).filter(StringUtils::isNotBlank).toJavaSet();
|
||||
if (strings.isEmpty()) return Map.of();
|
||||
List<String> names = new ArrayList<>();
|
||||
|
||||
List<String> names = this.repository.findNamesByIds(strings);
|
||||
try {
|
||||
|
||||
Map<String, String> javaMap = Stream.ofAll(names).toMap(x -> x.split(",")[0], x -> x.split(",")[1]).toJavaMap();
|
||||
names = this.repository.findNamesByIds(strings);
|
||||
|
||||
strings.forEach(x -> javaMap.putIfAbsent(x, null));
|
||||
Map<String, String> javaMap =
|
||||
Stream.ofAll(names)
|
||||
.toMap(x -> x.split(",")[0], x -> x.split(",")[1])
|
||||
.toJavaMap();
|
||||
|
||||
return javaMap;
|
||||
strings.forEach(x -> javaMap.putIfAbsent(x, null));
|
||||
|
||||
return javaMap;
|
||||
} catch (Exception e) {
|
||||
log.error("获取用户名称失败 {}", StringUtils.join(names, " | "), e);
|
||||
return Map.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user