From 6ee7395c87b6fb19b32c163d07ec8d04af8abea2 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期三, 09 三月 2022 10:09:49 +0800 Subject: [PATCH] 文件上传兼容Weblogic环境 --- src/main/java/com/ruoyi/project/system/controller/SysDeptController.java | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java b/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java index e549a43..953747c 100644 --- a/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java +++ b/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -75,6 +74,7 @@ @GetMapping(value = "/{deptId}") public AjaxResult getInfo(@PathVariable Long deptId) { + deptService.checkDeptDataScope(deptId); return AjaxResult.success(deptService.selectDeptById(deptId)); } @@ -113,7 +113,7 @@ { return AjaxResult.error("鏂板閮ㄩ棬'" + dept.getDeptName() + "'澶辫触锛岄儴闂ㄥ悕绉板凡瀛樺湪"); } - dept.setCreateBy(SecurityUtils.getUsername()); + dept.setCreateBy(getUsername()); return toAjax(deptService.insertDept(dept)); } @@ -125,20 +125,21 @@ @PutMapping public AjaxResult edit(@Validated @RequestBody SysDept dept) { + Long deptId = dept.getDeptId(); + deptService.checkDeptDataScope(deptId); if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) { return AjaxResult.error("淇敼閮ㄩ棬'" + dept.getDeptName() + "'澶辫触锛岄儴闂ㄥ悕绉板凡瀛樺湪"); } - else if (dept.getParentId().equals(dept.getDeptId())) + else if (dept.getParentId().equals(deptId)) { return AjaxResult.error("淇敼閮ㄩ棬'" + dept.getDeptName() + "'澶辫触锛屼笂绾ч儴闂ㄤ笉鑳芥槸鑷繁"); } - else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) - && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) + else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) { return AjaxResult.error("璇ラ儴闂ㄥ寘鍚湭鍋滅敤鐨勫瓙閮ㄩ棬锛�"); } - dept.setUpdateBy(SecurityUtils.getUsername()); + dept.setUpdateBy(getUsername()); return toAjax(deptService.updateDept(dept)); } @@ -158,6 +159,7 @@ { return AjaxResult.error("閮ㄩ棬瀛樺湪鐢ㄦ埛,涓嶅厑璁稿垹闄�"); } + deptService.checkDeptDataScope(deptId); return toAjax(deptService.deleteDeptById(deptId)); } } -- Gitblit v1.9.3