Commit 1bb3bc61 by zhangkb

还原代码

parent 5a4a632d
...@@ -273,12 +273,6 @@ public class TagCtrl { ...@@ -273,12 +273,6 @@ public class TagCtrl {
pageNum, pageSize, tagType); pageNum, pageSize, tagType);
} }
@ApiOperation(value = "根据标签id获取标签下的子节点总数", notes = "根据标签id获取标签下的子节点总数")
@PostMapping(value = "/getChildTagCount")
public int getChildTagCount(@RequestParam String tagId) {
return tagService.getChildCountByTagId(tagId);
}
//---------------以下为导入系统的时候用到------------------ //---------------以下为导入系统的时候用到------------------
@ApiOperation(value = "查询系统标签", notes = "查询系统标签") @ApiOperation(value = "查询系统标签", notes = "查询系统标签")
......
...@@ -144,8 +144,7 @@ public class TagService { ...@@ -144,8 +144,7 @@ public class TagService {
List<JsonNode> nodes = new ArrayList<>(); List<JsonNode> nodes = new ArrayList<>();
tags.forEach(p -> { tags.forEach(p -> {
JsonNode node = new JsonNode(p.getPath(), p.getId(), JsonNode node = new JsonNode(p.getPath(), p.getId(),
p.getPath(), p.getIdPath(),p.getTagType(),p.getDimensionType(), p.getPath(), p.getIdPath(),p.getTagType(),p.getDimensionType());
this.getChildCountByTagId(p.getId()));
nodes.add(node); nodes.add(node);
}); });
//自定拼接成树结构 //自定拼接成树结构
...@@ -183,7 +182,7 @@ public class TagService { ...@@ -183,7 +182,7 @@ public class TagService {
List<JsonNode> nodes = new ArrayList<>(); List<JsonNode> nodes = new ArrayList<>();
tags.forEach(p -> { tags.forEach(p -> {
JsonNode node = new JsonNode(p.getPath(), p.getId(), p.getPath(), p.getIdPath() 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); nodes.add(node);
}); });
JsonNode root = JsonTreeHelper.toJsonTree(nodes, Constants.TAG_PATH_SEPARATOR); JsonNode root = JsonTreeHelper.toJsonTree(nodes, Constants.TAG_PATH_SEPARATOR);
...@@ -301,7 +300,7 @@ public class TagService { ...@@ -301,7 +300,7 @@ public class TagService {
List<JsonNode> nodes = new ArrayList<>(); List<JsonNode> nodes = new ArrayList<>();
tags.forEach(p -> { tags.forEach(p -> {
JsonNode node = new JsonNode(p.getPath(), p.getId(), p.getPath(), p.getIdPath() 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); nodes.add(node);
}); });
JsonNode root = JsonTreeHelper.toJsonTree(nodes, Constants.TAG_PATH_SEPARATOR); JsonNode root = JsonTreeHelper.toJsonTree(nodes, Constants.TAG_PATH_SEPARATOR);
...@@ -882,13 +881,6 @@ public class TagService { ...@@ -882,13 +881,6 @@ public class TagService {
return false; 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();
}
......
...@@ -13,7 +13,6 @@ public class JsonTreeHelper { ...@@ -13,7 +13,6 @@ public class JsonTreeHelper {
public String path; public String path;
public String idPath; public String idPath;
public String dimensionType; public String dimensionType;
public int childCount;//author:zhangkb time:2020-3-5 desc:添加标签子标签数量字段
public JsonNode(String text) { public JsonNode(String text) {
this.text = text; this.text = text;
...@@ -42,17 +41,6 @@ public class JsonTreeHelper { ...@@ -42,17 +41,6 @@ public class JsonTreeHelper {
this.dimensionType = dimensionType; 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) { public void addChild(JsonNode child) {
if (children == null) { if (children == null) {
children = new JsonNode[] { child }; children = new JsonNode[] { child };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment