Merge branch 'dev-V0.4.5' of https://gitee.com/iotkit-open-source/iotkit-parent into dev-V0.4.5

V0.5.x
荭琪枫 2023-06-06 15:13:40 +08:00
commit 6c1bd70c8e
2 changed files with 3 additions and 2 deletions

View File

@ -135,7 +135,7 @@ public class SysMenuDataImpl implements ISysMenuData, IJPACommData<SysMenu, Long
@Override
public List<String> selectMenuPermsByUserId(Long userId) {
return jpaQueryFactory.select(Projections.bean(String.class, tbSysMenu.perms.countDistinct()))
List<String> menuIds = jpaQueryFactory.select(tbSysMenu.perms)
.from(tbSysMenu)
.leftJoin(tbSysRoleMenu).on(tbSysMenu.id.eq(tbSysRoleMenu.menuId))
.leftJoin(tbSysUserRole).on(tbSysRoleMenu.roleId.eq(tbSysUserRole.roleId))
@ -145,6 +145,7 @@ public class SysMenuDataImpl implements ISysMenuData, IJPACommData<SysMenu, Long
.and(tbSysRole.status.eq("0"))
.and(tbSysUserRole.userId.eq(userId))
.build()).fetch();
return menuIds;
}
@Override

View File

@ -144,7 +144,7 @@ public class SysRoleDataImpl implements ISysRoleData, IJPACommData<SysRole, Long
}
private List<SysRole> buildQueryTitle(Predicate predicate) {
return jpaQueryFactory.select(Projections.bean(SysRole.class, tbSysRole.id.countDistinct(), tbSysRole.roleName,
return jpaQueryFactory.select(Projections.fields(SysRole.class, tbSysRole.id, tbSysRole.roleName,
tbSysRole.roleKey, tbSysRole.roleSort, tbSysRole.menuCheckStrictly, tbSysRole.deptCheckStrictly,
tbSysRole.status, tbSysRole.delFlag, tbSysRole.createTime, tbSysRole.remark))
.from(tbSysRole)