|
@@ -1,5 +1,6 @@
|
|
package com.business.controller;
|
|
package com.business.controller;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.business.domain.ImputationData;
|
|
import com.business.domain.ImputationData;
|
|
import com.business.service.ImputationDataService;
|
|
import com.business.service.ImputationDataService;
|
|
@@ -43,12 +44,15 @@ public class VisualizationController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private ISysDeptService sysDeptService;
|
|
private ISysDeptService sysDeptService;
|
|
|
|
|
|
|
|
+ private static final String FORMAT_STRING = "0000000000";
|
|
|
|
+
|
|
@GetMapping("index")
|
|
@GetMapping("index")
|
|
public String index(ModelMap mmap){
|
|
public String index(ModelMap mmap){
|
|
SysDept dept = new SysDept();
|
|
SysDept dept = new SysDept();
|
|
dept.setParentId(214L);
|
|
dept.setParentId(214L);
|
|
List<SysDept> depts = sysDeptService.selectDeptList(dept);
|
|
List<SysDept> depts = sysDeptService.selectDeptList(dept);
|
|
mmap.put("depts",depts);
|
|
mmap.put("depts",depts);
|
|
|
|
+ mmap.put("deptCount",depts.size());
|
|
return "/visualization/index";
|
|
return "/visualization/index";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -62,14 +66,34 @@ public class VisualizationController extends BaseController {
|
|
List<TUInterfaceinfo> interfaceList = interfaceinfoService.selectTUInterfaceinfoList(interfaceinfo);
|
|
List<TUInterfaceinfo> interfaceList = interfaceinfoService.selectTUInterfaceinfoList(interfaceinfo);
|
|
/**查询接口数量**/
|
|
/**查询接口数量**/
|
|
TUInterfaceinfo shareCount = interfaceinfoService.getShareCountByDeptId(id.toString());
|
|
TUInterfaceinfo shareCount = interfaceinfoService.getShareCountByDeptId(id.toString());
|
|
-
|
|
|
|
|
|
+ /**部门归集数据量**/
|
|
|
|
+ Integer guijiCount = interfaceinfoService.getGuijiCountByDeptId(id.toString());
|
|
mmap.put("deptId",sysDept.getDeptId());
|
|
mmap.put("deptId",sysDept.getDeptId());
|
|
mmap.put("deptName",sysDept.getDeptName());
|
|
mmap.put("deptName",sysDept.getDeptName());
|
|
mmap.put("interfaceList",interfaceList);
|
|
mmap.put("interfaceList",interfaceList);
|
|
mmap.put("shareCount",shareCount);
|
|
mmap.put("shareCount",shareCount);
|
|
|
|
+ mmap.put("guijiCount",formatWithMakingUp(guijiCount.toString()));
|
|
return "/visualization/tk_iframe";
|
|
return "/visualization/tk_iframe";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 字符串前用零补齐
|
|
|
|
+ *
|
|
|
|
+ * @param src 原始字符串
|
|
|
|
+ * @return 补齐后的字符串
|
|
|
|
+ */
|
|
|
|
+ public static String formatWithMakingUp(String src) {
|
|
|
|
+ if (null == src) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ int delta = FORMAT_STRING.length() - src.length();
|
|
|
|
+ if (delta <= 0) {
|
|
|
|
+ return src;
|
|
|
|
+ }
|
|
|
|
+ return FORMAT_STRING.substring(0, delta) + src;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询 接口接口占比-子页
|
|
* 查询 接口接口占比-子页
|
|
* */
|
|
* */
|
|
@@ -226,4 +250,23 @@ public class VisualizationController extends BaseController {
|
|
return iIntRecordService.applyCount(year,deptId);
|
|
return iIntRecordService.applyCount(year,deptId);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询归集和接口排名TOP10
|
|
|
|
+ * */
|
|
|
|
+ @PostMapping("getCallNumByDept/{deptId}")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public JSONArray getCallNumByDept(@PathVariable("deptId") Long deptId){
|
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
|
+ //数据
|
|
|
|
+ List<TUInterfaceinfo> list_data = interfaceinfoService.getCallNumByDept(deptId);
|
|
|
|
+ for(TUInterfaceinfo info:list_data){
|
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
|
+ object.put("name",info.getDeptName());
|
|
|
|
+ object.put("value",info.getCount());
|
|
|
|
+ jsonArray.add(object);
|
|
|
|
+ }
|
|
|
|
+ return jsonArray;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|