diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java index 1f9e7b1..33001de 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java @@ -12,8 +12,8 @@ import com.ningdatech.pmapi.sys.model.entity.RoleMenu; import com.ningdatech.pmapi.sys.model.req.RolePageReq; import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; import com.ningdatech.pmapi.sys.model.vo.RoleVO; -import com.ningdatech.pmapi.sys.service.IRoleMenuService; import com.ningdatech.pmapi.sys.service.IMenuService; +import com.ningdatech.pmapi.sys.service.IRoleMenuService; import com.ningdatech.pmapi.sys.service.IRoleService; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.StringUtils; @@ -35,9 +35,8 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class RoleManage { - private final IRoleService IRoleService; - private final IMenuService IMenuService; - + private final IRoleService roleService; + private final IMenuService menuService; private final IRoleMenuService roleMenuService; public PageVo queryList(RolePageReq rolePageReq) { @@ -48,16 +47,17 @@ public class RoleManage { return PageVo.of(data, page.getTotal()); } - private void searchList(Page page, LambdaQueryWrapper wrapper, RolePageReq rolePageReq) { - wrapper.like(StringUtils.isNotBlank(rolePageReq.getName()), Role::getName, rolePageReq.getName()) + private void searchList(Page page, LambdaQueryWrapper wrapper, RolePageReq req) { + wrapper.like(StringUtils.isNotBlank(req.getName()), Role::getName, req.getName()) + .eq(req.getFixed() != null, Role::getFixed, req.getFixed()) .orderByDesc(Role::getUpdateOn); - IRoleService.page(page, wrapper); + roleService.page(page, wrapper); } public void buildMenu(RoleVO query) { //改成直接返回有权限的 - List list = IMenuService.list(Wrappers.lambdaQuery(Menu.class).orderByAsc(Menu::getSort)); + List list = menuService.list(Wrappers.lambdaQuery(Menu.class).orderByAsc(Menu::getSort)); List roleMenus = roleMenuService.list(Wrappers.lambdaQuery(RoleMenu.class) .eq(RoleMenu::getRoleId, query.getId())); List menus = list.stream().map(menu -> { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java index c31889a..42c3dc8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java @@ -29,7 +29,7 @@ public class Role extends BaseEntity { private static final long serialVersionUID = 1L; - @TableId(value = "id",type = IdType.AUTO) + @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty(value = "名称") @@ -38,6 +38,8 @@ public class Role extends BaseEntity { @ApiModelProperty("角色编码") private String code; + @ApiModelProperty("是否是内置角色") + private Boolean fixed; @ApiModelProperty(value = "描述") private String describe; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java index e4a2997..03ba905 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java @@ -34,4 +34,7 @@ public class RolePageReq extends PagePo implements Serializable { @ApiModelProperty(value = "名称") private String name; + @ApiModelProperty("是否是内置角色") + private Boolean fixed; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java index 34bc83c..025085b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java @@ -43,6 +43,9 @@ public class RoleVO extends BaseEntity { @ApiModelProperty(value = "描述") private String describe; + @ApiModelProperty("是否是内置角色:true 是、false 否") + private Boolean fixed; + /** * 数据范围 */