Commit 1b2b8ca4 by zhangkb

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

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