⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 archive_query_list.jsp

📁 oa 源码
💻 JSP
字号:
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import = "java.util.*"%>
<%@ page import = "java.sql.*"%>
<%@ page import = "cn.js.fan.db.*"%>
<%@ page import = "cn.js.fan.web.*"%>
<%@ page import = "cn.js.fan.util.*"%>
<%@ page import = "com.redmoon.oa.archive.*"%>
<%@ page import = "com.redmoon.oa.person.*"%>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
<jsp:useBean id="archivePrivilege" scope="page" class="com.redmoon.oa.archive.ArchivePrivilege"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>人事档案管理</title>
<link href="../common.css" rel="stylesheet" type="text/css">
<%@ include file="../inc/nocache.jsp"%>
<style type="text/css">
<!--
.STYLE2 {color: #0033FF}
.STYLE3 {color: #FF0000}
-->
</style>
</head>
<body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
<%
if (!privilege.isUserPrivValid(request, "archive.query")&&!archivePrivilege.canQuery(request)) {
	out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "pvg_invalid")));
	return;
}
%>
<br>
<table border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" width="100%">
  <form name="form1" action="archive_excel.jsp" method="post">
  <tr> 
    <td height="23" valign="middle" class="right-title"><span>&nbsp;综合查询</span></td>
  </tr>
  <tr> 
    <td valign="top" background="images/tab-b-back.gif">
<%
        String op = "",sql = "",conditionFieldSql = "",conditionFieldCode = "",condition_type = "",condition_field_code = "";
		int id = -1;
		
		ArchiveQueryDb aqd = new ArchiveQueryDb();
		ArchiveQueryConditionDb aqcd = new ArchiveQueryConditionDb();
	
		id = ParamUtil.getInt(request, "id");
		aqd = aqd.getArchiveQueryDb(id);
		conditionFieldSql = ArchiveSQLBuilder.getArchiveQueryCondition(id);
		Vector cvt = aqcd.list(conditionFieldSql);
		Iterator cir = null;
		cir = cvt.iterator();

		while (cir!=null && cir.hasNext()) {
			aqcd = (ArchiveQueryConditionDb)cir.next();
			if(!aqcd.getConditionType().equals("SELECTED") && condition_type.equals("SELECTED")){
			   conditionFieldCode += ")";
			}
			if(!condition_type.equals("") && condition_type.equals("SELECTED") && condition_field_code.equals(aqcd.getConditionFieldCode())){
				conditionFieldCode += " or ";
			}else{
				if(!condition_field_code.equals(""))
				   conditionFieldCode += " and ";
			}
			if(aqcd.getConditionType().equals("SELECTED") && !condition_type.equals("SELECTED")){
				conditionFieldCode += "(";
			}
			
			conditionFieldCode += aqcd.getConditionFieldCode() + " " + aqcd.getConditionSign() + " " + aqcd.getConditionValue();
			condition_type = aqcd.getConditionType();
			condition_field_code = aqcd.getConditionFieldCode();
		}	
	
		if(condition_type.equals("SELECTED")){
			conditionFieldCode += ")";
		}
		
		
		sql = "select distinct AUS.USERNAME from " + aqd.getTableCode() + " where "  + conditionFieldCode + " and AUS.DEPTCODE in (" + aqd.getDeptCode() + ")";
		if(!aqd.getOrderFieldCode().equals("")){
			sql += " order by " + aqd.getOrderFieldCode();
		}

		String querystr = "";	
		querystr = "id=" + id;	
				
		int pagesize = 10;
		Paginator paginator = new Paginator(request);
		int curpage = paginator.getCurPage();
			
		UserInfoDb uid = new UserInfoDb();
		
		ListResult lr = uid.listResult(sql, curpage, pagesize);
		int total = lr.getTotal();
		Vector v = lr.getResult();
	    Iterator ir = null;
		if (v!=null)
			ir = v.iterator();
		paginator.init(total, pagesize);
		// 设置当前页数和总页数
		int totalpages = paginator.getTotalPages();
		if (totalpages==0)
		{
			curpage = 1;
			totalpages = 1;
		}
%>
      <table border="0" cellpadding="0" cellspacing="0" width="95%" align="center">
        <tr> 
          <td align="right">找到符合条件的记录 <b><%=paginator.getTotal()%></b> 条 每页显示 <b><%=paginator.getPageSize()%></b> 条 页次 <b><%=curpage%>/<%=totalpages%></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td align="center"> 	  
	  <table border="0" cellpadding="0" cellspacing="0" width="98%">
        <tr bgcolor="#C4DAFF">
            <td width="45%" height="24" align="center">所在部门</td>
			<td width="10%" height="24" align="center">姓名</td>          
            <td align="center">其他信息</td>
          </tr>
<%
		int i = 0;
		String deptCode = "", deptName = "", str = "";	
		String tableFullCode = aqd.getTableCode();
        String[] tableFullCodeArr = tableFullCode.split(",");
		TableInfoDb tid = new TableInfoDb();

			        
		com.redmoon.oa.archive.DeptDb db = new com.redmoon.oa.archive.DeptDb();		
		while(ir.hasNext()){
			uid = (UserInfoDb)ir.next();
			deptCode = uid.getDeptCode();
			
			db = db.getDeptDb(deptCode); 
			deptName = db.getName();
			
			while(!db.getParentCode().equals("root")){
				deptCode = db.getParentCode();				
				db = db.getDeptDb(deptCode);
				deptName = db.getName() + deptName;
			}	
			/*
			while(i < tableFullCodeArr.length){
				String[] tableCodeArr = tableFullCodeArr[i].split(" ");
				tid = tid.getTableInfoDb(tableCodeArr[0]);
				str += "<a href='basic_date/" + tid.getTableCode() + "_list.jsp?userName=" + uid.getUserName() + "'>" + tid.getTableDescription()+ "</a>&nbsp;&nbsp;";
		    }
			*/				
%>
        <tr>
          <td height="22" align="left"><%=deptName%></td> 
          <td height="22" align="left"><%=uid.getUserRealName()%></td> 
          <td height="22" align="center"><%=str%>
		  </td>
          </tr>
<%
		}
%>	
      </table>
    </td>
  </tr>
  <tr align="center"> 
    <td></td>
  </tr>
   <tr> 
    <td align="right">  
      <table border="0" cellspacing="1" align="right" class="9black">
        <tr> 
          <td width="1%" height="23">&nbsp;</td>
          <td height="23" valign="baseline" align="right"> 
            <div>
             <%
			   out.print(paginator.getCurPageBlock("?"+querystr));
			 %>
            &nbsp;</div></td>
        </tr>
      </table>    
	</td>
  </tr>
  </form>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -