// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov Date: 2003-5-22 16:39:05
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: SaveArchiveAction.java
package com.stsc.archive.file;
import com.stsc.util.STPoolDataSet;
import com.stsc.util.STResultSet;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.apache.struts.upload.FormFile;
import com.stsc.archive.manage.User;
import com.stsc.util.PageCt;
// Referenced classes of package com.stsc.archive:
// ArchiveList, ArchiveForm, Archive
public final class SaveArchiveAction extends Action
{
public SaveArchiveAction()
{
}
public ActionForward perform(ActionMapping actionmapping, ActionForm actionform, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws IOException, ServletException
{
System.out.println("mapping.getAttribute(): = " + actionmapping.getAttribute());
System.out.println("mapping.getScope(): = " + actionmapping.getScope());
HttpSession httpsession = httpservletrequest.getSession();
ActionErrors actionerrors = new ActionErrors();
ArchiveList archivelist = new ArchiveList();
ArchiveForm archiveform = new ArchiveForm();
httpsession.setAttribute("archiveForm", archiveform);
String b1=Iso2Gb(httpservletrequest.getParameter("b1"));
//2003-06-01 add by liqf
//for forward
String b2=Iso2Gb(httpservletrequest.getParameter("b2"));
String s = httpservletrequest.getParameter("action");
if(s == null)
s = "Create";
int i = 0;
int j = 0;
int k = 0;
int l = 0;
String i1 ="";
String option=Iso2Gb(httpservletrequest.getParameter("r1"));
String unitno=Iso2Gb(httpservletrequest.getParameter("unitno"));
String s1 = httpservletrequest.getParameter("serialno");
String flowno = httpservletrequest.getParameter("flowno");
httpsession.setAttribute("serialno", s1);
String button = Iso2Gb(httpservletrequest.getParameter("b1"));
//2003-05-28 add by liqf
String volumnno=Iso2Gb(httpservletrequest.getParameter("volumnno"));
String copys=httpservletrequest.getParameter("copys");
if(copys==null || copys.equals("") || copys.equals("null")){
copys="0";
}
j = Integer.parseInt(copys);
String s2 = Iso2Gb(httpservletrequest.getParameter("code"));
String s5 = Iso2Gb(httpservletrequest.getParameter("title"));
String s3 = Iso2Gb(httpservletrequest.getParameter("archivetype"));
String s6 = Iso2Gb(httpservletrequest.getParameter("status"));
String s4 = Iso2Gb(httpservletrequest.getParameter("filetype"));
String s10 = Iso2Gb(httpservletrequest.getParameter("filedate"));
String s7 = Iso2Gb(httpservletrequest.getParameter("literaturetype"));
String s8 = Iso2Gb(httpservletrequest.getParameter("titleremark"));
String s9 = Iso2Gb(httpservletrequest.getParameter("fileno"));
// s10 = httpservletrequest.getParameter("filedate");
String pagenumber=httpservletrequest.getParameter("pagenumber");
if(pagenumber==null || pagenumber.equals("") || pagenumber.equals("null")){
pagenumber="0";
}
i = Integer.parseInt(pagenumber);
String s11 = Iso2Gb(httpservletrequest.getParameter("duty"));
String s13 = Iso2Gb(httpservletrequest.getParameter("electronicfilename"));
String s12 = Iso2Gb(httpservletrequest.getParameter("otherduty"));
String s14 = Iso2Gb(httpservletrequest.getParameter("keyword"));
//计算销毁日期
//按照保管期限和归档日期进行计算,即保管期限+归档日期
//取得归档日期
String s22 = httpservletrequest.getParameter("archivedate");
//String s24 = httpservletrequest.getParameter("destroydate");
String retentionperiod=httpservletrequest.getParameter("retentionperiod");
if(retentionperiod==null || retentionperiod.equals("") || retentionperiod.equals("null")){
retentionperiod="0";
}
i1 = Iso2Gb(retentionperiod);
//System.out.println("i1========================"+i1);
String s24="";
if(s22!=null && !s22.equals("") && !s22.equals("null")){
s24=toDate(i1,s22);
}
//System.out.println("s22========================"+s22);
//计算解密日期
//保密期限(年)+文件形成日期
//2003-06-03 add by liqf
String securityterm=httpservletrequest.getParameter("securityterm");
if(securityterm==null || securityterm.equals("") || securityterm.equals("null")){
securityterm="0";
}
l = Integer.parseInt(securityterm);
//System.out.println("l========================"+l);
// String s21 = httpservletrequest.getParameter("decryptiondate");
String s21="";
if(s10!=null && !s10.equals("") && !s10.equals("")){
int i9=i;
i9=l+Integer.parseInt(s10.substring(0,4));
s21=s10.substring(4);
String s101=""+i9;
s21=s101+s21;
}
//System.out.println("s21========================"+s21);
String s19 = Iso2Gb(httpservletrequest.getParameter("abstractmsg"));
String lendnum=httpservletrequest.getParameter("lendnum");
if(lendnum==null || lendnum.equals("") || lendnum.equals("null")){
lendnum="0";
}
k = Integer.parseInt(lendnum);
String s20 = Iso2Gb(httpservletrequest.getParameter("securityclass"));
String s26 = Iso2Gb(httpservletrequest.getParameter("handover"));
String s27 = Iso2Gb(httpservletrequest.getParameter("suggest"));
String s28 = Iso2Gb(httpservletrequest.getParameter("recordtransfer"));
String s16 = Iso2Gb(httpservletrequest.getParameter("category"));
String s29 = Iso2Gb(httpservletrequest.getParameter("filingtrace"));
String s30 = Iso2Gb(httpservletrequest.getParameter("filingscripts"));
String s31 = httpservletrequest.getParameter("reappraisedates");
String s17 = Iso2Gb(httpservletrequest.getParameter("attachmenttitle"));
//
String s15 = Iso2Gb(httpservletrequest.getParameter("memo"));
String s18 = Iso2Gb(httpservletrequest.getParameter("annotation"));
STPoolDataSet stpooldataset = new STPoolDataSet();
STResultSet rs=null;
Properties properties = new Properties();
properties.setProperty("dsJndiName", Constants.DATABASE_KEY);
//2003-06-03 add by liqf
//自动生成流水号
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy");
//取得当前年份
String nowyear=sdf2.format(new java.util.Date());
String td="DA";
//形成归档号
//调用 toElcno()方法
//String s25 = Iso2Gb(httpservletrequest.getParameter("archiveno"));
//String s23 = Iso2Gb(httpservletrequest.getParameter("archivalcode"));
String s23="";
String s25="";
if(s3.equals("图档")){
td="TZ";
}
else if(s3.equals("会档") || s3.equals("会计档案")){
td="HD";
}
else if(s3.equals("科档") || s3.equals("科技档案")){
td="KD";
}
else if(s3.equals("文档") || s3.equals("文书档案")){
td="WD";
}
else if(s3.equals("特种载体") || s3.equals("特种载体档案")){
td="TD";
}else{
td="QT";
}
String flow="";
//取出数字
String tempsql="SELECT MAX(FLOWNO) AS TOTAL FROM FARCHIVE WHERE ";
tempsql+="FileDate>=cdate('"+nowyear+"-01-01"+"') and FileDate<=cdate('"+nowyear+"-12-31"+"')";
tempsql+=" AND FLOWNO LIKE '%"+td+"%'";
System.out.println("tempsql==================================="+tempsql);
rs=stpooldataset.getSTResult(tempsql,properties);
String lastno="";
if(rs!=null && rs.next()){
lastno=rs.getString(1);
System.out.println("lastno==================================="+lastno);
}
if(lastno!=null