解决流量统计app趋势中app名称特殊符号跟国际化标签写法的冲突bug
This commit is contained in:
@@ -464,7 +464,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
* App趋势界面 独立IP访问数量趋势图
|
* App趋势界面 独立IP访问数量趋势图
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="appTrendList")
|
@RequestMapping(value="appTrendList")
|
||||||
public String appTrendList(Model model,String beginDate,String endDate,String appName,Integer appType,Integer entranceId){
|
public String appTrendList(Model model,String beginDate,String endDate,Integer appType,Integer entranceId){
|
||||||
if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){
|
if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){
|
||||||
Calendar cal = Calendar. getInstance ();
|
Calendar cal = Calendar. getInstance ();
|
||||||
cal.setTime(new Date());
|
cal.setTime(new Date());
|
||||||
@@ -472,6 +472,20 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 2);
|
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 2);
|
||||||
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||||
}
|
}
|
||||||
|
//标签集合
|
||||||
|
List<CodeResult> codeList = CodeDicUtils.getCodeList("appCode");
|
||||||
|
//将数字替换为标签文字
|
||||||
|
String appName="";
|
||||||
|
if(appType!=null){
|
||||||
|
Double value1 = Double.valueOf(appType);
|
||||||
|
for (CodeResult code : codeList) {
|
||||||
|
Double value2 = Double.valueOf(code.getCode().trim());
|
||||||
|
if(value1.equals(value2)){
|
||||||
|
appName= code.getItem().trim();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
model.addAttribute("appName", appName);
|
model.addAttribute("appName", appName);
|
||||||
model.addAttribute("appType", appType);
|
model.addAttribute("appType", appType);
|
||||||
model.addAttribute("entranceId", entranceId);
|
model.addAttribute("entranceId", entranceId);
|
||||||
|
|||||||
@@ -235,6 +235,7 @@
|
|||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var appName="<spring:message code='${appName}'/>";
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var starth = $("#beginDateh").val();
|
var starth = $("#beginDateh").val();
|
||||||
var endh = $("#endDateh").val();
|
var endh = $("#endDateh").val();
|
||||||
@@ -947,7 +948,7 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
exporting : {
|
exporting : {
|
||||||
filename : '<spring:message code="${appName}"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
|
filename : appName+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
|
||||||
scale : 1,
|
scale : 1,
|
||||||
sourceWidth : 1280,
|
sourceWidth : 1280,
|
||||||
sourceHeight : 500,
|
sourceHeight : 500,
|
||||||
@@ -972,7 +973,7 @@
|
|||||||
var start=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5);
|
var start=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
var begin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(start)); //获取1个点少算一分钟
|
var begin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(start)); //获取1个点少算一分钟
|
||||||
var end=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(timebe));
|
var end=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(timebe));
|
||||||
var tlt='<spring:message code="${appName}"></spring:message> '+begin+'--'+end+''
|
var tlt=appName+begin+'--'+end+''
|
||||||
return tlt;
|
return tlt;
|
||||||
}())
|
}())
|
||||||
|
|
||||||
@@ -1108,7 +1109,7 @@
|
|||||||
var startTime=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(start));
|
var startTime=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(start));
|
||||||
var ends=(new Date().getTime())-(1000 * 60 * 5);
|
var ends=(new Date().getTime())-(1000 * 60 * 5);
|
||||||
var endTime=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(ends));
|
var endTime=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(ends));
|
||||||
chart.title.update({ text: '<spring:message code="${appName}"></spring:message> '+startTime+'--'+endTime+''});
|
chart.title.update({ text: appName+startTime+'--'+endTime+''});
|
||||||
closeTip();
|
closeTip();
|
||||||
},
|
},
|
||||||
error : function(data, textStatus, errorThrown) {
|
error : function(data, textStatus, errorThrown) {
|
||||||
@@ -1201,7 +1202,7 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
exporting : {
|
exporting : {
|
||||||
filename : '<spring:message code="${appName}"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
|
filename : appName+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
|
||||||
scale : 1,
|
scale : 1,
|
||||||
sourceWidth : 1280,
|
sourceWidth : 1280,
|
||||||
sourceHeight : 500,
|
sourceHeight : 500,
|
||||||
@@ -1220,7 +1221,7 @@
|
|||||||
// colors:['#EF843C','#EFCA6B','#6ED0E0'],
|
// colors:['#EF843C','#EFCA6B','#6ED0E0'],
|
||||||
colors:['#709c58','#c9a206','#64b5c5'],
|
colors:['#709c58','#c9a206','#64b5c5'],
|
||||||
title : {
|
title : {
|
||||||
text : '<spring:message code="${appName}"></spring:message> '+$("#beginDateh").val()+'--'+$("#endDateh").val()+''
|
text : appName+$("#beginDateh").val()+'--'+$("#endDateh").val()+''
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type:'datetime',
|
type:'datetime',
|
||||||
@@ -1342,10 +1343,10 @@
|
|||||||
}
|
}
|
||||||
total.unshift('<spring:message code="report_total"/>');
|
total.unshift('<spring:message code="report_total"/>');
|
||||||
rows.push(total)
|
rows.push(total)
|
||||||
map["titleTime"]='<spring:message code="${appName}"></spring:message>'+","+start+"--"+end;
|
map["titleTime"]=appName+","+start+"--"+end;
|
||||||
map["heard"]=heard;
|
map["heard"]=heard;
|
||||||
map["book"]=rows;
|
map["book"]=rows;
|
||||||
map["titleCode"]='<spring:message code="${appName}"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
|
map["titleCode"]=appName+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
|
||||||
var exports = JSON.stringify(map);
|
var exports = JSON.stringify(map);
|
||||||
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
|
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ function htmlData(fileDataS){
|
|||||||
gbytper=((data.GByte/totalGByte)*100).toFixed(2);
|
gbytper=((data.GByte/totalGByte)*100).toFixed(2);
|
||||||
}
|
}
|
||||||
var html = "<tr>";
|
var html = "<tr>";
|
||||||
html+= "<td class='tc'><a href='#' onclick='openAppTrend(\""+data.appType+"\",\""+data.appName+"\")'><i class='fa fa-line-chart'></i></a></td>";
|
html+= "<td class='tc'><a href='#' onclick='openAppTrend(\""+data.appType+"\")'><i class='fa fa-line-chart'></i></a></td>";
|
||||||
html+= "<td class='tc'>"+data.appName+"</td>";
|
html+= "<td class='tc'>"+data.appName+"</td>";
|
||||||
html+= "<td class='tc'>"+data.linkNum+"</td>";
|
html+= "<td class='tc'>"+data.linkNum+"</td>";
|
||||||
html+= "<td class='tc'>"+linkper+"%"+"</td>";
|
html+= "<td class='tc'>"+linkper+"%"+"</td>";
|
||||||
@@ -378,11 +378,11 @@ function htmlData(fileDataS){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 跳转到app访问趋势
|
// 跳转到app访问趋势
|
||||||
function openAppTrend(appType,appName){
|
function openAppTrend(appType){
|
||||||
var beginDate=$("#beginDateh").val();
|
var beginDate=$("#beginDateh").val();
|
||||||
var endDate=$("#endDateh").val();
|
var endDate=$("#endDateh").val();
|
||||||
var entranceId = $("#entranceId").val();
|
var entranceId = $("#entranceId").val();
|
||||||
var url= "${ctx}/dashboard/traffic/appTrendList?beginDate="+beginDate+"&endDate="+endDate+"&appName="+appName+"&appType="+appType+"&entranceId="+entranceId;
|
var url= "${ctx}/dashboard/traffic/appTrendList?beginDate="+beginDate+"&endDate="+endDate+"&appType="+appType+"&entranceId="+entranceId;
|
||||||
window.location.href=(url)
|
window.location.href=(url)
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user