Browse Source

Merge remote-tracking branch 'origin/master'

‘linchangsheng’ 2 weeks ago
parent
commit
6c4ca5696b

+ 7 - 1
src/main/java/com/gree/mall/manager/bean/admin/AdminUserCom.java

@@ -1,5 +1,6 @@
 package com.gree.mall.manager.bean.admin;
 
+import com.gree.mall.manager.bean.admin.reqDto.AdminUserPermissions;
 import com.gree.mall.manager.plus.entity.AdminCompanyWechat;
 import com.gree.mall.manager.plus.entity.AdminUser;
 import com.gree.mall.manager.plus.entity.AdminUserPermissionsRela;
@@ -42,6 +43,11 @@ public class AdminUserCom extends AdminUser {
     private String token;
 
     @ApiModelProperty("数据权限集合")
-    private List<AdminUserPermissionsRela> permissions;
+    private List<AdminUserPermissionsRela> permissionList;
 
+    @ApiModelProperty("部门集合(账号详情接口时有值)")
+    private List<AdminUserPermissions> deptList;
+
+    @ApiModelProperty("商家权限集合(账号详情接口时有值)")
+    private List<AdminUserPermissions> permissions;
 }

+ 25 - 5
src/main/java/com/gree/mall/manager/logic/admin/AdminUserLogic.java

@@ -481,19 +481,39 @@ public class AdminUserLogic {
                 .eq(AdminUserPermissionsRela::getAdminUserId, adminUser.getAdminUserId())
                 .list();
 
-        final List<String> deptList = permissionsRelas.stream()
+        final List<String> deptIds = permissionsRelas.stream()
                 .filter(AdminUserPermissionsRela::getIsDept)
                 .map(AdminUserPermissionsRela::getAdminUserPermissionsId)
                 .collect(Collectors.toList());
 
-        final List<String> websitList = permissionsRelas.stream()
+        final List<String> websitIds = permissionsRelas.stream()
                 .filter(v -> !v.getIsDept())
                 .map(AdminUserPermissionsRela::getAdminUserPermissionsId)
                 .collect(Collectors.toList());
 
-        adminUserBean.setPermissions(permissionsRelas);
-        adminUserBean.setAdminDeptIds(deptList);
-        adminUserBean.setAdminWebsitIds(websitList);
+        List<AdminUserPermissions> permissions = new ArrayList<>();
+        List<AdminUserPermissions> deptList = new ArrayList<>();
+        if (CollectionUtil.isNotEmpty(deptIds)) {
+            for (String deptId : deptIds) {
+                AdminUserPermissions bean = new AdminUserPermissions();
+                bean.setAdminUserPermissionsId(deptId);
+                deptList.add(bean);
+            }
+        }
+
+        if (CollectionUtil.isNotEmpty(websitIds)) {
+            for (String websitId : websitIds) {
+                AdminUserPermissions bean = new AdminUserPermissions();
+                bean.setAdminUserPermissionsId(websitId);
+                permissions.add(bean);
+            }
+        }
+
+        adminUserBean.setPermissionList(permissionsRelas);
+        adminUserBean.setAdminDeptIds(deptIds);
+        adminUserBean.setAdminWebsitIds(websitIds);
+        adminUserBean.setDeptList(deptList);
+        adminUserBean.setPermissions(permissions);
 
         return adminUserBean;
     }