Browse Source

修改 角色管理--编辑页面--菜单/操作权限--缺少提示语“更改权限时将会同步影响子角色1、子角色2、子角色3的权限,请确认后更改”的问题

v_HuilingDeng 3 years ago
parent
commit
f74af7d347

+ 22 - 3
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/GetRoleInfoRes.java

@@ -1,7 +1,5 @@
 package com.abi.qms.platform.dto.res;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -33,9 +31,30 @@ public class GetRoleInfoRes implements Serializable {
   private String roleDesc;
 
   @ApiModelProperty("资源code列表")
-  List<String> resourceCodeList;
+  private List<String> resourceCodeList;
 
   @ApiModelProperty(value = "激活小程序资源列表(里面只会有2种code: 1-主账号 2-子账号)")
   private List<Integer> activateMiniAppResourceCodeList;
 
+  @ApiModelProperty("子角色列表")
+  private List<RoleInfoBean> subRoleInfoList;
+
+
+  /**
+   * 子角色bean
+   */
+  @Data
+  @NoArgsConstructor
+  @AllArgsConstructor
+  @ToString
+  @ApiModel(value = "GetRoleInfoRes_RoleInfoBean")
+  public static class RoleInfoBean implements Serializable {
+
+    @ApiModelProperty(value = "角色code")
+    private String roleCode;
+
+    @ApiModelProperty(value = "角色name")
+    private String roleName;
+
+  }
 }

+ 0 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/FactoryServiceImpl.java

@@ -2,7 +2,6 @@ package com.abi.qms.platform.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.abi.qms.platform.dao.entity.*;
-import cn.hutool.json.JSONUtil;
 import com.abi.qms.platform.dao.entity.BaseFactory;
 import com.abi.qms.platform.dao.entity.QrBoxCodeFormat;
 import com.abi.qms.platform.dao.entity.QrPackage;

+ 7 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/RoleManagerServiceImpl.java

@@ -245,6 +245,13 @@ public class RoleManagerServiceImpl implements RoleManagerService {
         res.setResourceCodeList(resourceCodeList);
         res.setActivateMiniAppResourceCodeList(miniAppResourceCodeList);
 
+        //查询启用中的下级角色列表
+        List<UserRole> subRoles = userRoleMapper.subordinateRoleEnable(userRole.getRoleCode(), userRole.getRoleLevel());
+        if(CollectionUtils.isNotEmpty(subRoles)){
+            List<GetRoleInfoRes.RoleInfoBean> roleInfoBeans = PojoConverterUtils.copyList(subRoles, GetRoleInfoRes.RoleInfoBean.class);
+            res.setSubRoleInfoList(roleInfoBeans);
+        }
+
         return res;
     }