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
06bf1140
Commit
06bf1140
authored
Jan 10, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改加载标签兼容一个用户多个机构情况
parent
ac28d254
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
TagCtrl.java
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
+21
-7
TagService.java
...ain/java/com/keymobile/tagmanager/service/TagService.java
+0
-0
No files found.
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
View file @
06bf1140
package
com
.
keymobile
.
tagmanager
.
api
;
package
com
.
keymobile
.
tagmanager
.
api
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -15,7 +15,6 @@ import com.keymobile.tagmanager.model.SysTag;
...
@@ -15,7 +15,6 @@ import com.keymobile.tagmanager.model.SysTag;
import
com.keymobile.tagmanager.model.Tag
;
import
com.keymobile.tagmanager.model.Tag
;
import
com.keymobile.tagmanager.service.TagService
;
import
com.keymobile.tagmanager.service.TagService
;
import
com.keymobile.tagmanager.util.JsonTreeHelper.JsonNode
;
import
com.keymobile.tagmanager.util.JsonTreeHelper.JsonNode
;
import
com.keymobile.tagmanager.util.Constants
;
import
com.keymobile.tagmanager.util.UserInfoUtils
;
import
com.keymobile.tagmanager.util.UserInfoUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -74,7 +73,10 @@ public class TagCtrl {
...
@@ -74,7 +73,10 @@ public class TagCtrl {
@RequestParam
(
required
=
false
)
String
deptIdPath
)
throws
TagNotExistException
{
@RequestParam
(
required
=
false
)
String
deptIdPath
)
throws
TagNotExistException
{
//获取当前登录用户机构
//获取当前登录用户机构
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
return
tagService
.
queryDimensionTagAsTree
(
deptIdPath
,
parentId
);
//考虑一个用户对应多个机构的情况
List
<
String
>
orgIds
=
new
ArrayList
<>();
orgIds
.
add
(
deptIdPath
);
return
tagService
.
queryDimensionTagAsTree
(
orgIds
,
parentId
);
}
}
@ApiOperation
(
value
=
"获取个人标签树"
,
notes
=
"获取个人标签树"
)
@ApiOperation
(
value
=
"获取个人标签树"
,
notes
=
"获取个人标签树"
)
...
@@ -84,9 +86,12 @@ public class TagCtrl {
...
@@ -84,9 +86,12 @@ public class TagCtrl {
@RequestParam
(
required
=
false
)
String
deptIdPath
)
throws
TagNotExistException
{
@RequestParam
(
required
=
false
)
String
deptIdPath
)
throws
TagNotExistException
{
//获取当前登录用户机构id
//获取当前登录用户机构id
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
//考虑一个用户对应多个机构的情况
List
<
String
>
orgIds
=
new
ArrayList
<>();
orgIds
.
add
(
deptIdPath
);
//获取当前登录用户id
//获取当前登录用户id
String
userId
=
UserInfoUtils
.
getUserId
();
String
userId
=
UserInfoUtils
.
getUserId
();
return
tagService
.
queryPersonalTagAsTree
(
parentId
,
userId
,
deptIdPath
);
return
tagService
.
queryPersonalTagAsTree
(
parentId
,
userId
,
orgIds
);
}
}
@ApiOperation
(
value
=
"搜索维度标签里面的个人标签"
,
notes
=
"搜索维度标签里面的个人标签"
)
@ApiOperation
(
value
=
"搜索维度标签里面的个人标签"
,
notes
=
"搜索维度标签里面的个人标签"
)
...
@@ -100,7 +105,10 @@ public class TagCtrl {
...
@@ -100,7 +105,10 @@ public class TagCtrl {
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
throws
TagNotExistException
{
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
throws
TagNotExistException
{
String
userName
=
UserInfoUtils
.
getUserId
();
String
userName
=
UserInfoUtils
.
getUserId
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
return
tagService
.
searchPersonalDimensionTagByPage
(
userName
,
deptIdPath
,
keyword
,
//考虑一个用户对应多个机构的情况
List
<
String
>
orgIds
=
new
ArrayList
<>();
orgIds
.
add
(
deptIdPath
);
return
tagService
.
searchPersonalDimensionTagByPage
(
userName
,
orgIds
,
keyword
,
path
,
domain
,
new
Page
(
pageSize
,
pageNo
));
path
,
domain
,
new
Page
(
pageSize
,
pageNo
));
}
}
...
@@ -114,7 +122,10 @@ public class TagCtrl {
...
@@ -114,7 +122,10 @@ public class TagCtrl {
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
throws
TagNotExistException
{
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
throws
TagNotExistException
{
String
userName
=
UserInfoUtils
.
getUserId
();
String
userName
=
UserInfoUtils
.
getUserId
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
return
tagService
.
searchPersonalTagByPage
(
userName
,
deptIdPath
,
keyword
,
path
,
domain
,
new
Page
(
pageSize
,
pageNo
));
//考虑一个用户对应多个机构的情况
List
<
String
>
orgIds
=
new
ArrayList
<>();
orgIds
.
add
(
deptIdPath
);
return
tagService
.
searchPersonalTagByPage
(
userName
,
orgIds
,
keyword
,
path
,
domain
,
new
Page
(
pageSize
,
pageNo
));
}
}
// @PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_admin')].size() > 0")
// @PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_admin')].size() > 0")
...
@@ -142,7 +153,10 @@ public class TagCtrl {
...
@@ -142,7 +153,10 @@ public class TagCtrl {
@RequestParam
(
required
=
false
)
String
deptIdPath
)
throws
TagNotExistException
{
@RequestParam
(
required
=
false
)
String
deptIdPath
)
throws
TagNotExistException
{
String
userName
=
UserInfoUtils
.
getUserId
();
String
userName
=
UserInfoUtils
.
getUserId
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
deptIdPath
=
UserInfoUtils
.
getDataRoleOrg
();
return
tagService
.
queryPersonalTagExcludeOpenTypeAsTree
(
parentId
,
userName
,
deptIdPath
);
//考虑一个用户对应多个机构的情况
List
<
String
>
orgIds
=
new
ArrayList
<>();
orgIds
.
add
(
deptIdPath
);
return
tagService
.
queryPersonalTagExcludeOpenTypeAsTree
(
parentId
,
userName
,
orgIds
);
}
}
@ApiOperation
(
value
=
"分享/取消分享标签(0:取消分享 1:分享)"
,
notes
=
"分享/取消分享标签(0:取消分享 1:分享)"
)
@ApiOperation
(
value
=
"分享/取消分享标签(0:取消分享 1:分享)"
,
notes
=
"分享/取消分享标签(0:取消分享 1:分享)"
)
...
...
src/main/java/com/keymobile/tagmanager/service/TagService.java
View file @
06bf1140
This diff is collapsed.
Click to expand it.
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