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
45c51b11
Commit
45c51b11
authored
Mar 02, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改根据数据权限获取标签元数据接口
parent
e66c5c97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
10 deletions
+29
-10
RepoServiceClient.java
...va/com/keymobile/tagmanager/remote/RepoServiceClient.java
+11
-0
TagService.java
...ain/java/com/keymobile/tagmanager/service/TagService.java
+18
-10
No files found.
src/main/java/com/keymobile/tagmanager/remote/RepoServiceClient.java
View file @
45c51b11
...
...
@@ -32,6 +32,17 @@ public interface RepoServiceClient {
@RequestParam
int
pageNum
,
@RequestParam
int
pageSize
);
@PostMapping
(
value
=
"/getByTagByPrivileges"
)
public
List
<
Map
<
String
,
Object
>>
getByTagByPrivileges
(
@RequestBody
Map
<
Long
,
Set
<
String
>>
systemTagMap
,
@RequestParam
(
required
=
false
)
String
modelPath
,
@RequestParam
String
idPath
,
@RequestParam
String
tagType
,
@RequestParam
String
dimensionType
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
);
@PostMapping
(
value
=
"/rest/metadata/getByNamePathAndClass"
)
public
Map
<
String
,
Object
>
getMetaByNamePathAndClass
(
@RequestParam
String
claz
,
@RequestParam
String
namePath
);
...
...
src/main/java/com/keymobile/tagmanager/service/TagService.java
View file @
45c51b11
...
...
@@ -721,8 +721,8 @@ public class TagService {
//获取用户关联的数据权限
Map
<
Long
,
Set
<
String
>>
systemTagMap
=
GrantedAuthHelper
.
getDataPrivileges
();
//调用repo接口获取标签关联的元数据
Map
<
String
,
Object
>
tagData
=
repoService
.
get
TagMetadata
(
dimensionType
,
idPath
,
keyword
,
modelPath
,
pageNum
,
pageSize
,
tagTyp
e
);
Map
<
String
,
Object
>
tagData
=
repoService
.
get
PageByTag
(
systemTagMap
,
modelPath
,
idPath
,
tagType
,
dimensionType
,
keyword
,
pageNum
,
pageSiz
e
);
tagData
.
put
(
"systemTagMap"
,
systemTagMap
);
List
<
Map
<
String
,
Object
>>
content
=
(
List
<
Map
<
String
,
Object
>>)
tagData
.
get
(
"content"
);
//判断不是个人标签
...
...
@@ -759,10 +759,14 @@ public class TagService {
//根据当前用户被授予的标签获取关联的元数据
Set
<
String
>
tags
=
systemTagMap
.
get
(
Long
.
valueOf
(
sys
));
for
(
String
usrTag
:
tags
)
{
Map
<
String
,
Object
>
userTagData
=
repoService
.
getTagMetadata
(
"1"
,
usrTag
,
""
,
null
,
1
,
100000
,
"1"
);
List
<
Map
<
String
,
Object
>>
tagContent
=
(
List
<
Map
<
String
,
Object
>>)
userTagData
.
get
(
"content"
);
if
(
tagContent
.
contains
(
mData
))
{
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
getByTagByPrivileges
(
systemTagMap
,
null
,
usrTag
,
"1"
,
"1"
,
""
,
pageNum
,
pageSize
);
List
<
String
>
idList
=
new
ArrayList
<
String
>();
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
idList
.
add
(
map
.
get
(
"_id"
).
toString
());
}
if
(
idList
.
contains
(
mData
.
get
(
"_id"
)))
{
mData
.
put
(
"operable"
,
"1"
);
}
}
...
...
@@ -790,10 +794,14 @@ public class TagService {
mData
.
put
(
"operable"
,
"1"
);
}
else
{
for
(
String
usrTag
:
tagList
)
{
Map
<
String
,
Object
>
userTagData
=
repoService
.
getTagMetadata
(
"1"
,
usrTag
,
""
,
modelPath
,
1
,
100000
,
"1"
);
List
<
Map
<
String
,
Object
>>
tagContent
=
(
List
<
Map
<
String
,
Object
>>)
userTagData
.
get
(
"content"
);
if
(
tagContent
.
contains
(
mData
))
{
List
<
Map
<
String
,
Object
>>
tagContent
=
repoService
.
getByTagByPrivileges
(
systemTagMap
,
modelPath
,
usrTag
,
"1"
,
"1"
,
""
,
pageNum
,
pageSize
);
List
<
String
>
idList
=
new
ArrayList
<
String
>();
for
(
Map
<
String
,
Object
>
map
:
tagContent
)
{
idList
.
add
(
map
.
get
(
"_id"
).
toString
());
}
if
(
idList
.
contains
(
mData
.
get
(
"_id"
)))
{
mData
.
put
(
"operable"
,
"1"
);
}
}
...
...
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