re_flow_now_test.jsp 8.42 KB
<%@ page import="com.engine.kq.biz.KQFlowActiontBiz" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="com.engine.kq.enums.KqSplitFlowTypeEnum" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
    try {

        String requestids = "111270"
                + ",115154"
                + ",115222"
                + ",115305"
                + ",125163"
                + ",125171"
                + ",126154"
                + ",126161"
                + ",126170"
                + ",126182"
                + ",126254"
                + ",126271"
                + ",126277"
                + ",135174"
                + ",135206"
                + ",135264"
                + ",135299"
                + ",135332"
                + ",135334"
                + ",135424"
                + ",135439"
                + ",135468"
                + ",135473"
                + ",135506"
                + ",135588"
                + ",135589"
                + ",135595"
                + ",135651"
                + ",135785"
                + ",135814"
                + ",136160"
                + ",136162"
                + ",136164"
                + ",136171"
                + ",136173"
                + ",136174"
                + ",136175"
                + ",136244"
                + ",136285"
                + ",136286"
                + ",141170"
                + ",141308"
                + ",141309"
                + ",144224"
                + ",144266"
                + ",144275"
                + ",144297"
                + ",144365"
                + ",144380"
                + ",144385"
                + ",144386"
                + ",144417"
                + ",144494"
                + ",144531"
                + ",144542"
                + ",144583"
                + ",144713"
                + ",144717"
                + ",144731"
                + ",144851"
                + ",146298"
                + ",146299"
                + ",146316"
                + ",146320"
                + ",146364"
                + ",146377"
                + ",146378"
                + ",160162"
                + ",160227"
                + ",160280"
                + ",162162"
                + ",162186"
                + ",162209"
                + ",162261"
                + ",162521"
                + ",162523"
                + ",166166"
                + ",170176"
                + ",170184"
                + ",170193"
                + ",170315"
                + ",170316"
                + ",170317"
                + ",170389"
                + ",170392"
                + ",170418"
                + ",170431"
                + ",170485"
                + ",170512"
                + ",170588"
                + ",170723"
                + ",180180"
                + ",180194"
                + ",180284"
                + ",180296"
                + ",180297"
                + ",180373"
                + ",180390"
                + ",180396"
                + ",180544"
                + ",180546"
                + ",182188"
                + ",184252"
                + ",184333"
                + ",184364"
                + ",184373"
                + ",188260"
                + ",189205"
                + ",190200"
                + ",190210"
                + ",192250"
                + ",192251"
                + ",192272"
                + ",192307"
                + ",192356"
                + ",193196"
                + ",193201"
                + ",194295"
                + ",196298"
                + ",196354"
                + ",198200"
                + ",198257"
                + ",198269"
                + ",202301"
                + ",202348"
                + ",202384"
                + ",202407"
                + ",203258"
                + ",205241"
                + ",205353"
                + ",205414"
                + ",205427"
                + ",205430"
                + ",205456"
                + ",205461"
                + ",205642"
                + ",205885"
                + ",205950"
                + ",205978"
                + ",206176"
                + ",206343"
                + ",206408"
                + ",88234";
        String workflowid = Util.null2String(request.getParameter("workflowid"));
        //是否是强制归档,true的话可以做带薪数据扣减和加班生成,默认false
        String isForce = Util.null2String(request.getParameter("isForce"));
        //是否是老考勤升级,true的话表示是老考勤升级,不需要考勤扣减和加班生成的问题。默认false
        String isUpgrade = Util.null2String(request.getParameter("isUpgrade"));
        boolean isForce1 = true;
        boolean isUpgrade1 = false;
        if("true".equalsIgnoreCase(isUpgrade)){
            isUpgrade1 = true;
        }
//        if(requestid.length() == 0){
//            out.println("param requestid is null:<br/>");
//            return ;
//        }
        if(workflowid.length() == 0){
            out.println("param workflowid is null:<br/>");
            return ;
        }
        long start = System.currentTimeMillis();
        KQFlowActiontBiz kqFlowActiontBiz = new KQFlowActiontBiz();
        RecordSet rs = new RecordSet();
        RecordSet rs1 = new RecordSet();

        String[] requ = requestids.split(",");
        for(int i = 0 ; i < requ.length ; i++){
          String requestid = requ[i];
            String proc_set_sql = "select * from kq_att_proc_set where field001 = ?  ";
            rs.executeQuery(proc_set_sql, workflowid);
            if(rs.next()){
                String proc_set_id = rs.getString("id");
                //得到这个考勤流程设置是否使用明细
                String usedetails = rs.getString("usedetail");

                int kqtype = Util.getIntValue(rs.getString("field006"));
                out.println("do action on kqtype:" + kqtype+"<br/>");


                Map<String, String> map = new HashMap<String, String>();
                if(Util.getIntValue(requestid) > 0){
                    map.put("requestId", "and t.requestId = " + requestid);
                }
                String tablename = "";
                if(kqtype == KqSplitFlowTypeEnum.LEAVE.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.LEAVE.getTablename();
                }else if(kqtype == KqSplitFlowTypeEnum.EVECTION.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.EVECTION.getTablename();
                }else if(kqtype == KqSplitFlowTypeEnum.OUT.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.OUT.getTablename();;
                }else if(kqtype == KqSplitFlowTypeEnum.OVERTIME.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.OVERTIME.getTablename();;
                }else if(kqtype == KqSplitFlowTypeEnum.SHIFT.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.SHIFT.getTablename();;
                }else if(kqtype == KqSplitFlowTypeEnum.OTHER.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.OTHER.getTablename();;
                }else if(kqtype == KqSplitFlowTypeEnum.CARD.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.CARD.getTablename();;
                }else if(kqtype == KqSplitFlowTypeEnum.LEAVEBACK.getFlowtype()){
                    tablename = KqSplitFlowTypeEnum.LEAVEBACK.getTablename();;
                }else{
                    out.print("考勤流程没有找到对应类型##kqtype##"+kqtype);
                    return;
                }
                //先根据requestid删除中间表里的数据,再做啥插入操作
                String delSql = "delete from "+tablename+" where requestid = "+requestid;
                out.println("先删除中间表数据 : " + delSql+"<br/>");
                rs1.executeUpdate(delSql);

                Map<String,String> result = kqFlowActiontBiz.handleKQFlowAction(proc_set_id, usedetails, Util.getIntValue(requestid), kqtype, Util.getIntValue(workflowid), isForce1,isUpgrade1,map);

                out.println("do action on kqtype result:" + result+"<br/>");
                if(!result.isEmpty()){
                    out.println("do action on kqtype 失败:" + result+"<br/>");
                }
            }
        }

        long end = System.currentTimeMillis();
        out.println((end-start)/1000+"秒");
    }catch (Exception e){
        e.printStackTrace();;
    }
%>