Commit 1b2b8ca4 by zhangkb

标签分析接口逻辑修改,添加自定义标签分析结果

parent 8b544fd1
...@@ -359,6 +359,10 @@ public class TagService { ...@@ -359,6 +359,10 @@ public class TagService {
List<Map<String,Object>> dimTagList = new ArrayList<>(); List<Map<String,Object>> dimTagList = new ArrayList<>();
//定义存储自定义标签list<Map> //定义存储自定义标签list<Map>
List<Map<String,Object>> perTagList = new ArrayList<>(); List<Map<String,Object>> perTagList = new ArrayList<>();
//author:zhangkb time:2020-3-18 desc:添加自定义listMap
List<Map<String,Object>> customList = new ArrayList<>();
//根据类型获取模型路径 //根据类型获取模型路径
switch(dataType) { switch(dataType) {
case "0": case "0":
...@@ -417,13 +421,33 @@ public class TagService { ...@@ -417,13 +421,33 @@ public class TagService {
tag = null; tag = null;
} }
if(tag!=null) { if(tag!=null) {
tagMap.put("total",map.get("total")); //如果是个人标签,加入统计
tagMap.put("name", tag.getName()); if("0".equals(tag.getDimensionType())&&"1".equals(tag.getTagType())) {
tagMap.put("EnName", tag.getNameEn()); tagMap.put("total",map.get("total"));
perTagList.add(tagMap); tagMap.put("name", tag.getName());
tagMap.put("EnName", tag.getNameEn());
perTagList.add(tagMap);
}
} }
} }
} }
//自定义标签=维度标签+个人标签
customList.addAll(dimTagList);
customList.addAll(perTagList);
//排序自定义标签
if(!customList.isEmpty()) {
Collections.sort(customList, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
int total1 = Integer.parseInt(o1.get("total").toString());
int total2 = Integer.parseInt(o2.get("total").toString());
return total2-total1;
}
});
}
//排序系统标签(降序) //排序系统标签(降序)
if(!sysTagList.isEmpty()) { if(!sysTagList.isEmpty()) {
Collections.sort(sysTagList, new Comparator<Map<String, Object>>() { Collections.sort(sysTagList, new Comparator<Map<String, Object>>() {
...@@ -435,7 +459,7 @@ public class TagService { ...@@ -435,7 +459,7 @@ public class TagService {
} }
}); });
} }
//配许维度标签 //排序维度标签
if(!dimTagList.isEmpty()) { if(!dimTagList.isEmpty()) {
Collections.sort(dimTagList, new Comparator<Map<String, Object>>() { Collections.sort(dimTagList, new Comparator<Map<String, Object>>() {
@Override @Override
...@@ -461,6 +485,7 @@ public class TagService { ...@@ -461,6 +485,7 @@ public class TagService {
result.put("sysTag", sysTagList); result.put("sysTag", sysTagList);
result.put("dimTag", dimTagList); result.put("dimTag", dimTagList);
result.put("personalTag", perTagList); result.put("personalTag", perTagList);
result.put("custom", customList);
return result; return result;
} }
......
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