SEBSERV-417 fixed predicate
This commit is contained in:
parent
3e426ce2cc
commit
27c5cff6f5
1 changed files with 7 additions and 4 deletions
|
@ -173,10 +173,13 @@ public class UserDAOImpl implements UserDAO {
|
|||
public Result<Collection<UserInfo>> allMatching(final FilterMap filterMap, final Predicate<UserInfo> predicate) {
|
||||
return Result.tryCatch(() -> {
|
||||
final String userRole = filterMap.getUserRole();
|
||||
final Set<String> userRoles = new HashSet<>(Arrays.asList(StringUtils.split(userRole, Constants.LIST_SEPARATOR)));
|
||||
final Predicate<UserInfo> _predicate = (StringUtils.isNotBlank(userRole))
|
||||
? predicate.and(ui -> userRoles.stream().anyMatch(ui.roles::contains))
|
||||
: predicate;
|
||||
final Predicate<UserInfo> _predicate;
|
||||
if (StringUtils.isNotBlank(userRole)) {
|
||||
final Set<String> userRoles = new HashSet<>(Arrays.asList(StringUtils.split(userRole, Constants.LIST_SEPARATOR)));
|
||||
_predicate = predicate.and(ui -> userRoles.stream().anyMatch(ui.roles::contains));
|
||||
} else {
|
||||
_predicate = predicate;
|
||||
}
|
||||
|
||||
final QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserRecord>>>.QueryExpressionWhereBuilder sqlWhereClause =
|
||||
(filterMap.getBoolean(FilterMap.ATTR_ADD_INSITUTION_JOIN))
|
||||
|
|
Loading…
Reference in a new issue