Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tagManager
Overview
Overview
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
lanmw
tagManager
Commits
845adc66
Commit
845adc66
authored
Mar 02, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户权限接口之前返回是标签idPath,现在改成返回标签id,所以涉及相关代码修改
parent
96ae3889
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
TagCtrl.java
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
+1
-1
TagService.java
...ain/java/com/keymobile/tagmanager/service/TagService.java
+14
-4
No files found.
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
View file @
845adc66
...
@@ -268,7 +268,7 @@ public class TagCtrl {
...
@@ -268,7 +268,7 @@ public class TagCtrl {
public
Map
<
String
,
Object
>
getTagMetadataWithDataPrivilege
(
@RequestParam
String
dimensionType
,
public
Map
<
String
,
Object
>
getTagMetadataWithDataPrivilege
(
@RequestParam
String
dimensionType
,
@RequestParam
String
idPath
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
String
idPath
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
required
=
false
)
String
modelPath
,
@RequestParam
int
pageNum
,
@RequestParam
(
required
=
false
)
String
modelPath
,
@RequestParam
int
pageNum
,
@RequestParam
int
pageSize
,
@RequestParam
String
tagType
){
@RequestParam
int
pageSize
,
@RequestParam
String
tagType
)
throws
Exception
{
return
tagService
.
getTagMetadataWithDataPrivilege
(
dimensionType
,
idPath
,
keyword
,
modelPath
,
return
tagService
.
getTagMetadataWithDataPrivilege
(
dimensionType
,
idPath
,
keyword
,
modelPath
,
pageNum
,
pageSize
,
tagType
);
pageNum
,
pageSize
,
tagType
);
}
}
...
...
src/main/java/com/keymobile/tagmanager/service/TagService.java
View file @
845adc66
...
@@ -716,7 +716,7 @@ public class TagService {
...
@@ -716,7 +716,7 @@ public class TagService {
//根据授予的元数据数据权限过滤标签关联的元数据
//根据授予的元数据数据权限过滤标签关联的元数据
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
Map
<
String
,
Object
>
getTagMetadataWithDataPrivilege
(
String
dimensionType
,
String
idPath
,
public
Map
<
String
,
Object
>
getTagMetadataWithDataPrivilege
(
String
dimensionType
,
String
idPath
,
String
keyword
,
String
modelPath
,
int
pageNum
,
int
pageSize
,
String
tagType
){
String
keyword
,
String
modelPath
,
int
pageNum
,
int
pageSize
,
String
tagType
)
throws
Exception
{
//获取用户关联的数据权限
//获取用户关联的数据权限
Map
<
Long
,
Set
<
String
>>
systemTagMap
=
GrantedAuthHelper
.
getDataPrivileges
();
Map
<
Long
,
Set
<
String
>>
systemTagMap
=
GrantedAuthHelper
.
getDataPrivileges
();
logger
.
info
(
"tag metadata user privilege:"
+
systemTagMap
);
logger
.
info
(
"tag metadata user privilege:"
+
systemTagMap
);
...
@@ -758,8 +758,10 @@ public class TagService {
...
@@ -758,8 +758,10 @@ public class TagService {
//根据当前用户被授予的标签获取关联的元数据
//根据当前用户被授予的标签获取关联的元数据
Set
<
String
>
tags
=
systemTagMap
.
get
(
Long
.
valueOf
(
sys
));
Set
<
String
>
tags
=
systemTagMap
.
get
(
Long
.
valueOf
(
sys
));
for
(
String
usrTag
:
tags
)
{
for
(
String
usrTag
:
tags
)
{
//根据标签id获取标签
Tag
tag
=
this
.
getTagById
(
usrTag
);
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
getByTagByPrivileges
(
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
getByTagByPrivileges
(
systemTagMap
,
null
,
usrTag
,
"1"
,
"1"
,
""
,
systemTagMap
,
null
,
tag
.
getIdPath
()
,
"1"
,
"1"
,
""
,
pageNum
,
pageSize
);
pageNum
,
pageSize
);
List
<
String
>
idList
=
new
ArrayList
<
String
>();
List
<
String
>
idList
=
new
ArrayList
<
String
>();
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
...
@@ -793,8 +795,10 @@ public class TagService {
...
@@ -793,8 +795,10 @@ public class TagService {
mData
.
put
(
"operable"
,
"1"
);
mData
.
put
(
"operable"
,
"1"
);
}
else
{
}
else
{
for
(
String
usrTag
:
tagList
)
{
for
(
String
usrTag
:
tagList
)
{
//根据标签id获取标签
Tag
tag
=
this
.
getTagById
(
usrTag
);
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
getByTagByPrivileges
(
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
getByTagByPrivileges
(
systemTagMap
,
modelPath
,
usrTag
,
"1"
,
"1"
,
""
,
systemTagMap
,
modelPath
,
tag
.
getIdPath
()
,
"1"
,
"1"
,
""
,
pageNum
,
pageSize
);
pageNum
,
pageSize
);
List
<
String
>
idList
=
new
ArrayList
<
String
>();
List
<
String
>
idList
=
new
ArrayList
<
String
>();
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
...
@@ -847,9 +851,12 @@ public class TagService {
...
@@ -847,9 +851,12 @@ public class TagService {
//根据当前用户被授予的标签获取关联的元数据
//根据当前用户被授予的标签获取关联的元数据
Set
<
String
>
tags
=
systemTagMap
.
get
(
Long
.
valueOf
(
sys
));
Set
<
String
>
tags
=
systemTagMap
.
get
(
Long
.
valueOf
(
sys
));
for
(
String
usrTag
:
tags
)
{
for
(
String
usrTag
:
tags
)
{
//根据标签id获取标签
try
{
Tag
uTag
=
this
.
getTagById
(
usrTag
);
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
getByTagByPrivileges
(
systemTagMap
,
null
,
getByTagByPrivileges
(
systemTagMap
,
null
,
usrTag
,
"1"
,
"1"
,
""
,
1
,
10
);
uTag
.
getIdPath
()
,
"1"
,
"1"
,
""
,
1
,
10
);
List
<
String
>
idList
=
new
ArrayList
<>();
List
<
String
>
idList
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
idList
.
add
(
map
.
get
(
"_id"
).
toString
());
idList
.
add
(
map
.
get
(
"_id"
).
toString
());
...
@@ -857,6 +864,9 @@ public class TagService {
...
@@ -857,6 +864,9 @@ public class TagService {
if
(
idList
.
contains
(
mData
.
get
(
"_id"
)))
{
if
(
idList
.
contains
(
mData
.
get
(
"_id"
)))
{
return
true
;
return
true
;
}
}
}
catch
(
TagNotExistException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
}
...
...
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