Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
ec407bbe
Commit
ec407bbe
authored
Jun 03, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据范围过滤属性调整
parent
b4b3ff88
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
17 deletions
+9
-17
ruoyi/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
...ain/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
+6
-1
ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
.../main/java/com/ruoyi/framework/web/domain/BaseEntity.java
+0
-13
ruoyi/src/main/resources/mybatis/system/SysDeptMapper.xml
ruoyi/src/main/resources/mybatis/system/SysDeptMapper.xml
+1
-1
ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml
ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml
+1
-1
ruoyi/src/main/resources/mybatis/system/SysUserMapper.xml
ruoyi/src/main/resources/mybatis/system/SysUserMapper.xml
+1
-1
No files found.
ruoyi/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
View file @
ec407bbe
...
@@ -52,6 +52,11 @@ public class DataScopeAspect
...
@@ -52,6 +52,11 @@ public class DataScopeAspect
*/
*/
public
static
final
String
DATA_SCOPE_SELF
=
"5"
;
public
static
final
String
DATA_SCOPE_SELF
=
"5"
;
/**
* 数据权限过滤关键字
*/
public
static
final
String
DATA_SCOPE
=
"dataScope"
;
// 配置织入点
// 配置织入点
@Pointcut
(
"@annotation(com.ruoyi.framework.aspectj.lang.annotation.DataScope)"
)
@Pointcut
(
"@annotation(com.ruoyi.framework.aspectj.lang.annotation.DataScope)"
)
public
void
dataScopePointCut
()
public
void
dataScopePointCut
()
...
@@ -138,7 +143,7 @@ public class DataScopeAspect
...
@@ -138,7 +143,7 @@ public class DataScopeAspect
if
(
StringUtils
.
isNotBlank
(
sqlString
.
toString
()))
if
(
StringUtils
.
isNotBlank
(
sqlString
.
toString
()))
{
{
BaseEntity
baseEntity
=
(
BaseEntity
)
joinPoint
.
getArgs
()[
0
];
BaseEntity
baseEntity
=
(
BaseEntity
)
joinPoint
.
getArgs
()[
0
];
baseEntity
.
setDataScope
(
" AND ("
+
sqlString
.
substring
(
4
)
+
")"
);
baseEntity
.
getParams
().
put
(
DATA_SCOPE
,
" AND ("
+
sqlString
.
substring
(
4
)
+
")"
);
}
}
}
}
...
...
ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
View file @
ec407bbe
...
@@ -36,9 +36,6 @@ public class BaseEntity implements Serializable
...
@@ -36,9 +36,6 @@ public class BaseEntity implements Serializable
/** 备注 */
/** 备注 */
private
String
remark
;
private
String
remark
;
/** 数据权限 */
private
String
dataScope
;
/** 开始时间 */
/** 开始时间 */
@JsonIgnore
@JsonIgnore
private
String
beginTime
;
private
String
beginTime
;
...
@@ -110,16 +107,6 @@ public class BaseEntity implements Serializable
...
@@ -110,16 +107,6 @@ public class BaseEntity implements Serializable
this
.
remark
=
remark
;
this
.
remark
=
remark
;
}
}
public
String
getDataScope
()
{
return
dataScope
;
}
public
void
setDataScope
(
String
dataScope
)
{
this
.
dataScope
=
dataScope
;
}
public
String
getBeginTime
()
public
String
getBeginTime
()
{
{
return
beginTime
;
return
beginTime
;
...
...
ruoyi/src/main/resources/mybatis/system/SysDeptMapper.xml
View file @
ec407bbe
...
@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND status = #{status}
AND status = #{status}
</if>
</if>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
${dataScope}
${
params.
dataScope}
order by d.parent_id, d.order_num
order by d.parent_id, d.order_num
</select>
</select>
...
...
ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml
View file @
ec407bbe
...
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and date_format(r.create_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
and date_format(r.create_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
</if>
</if>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
${dataScope}
${
params.
dataScope}
order by r.role_sort
order by r.role_sort
</select>
</select>
...
...
ruoyi/src/main/resources/mybatis/system/SysUserMapper.xml
View file @
ec407bbe
...
@@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
</if>
</if>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
${dataScope}
${
params.
dataScope}
</select>
</select>
<select
id=
"selectUserByUserName"
parameterType=
"String"
resultMap=
"SysUserResult"
>
<select
id=
"selectUserByUserName"
parameterType=
"String"
resultMap=
"SysUserResult"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment