<%@ page import="org.apache.commons.lang3.StringUtils" %> <%@ page import="java.sql.Timestamp" %> <%-- Created by IntelliJ IDEA. User: SamRichard Date: 2017/1/12 0012 Time: 13:29 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; Integer fullscreen = 0; String strFullscreen = (String) request.getParameter("fullscreen"); if (StringUtils.isNotBlank(strFullscreen)){ fullscreen = Integer.parseInt(strFullscreen); } String[] strTaskName = request.getParameterValues("taskname"); String strStartTime = (String)request.getParameter("starttime"); String strEndTime = (String)request.getParameter("endtime"); Integer charttype = null; String strType = (String)request.getParameter("type"); if (StringUtils.isNotBlank(strType)){ charttype = Integer.parseInt(strType); } if (charttype == null && StringUtils.isNotBlank(strStartTime) && StringUtils.isNotBlank(strEndTime)){ try { Timestamp a = Timestamp.valueOf(strStartTime); Timestamp b = Timestamp.valueOf(strEndTime); Long iDif = (b.getTime() - a.getTime()) / 1000; System.out.println(a.toString() + ":" + b.toString() + ":" + iDif.toString()); if (iDif <= 0){ } else if (iDif <= 2 * 3600){ charttype = 0; } else if (iDif <= 2 * 86400){ charttype = 1; } else if (iDif <= 60 * 86400){ charttype = 2; } else { charttype = 3; } } catch (Exception e){ e.printStackTrace(); } } if (charttype == null){ charttype = 0; } %> 车流量报表