feat:部门修改权限
This commit is contained in:
1 parent
40ac5855d0
commit
47d6fd77d0
1 file changed
+16
-1
+16
-1
@@ -19,6 +19,7 @@
|
||||
|
||||
package com.bsd.pjcloud.admin.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.admin.api.dto.DeptAllListDto;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.vo.DeptExcelVO;
|
||||
@@ -31,10 +32,13 @@ import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.HasPermission;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -56,6 +60,7 @@ import java.util.Map;
|
||||
@RequestMapping("/dept")
|
||||
@Tag(description = "dept", name = "部门管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
@Slf4j
|
||||
public class SysDeptController {
|
||||
|
||||
private final SysDeptService sysDeptService;
|
||||
@@ -89,14 +94,24 @@ public class SysDeptController {
|
||||
*/
|
||||
@GetMapping(value = "/tree")
|
||||
public R getTree(String deptName, Long parentId) {
|
||||
Long deptId = null;
|
||||
try {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
deptId = user.getDeptId();
|
||||
} catch (Exception e) {
|
||||
log.error("获取当前用户ID异常", e);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(parentId)) {
|
||||
parentId = deptId;
|
||||
}
|
||||
return R.ok(sysDeptService.selectTree(deptName, parentId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 查询所有,无权限过滤
|
||||
* simpleTree
|
||||
*
|
||||
* @param deptName
|
||||
* @param parentId
|
||||
* @return
|
||||
|
||||
Reference in new issue
Block a user