流量统计增加活跃端口详情,增加接口,替燕姐提交。修改界面线数据点大小

This commit is contained in:
zhanghongqing
2018-12-23 20:58:42 +08:00
parent 367029f884
commit 9d8786dd2e
10 changed files with 519 additions and 1112 deletions

View File

@@ -714,6 +714,7 @@ public final class Constants {
public static final String TRAFFIC_WEBSITELIST_NOTIME=Configurations.getStringProperty("trafficWebsiteListNoTime","trafficWebsiteListNoTime");
public static final String TRAFFIC_TOPICLIST=Configurations.getStringProperty("trafficTopicList","trafficTopicList");
public static final String TRAFFIC_DOMAIN_TRANS=Configurations.getStringProperty("trafficDomainTrans","trafficDomainTrans");
public static final String TRAFFIC_PORTACTIVE_FIVEMINUTE=Configurations.getStringProperty("trafficPortActiveFiveMinute","trafficPortActiveFiveMinute");
/**
* httpclient 工具超时时间设置
*/

View File

@@ -96,6 +96,33 @@ public class DashboardController extends BaseController{
}
return list;
}
/**
* 跳转活跃端口详情界面
* @return
*/
@RequestMapping(value="portActiveChart")
@ResponseBody
public List portActiveChart(String beginDate,String endDate){
Map<String, Object> fromJsonList = new HashMap<String, Object>();
List list = new ArrayList();
try {
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_PORTACTIVE_FIVEMINUTE;//+Constants.TRAFFIC_IPACTIVE_ONEHOUR;
url=urlAddDate(url, beginDate, endDate);
String string = HttpClientUtil.get(url);
Gson gson = new GsonBuilder().create();
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
logger.debug("活跃端口从"+beginDate+""+endDate+",间隔5分钟数据"+fromJsonList);
list = (ArrayList) fromJsonList.get("data");
return list;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("活跃端口详情界面数据获取错误"+e);
}
return list;
}
/**
* 跳转活跃端口详情界面
* @return
@@ -319,19 +346,19 @@ public class DashboardController extends BaseController{
//将数字替换为标签文字
if(list!=null&&!list.isEmpty()){
for (Map map : list) {
Double value1 = Double.parseDouble(map.get("protoType").toString());
Double value1 = Double.parseDouble(map.get("protoType").toString().trim());
for (CodeResult code : codeList) {
Double value2 = Double.valueOf(code.getCode());
Double value2 = Double.valueOf(code.getCode().trim());
if(value1.equals(value2)){
map.put("protoType", code.getItem());
map.put("protoType", code.getItem().trim());
break;
}
}
// 协议没匹配的匹配app码表
for (CodeResult code : appCodeList) {
Double value3 = Double.valueOf(code.getCode());
Double value3 = Double.valueOf(code.getCode().trim());
if(value1.equals(value3)){
map.put("protoType", code.getItem());
map.put("protoType", code.getItem().trim());
break;
}
}
@@ -366,11 +393,11 @@ public class DashboardController extends BaseController{
//将数字替换为标签文字
if(list!=null&&!list.isEmpty()){
for (Map map : list) {
Double value1 = Double.parseDouble(map.get("appType").toString());
Double value1 = Double.parseDouble(map.get("appType").toString().trim());
for (CodeResult code : codeList) {
Double value2 = Double.valueOf(code.getCode());
Double value2 = Double.valueOf(code.getCode().trim());
if(value1.equals(value2)){
map.put("appType", code.getItem());
map.put("appType", code.getItem().trim());
break;
}
}
@@ -405,11 +432,11 @@ public class DashboardController extends BaseController{
//将数字替换为标签文字
if(list!=null&&!list.isEmpty()){
for (Map map : list) {
Double value1 = Double.parseDouble(map.get("osType").toString());
Double value1 = Double.parseDouble(map.get("osType").toString().trim());
for (CodeResult code : codeList) {
Double value2 = Double.valueOf(code.getCode());
Double value2 = Double.valueOf(code.getCode().trim());
if(value1.equals(value2)){
map.put("osType", code.getItem());
map.put("osType", code.getItem().trim());
break;
}
}
@@ -439,8 +466,8 @@ public class DashboardController extends BaseController{
//将标签文字转为数字
Integer os=null;
for (CodeResult codeResult : codeList1) {
if(osType.equalsIgnoreCase(codeResult.getItem())){
os=Integer.parseInt(codeResult.getCode());
if(osType.equalsIgnoreCase(codeResult.getItem().trim())){
os=Integer.parseInt(codeResult.getCode().trim());
break;
}
}
@@ -457,11 +484,11 @@ public class DashboardController extends BaseController{
//将数字替换为标签文字
if(null!=list&&!list.isEmpty()){
for (Map map : list) {
Double value1 = Double.parseDouble(map.get("bsType").toString());
Double value1 = Double.parseDouble(map.get("bsType").toString().trim());
for (CodeResult code : codeList2) {
Double value2 = Double.valueOf(code.getCode());
Double value2 = Double.valueOf(code.getCode().trim());
if(value1.equals(value2)){
map.put("bsType", code.getItem());
map.put("bsType", code.getItem().trim());
break;
}
//10个域名之外的为others 设为-1外
@@ -501,11 +528,11 @@ public class DashboardController extends BaseController{
//将数字替换为标签文字
if(list!=null&&!list.isEmpty()){
for (Map map : list) {
Double value1 = Double.parseDouble(map.get("bsType").toString());
Double value1 = Double.parseDouble(map.get("bsType").toString().trim());
for (CodeResult code : codeList) {
Double value2 = Double.valueOf(code.getCode());
Double value2 = Double.valueOf(code.getCode().trim());
if(value1.equals(value2)){
map.put("bsType", code.getItem());
map.put("bsType", code.getItem().trim());
break;
}
}
@@ -535,13 +562,13 @@ public class DashboardController extends BaseController{
//将标签文字转为数字
Integer bs=null;
for (CodeResult codeResult : codeList1) {
if(bsType.equalsIgnoreCase(codeResult.getItem())){
bs=Integer.parseInt(codeResult.getCode());
if(bsType.equalsIgnoreCase(codeResult.getItem().trim())){
bs=Integer.parseInt(codeResult.getCode().trim());
break;
}
}
if(bs==null){
bs=Integer.parseInt(bsType);//处理为匹配项编码
bs=Integer.parseInt(bsType.trim());//处理为匹配项编码
}
try {
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_SYSTEM_CHART+"?bsType="+bs);
@@ -553,16 +580,16 @@ public class DashboardController extends BaseController{
//将数字替换为标签文字
if(null!=list&&!list.isEmpty()){
for (Map map : list) {
Double value1 = Double.parseDouble(map.get("osType").toString());
Double value1 = Double.parseDouble(map.get("osType").toString().trim());
for (CodeResult code : codeList2) {
Double value2 = Double.valueOf(code.getCode());
Double value2 = Double.valueOf(code.getCode().trim());
//10个域名之外的为others webId设为-1外
if(map.get("osType").toString().equals("-1")){
map.put("osType", "Others");
break;
}
if(value1.equals(value2)){
map.put("osType", code.getItem());
map.put("osType", code.getItem().trim());
break;
}
}
@@ -599,15 +626,15 @@ public class DashboardController extends BaseController{
if(list!=null&&!list.isEmpty()){
for (Map map : list) {
Double value1=0d;
if(StringUtil.isBlank(map.get("websiteServiceId").toString())){
if(StringUtil.isBlank(map.get("websiteServiceId").toString().trim())){
value1=268435455d;
}else{
value1 = Double.parseDouble(map.get("websiteServiceId").toString());
value1 = Double.parseDouble(map.get("websiteServiceId").toString().trim());
}
for (SysDataDictionaryItem code : codeList) {
Double value2 = Double.valueOf(code.getItemCode());
Double value2 = Double.valueOf(code.getItemCode().trim());
if(value1.equals(value2)){
map.put("websiteService", code.getItemValue());
map.put("websiteService", code.getItemValue().trim());
break;
}
}
@@ -647,7 +674,7 @@ public class DashboardController extends BaseController{
if(wdt!=null){
String domain = wdt.getDomain();
Double domainId = wdt.getId().doubleValue();
Double webId = Double.parseDouble(dataMap.get("webId").toString());
Double webId = Double.parseDouble(dataMap.get("webId").toString().trim());
//10个域名之外的为others webId设为-1外
if(dataMap.get("webId").toString().equals("-1")){
dataMap.put("domain", "Others");
@@ -697,12 +724,12 @@ public class DashboardController extends BaseController{
if(StringUtil.isBlank(map.get("topicId").toString())){
value1=268435455d;
}else{
value1 = Double.parseDouble(map.get("topicId").toString());
value1 = Double.parseDouble(map.get("topicId").toString().trim());
}
for (SysDataDictionaryItem code : codeList) {
Double value2 = Double.valueOf(code.getItemCode());
Double value2 = Double.valueOf(code.getItemCode().trim());
if(value1.equals(value2)){
map.put("topic", code.getItemValue());
map.put("topic", code.getItemValue().trim());
break;
}
}
@@ -714,7 +741,7 @@ public class DashboardController extends BaseController{
if(wdt!=null){
String domain = wdt.getDomain();
Double domainId = wdt.getId().doubleValue();
Double webId = Double.parseDouble(dataMap.get("webId").toString());
Double webId = Double.parseDouble(dataMap.get("webId").toString().trim());
//10个域名之外的为others webId设为-1
// if(dataMap.get("webId").toString().equals("-1")){
// dataMap.put("domain", "Others");