FengChaoYu 5 ay önce
ebeveyn
işleme
7ac18a304e

+ 13 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/admin/AdminRoleLogic.java

@@ -66,6 +66,19 @@ public class AdminRoleLogic {
                 .orderByDesc(AdminRole::getType)
                 .page(new Page<>(pageNo, pageSize));
 
+        if (pageSize < 0) {
+            final AdminRole parentRole = adminRoleService.lambdaQuery()
+                    .eq(AdminRole::getName, "企业负责人")
+                    .last("limit 1")
+                    .one();
+            List<AdminRole> roleList = new ArrayList<>();
+            if (Objects.nonNull(parentRole)) {
+                roleList.add(parentRole);
+            }
+            roleList.addAll(rolePage.getRecords());
+            rolePage.setRecords(roleList);
+        }
+
         return rolePage;
     }