📄 hreffileinfoaction.java
字号:
package com.stsc.archive.second;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import java.util.Properties;
import org.apache.struts.util.MessageResources;
import com.stsc.util.STPoolDataSet;
import com.stsc.util.STResultSet;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.ParseException;
public final class hreffileinfoAction extends Action
{
public ActionForward perform(ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse res)
{
System.out.println("进了hreffileinfoAction.java 123");
//建立session
HttpSession session = req.getSession();
//取得表单的数据
String convert=req.getParameter("convert");
String convert1=req.getParameter("convert1");
String convert2=req.getParameter("convert2");
System.out.println("convert的值是。。。。");
System.out.println(convert);
System.out.println("convert1的值是。。。。");
System.out.println(convert1);
System.out.println("convert2的值是。。。。");
System.out.println(convert2);
//把archivetype存到session中去
session.setAttribute("archivetype",convert);
session.setAttribute("archivetype1",convert1);
session.setAttribute("archivetype2",convert2);
System.out.println("出了hreffileinfoAction.java 123");
if(convert!=null)
{
return mapping.findForward("success1");
}
else if(convert1!=null)
{
return mapping.findForward("success2");
}
else
{
Properties dbBase=new Properties();
dbBase.setProperty("dsJndiName", Constants.ARCHIVE_DBSOURCE_KEY);
STPoolDataSet data=new STPoolDataSet();
String sql=(String)session.getAttribute("sql2");
STResultSet rs=data.getSTResult(sql,dbBase);
rs.next();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM");
String startdate2=null;
String enddate2=null;
String category=rs.getString("Category");
String archivetype=rs.getString("ArchiveType");
String security=rs.getString("Security");
String volumnno=rs.getString("VolumnNo");
//2003-05-28 add by liqf
//存入密级,类目号
session.setAttribute("category",category);
session.setAttribute("security",security);
session.setAttribute("volumnno",volumnno);
String volumntitle=rs.getString("VolumnTitle");
String code=rs.getString("Code");
String retentionperiod=rs.getString("RetentionPeriod");
if(rs.getDate("StartDate")==null && rs.getDate("EndDate")==null)
{
//startdate2="0";
//enddate2="0";
//System.out.println("进入if语句");
}
else if(rs.getDate("StartDate")==null && rs.getDate("EndDate")!=null)
{
//startdate2="0";
enddate2=sdf.format(rs.getDate("EndDate"));
//System.out.println("进入else if语句");
}
else if(rs.getDate("EndDate")==null && rs.getDate("StartDate")!=null)
{
//enddate2="0";
startdate2=sdf.format(rs.getDate("StartDate"));
//System.out.println("进入else if语句");
}
else
{
startdate2=sdf.format(rs.getDate("StartDate"));
enddate2=sdf.format(rs.getDate("EndDate"));
System.out.println(rs.getDate("StartDate"));
}
String totalnum=Integer.toString(rs.getInt("TotalNum"));
String totalpage=Integer.toString(rs.getInt("TotalPage"));
String duty=rs.getString("Duty");
String archiveunit=rs.getString("ArchiveUnit");
String remark=rs.getString("Remark");
String status=rs.getString("Status");
int volumnid=rs.getInt("VolumnID");
//System.out.println("status语句");
((fileinfoForm)form).setvolumnno(volumnno);
((fileinfoForm)form).setvolumntitle(volumntitle);
((fileinfoForm)form).setcode(code);
((fileinfoForm)form).setcategory(category);
((fileinfoForm)form).setretentionperiod(retentionperiod);
((fileinfoForm)form).setstartdate(startdate2);
((fileinfoForm)form).setenddate(enddate2);
((fileinfoForm)form).settotalnum(totalnum);
((fileinfoForm)form).settotalpage(totalpage);
((fileinfoForm)form).setduty(duty);
((fileinfoForm)form).setsecurity(security);
((fileinfoForm)form).setarchiveunit(archiveunit);
((fileinfoForm)form).setremark(remark);
((fileinfoForm)form).setstatus(status);
((fileinfoForm)form).setvolumnid(volumnid);
return mapping.findForward("success3");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -