页面权限接口
This commit is contained in:
parent
0d11678148
commit
7d9cfb74f4
|
|
@ -50,6 +50,20 @@ public class ShopPagePermissionController {
|
|||
return CzgResult.success(shopStaffPagePermissionService.add(StpKit.USER.getShopId(), pagePathPermissionAddDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工拥有页面路径
|
||||
* @param staffId 员工ID
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<List<ShopPagePath>> detail(@RequestParam Long staffId) {
|
||||
Set<Long> pageIdList = shopStaffPagePermissionService.list(new QueryWrapper().eq(ShopStaffPagePermission::getShopId,
|
||||
StpKit.USER.getShopId()).eq(ShopStaffPagePermission::getStaffId, staffId)).stream().map(ShopStaffPagePermission::getPagePathId).collect(Collectors.toSet());
|
||||
if (pageIdList.isEmpty()) {
|
||||
return CzgResult.success(new ArrayList<>());
|
||||
}
|
||||
return CzgResult.success(shopPagePathService.list(new QueryWrapper().in(ShopPagePath::getId, pageIdList)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前员工已拥有页面路径权限
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
|
|||
if (b) {
|
||||
sysRolesMenusService.updateChain().eq(SysRolesMenus::getRoleId, role.getId()).remove();
|
||||
return addMenu(role.getId(), roleEditDTO.getMenuIdList());
|
||||
}
|
||||
}
|
||||
throw new ApiNotPrintException("保存失败");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue