📄 personbean.java
字号:
+ getBMBH()
+ "' and ZZZT=0 and JBXH >"
+ yjbxh;
deleteRecord(sql);
sql = "update ZZ_ZGB set ZZZT = 3 where ZGBH = '"+strPersonNO+"'";
deleteRecord(sql);
sql = "delete from ZZ_ZGZWB where ZGBH = '"+strPersonNO+"'";
deleteRecord(sql);
sql = "delete from ZZ_FBXWB where ZGBH = '"+strPersonNO+"'";
return deleteRecord(sql);
}
public void delDBPs()//从数据库中永久删除离退休等人员信息
{
String sql="";
sql = "delete from ZZ_ZGB where ZGBH = '"+strPersonNO+"'";
deleteRecord(sql);
}
public void resumePs()
{
String sql="";
sql = "update ZZ_ZGB set ZZZT=0,JBXH=1+(select JBXH) where ZGBH = '"+strPersonNO+"'";
sql = "update ZZ_ZGB set ZZZT=0,JBXH=(select max(JBXH)+1 from ZZ_ZGB where ZZZT=0 and BMBH=(select BMBH from ZZ_ZGB where ZGBH='"+strPersonNO+"')) where ZGBH='"+strPersonNO+"'";
deleteRecord(sql);
}
public String getOper()
{
String strOper = "";
String sql = "";
String strMRCZ = "1";
String strSYZT = "0";
String str1 = ",";
String str2 = "@";
String strBMBH = "";
String strZWBH = "";
String strMax = "";
int i,j;
sql = " select CZQX from ZZ_ZGZWB where ZGBH = '"+strPersonNO+"' ";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try{
while(rs.next())
{
String strX = ds.toString(rs.getString(1));
if (!strX.equals(""))
{
strMax+=strX+str2;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs!=null)try{ stmt = rs.getStatement(); rs.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
{
sql = "select a.CZQX from ZZ_ZWB a,ZZ_ZGZWB b where ZGBH = '"+strPersonNO+"' and a.zwzt<>1 and a.BMBH = b.BMBH and a.ZWBH = b.ZWBH ";
rs = selectRecord(sql);
try{
while(rs.next())//把此职工的所有职务的权限用(@)分割存储
{
String strX = ds.toString(rs.getString(1));//取得某一职务的权限
if (!strX.equals(""))
{
strMax+=strX+str2;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs!=null)try{ stmt = rs.getStatement(); rs.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
{
sql = "select ID from CODE_ANCZQXB where MRCZ = "+strMRCZ+" and SYZT = "+strSYZT+"";
ResultSet r = selectRecord(sql);
try{
while(r.next())
{
strOper+=ds.toString(r.getString("ID"))+str1;
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(r!=null)try{ stmt = r.getStatement(); r.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(strOper.length()!=0)
strOper = strOper.substring(0,strOper.length()-1);
if(strOper.length()==0)
strOper = "";
}
}
strMax = strMax.substring(0,strMax.length()-1);
String strMaxOper[] = strMax.split("@");
strMax = ",";
for(i=0;i<strMaxOper.length;i++)//取得此职工最大权限集合strMax
{
String strEp[] = strMaxOper[i].split(",");
for(j=0;j<strEp.length;j++)
{
strEp[j] = strEp[j];
if(strMax.indexOf("," + strEp[j] + ",")==-1)
{
strMax+=strEp[j]+str1;
}
}
}
strOper = strMax;
strOper = strOper.substring(1,strOper.length()-1);
return strOper;
}
public String getOper_lm()
{
String strOper = "";
String sql = "";
String strMRCZ = "1";
String strSYZT = "0";
String str1 = ",";
String str2 = "@";
String strBMBH = "";
String strZWBH = "";
String strMax = "";
int i,j;
sql = " select x.CZQX from ZZ_ZGZWB x,zz_zwb y where x.ZGBH = '"+strPersonNO+"' and y.zwzt<>1 and x.bmbh=y.bmbh and x.zwbh=y.zwbh and x.BMBH in ( select distinct a.BMBH from ZZ_ZGZWB a,ZZ_ZWB b where a.ZGBH='"+strPersonNO+"' and (a.CZQX like '%,73%' or a.CZQX like '%,73%,' or a.CZQX like '%73%,' or b.CZQX like '%,73%' or b.CZQX like '%,73%,' or b.CZQX like '%73%,') and b.zwzt<>1 and a.BMBH=b.BMBH and a.ZWBH=b.ZWBH ) ";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try{
while(rs.next())
{
String strX = ds.toString(rs.getString(1));//取得某一职务的权限
if (!strX.equals(""))
{
strMax+=strX+str2;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs!=null)try{ stmt = rs.getStatement(); rs.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(strMax.equals(""))
{
sql = "select a.CZQX from ZZ_ZWB a,ZZ_ZGZWB b where ZGBH = '"+strPersonNO+"' and a.zwzt<>1 and a.BMBH = b.BMBH and a.ZWBH = b.ZWBH and b.BMBH in ( select distinct a.BMBH from ZZ_ZGZWB a,ZZ_ZWB b where a.ZGBH='"+strPersonNO+"' and b.zwzt<>1 and (a.CZQX like '%,73%' or a.CZQX like '%,73%,' or a.CZQX like '%73%,' or b.CZQX like '%,73%' or b.CZQX like '%,73%,' or b.CZQX like '%73%,') and a.BMBH=b.BMBH and a.ZWBH=b.ZWBH ) ";
rs = selectRecord(sql);
try{
while(rs.next())
{
String strX = ds.toString(rs.getString(1));
if (!strX.equals(""))
{
strMax+=strX+str2;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs!=null)try{ stmt = rs.getStatement(); rs.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(strMax.equals(""))
{
sql = "select ID from CODE_ANCZQXB where MRCZ = "+strMRCZ+" and SYZT = "+strSYZT+"";
ResultSet r = selectRecord(sql);
try{
while(r.next())
{
strOper+=ds.toString(r.getString("ID"))+str1;
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(r!=null)try{ stmt = r.getStatement(); r.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(strOper.length()!=0)
strOper = strOper.substring(0,strOper.length()-1);
if(strOper.length()==0)
strOper = "";
return strOper;
}
}
strMax = strMax.substring(0,strMax.length()-1);
String strMaxOper[] = strMax.split("@");
strMax = ",";
for(i=0;i<strMaxOper.length;i++)
{
String strEp[] = strMaxOper[i].split(",");
for(j=0;j<strEp.length;j++)
{
strEp[j] = strEp[j];
if(strMax.indexOf("," + strEp[j] + ",")==-1)
{
strMax+=strEp[j]+str1;
}
}
}
strOper = strMax;
strOper = strOper.substring(1,strOper.length()-1);
return strOper;
}
public String toOperName(String strOperNo)
{
String strOper="";
String strOpers[] = strOperNo.split(",");
for(int i=0;i<strOpers.length;i++)
{
strOper+=db.toName("CODE_ANCZQXB","ID","MKMC",strOpers[i])+":"+db.toName("CODE_ANCZQXB","ID","ANMC",strOpers[i])+"<br>";
}
return strOper;
}
//将getFlow返回的流程权限编号转为汉字
public String toFlowName(String strFlowNo)
{
String strFlow="";
String strFlows[] = strFlowNo.split(",");
for(int i=0;i<strFlows.length;i++)//根据分割后的编号取得模块名称
{
strFlow+=db.toName("CODE_LCQXB","MKBH","MKMC",strFlows[i])+",";
}
strFlow = strFlow.substring(0,strFlow.length()-1);
return strFlow;
}
public String toFlowName1(String strFlowNo)
{
String strFlow="";
String strFlows[] = strFlowNo.split(",");
for(int i=0;i<strFlows.length;i++)
{
strFlow+=db.toName("CODE_LCQXB","MKBH","MKMC",strFlows[i])+"<br>";
}
return strFlow;
}
public String getFlow()
{
String strFlow = "";
String sql = "";
String strMRCZ = "1";
String strSYZT = "0";
String str1 = ",";
String str2 = "@";
String strBMBH = "";
String strZWBH = "";
String strMax = "";
int i,j;
sql = "select LCQX from ZZ_ZGZWB where ZGBH = '"+strPersonNO+"'";
ResultSet rs = null;
Statement stmt = null;
try{
rs = selectRecord(sql);
while(rs.next())
{
String strX = ds.toString(rs.getString("LCQX"));
if (!strX.equals(""))
{
strMax+=strX+str2;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs!=null)try{ stmt = rs.getStatement(); rs.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(strMax.equals(""))
{
sql = "select a.LCQX from ZZ_ZWB a,ZZ_ZGZWB b where ZGBH = '"+strPersonNO+"' and a.zwzt<>1 and a.BMBH = b.BMBH and a.ZWBH = b.ZWBH ";
ResultSet rs1 = selectRecord(sql);
try{
while(rs1.next())
{
String strX = ds.toString(rs1.getString("LCQX"));
if (!strX.equals(""))
{
strMax+=strX+str2;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs1!=null)try{ stmt = rs1.getStatement(); rs1.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(strMax.equals(""))
{
sql = "select MKBH from CODE_LCQXB where MRCZ = "+strMRCZ+" and SYZT = "+strSYZT+"";
ResultSet r = selectRecord(sql);
try{
while(r.next())
{
strFlow+=ds.toString(r.getString("MKBH"))+str1;
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(r!=null)try{ stmt = r.getStatement(); r.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(strFlow.length()!=0)
strFlow = strFlow.substring(0,strFlow.length()-1);
if(strFlow.length()==0)
strFlow = "";
return strFlow;
}
}
strMax = strMax.substring(0,strMax.length()-1);
String strMaxOper[] = strMax.split("@");
strMax = "";
for(i=0;i<strMaxOper.length;i++)
{
String strEp[] = strMaxOper[i].split(",");
for(j=0;j<strEp.length;j++)
{
if(strMax.indexOf(strEp[j])==-1)
{
strMax+=strEp[j]+str1;
}
}
}
strFlow = strMax;
return strFlow;
}
public boolean getFlow_new(String bmno,String qx)
{
boolean strFlow = false;
String sql = "";
String sql1 = " select distinct LCQX as AAA from ZZ_ZGZWB where LCQX is not null and ZGBH in (select ZGBH from ZZ_ZGB where BMBH='"+bmno+"')";
String sql2 = " select distinct a.LCQX from ZZ_ZWB a,ZZ_ZGZWB b where a.LCQX is not null and a.zwzt<>1 and a.BMBH=b.BMBH and a.ZWBH=b.ZWBH and b.ZGBH in (select ZGBH from ZZ_ZGB where BMBH ='"+bmno+"')";
String sql3 = " select to_char(MKBH) as AAA from CODE_LCQXB where MRCZ = 1 and SYZT = 0";
sql = sql1 + " union " + sql2 + " union "+ sql3;
ResultSet rs = selectRecord(sql1);
Statement stmt = null;
String t = "";
try{
while(rs.next())
{
t = rs.getString(1);
if(t.equals(qx)||t.indexOf(","+qx)!=-1||t.indexOf(","+qx+",")!=-1||t.indexOf(qx+",")!=-1)
{
strFlow = true;
break;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs!=null)try{ stmt = rs.getStatement(); rs.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
if(!strFlow)
{
ResultSet rs2 = selectRecord(sql2);
try{
while(rs2.next())
{
t = rs2.getString(1);
//System.out.println("b"+t+"b");
if(t.equals(qx)||t.indexOf(","+qx)!=-1||t.indexOf(","+qx+",")!=-1||t.indexOf(qx+",")!=-1)
{
strFlow = true;
break;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs2!=null)try{ stmt = rs2.getStatement(); rs2.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
}
if(!strFlow)
{
ResultSet rs3 = selectRecord(sql3);
try{
while(rs3.next())
{
t = rs3.getString(1);
if(t.equals(qx)||t.indexOf(","+qx)!=-1||t.indexOf(","+qx+",")!=-1||t.indexOf(qx+",")!=-1)
{
strFlow = true;
break;
}
}
}catch(Exception e){System.out.println("运行时出错:"+e);}
finally{
if(rs3!=null)try{ stmt = rs3.getStatement(); rs3.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -