数据权限管理优化:在部门相关接口中禁用数据权限

此次提交禁用了以下接口的数据权限管理,以确保在处理部门数据时不会进行额外的数据权限验证:
- 在`DeptApiImpl`中的`deleteDept`和`getDeptByFactoryId`方法上禁用数据权限。
- 在`DeptController`中,新增的`getVirtuallyDeptList`方法和已有的`all-list`方法上禁用数据权限。
- 在`DeptServiceImpl`中的`getDeptByFactoryId`方法上禁用数据权限。这些更改确保了在执行相关操作时,能够直接获取和修改数据,避免了数据权限管理的干扰。
This commit is contained in:
furongxin 2024-09-25 18:38:59 +08:00
parent f6eaab85bf
commit a4dfe1a5a1
3 changed files with 12 additions and 0 deletions

View File

@ -82,6 +82,7 @@ public class DeptApiImpl implements DeptApi {
}
@Override
@DataPermission(enable = false)
public void deleteDept(Long factoryId) {
DeptDO deptDO = deptService.getDeptByFactoryId(factoryId);
@ -92,6 +93,7 @@ public class DeptApiImpl implements DeptApi {
}
@Override
@DataPermission(enable = false)
public CommonResult<DeptRespDTO> getDeptByFactoryId(Long factoryId) {
DeptDO deptDO = deptService.getDeptByFactoryId(factoryId);

View File

@ -128,6 +128,15 @@ public class DeptController {
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
}
@GetMapping(value = { "/virtually-list"})
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
public CommonResult<List<DeptSimpleRespVO>> getVirtuallyDeptList() {
List<DeptDO> list = deptService.getDeptList(
new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
}
@GetMapping(value = {"/all-list"})
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
@DataPermission(enable = false)

View File

@ -311,6 +311,7 @@ public class DeptServiceImpl implements DeptService {
}
@Override
@DataPermission(enable = false)
public DeptDO getDeptByFactoryId(Long factoryId) {
return deptMapper.selectOne(DeptDO::getFactoryId, factoryId);