|
|
@@ -449,12 +449,15 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
List<String> pidList = new ArrayList<>();
|
|
|
idList.forEach(id -> {
|
|
|
R<Dept> deptR = sysClient.getDept(Long.valueOf(id));
|
|
|
- String[] ancestors = deptR.getData().getAncestors().split(",");
|
|
|
- if (ancestors.length > 1) {
|
|
|
- pidList.add(ancestors[1]);
|
|
|
- } else {
|
|
|
- pidList.add(deptId);
|
|
|
+ if (deptR.isSuccess() && ObjectUtil.isNotEmpty(deptR.getData())) {
|
|
|
+ String[] ancestors = deptR.getData().getAncestors().split(",");
|
|
|
+ if (ancestors.length > 1) {
|
|
|
+ pidList.add(ancestors[1]);
|
|
|
+ } else {
|
|
|
+ pidList.add(deptId);
|
|
|
+ }
|
|
|
}
|
|
|
+ pidList.add(deptId);
|
|
|
});
|
|
|
return pidList.stream().distinct().collect(Collectors.joining(","));
|
|
|
}
|