Commit e66c5c97 by zhangkb

修改标签分析和分析导出接口

parent 401ce8bf
...@@ -256,7 +256,7 @@ public class TagCtrl { ...@@ -256,7 +256,7 @@ public class TagCtrl {
return tagService.tagAnalysis(dataType); return tagService.tagAnalysis(dataType);
} }
@ApiOperation(value = "导出标签分析excel文件(dataType:0,1,2 依次代表:元数据,模型,标准; type:0,1 代表:导出系统分析,导出自定义分析)", notes = "导出标签分析excel文件(dataType:0,1,2 依次代表:元数据,模型,标准; type:0,1 代表:导出系统分析,导出自定义分析)") @ApiOperation(value = "导出标签分析excel文件(dataType:0,1,2 依次代表:元数据,模型,标准; type:0,1,2 代表:导出系统分析,导出维度分析,导出自定义分析)", notes = "导出标签分析excel文件(dataType:0,1,2 依次代表:元数据,模型,标准; type:0,1,2 代表:导出系统分析,导出维度分析,导出自定义分析)")
@GetMapping("/exportTagAnalysis") @GetMapping("/exportTagAnalysis")
public int exportTagAnalysis(@RequestParam String dataType,@RequestParam String type, public int exportTagAnalysis(@RequestParam String dataType,@RequestParam String type,
HttpServletResponse response)throws Exception{ HttpServletResponse response)throws Exception{
......
...@@ -71,6 +71,8 @@ public class TagFileService { ...@@ -71,6 +71,8 @@ public class TagFileService {
//如果是导出系统标签 //如果是导出系统标签
if("0".equals(type)) { if("0".equals(type)) {
tagList = (List<Map<String,Object>>)tagAnalysisMap.get("sysTag"); tagList = (List<Map<String,Object>>)tagAnalysisMap.get("sysTag");
}else if("1".equals(type)){
tagList = (List<Map<String,Object>>)tagAnalysisMap.get("dimTag");
}else { }else {
tagList = (List<Map<String,Object>>)tagAnalysisMap.get("personalTag"); tagList = (List<Map<String,Object>>)tagAnalysisMap.get("personalTag");
} }
......
...@@ -348,8 +348,11 @@ public class TagService { ...@@ -348,8 +348,11 @@ public class TagService {
public Map<String,Object> tagAnalysis(String dataType) throws Exception{ public Map<String,Object> tagAnalysis(String dataType) throws Exception{
Map<String,Object> result = new HashMap<>(); Map<String,Object> result = new HashMap<>();
String modelPath = null; String modelPath = null;
//定义存储系统和个人标签分析的list<Map> //定义存储系统list<Map>
List<Map<String,Object>> sysTagList = new ArrayList<>(); List<Map<String,Object>> sysTagList = new ArrayList<>();
//定义存储维度标签list<Map>
List<Map<String,Object>> dimTagList = new ArrayList<>();
//定义存储自定义标签list<Map>
List<Map<String,Object>> perTagList = new ArrayList<>(); List<Map<String,Object>> perTagList = new ArrayList<>();
//根据类型获取模型路径 //根据类型获取模型路径
switch(dataType) { switch(dataType) {
...@@ -390,7 +393,7 @@ public class TagService { ...@@ -390,7 +393,7 @@ public class TagService {
if("0".equals(tag.getTagType())) { if("0".equals(tag.getTagType())) {
sysTagList.add(tagMap); sysTagList.add(tagMap);
}else { }else {
perTagList.add(tagMap); dimTagList.add(tagMap);
} }
} }
} }
...@@ -427,6 +430,17 @@ public class TagService { ...@@ -427,6 +430,17 @@ public class TagService {
} }
}); });
} }
//配许维度标签
if(!dimTagList.isEmpty()) {
Collections.sort(dimTagList, 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(!perTagList.isEmpty()) { if(!perTagList.isEmpty()) {
Collections.sort(perTagList, new Comparator<Map<String, Object>>() { Collections.sort(perTagList, new Comparator<Map<String, Object>>() {
...@@ -440,6 +454,7 @@ public class TagService { ...@@ -440,6 +454,7 @@ public class TagService {
} }
//装填结果 //装填结果
result.put("sysTag", sysTagList); result.put("sysTag", sysTagList);
result.put("dimTag", dimTagList);
result.put("personalTag", perTagList); result.put("personalTag", perTagList);
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