📄 savearchiveaction.java
字号:
elecno=toChat_4(categray)+"("+nowyear+")-"+toFlowno_3(temp_int)+"-"+toChat_3(unitno);
}else{
elecno=toChat_4(categray)+"("+nowyear+")-"+"001"+"-"+toChat_3(unitno);
}
System.out.println("会档---------------------"+elecno);
}
}
//特种载体档案,
if(archivetype.equals("特种载体") || archivetype.equals("特种载体档案")){
String ztzl="";
if(filetype.equals("照片档案")){
ztzl="Z";
sql="select max(archivalcode) from fArchive where filetype='照片档案' ";
sql+=" and FileDate>=cdate('"+nowyear+"-01-01"+"') and FileDate<=cdate('"+nowyear+"-12-31"+"')";
ms=data.getSTResult(sql,properties);
String last_maxarchivalcode="";
ms.next();
String maxarchivalcode=ms.getString(1);
if(!last_maxarchivalcode.equals("") && last_maxarchivalcode.length()>=14){
last_maxarchivalcode=maxarchivalcode.substring(11,14);
}else{
last_maxarchivalcode="0";
}
int temp_int=Integer.parseInt(last_maxarchivalcode);
//temp_int=temp_int+1;
elecno=nowyear+ztzl+toFlowno_3(temp_int);
if(option.equals("z")){
sql="select max(archivalcode) from fArchive where filetype='照片档案' ";
sql+=" and FileDate>=cdate('"+nowyear+"-01-01"+"') and FileDate<=cdate('"+nowyear+"-12-31"+"')";
ms=data.getSTResult(sql,properties);
ms.next();
maxarchivalcode=ms.getString(1);
//如果已经存在同组的照片档案
if(maxarchivalcode.length()>=11){
last_maxarchivalcode=maxarchivalcode.substring(9,11);
temp_int=Integer.parseInt(last_maxarchivalcode);
//temp_int=temp_int+1;
elecno=elecno+"."+toFlowno_3(temp_int);
//System.out.println("照片档案---------------------"+elecno);
//不存在照片档案流水号
}else{
elecno=elecno+"."+"01";
//System.out.println("照片档案---------------------"+elecno);
}
}
}else if(filetype.equals("实物档案")){
ztzl="S";
sql="select max(archivalcode) from fArchive where filetype='实物档案' ";
sql+=" and FileDate>=cdate('"+nowyear+"-01-01"+"') and FileDate<=cdate('"+nowyear+"-12-31"+"')";
//取出实物档案的当前流水号
ms=data.getSTResult(sql,properties);
if(option==null || option.equals("") || option.equals("null")){
option="01";
}
if(ms!=null){
ms.next();
String maxarchivalcode=ms.getString(1);
String last_maxarchivalcode="";
if(!last_maxarchivalcode.equals("") && last_maxarchivalcode.length()>=11){
last_maxarchivalcode=maxarchivalcode.substring(8,11);
}else{
last_maxarchivalcode="0";
}
int temp_int=Integer.parseInt(last_maxarchivalcode);
//temp_int=temp_int+1;
elecno=nowyear+ztzl+option+"."+toFlowno_3(temp_int);
}else{
elecno=nowyear+ztzl+option+"."+"001";
}
System.out.println("实物档案---------------------"+elecno);
}else {
ztzl="L";
sql="select max(archivalcode) from fArchive where filetype<>'照片档案' and filetype<>'实物档案' and archivetype='特种载体档案'";
sql+=" and FileDate>=cdate('"+nowyear+"-01-01"+"') and FileDate<=cdate('"+nowyear+"-12-31"+"')";
ms=data.getSTResult(sql,properties);
String last_maxarchivalcode="";
if(ms!=null){
ms.next();
String maxarchivalcode=ms.getString(1);
if(!maxarchivalcode.equals("") && maxarchivalcode.length()>8){
last_maxarchivalcode=maxarchivalcode.substring(5,8);
int temp_int=Integer.parseInt(last_maxarchivalcode);
//temp_int=temp_int+1;
elecno=nowyear+ztzl+toFlowno_3(temp_int);
}else{
elecno=nowyear+ztzl+"001";
}
}else{
elecno=nowyear+ztzl+"001";
}
System.out.println("特种载体---------------------"+elecno);
}
}
return elecno;
}
//2003-06-03 add by liqf
//计算解密日期的方法
public String toDate(String date,String archivedate){
String new_date="";
String last_date="";
int a=0;
if(archivedate!=null && !archivedate.equals("") && !archivedate.equals("null")){
//archivedate=archivedate.substring(0,4);
a=Integer.parseInt(archivedate.substring(0,4));
last_date=archivedate.substring(4);
}
if(a!=0){
if(date.equals("永久")){
new_date=null;
}
if(date.equals("长期")){
a=a+50;
}
if(date.equals("短期")){
a=a+15;
}
if(date.equals("50年")){
a=a+50;
}
if(date.equals("25年")){
a=a+25;
}
if(date.equals("15年")){
a=a+15;
}
if(date.equals("10年")){
a=a+10;
}
if(date.equals("5年")){
a=a+5;
}
if(date.equals("3年")){
a=a+3;
}
}
if(new_date!=null){
new_date=""+a;
new_date=new_date+last_date;
System.out.println("new_date======================="+new_date);
}
return new_date;
}
//2003-06-04 add by liqf
//生成四位字符串,不足的用0补足
//返回类型为"xxxx",x:0-9,a-z
public String toChat_4(String flowno)
{
String folwno_new="";
//flowno=flowno+1;
if(flowno.length()==0){
folwno_new="0001";
}
if(flowno.length()==1){
folwno_new="000"+flowno;
}
if(flowno.length()==2){
folwno_new="00"+flowno;
}
if(flowno.length()==3){
folwno_new="0"+flowno;
}
if(flowno.length()==4){
folwno_new=flowno;
}
if(flowno.length()>4){
folwno_new=flowno.substring(0,4);
}
return folwno_new;
}
//2003-06-04 add by liqf
//生成三位字符串,不足的用0补足
//返回类型为"xxx",x:0-9,a-z
public String toChat_3(String flowno)
{
String folwno_new="";
//flowno=flowno+1;
if(flowno.length()==0){
folwno_new="001";
}
if(flowno.length()==1){
folwno_new="00"+flowno;
}
if(flowno.length()==2){
folwno_new="0"+flowno;
}
if(flowno.length()==3){
folwno_new=flowno;
}
if(flowno.length()>4){
folwno_new=flowno.substring(0,3);
}
return folwno_new;
}
//2003-06-03 add by liqf
//生成五位数字,不足的用0补足
//返回类型为"xxxxx",x:0-9
public String toFlowno(int flowno)
{
String folwno_new="";
flowno=flowno+1;
if(flowno<10){
folwno_new=""+flowno;
folwno_new="0000"+folwno_new;
}
if(flowno<100 && flowno>9){
folwno_new=""+flowno;
folwno_new="000"+folwno_new;
}
if(flowno<1000 && flowno>99){
folwno_new=""+flowno;
folwno_new="00"+folwno_new;
}
if(flowno<10000 && flowno>999){
folwno_new=""+flowno;
folwno_new="0"+folwno_new;
}
if(flowno<100000 && flowno>9999){
folwno_new=""+flowno;
folwno_new=folwno_new;
}
if(flowno>99999){
folwno_new=""+flowno;
folwno_new=folwno_new;
}
return folwno_new;
}
//2003-06-03 add by liqf
//生成四位数字,不足的用0补足
//返回类型为"xxxx",x:0-9
public String toFlowno_4(int flowno)
{
String folwno_new="";
flowno=flowno+1;
if(flowno<10){
folwno_new=""+flowno;
folwno_new="000"+folwno_new;
}
if(flowno<100 && flowno>9){
folwno_new=""+flowno;
folwno_new="00"+folwno_new;
}
if(flowno<1000 && flowno>99){
folwno_new=""+flowno;
folwno_new="0"+folwno_new;
}
if(flowno<10000 && flowno>999){
folwno_new=""+flowno;
folwno_new=folwno_new;
}
return folwno_new;
}
//2003-06-03 add by liqf
//生成三位数字,不足的用0补足
//返回类型为"xxx",x:0-9
public String toFlowno_3(int flowno)
{
String folwno_new="";
flowno=flowno+1;
if(flowno<10){
folwno_new=""+flowno;
folwno_new="00"+folwno_new;
}
if(flowno<100 && flowno>9){
folwno_new=""+flowno;
folwno_new="0"+folwno_new;
}
if(flowno<1000 && flowno>99){
folwno_new=""+flowno;
folwno_new=folwno_new;
}
return folwno_new;
}
//转化字符
public String Iso2Gb(String s)
{
String s1 = s != null ? s : "";
try
{
byte abyte0[] = s.getBytes("ISO-8859-1");
return new String(abyte0, "gb2312");
}
catch(Exception exception)
{
return s1;
}
}
public String changeString(String s)
{
String s1 = s;
if(s1 == null || s1.equals("null"))
s1 = "";
return s1;
}
//创建目录。
//s:传入的需要创建的文件夹名称
public String Mkdir(String s){
File file = new File(s);
if(file == null){
String s1 = " Can't create null directory";
s1 = "0";
return s1;
}
if(file.isFile()){
String s2 = "this directory" + file.getAbsolutePath() + " exist";
s2 = "1";
return s2;
}
if(!file.exists()){
boolean flag = file.mkdirs();
if(!flag){
String s3 = "Create Directory failue" + file.getAbsolutePath();
s3 = "2";
return s3;
} else{
String s4 = "9";
System.out.println("Directory is created!!!!!!!!!========="+file.getAbsolutePath());
return s4;
}
}else{
String s5 = "\u9519\u8BEF\u539F\u56E0:<BR>\u76EE\u5F55<b>" + file.getAbsolutePath() + "</b>\u5DF2\u5B58\u5728\u3002";
s5 = "3";
return s5;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -