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
1bb3bc61
Commit
1bb3bc61
authored
Mar 05, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
还原代码
parent
5a4a632d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
29 deletions
+3
-29
TagCtrl.java
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
+0
-6
TagService.java
...ain/java/com/keymobile/tagmanager/service/TagService.java
+3
-11
JsonTreeHelper.java
...in/java/com/keymobile/tagmanager/util/JsonTreeHelper.java
+0
-12
No files found.
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
View file @
1bb3bc61
...
...
@@ -273,12 +273,6 @@ public class TagCtrl {
pageNum
,
pageSize
,
tagType
);
}
@ApiOperation
(
value
=
"根据标签id获取标签下的子节点总数"
,
notes
=
"根据标签id获取标签下的子节点总数"
)
@PostMapping
(
value
=
"/getChildTagCount"
)
public
int
getChildTagCount
(
@RequestParam
String
tagId
)
{
return
tagService
.
getChildCountByTagId
(
tagId
);
}
//---------------以下为导入系统的时候用到------------------
@ApiOperation
(
value
=
"查询系统标签"
,
notes
=
"查询系统标签"
)
...
...
src/main/java/com/keymobile/tagmanager/service/TagService.java
View file @
1bb3bc61
...
...
@@ -144,8 +144,7 @@ public class TagService {
List
<
JsonNode
>
nodes
=
new
ArrayList
<>();
tags
.
forEach
(
p
->
{
JsonNode
node
=
new
JsonNode
(
p
.
getPath
(),
p
.
getId
(),
p
.
getPath
(),
p
.
getIdPath
(),
p
.
getTagType
(),
p
.
getDimensionType
(),
this
.
getChildCountByTagId
(
p
.
getId
()));
p
.
getPath
(),
p
.
getIdPath
(),
p
.
getTagType
(),
p
.
getDimensionType
());
nodes
.
add
(
node
);
});
//自定拼接成树结构
...
...
@@ -183,7 +182,7 @@ public class TagService {
List
<
JsonNode
>
nodes
=
new
ArrayList
<>();
tags
.
forEach
(
p
->
{
JsonNode
node
=
new
JsonNode
(
p
.
getPath
(),
p
.
getId
(),
p
.
getPath
(),
p
.
getIdPath
()
,
p
.
getTagType
(),
p
.
getDimensionType
()
,
this
.
getChildCountByTagId
(
p
.
getId
())
);
,
p
.
getTagType
(),
p
.
getDimensionType
());
nodes
.
add
(
node
);
});
JsonNode
root
=
JsonTreeHelper
.
toJsonTree
(
nodes
,
Constants
.
TAG_PATH_SEPARATOR
);
...
...
@@ -301,7 +300,7 @@ public class TagService {
List
<
JsonNode
>
nodes
=
new
ArrayList
<>();
tags
.
forEach
(
p
->
{
JsonNode
node
=
new
JsonNode
(
p
.
getPath
(),
p
.
getId
(),
p
.
getPath
(),
p
.
getIdPath
()
,
p
.
getTagType
(),
p
.
getDimensionType
()
,
this
.
getChildCountByTagId
(
p
.
getId
())
);
,
p
.
getTagType
(),
p
.
getDimensionType
());
nodes
.
add
(
node
);
});
JsonNode
root
=
JsonTreeHelper
.
toJsonTree
(
nodes
,
Constants
.
TAG_PATH_SEPARATOR
);
...
...
@@ -882,13 +881,6 @@ public class TagService {
return
false
;
}
//author:zhangkb time:2020-3-5 desc:根据标签id获取标签子节点数量
public
int
getChildCountByTagId
(
String
tagId
)
{
List
<
Tag
>
dirs
=
mongoOperations
.
find
(
new
Query
().
addCriteria
(
Criteria
.
where
(
"idPath"
)
.
regex
(
"^"
+
tagId
+
Constants
.
TAG_PATH_SEPARATOR
)),
Tag
.
class
);
return
dirs
.
size
();
}
...
...
src/main/java/com/keymobile/tagmanager/util/JsonTreeHelper.java
View file @
1bb3bc61
...
...
@@ -13,7 +13,6 @@ public class JsonTreeHelper {
public
String
path
;
public
String
idPath
;
public
String
dimensionType
;
public
int
childCount
;
//author:zhangkb time:2020-3-5 desc:添加标签子标签数量字段
public
JsonNode
(
String
text
)
{
this
.
text
=
text
;
...
...
@@ -42,17 +41,6 @@ public class JsonTreeHelper {
this
.
dimensionType
=
dimensionType
;
}
public
JsonNode
(
String
text
,
String
nodeId
,
String
path
,
String
idPath
,
String
tagType
,
String
dimensionType
,
int
childCount
)
{
this
.
text
=
text
;
this
.
path
=
path
;
this
.
nodeId
=
nodeId
;
this
.
idPath
=
idPath
;
this
.
tagType
=
tagType
;
this
.
dimensionType
=
dimensionType
;
this
.
childCount
=
childCount
;
}
public
void
addChild
(
JsonNode
child
)
{
if
(
children
==
null
)
{
children
=
new
JsonNode
[]
{
child
};
...
...
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