⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 articlebean.java

📁 运用java+jsp写的一个新闻发布系统
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/**********************************************************
All rights reserved.
Filename: ArticleBean.java
Version 1.0
Date:2003-10-21
Description:查询发表文章时所须的信息及增加记录、修改记录、删除记录
Other:
Variable List:
1.int strID //文章编号

Function List:
1.public ArticleBean()//构造函数
2.public void setID(String o)//设置文章编号

4.public Hashtable getOneData() //取得一篇文章的信息
5.	public Vector getOnePage(String flag,int page,int records)//

6.public int addArticle(Hashtable hash)//增加文章表数据记录
public Vector getOrg(String uid) //获得个人能发表文章的部门
public Vector getWzlx(String orgid) //获得个人能发表文章的可选类型
public Vector getkybm(String uid) //获得个人能发表文章的可用版面
public Hashtable getbmqx(String uid) //获得个人有管理员权限的所有版面 
public Hashtable getorgqx(String uid) //获得个人可发表文章和可管理的部门

public int updateCZQX(qx,zgbh)//修改ZZ_ZGB的 LRSF     柳美
public int updateWZQX(qx,zgbh)//修改ZZ_ZGZWB的 WZQX     柳美

public Vector getwzly()//从字典表取得文章来源    柳美


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; //文章编号
	

	public void setID(String o)//设置文章编号
	{
		strID = Integer.parseInt(o);
	}

	public Hashtable getorgqx(String uid)//获得个人可发表文章和可管理的部门
	{
		Hashtable hash = new Hashtable();
		String lr = "";//可发表到的部门
		String gl = "";//可管理的部门

		String sql = "";

		sql = "select zz_fbxwb.BMBH,zz_fbxwb.SFGL from zz_fbxwb,zz_bmb where zgbh='"+uid+"' and lb=2 and zz_fbxwb.BMBH=zz_bmb.BMBH order by 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)处理时出错了:"+e);}
		finally{
			if(rs != null) try{stmt = rs.getStatement();rs.close();}catch(Exception e){System.out.println("AticleBean.getorgqx(String)试图释放记录集rs时出错:"+e);}
			if(stmt != null)try{stmt.close();}catch(Exception e){System.out.println("AticleBean.getorgqx(String)试图释放声明Statement时出错:"+e);}
		}
		hash.put("LR",lr);
		hash.put("GL",gl);
		return hash;
	}



	public Hashtable getbmqx(String uid)//获得个人有管理员权限的所有版面 
	{
		String showqx1 = "";//所有可审批的位于menu表中的版面
		String showqx2 = "";//所有可审批的位于menuchild表中的版面
		String imgqx1 = "";//所有可审批图片的位于menu表中的版面
		String imgqx2 = "";//所有可审批图片的位于menuchild表中的版面
		String headqx1 = "";//所有可审批首页的位于menu表中的版面
		String headqx2 = "";//所有可审批首页的位于menuchild表中的版面
		String goodqx1 = "";//所有可审批焦点的位于menu表中的版面
		String goodqx2 = "";//所有可审批焦点的位于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 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 = "";//保存中间结果
			String str2 = "";//保存中间结果
			String sql_1 = "";
			ResultSet rs_1 = null;
			String id1="",id2="",id3="";
			if(whichtable.equals("1"))//在menu表中
			{
				sql_1 = "select id,id1,id2,id3 from 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)运行时出错:"+e);}
				finally{
					if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭记录集rs时出错"+e);}
					if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭声明时statement出错"+e);}		
				}

				if(id2.equals("0"))//一级菜单
				{
					sql_1 = "select id from 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)运行时出错:"+e);}
					finally{
						if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭记录集rs时出错"+e);}
						if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭声明时statement出错"+e);}		
					}
					
					sql_1 = "select id from 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)运行时出错:"+e);}
					finally{
						if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭记录集rs时出错"+e);}
						if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭声明时statement出错"+e);}		
					}
				}
				if(id3.equals("0")&&!id2.equals("0"))//二级菜单
				{
					sql_1 = "select id from 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)运行时出错:"+e);}
					finally{
						if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭记录集rs时出错"+e);}
						if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭声明时statement出错"+e);}		
					}
					
					sql_1 = "select id from 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)运行时出错:"+e);}
					finally{
						if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭记录集rs时出错"+e);}
						if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭声明时statement出错"+e);}		
					}
				}
				if(!id3.equals("0"))//三级菜单
				{				
					if(!str1.equals(""))
					{
						str1 = str1 + ",";
					}
					str1 = str1 + dxbh;					
					
					sql_1 = "select id from 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)运行时出错:"+e);}
					finally{
						if(rs_1!=null)try{ stmt = rs_1.getStatement(); rs_1.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭记录集rs时出错"+e);}
						if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("ArticleBean.getbmqx(String)关闭声明时statement出错"+e);}		
					}
				}
				if(!str1.equals(""))
				{
					if(!showqx1.equals(""))
					{
						showqx1 = showqx1 + ",";
					}
					showqx1 = showqx1 + str1;

					if(cz.equals("1"))//审焦点
					{
						if(!goodqx1.equals(""))
						{
							goodqx1 = goodqx1 + ",";
						}
						goodqx1 = goodqx1 + str1;
					}

					if(cz.equals("2"))//审首页
					{
						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"))//审焦点
					{
						if(!goodqx2.equals(""))
						{
							goodqx2 = goodqx2 + ",";
						}
						goodqx2 = goodqx2 + str2;
					}
					if(cz.equals("2"))//审首页
					{
						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"))//审焦点
				{
					if(!goodqx2.equals(""))
					{
						goodqx2 = goodqx2 + ",";
					}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -