Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
707d52a5
Commit
707d52a5
authored
Jan 04, 2022
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐患数据权限修改
parent
a0a5554a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
8 deletions
+36
-8
PermissionInterceptor.java
...s/boot/biz/common/interceptors/PermissionInterceptor.java
+25
-2
LatentDangerServiceImpl.java
...danger/business/service/impl/LatentDangerServiceImpl.java
+2
-1
HiddenDangerServiceImpl.java
...vision/business/service/impl/HiddenDangerServiceImpl.java
+9
-5
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptor.java
View file @
707d52a5
...
...
@@ -55,6 +55,8 @@ public class PermissionInterceptor implements Interceptor {
@Autowired
RedisUtils
redisUtils
;
private
String
falseCondition
=
" 1=2"
;
@Override
public
Object
intercept
(
Invocation
invocation
)
throws
Throwable
{
StatementHandler
statementHandler
=
PluginUtils
.
realTarget
(
invocation
.
getTarget
());
...
...
@@ -190,7 +192,7 @@ public class PermissionInterceptor implements Interceptor {
dataAuthorization
.
entrySet
().
stream
().
filter
(
map
->
!
ValidationUtil
.
isEmpty
(
map
.
getValue
())).
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
));
// 没有配置数据权限直接返回 false 条件
if
(
ValidationUtil
.
isEmpty
(
nonEmptyDataAuthorization
))
{
authSql
=
" 1=2"
;
authSql
=
falseCondition
;
}
else
{
// 解析数据权限sql
authSql
=
parseDataAuthorization
(
nonEmptyDataAuthorization
,
reginParams
,
mainTableAlias
,
boundSql
);
...
...
@@ -302,7 +304,8 @@ public class PermissionInterceptor implements Interceptor {
getRuleValue
(
rule
,
reginParam
,
boundSql
))
+
"'"
;
}
else
{
// 包含
authSql
=
mainTableAlias
+
"."
+
rule
.
getRuleColumn
()
+
" like '"
+
getRuleValue
(
rule
,
reginParam
,
boundSql
)
+
"'"
;
authSql
=
mainTableAlias
+
"."
+
rule
.
getRuleColumn
()
+
" like '%"
+
getRuleValue
(
rule
,
reginParam
,
boundSql
)
+
"%'"
;
}
}
else
{
// =; >; >=; <; <=; !=
...
...
@@ -336,6 +339,26 @@ public class PermissionInterceptor implements Interceptor {
String
attrName
=
ruleValue
.
substring
(
2
,
ruleValue
.
length
()
-
1
);
ruleValue
=
ValidationUtil
.
isEmpty
(
map
.
get
(
attrName
))
?
""
:
map
.
get
(
attrName
).
toString
();
}
// 从查询参数中获取json字段参数值
if
(
rule
.
getRuleColumn
().
contains
(
"->"
))
{
Map
<
String
,
Object
>
map
;
Map
<
String
,
Object
>
map2
=
Maps
.
newHashMap
();
if
(
boundSql
.
getParameterObject
()
instanceof
Map
)
{
map
=
(
Map
<
String
,
Object
>)
boundSql
.
getParameterObject
();
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
if
(
entry
.
getValue
()
instanceof
Map
)
{
map2
.
putAll
((
Map
<?
extends
String
,
?>)
entry
.
getValue
());
}
}
map
.
putAll
(
map2
);
}
else
{
map
=
Bean
.
BeantoMap
(
boundSql
.
getParameterObject
());
}
if
(
map
.
containsKey
(
ruleValue
))
{
ruleValue
=
ValidationUtil
.
isEmpty
(
map
.
get
(
ruleValue
))
?
falseCondition
:
map
.
get
(
ruleValue
).
toString
();
}
}
return
ruleValue
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/LatentDangerServiceImpl.java
View file @
707d52a5
...
...
@@ -1917,10 +1917,11 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
pageParam
.
put
(
"leadPeopleId"
,
jcsUserId
);
// 登录人为整改责任人
pageParam
.
put
(
"reformLeaderId"
,
jcsUserId
);
// 登录人单位
pageParam
.
put
(
"bizOrgCode"
,
person
.
get
(
"bizOrgCode"
).
toString
().
substring
(
0
,
6
));
}
}
Page
page
=
new
Page
(
pageParam
.
getParamPageCurrent
(),
pageParam
.
getParamPageSize
());
IPage
<
LatentDanger
>
iPage
=
this
.
baseMapper
.
selectPageByParam
(
page
,
(
Map
<
String
,
Object
>)
pageParam
);
if
(
iPage
.
getCurrent
()
!=
pageParam
.
getParamPageCurrent
())
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/HiddenDangerServiceImpl.java
View file @
707d52a5
...
...
@@ -288,13 +288,17 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
result
.
put
(
"bizId"
,
hiddenDangerDto
.
getCheckInputId
());
result
.
put
(
"bizName"
,
hiddenDangerDto
.
getInputItemName
());
result
.
put
(
"routeId"
,
plan
.
getRouteId
());
result
.
put
(
"accompanyingUserId"
,
plan
.
getLeadPeopleIds
());
result
.
put
(
"accompanyingUserName"
,
plan
.
getLeadPeopleNames
());
result
.
put
(
"accompanyingUserId"
,
plan
.
getLeadPeopleIds
());
// 检查陪同人id
result
.
put
(
"accompanyingUserName"
,
plan
.
getLeadPeopleNames
());
// 检查陪同人名称
result
.
put
(
"checkUnitId"
,
plan
.
getCheckUnitId
());
result
.
put
(
"checkUnitName"
,
plan
.
getCheckUnitName
());
result
.
put
(
"leadPeopleId"
,
plan
.
getLeadPeopleIds
());
result
.
put
(
"leadPeopleName"
,
plan
.
getLeadPeopleNames
());
// TODO tb 将机场单位bizOrgCode保存起来用于数据过滤
result
.
put
(
"leadPeopleId"
,
plan
.
getLeadPeopleIds
());
// 牵头人id
result
.
put
(
"leadPeopleName"
,
plan
.
getLeadPeopleNames
());
// 牵头人名称
result
.
put
(
"makerUserId"
,
plan
.
getMakerUserId
());
// 计划制定人id
result
.
put
(
"makerUserName"
,
plan
.
getMakerUserName
());
// 计划制定人名称
result
.
put
(
"userId"
,
plan
.
getUserId
());
// 检查参与人id
result
.
put
(
"userIdName"
,
plan
.
getUserName
());
// 检查参与人名称
// 将机场单位bizOrgCode保存起来用于按机场单位数据过滤
FeignClientResult
<
Map
<
String
,
Object
>>
companyResult
=
jcsFeignClient
.
getCompanyById
(
point
.
getOriginalId
());
if
(!
ValidationUtil
.
isEmpty
(
companyResult
))
{
result
.
put
(
"bizOrgCode"
,
companyResult
.
getResult
().
get
(
"bizOrgCode"
));
...
...
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