expDataSet.jsp 6.88 KB
<!DOCTYPE html>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.conn.*" %>

<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="weaver.formmode.exttools.impexp.common.StringUtils"%> 
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="CommonConstant" class="weaver.formmode.service.CommonConstant" scope="page"/>
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="../../js/weaver_wev8.js"></script>
<link rel="stylesheet" href="/css/ecology8/request/requestTopMenu_wev8.css" type="text/css" />
</head>
<%
if(!HrmUserVarify.checkUserRight("WorkflowCustomManage:All", user))
{
    response.sendRedirect("/notice/noright.jsp");
    return;
}
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(23799,user.getLanguage());
String needfav ="1";
String needhelp ="";

String concatS = CommonConstant.DB_CONCAT_SYMBOL;
String isnullFun=CommonConstant.DB_ISNULL_FUN;
String shortName = Util.null2String(request.getParameter("shortName"));
String appid = Util.null2String(request.getParameter("appid"));


String wheresql="and b.id in  (select id from modeinfo where modetype in ("+
" select id from (select id,','"+concatS+"allSuperFieldId"+concatS+"',' as allSuperFieldId from modeTreeField"+
" ) A where A.id = "+appid+" or A.allSuperFieldId like '%,"+appid+",%'"+
" ) and "+isnullFun+"(isdelete,0)!=1   )AND  a.id= b.formid AND "+isnullFun+"(b.isdelete,0)!=1 "+
"AND a.id NOT IN ( SELECT formid FROM  ModeFormExtend m  where m.isvirtualform = '1' )";
rs.executeSql("select a.tablename,b.id as modeid from workflow_bill a,modeinfo b where a.id=b.formid  "+wheresql);
String spit="";
String formmodeid="";
int num=0;
while(rs.next()){
    String tablename=StringUtils.null2String(rs.getString("tablename"));
    String modeid=StringUtils.null2String(rs.getString("modeid"));
    if(tablename!=""){
        rs1.executeSql("select count(1) sum FROM "+tablename+" WHERE  "+isnullFun+"(formmodeid,0)!=1  and formmodeid="+modeid);
        while(rs1.next()){
            int sum=StringUtils.getIntValue(rs1.getString("sum"),0);
            if(sum>0){
              if(formmodeid!=""){
                  spit=",";
              }
              formmodeid+=spit+modeid;
              num++;
            }
          } 
      }
}
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>

<TABLE class=Shadow>
<tr>
<td valign="top">
<form name="frmSearch" method="post" action="expDataSet.jsp">
<input name="appid" id="appid" value="<%=appid%>" type="hidden">
<table id="topTitle" cellpadding="0" cellspacing="0">
    <tr>
        <td>
        </td>
        <td class="rightSearchSpan" style="text-align:right; width:500px!important">
            <input type="text" class="searchInput" name="flowTitle" value="<%=shortName%>"/>
            &nbsp;&nbsp;&nbsp;
            <span id="advancedSearch" class="advancedSearch"></span>
        </td>
    </tr>
</table>
<%
String sqlWhere="";
if(formmodeid!=""){
    sqlWhere=" WHERE b.id IN( ";
    sqlWhere+=formmodeid+"  )AND  a.id= b.formid AND "+isnullFun+"(b.isdelete,0)!=1 "+
        "AND a.id NOT IN ( SELECT formid FROM  ModeFormExtend m  where m.isvirtualform = '1' )";
    if(!"".equals(shortName)){
        sqlWhere+="and (b.modename like '%"+shortName+"%' or a.tablename like '%"+shortName+"%' )" ;
    }
}else {
    sqlWhere="where 1=2";
}
    String  operateString= "";
    String tabletype="checkbox";
    String tableString=""+
       "<table  needPage=\"false\" instanceid=\"chooseSubWorkflow\" pagesize=\""+PageIdConst.getPageSize(PageIdConst.WF_WORKFLOW_FIELDTRIGGER,user.getUID())+"\" tabletype=\""+tabletype+"\">"+
        " <checkboxpopedom  id=\"checkbox\" showmethod=\"weaver.general.KnowledgeTransMethod.getMailCheckbox\" />"+
       "<sql backfields=\"b.id as id,b.modename modename,a.tablename\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\"  sqlform=\"workflow_bill a,modeinfo b \" sqlorderby=\"b.id\"  sqlprimarykey=\"b.id\" sqlsortway=\"asc\"  sqldistinct=\"true\" />"+
       operateString+
       "<head>"+                             
	       "<col width=\"30%\" text=\""+SystemEnv.getHtmlLabelName(28485,user.getLanguage())+"\" column=\"modeName\"/>"+
	       "<col width=\"30%\" column=\"tablename\" text=\""+SystemEnv.getHtmlLabelName(384336,user.getLanguage())+"\" />"+
	       "<col width=\"30%\" transmethod=\"weaver.formmode.exttools.impexp.exp.service.extttoolsTransMethod.getModeDataCount\" otherpara=\"column:tablename+column:id\" column=\"count\" text=\""+SystemEnv.getHtmlLabelName(384337,user.getLanguage())+"\"/>"+
       "</head>"+
       "</table>";
%>
<TABLE width="100%" cellspacing=0>
    <tr>
        <td valign="top">  
            <wea:SplitPageTag  tableString='<%=tableString%>'  mode="run" />
        </td>
    </tr>
</TABLE>
</td>
</tr>
</TABLE>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
        <wea:layout needImportDefaultJsAndCss="false">
            <wea:group context=""  attributes="{groupDisplay:none}">
                <wea:item type="toolbar">
                    <input type="button" value="<%=SystemEnv.getHtmlLabelName(128844,user.getLanguage())%>" id="cancelBtn"  class="zd_btn_cancle" onclick="expData()">
                </wea:item>
            </wea:group>
        </wea:layout>      
</div>
<script type="text/javascript">
    function doSubmit(){
        enableAllmenu();
        document.frmSearch.submit();
    }
</script>

</BODY>
<script type="text/javascript">
var diag_vote;
jQuery(document).ready(function () {
    $("#topTitle").topMenuTitle({searchFn:onBtnSearchClick});
    $(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
    $("#tabDiv").remove();
    parent.loadUp(<%=num%>);     
});

function closeDialog(){
    diag_vote.close();
}


function onBtnSearchClick(){
    var typename=$("input[name='flowTitle']",parent.document).val();
    var appid=$("#appid").val();
    try{
        typename = encodeURI(typename);
    }catch(e){
        if(window.console)console.log(e)
     }
    $("input[name='shortName']").val(typename);
    window.location="CustomQuerySet.jsp?appid="+appid+"&shortName="+typename;
}

function onReset() {
    jQuery('input[name="flowTitle"]', parent.document).val('');
    jQuery('input[name="shortName"]').val('');
}
function expData(id){
        if(!id){
            id = _xtable_CheckedCheckboxId();
        }
        if(!id){
            window.top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(32568,user.getLanguage())%>");
            return;
        }
        if(id.match(/,$/)){
            id = id.substring(0,id.length-1);
        }
        parent.closDilog(id);
}
</script>
</HTML>