?? articlebean.java
字號(hào):
/**********************************************************
All rights reserved.
Filename: ArticleBean.java
Version 1.0
Date:2003-10-21
Description:查詢發(fā)表文章時(shí)所須的信息及增加記錄、修改記錄、刪除記錄
Other:
Variable List:
1.int strID //文章編號(hào)
Function List:
1.public ArticleBean()//構(gòu)造函數(shù)
2.public void setID(String o)//設(shè)置文章編號(hào)
4.public Hashtable getOneData() //取得一篇文章的信息
5. public Vector getOnePage(String flag,int page,int records)//
6.public int addArticle(Hashtable hash)//增加文章表數(shù)據(jù)記錄
public Vector getOrg(String uid) //獲得個(gè)人能發(fā)表文章的部門(mén)
public Vector getWzlx(String orgid) //獲得個(gè)人能發(fā)表文章的可選類(lèi)型
public Vector getkybm(String uid) //獲得個(gè)人能發(fā)表文章的可用版面
public Hashtable getbmqx(String uid) //獲得個(gè)人有管理員權(quán)限的所有版面
public Hashtable getorgqx(String uid) //獲得個(gè)人可發(fā)表文章和可管理的部門(mén)
public int updateCZQX(qx,zgbh)//修改ZZ_ZGB的 LRSF 柳美
public int updateWZQX(qx,zgbh)//修改ZZ_ZGZWB的 WZQX 柳美
public Vector getwzly()//從字典表取得文章來(lái)源 柳美
History:
***********************************************************/
package oa.bean;
import java.text.*;
import java.util.*;
import java.util.Date;
import java.lang.*;
import java.io.*;
import java.io.File;
import java.sql.*;
import oa.main.*;
public class ArticleBean extends ParentBean
{
int strID = -1; //文章編號(hào)
public void setID(String o)//設(shè)置文章編號(hào)
{
strID = Integer.parseInt(o);
}
public Hashtable getorgqx(String uid)//獲得個(gè)人可發(fā)表文章和可管理的部門(mén)
{
Hashtable hash = new Hashtable();
String lr = "";//可發(fā)表到的部門(mén)
String gl = "";//可管理的部門(mén)
String sql = "";
sql = "select news.zz_fbxwb.BMBH,news.zz_fbxwb.SFGL from news.zz_fbxwb,news.zz_bmb where zgbh='"+uid+"' and lb=2 and news.zz_fbxwb.BMBH=news.zz_bmb.BMBH order by news.zz_bmb.JBXH";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try{
while(rs.next())
{
String bmbh = ds.toString(rs.getString(1));
String sfgl = ds.toString(rs.getString(2));
if(!lr.equals(""))
{
lr = lr + ",";
}
lr = lr + bmbh;
if(sfgl.equals("1"))
{
if(!gl.equals(""))
{
gl = gl + ",";
}
gl = gl + bmbh;
}
}
}catch(Exception e){System.out.println("AticleBean.getorgqx(String)處理時(shí)出錯(cuò)了:"+e);}
finally{
if(rs != null) try{stmt = rs.getStatement();rs.close();}catch(Exception e){System.out.println("AticleBean.getorgqx(String)試圖釋放記錄集rs時(shí)出錯(cuò):"+e);}
if(stmt != null)try{stmt.close();}catch(Exception e){System.out.println("AticleBean.getorgqx(String)試圖釋放聲明Statement時(shí)出錯(cuò):"+e);}
}
hash.put("LR",lr);
hash.put("GL",gl);
return hash;
}
public Hashtable getbmqx(String uid)//獲得個(gè)人有管理員權(quán)限的所有版面
{
String showqx1 = "";//所有可審批的位于menu表中的版面
String showqx2 = "";//所有可審批的位于menuchild表中的版面
String imgqx1 = "";//所有可審批圖片的位于menu表中的版面
String imgqx2 = "";//所有可審批圖片的位于menuchild表中的版面
String headqx1 = "";//所有可審批首頁(yè)的位于menu表中的版面
String headqx2 = "";//所有可審批首頁(yè)的位于menuchild表中的版面
String goodqx1 = "";//所有可審批焦點(diǎn)的位于menu表中的版面
String goodqx2 = "";//所有可審批焦點(diǎn)的位于menuchild表中的版面
Hashtable ht = new Hashtable();
ResultSet rs= null;
MenuBean mb = null;
Statement stmt = null;
try{
mb = new MenuBean();
String sql = "select dxbh,cz,whichtable from news.zz_fbxwb where zgbh='"+uid+"' and lb='1' and sf='2' ";
rs = selectRecord(sql);
while(rs.next())
{
String dxbh = ds.toString(rs.getString(1));
String cz = ds.toString(rs.getString(2));
String whichtable = ds.toString(rs.getString(3));
String str1 = "";//保存中間結(jié)果
String str2 = "";//保存中間結(jié)果
String sql_1 = "";
ResultSet rs_1 = null;
String id1="",id2="",id3="";
if(whichtable.equals("1"))//在menu表中
{
sql_1 = "select id,id1,id2,id3 from news.menu where id = "+dxbh;
rs_1 = selectRecord(sql_1);
try{
if(!rs_1.next())
return ht;
id1 = ds.toString(rs_1.getString(2));
id2 = ds.toString(rs_1.getString(3));
id3 = ds.toString(rs_1.getString(4));
}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)運(yùn)行時(shí)出錯(cuò):"+e);}
finally{
if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉記錄集rs時(shí)出錯(cuò)"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉聲明時(shí)statement出錯(cuò)"+e);}
}
if(id2.equals("0"))//一級(jí)菜單
{
sql_1 = "select id from news.menu where id1='"+id1+"'";
rs_1 = selectRecord(sql_1);
try{
while(rs_1.next())
{
if(!str1.equals(""))
{
str1 = str1 + ",";
}
str1 = str1 + ds.toString(rs_1.getString(1));
}
}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)運(yùn)行時(shí)出錯(cuò):"+e);}
finally{
if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉記錄集rs時(shí)出錯(cuò)"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉聲明時(shí)statement出錯(cuò)"+e);}
}
sql_1 = "select id from news.menuchild where idparent in ("+str1+") and isthis='0'";
rs_1 = selectRecord(sql_1);
try{
while(rs_1.next())
{
if(!str2.equals(""))
{
str2 = str2 + ",";
}
str2 = str2 + ds.toString(rs_1.getString(1));
}
}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)運(yùn)行時(shí)出錯(cuò):"+e);}
finally{
if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉記錄集rs時(shí)出錯(cuò)"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉聲明時(shí)statement出錯(cuò)"+e);}
}
}
if(id3.equals("0")&&!id2.equals("0"))//二級(jí)菜單
{
sql_1 = "select id from news.menu where id1='"+id1+"' and id2='"+id2+"'";
rs_1 = selectRecord(sql_1);
try{
while(rs_1.next())
{
if(!str1.equals(""))
{
str1 = str1 + ",";
}
str1 = str1 + ds.toString(rs_1.getString(1));
}
}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)運(yùn)行時(shí)出錯(cuò):"+e);}
finally{
if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉記錄集rs時(shí)出錯(cuò)"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉聲明時(shí)statement出錯(cuò)"+e);}
}
sql_1 = "select id from news.menuchild where idparent in ("+str1+") and isthis='0'";
rs_1 = selectRecord(sql_1);
try{
while(rs_1.next())
{
if(!str2.equals(""))
{
str2 = str2 + ",";
}
str2 = str2 + ds.toString(rs_1.getString(1));
}
}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)運(yùn)行時(shí)出錯(cuò):"+e);}
finally{
if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉記錄集rs時(shí)出錯(cuò)"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉聲明時(shí)statement出錯(cuò)"+e);}
}
}
if(!id3.equals("0"))//三級(jí)菜單
{
if(!str1.equals(""))
{
str1 = str1 + ",";
}
str1 = str1 + dxbh;
sql_1 = "select id from news.menuchild where idparent in ("+str1+") and isthis='0'";
rs_1 = selectRecord(sql_1);
try{
while(rs_1.next())
{
if(!str2.equals(""))
{
str2 = str2 + ",";
}
str2 = str2 + ds.toString(rs_1.getString(1));
}
}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)運(yùn)行時(shí)出錯(cuò):"+e);}
finally{
if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉記錄集rs時(shí)出錯(cuò)"+e);}
if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)關(guān)閉聲明時(shí)statement出錯(cuò)"+e);}
}
}
if(!str1.equals(""))
{
if(!showqx1.equals(""))
{
showqx1 = showqx1 + ",";
}
showqx1 = showqx1 + str1;
if(cz.equals("1"))//審焦點(diǎn)
{
if(!goodqx1.equals(""))
{
goodqx1 = goodqx1 + ",";
}
goodqx1 = goodqx1 + str1;
}
if(cz.equals("2"))//審首頁(yè)
{
if(!headqx1.equals(""))
{
headqx1 = headqx1 + ",";
}
headqx1 = headqx1 + str1;
}
if(cz.equals("3"))//審圖片
{
if(!imgqx1.equals(""))
{
imgqx1 = imgqx1 + ",";
}
imgqx1 = imgqx1 + str1;
}
}
if(!str2.equals(""))
{
if(!showqx2.equals(""))
{
showqx2 = showqx2 + ",";
}
showqx2 = showqx2 + str2;
if(cz.equals("1"))//審焦點(diǎn)
{
if(!goodqx2.equals(""))
{
goodqx2 = goodqx2 + ",";
}
goodqx2 = goodqx2 + str2;
}
if(cz.equals("2"))//審首頁(yè)
{
if(!headqx2.equals(""))
{
headqx2 = headqx2 + ",";
}
headqx2 = headqx2 + str2;
}
if(cz.equals("3"))//審圖片
{
if(!imgqx2.equals(""))
{
imgqx2 = imgqx2 + ",";
}
imgqx2 = imgqx2 + str2;
}
}
}
if(whichtable.equals("2"))//menuchild表中
{
str2 = dxbh;
if(!showqx2.equals(""))
{
showqx2 = showqx2 + ",";
}
showqx2 = showqx2 + str2;
if(cz.equals("1"))//審焦點(diǎn)
{
if(!goodqx2.equals(""))
{
goodqx2 = goodqx2 + ",";
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -