新增角色配置本部门及以下数据权限
This commit is contained in:
@ -39,6 +39,11 @@ public class DataScopeAspect
|
||||
*/
|
||||
public static final String DATA_SCOPE_DEPT = "3";
|
||||
|
||||
/**
|
||||
* 部门及以下数据权限
|
||||
*/
|
||||
public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
|
||||
|
||||
/**
|
||||
* 数据权限过滤关键字
|
||||
*/
|
||||
@ -105,6 +110,12 @@ public class DataScopeAspect
|
||||
{
|
||||
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", alias, user.getDeptId()));
|
||||
}
|
||||
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
||||
{
|
||||
sqlString.append(StringUtils.format(
|
||||
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or parent_id= {} )", alias,
|
||||
user.getDeptId(), user.getDeptId()));
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(sqlString.toString()))
|
||||
|
@ -80,7 +80,6 @@ public class GlobalExceptionHandler
|
||||
public Object businessException(HttpServletRequest request, BusinessException e)
|
||||
{
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
if (ServletUtils.isAjaxRequest(request))
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
|
Reference in New Issue
Block a user