📄 backuparchivelistaction.java
字号:
sql+=" WHERE DELETED<>'1' ";
}else if(!userInfo.hasPopedom(4) && !userInfo.hasPopedom(5)){
//普通用户
sql+=" WHERE DELETED<>'1' AND SECURITYCLASS='普通'";
}
//sql+=" WHERE DELETED<>'1'";
}
String sql9=sql;
ArchiveList archiveList = new ArchiveList();
session.setAttribute(Constants.ARCHIVELIST_KEY,archiveList);
Properties dbBase = new Properties();
dbBase.setProperty("dsJndiName",Constants.DATABASE_KEY);
STPoolDataSet data = new STPoolDataSet();
//得到每个用户对于自己每页所显示的查询结果条数,如果用户没有设置,默认为10。
int perpage = 0;
try
{
perpage = Integer.parseInt((String)(session.getAttribute(Constants.ROWSPERPAGE)));
}
catch (Exception e)
{
perpage = 10;
}
int total = 0;
int totalPage = 0;
int curPage;
String sPageNo = request.getParameter("pageno");
if (sPageNo==null )
curPage = 1;
else
curPage = (Integer.parseInt(sPageNo));
String sGoPageNo = request.getParameter("goPage");
if (sGoPageNo!=null )
curPage = (Integer.parseInt(sGoPageNo));
//String sql = "";
Archive arc = (Archive)session.getAttribute(Constants.ARCHIVE_KEY);
//sql=arc.searchsql("","");
//sql="SELECT * FROM FARCHIVE ORDER BY SERIALNO";
sql=sql+generateSql(request);
//System.out.println("sql================="+sql);
//2003-05-28 add by liqf
//将查询所用sql置入session
//第一次进入,未翻页之前
String currentpage=(String)request.getParameter("currentpage");
//System.out.println("currentpage================="+currentpage);
if(currentpage==null || currentpage.equals("") || currentpage.equals("null")){
session.setAttribute("searchsql",sql);
//System.out.println("3333333333333333333================="+sql);
}
if(currentpage!=null && !currentpage.equals("") && !currentpage.equals("null")){
sql=(String)session.getAttribute("searchsql");
}
if(sql==null || sql.equals("") || sql.equals("null")){
sql=sql9;
}
//System.out.println("2222222222222222222================="+sql);
STResultSet rs = data.getSTResult(sql,dbBase);
//2003-05-29 add by liqf
//int count=data.getReturnCount();
int count=rs.getRecCount();
String[] temp=new String[count];
//2003-05-29 add by liqf
//System.out.println("sql11111111111111111111111================="+sql);
STResultSet ns = data.getSTResult(sql,dbBase);
int i=0;
while(ns!=null && ns.next()){
temp[i]=""+ns.getInt("SERIALNO");
i++;
}
//System.out.println("j========="+j);
//2003-06-07 add by liqf
//增加分页处理
// STResultSet rs=data.getSTResult(sql1,dbBase);
long data_num=rs.getRecCount();
//System.out.println("data_num====="+data_num);
long Current_Page = 0;
PageCt PageCt=new PageCt();
if (currentpage != null && !currentpage.equals("") && !currentpage.equals(""))
{
Current_Page = Integer.parseInt(request.getParameter("currentpage"));
}
String Query_Page=(String)request.getParameter("Query_Page");
if (Query_Page!=null && !Query_Page.equals(""))
{
Current_Page = Integer.parseInt(request.getParameter("Query_Page"))-1;
}
PageCt.Init(Current_Page,data_num,session);
long l_start = PageCt.getStart();
//System.out.println("l_start==================="+l_start);
long l_end = PageCt.getEnd();
//System.out.println("l_end==================="+l_end);
long i1=0;
//System.out.println("PageCt==================="+PageCt.getTotalnum());
while((i1<l_start) && rs.next())
{
i1++;
}
//输出查询结果
long j=0;
String temp_attachmentpath="";
while(rs!=null && rs.next() && (i1<l_end))
{
j=i1+1;
Archive archive = new Archive();
//2003-05-29 add by liqf
archive.setVolumnno(rs.getString("VOLUMNNO"));
archive.setDeleted(rs.getString("Deleted"));
archive.setSerialno(rs.getInt("SERIALNO"));
temp_attachmentpath=rs.getString("attachmentpath");
temp_attachmentpath=temp_attachmentpath.replace('\\', '/');
archive.setAttachmentpath(temp_attachmentpath);
archive.setFlowno(rs.getString("unitno"));
archive.setFlowno(rs.getString("FLOWNO"));
archive.setStatus(rs.getString("STATUS"));
archive.setArchivetype(rs.getString("ARCHIVETYPE"));
archive.setCode(rs.getString("CODE"));
archive.setCategory(rs.getString("CATEGORY"));
archive.setFiletype(rs.getString("FILETYPE"));
archive.setTitle(rs.getString("TITLE"));
archive.setTitleremark(rs.getString("TITLEREMARK"));
archive.setFileno(rs.getString("FILENO"));
archive.setLiteraturetype(rs.getString("LITERATURETYPE"));
archive.setFiledate(rs.getDate("FILEDATE"));
archive.setPagenumber(rs.getInt("PAGENUMBER"));
archive.setDuty(rs.getString("DUTY"));
archive.setOtherduty(rs.getString("OTHERDUTY"));
archive.setElectronicfilename(rs.getString("ELECTRONICFILENAME"));
archive.setAttachmenttitle(rs.getString("ATTACHMENTTITLE"));
archive.setKeyword(rs.getString("KEYWORD"));
archive.setMemo(rs.getString("MEMO"));
archive.setAnnotation(rs.getString("ANNOTATION"));
archive.setAbstractmsg(rs.getString("ABSTRACT"));
archive.setCopys(rs.getInt("COPYS"));
archive.setLendnum(rs.getInt("LENDNUM"));
archive.setSecurityclass(rs.getString("SECURITYCLASS"));
archive.setSecurityterm(rs.getInt("SECURITYTERM"));
archive.setDecryptiondate(rs.getDate("DECRYPTIONDATE"));
archive.setRetentionperiod(rs.getString("RETENTIONPERIOD"));
//System.out.println(");
archive.setArchivedate(rs.getDate("ARCHIVEDATE"));
archive.setDestroydate(rs.getDate("DESTROYDATE"));
archive.setArchivalcode(rs.getString("ARCHIVALCODE"));
archive.setArchiveno(rs.getString("ARCHIVENO"));
archive.setHandover(rs.getString("HANDOVER"));
archive.setSuggest(rs.getString("SUGGEST"));
archive.setRecordtransfer(rs.getString("RECORDTRANSFER"));
archive.setFilingtrace(rs.getString("FILINGTRACE"));
archive.setFilingscripts(rs.getString("FILINGSCRIPTS"));
archive.setReappraisedates(rs.getString("REAPPRAISEDATES"));
archiveList.addArchive(archive);
i1++;
}
total = count;
//System.out.println("total========="+total);
archiveList.setTotal(total);
//System.out.println("total========="+archiveList.getTotal());
// Report any errors we have discovered back to the original form
if (!errors.empty()) {
saveErrors(request, errors);
return (new ActionForward(mapping.getInput()));
}
//2003-06-07 add by liqf
//增加分页处理
session.setAttribute("PageCt", PageCt);
//System.out.println("sql================="+sql);
String volumnno=request.getParameter("volumnno");
//System.out.println("volumnno======"+volumnno);
session.setAttribute("temp", temp);
if(volumnno!=null && !volumnno.equals("") && !volumnno.equals("null")){
//System.out.println("volumnno1111111111======"+volumnno);
session.setAttribute("back", volumnno);
}
session.setAttribute(Constants.ARCHIVELIST_KEY, archiveList);
//System.out.println("555555555555555555555555555555555555555");
// Remove the obsolete form bean
if (mapping.getAttribute() != null) {
if ("request".equals(mapping.getScope()))
request.removeAttribute(mapping.getAttribute());
else
session.removeAttribute(mapping.getAttribute());
}
// Forward control to the specified success URI
return (mapping.findForward("success"));
//System.out.println("66666666666666666666666666666");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -