|
@@ -52,12 +52,10 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import sun.security.krb5.internal.PAData;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
@Service
|
|
|
@Transactional
|
|
@@ -707,24 +705,24 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
|
|
|
Pageable page = searchable.getPage();
|
|
|
String appId = searchable.getSearchFilter("appId", SearchOperator.eq).getValue().toString();
|
|
|
List<RoleInfo> roleInfos = roleInfoService.getRolesByAppId(appId);
|
|
|
- Stream<RoleInfo> stream = roleInfos.stream();
|
|
|
Condition roleCodeEq = searchable.getSearchFilter("roleCode", SearchOperator.eq);
|
|
|
if(null != roleCodeEq) {
|
|
|
String roleCode = roleCodeEq.getValue().toString();
|
|
|
- stream = stream.filter(e -> e.getCode().equals(roleCode));
|
|
|
+ roleInfos = roleInfos.stream().filter(e -> e.getCode().equals(roleCode)).collect(Collectors.toList());
|
|
|
}
|
|
|
Condition roleCodeIn = searchable.getSearchFilter("roleCode", SearchOperator.in);
|
|
|
if(null != roleCodeIn) {
|
|
|
- String[] value = (String[]) roleCodeIn.getValue();
|
|
|
- Set<String> set = Stream.of(value).collect(Collectors.toSet());
|
|
|
- stream = stream.filter(e->set.contains(e.getCode()));
|
|
|
+ JSONArray jsonArray = (JSONArray) roleCodeIn.getValue();
|
|
|
+ List<String> list = jsonArray.toJavaList(String.class);
|
|
|
+ Set<String> set = new HashSet<>(list);
|
|
|
+ roleInfos = roleInfos.stream().filter(e -> set.contains(e.getCode())).collect(Collectors.toList());
|
|
|
}
|
|
|
- if(stream.count() == 0) {
|
|
|
+ if(roleInfos.size() == 0) {
|
|
|
return Page.empty();
|
|
|
}
|
|
|
Searchable pageSearch = Searchable.newSearchable();
|
|
|
pageSearch.setPage(page);
|
|
|
- List<String> roleIds = stream.map(RoleInfo::getId).collect(Collectors.toList());
|
|
|
+ List<String> roleIds = roleInfos.stream().map(RoleInfo::getId).collect(Collectors.toList());
|
|
|
pageSearch.addSearchFilter("roleId", SearchOperator.in, roleIds);
|
|
|
Condition orgCodeEq = searchable.getSearchFilter("orgCode", SearchOperator.eq);
|
|
|
List<AuthOrgInfo> orgInfos = null;
|
|
@@ -770,7 +768,7 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
|
|
|
List<String> orgIds = dtoPage.getContent().stream().map(StaffRoleAuthApiDTO::getStaffOrgId).distinct().collect(Collectors.toList());
|
|
|
orgInfos = authOrgInfoService.getByIds(orgIds);
|
|
|
}
|
|
|
- Map<String, RoleInfo> roleInfoMap = stream.collect(Collectors.toMap(RoleInfo::getId, e -> e, (old, last) -> last));
|
|
|
+ Map<String, RoleInfo> roleInfoMap = roleInfos.stream().collect(Collectors.toMap(RoleInfo::getId, e -> e, (old, last) -> last));
|
|
|
Map<String, AuthUserInfo> userInfoMap = userInfos.stream().collect(Collectors.toMap(AuthUserInfo::getId, e -> e, (old, last) -> last));
|
|
|
Map<String, AuthOrgInfo> orgInfoMap = orgInfos.stream().collect(Collectors.toMap(AuthOrgInfo::getId, e -> e, (old, last) -> last));
|
|
|
List<StaffRoleAuthApiVo> vos = dtoPage.stream()
|