loadReportData.jsp 3.12 KB
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="com.api.report.service.RequestFlowTimeTask" %>
<%@ page import="com.api.report.service.CalculateFlowTimeEngine" %>
<%@ page import="com.api.report.service.CalculateRequestFlowTime" %>
<%@ page import="com.api.report.service.newCalculateEngine.CalculateFlowTimeThread" %>

<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<%
    String actionType = Util.null2String(request.getParameter("actionType"));
    if ("1".equals(actionType)) {
        rs.executeUpdate("delete from wf_flowtime_reporttask_log");
        rs.executeUpdate("truncate table workflow_node_flowtime");
        rs.executeUpdate("truncate table workflow_node_fix_flowtime");
        rs.executeUpdate("truncate table workflow_request_flowtime");
        rs.executeUpdate("truncate table workflow_request_fix_flowtime");
    } else if ("2".equals(actionType)) {
        //CalculateFlowTimeEngine calEngine = new CalculateFlowTimeEngine("2017-05-01","2017-05-31",0);
        //calEngine.calculate();

        String startDate = Util.null2String(request.getParameter("startDate"));
        CalculateRequestFlowTime crft = new CalculateRequestFlowTime();
        crft.calculate(startDate);
    } else if ("3".equals(actionType)) {
        String startDate = Util.null2String(request.getParameter("startDate"));
        String endDate = Util.null2String(request.getParameter("endDate"));
        //isCalculateRange 1:计算归档流程 2:计算待办流程 0:计算所有的数据
        int isCalculateRange = Util.getIntValue(request.getParameter("isCalculateRange"), 0);

        CalculateRequestFlowTime crft = new CalculateRequestFlowTime();
        crft.executeDateRangeFlowTime(startDate, endDate, isCalculateRange);
    } else if ("4".equals(actionType)) {
        rs.executeQuery("select * from wf_flowtime_reporttask_log where taskstatus = '0'");
        if (rs.next()) {
            out.println("starttime:" + rs.getString("startdate") + " " + rs.getString("taskstarttime"));
            out.println("<br/>");
        }
        rs.executeQuery("select count(1) from workflow_request_flowtime ");
        if (rs.next()) {
            out.println("requestflowtime count:" + rs.getInt(1));
            out.println("<br/>");
        }
        rs.executeQuery("select count(1) from workflow_node_flowtime ");
        if (rs.next()) {
            out.println("nodeflowtime count:" + rs.getInt(1));
            out.println("<br/>");
        }
    } else if ("5".equals(actionType)) {
        CalculateFlowTimeThread cftt = new CalculateFlowTimeThread();
        cftt.doCalculate();
    } else if ("6".equals(actionType)) {
        rs.executeUpdate("delete from wf_flowtime_reporttask_log");
        rs.executeUpdate("truncate table workflow_node_flowtime");
        rs.executeUpdate("truncate table workflow_node_fix_flowtime");
        rs.executeUpdate("truncate table workflow_request_flowtime");
        rs.executeUpdate("truncate table workflow_request_fix_flowtime");

        CalculateFlowTimeThread cftt = new CalculateFlowTimeThread();
        cftt.doCalculate();
    }
%>