@@ -263,11 +263,12 @@ public class DashboardController extends BaseController{
|
||||
list = gson.fromJson(fromJsonList.get("data").toString(), new TypeToken<List<TrafficIpActiveStatistic>>() {}.getType()) ;
|
||||
if(list.size()>0) {
|
||||
DecimalFormat lf = new DecimalFormat("0");
|
||||
DecimalFormat f = new DecimalFormat("0.00");
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//两个时间段之间的秒数
|
||||
double allSeconds = DateUtils.getSecondsOfTwoDate(sdf.parse(beginDate),sdf.parse(endDate));
|
||||
for(TrafficIpActiveStatistic data:list) {
|
||||
data.setAvgByte(lf.format(Long.parseLong(data.get_byte())/1024/1024/1024/allSeconds));
|
||||
data.setAvgByte(f.format(Long.parseLong(data.get_byte())/1024/1024/1024/allSeconds));
|
||||
data.setAvgPacket(lf.format(Long.parseLong(data.get_packet())/allSeconds));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user