|
@@ -69,6 +69,8 @@ public class AdminUserLogic {
|
|
|
|
|
|
private final AdminDeptService adminDeptService;
|
|
|
|
|
|
+ private final AdminDeptWebsitService adminDeptWebsitService;
|
|
|
+
|
|
|
@Value("${front.top.url}")
|
|
|
private String frontTopUrl;
|
|
|
|
|
@@ -328,7 +330,7 @@ public class AdminUserLogic {
|
|
|
Set<String> adminUserIdList = new HashSet<>();
|
|
|
if (!adminUser.getUserName().equals("admin")) {
|
|
|
// 非admin账号,筛选能看的账号
|
|
|
-// this.queryCanSeeAdminUser(adminUserIdList, adminUser);
|
|
|
+ this.queryCanSeeAdminUser(adminUserIdList, adminUser);
|
|
|
}
|
|
|
|
|
|
IPage<AdminUser> page = adminUserService.lambdaQuery()
|
|
@@ -343,14 +345,33 @@ public class AdminUserLogic {
|
|
|
private void queryCanSeeAdminUser(Set<String> adminUserIdList, AdminUserCom adminUser) {
|
|
|
final List<AdminUserPermissionsRela> permissionsRelaList = adminUserPermissionsRelaService.lambdaQuery()
|
|
|
.eq(AdminUserPermissionsRela::getAdminUserId, adminUser.getAdminUserId())
|
|
|
- .eq(AdminUserPermissionsRela::getIsDept, false)
|
|
|
.list();
|
|
|
|
|
|
// 商家id集合
|
|
|
- final List<String> websitIdList = permissionsRelaList.stream()
|
|
|
+ Set<String> websitIdList = permissionsRelaList.stream()
|
|
|
+ .filter(v -> !v.getIsDept())
|
|
|
+ .map(AdminUserPermissionsRela::getAdminUserPermissionsId)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+
|
|
|
+ final List<String> deptList = permissionsRelaList.stream()
|
|
|
+ .filter(AdminUserPermissionsRela::getIsDept)
|
|
|
.map(AdminUserPermissionsRela::getAdminUserPermissionsId)
|
|
|
+ .distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(deptList)) {
|
|
|
+ // 找出部门下的商家
|
|
|
+ for (String deptId : deptList) {
|
|
|
+ final List<AdminDeptWebsit> adminDeptWebsits = adminDeptWebsitService.lambdaQuery()
|
|
|
+ .eq(AdminDeptWebsit::getAdminDeptId, deptId)
|
|
|
+ .list();
|
|
|
+ final List<String> websitIds = adminDeptWebsits.stream()
|
|
|
+ .map(AdminDeptWebsit::getWebsitId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ websitIdList.addAll(websitIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 根据商家id集合查找有关联的账号
|
|
|
final List<AdminUserPermissionsRela> adminUserPermissionsRelaList = adminUserPermissionsRelaService.lambdaQuery()
|
|
|
.select(AdminUserPermissionsRela::getAdminUserId)
|