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

📄 manageservlet.java

📁 在系统开发过程中用到了javabean和jsp技术
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
				String strTopicId = ds.toString((String)request.getParameter("topicid"));

				//部门特有
				String strwzlx = ds.toString((String)request.getParameter("wzlxid"));
				Hashtable hash = new Hashtable();
				//公司和部门共有
				hash.put("TITLE",strTitle);
				hash.put("BMBH",strbm);
				hash.put("CONTENT",strContent);
				hash.put("ORGID",strOrgId);
				hash.put("FROMSITE",strFromSite);				
				hash.put("KEYWORD",strKeyword);
				//hash.put("HITS",strHits);
				hash.put("FTPFILE",strFTPFile);
				hash.put("IFHEAD",strIfhead);
				hash.put("IFGOOD",strIfgood);
				hash.put("IFIMG",strIfimg);
				hash.put("IFSHOW",strIfshow);
				hash.put("WRITER",struid);
				hash.put("AUTHOR",strAuthor);
				hash.put("OLDORGID",strOldOrgId);
				hash.put("STRSIZE",strsize);
				hash.put("CURSIZE",strcursize);

				String goen = "";//跳页
				
				if(strEdit.equals("1"))//新增文章
				{  
					if(strbm.equals("00000000000000000000"))//向公司加入一条记录
					{
						hash.put("MENUID",strMenuId);
						hash.put("TOPICID",strTopicId);
						hash.put("WHICHTABLE",strWhichTable);
						hash.put("IMG",strImg);

						goen="oa/manage/index.jsp?txt_type=11";
					}
					else//向部门加入一条记录
					{						
						hash.put("WZLX",strwzlx);
						hash.put("EDITER",struid);
						hash.put("EDITIP",strEditIP);

						goen="oa/manage/index.jsp?txt_type=11&wh=2";
					}	
					
					errcode = ab.addArticle(hash);
				}				
				
				if(strEdit.equals("2"))//修改文章
				{
					hash.put("MENUID",strMenuId);
					hash.put("TOPICID",strTopicId);
					hash.put("WHICHTABLE",strWhichTable);
					hash.put("IMG",strImg);
					
					ab.setID(strID);
					errcode = ab.modArticle(hash);

					String strwhere = ds.toString((String)request.getParameter("where"));
					goen="oa/manage/index.jsp?txt_type="+strwhere;
				}
				
				
				go = goen + "&errcode="+errcode;
				//response.sendRedirect(goen);
			}
			else if(strType.equals("11")&&strEdit.equals("3"))//审批文章
			{	
				ab = new ArticleBean();
				String strlx = ds.toString((String)request.getParameter("id"));
				if(strlx.equals("2"))//不通过
				{
					ab.setID(strID);
					Hashtable htsms = (Hashtable)ab.getOneData();
					String receiver = (String)htsms.get("WRITER");
					String title1 = "文章审批未通过";
					String content1 = "您发表的文章《"+(String)htsms.get("TITLE")+"》审批未通过,已经被删除!";
					Hashtable hashsms = new Hashtable();
					hashsms.put("receiver",receiver);
					hashsms.put("sender",struid);
					hashsms.put("title",title1);
					hashsms.put("content",content1);
					smsb = new SmsBean();
					errcode = smsb.addSMS(hashsms);
					errcode = ab.delData(strID);
				}
				if(strlx.equals("1"))//通过
				{
					Hashtable ht = new Hashtable();
					ht.put("ID",strID);
					ht.put("EDITER",struid);
					ht.put("EDITIP",request.getRemoteAddr());
					//System.out.println(ht);
					errcode = ab.updateArticle(ht);

				}

				go="oa/manage/index.jsp?txt_type=6&errcode"+errcode;
				//response.sendRedirect(goen);
			}
			else if(strType.equals("12"))//主题设置2003.11.1加入
			{	
				tb = new TopicBean();
				tb.setID(strID);
				if(strEdit.equals("1"))//新增设置
				{  
					String strNAME = ds.toString(ds.toGBK((String)request.getParameter("txt_name")));
					String strTYPE = ds.toString(ds.toGBK((String)request.getParameter("txt_kind")));
					String strINTRO = ds.toString(ds.toGBK((String)request.getParameter("txt_intro")));
					String strTIME = ds.getDateTime();
					String strSTATUS = ds.toString(ds.toGBK((String)request.getParameter("sel_status")));
					if(strSTATUS.equals("已公开")) strSTATUS="0";
					else strSTATUS="1";

					String strJBXH = ds.toString(ds.toGBK((String)request.getParameter("txt_JB")));
				

					Hashtable hash = new Hashtable();
					hash.put("NAME",strNAME);
					hash.put("TYPE",strTYPE);
					hash.put("INTRODUCE",strINTRO);
					hash.put("ADDTIME",strTIME);
					hash.put("STATUS",strSTATUS);
					hash.put("JBXH",strJBXH);

					errcode = tb.addTopic(hash);
				}
				else if(strEdit.equals("2"))//修改设置
				{   
					String strNAME = ds.toString(ds.toGBK((String)request.getParameter("txt_name")));
					String strTYPE = ds.toString(ds.toGBK((String)request.getParameter("txt_kind")));
					String strINTRO = ds.toString(ds.toGBK((String)request.getParameter("txt_intro")));
					String strTIME = ds.toString(ds.toGBK((String)request.getParameter("txt_time")));
					String strSTATUS = ds.toString(ds.toGBK((String)request.getParameter("sel_status")));
					if(strSTATUS.equals("已公开")) strSTATUS="0";
					else strSTATUS="1";
					String strJBXH = ds.toString(ds.toGBK((String)request.getParameter("txt_JB")));

					//System.out.println("status:"+strSTATUS);

					Hashtable hash = new Hashtable();
					hash.put("NAME",strNAME);
					hash.put("TYPE",strTYPE);
					hash.put("INTRODUCE",strINTRO);
					hash.put("ADDTIME",strTIME);
					hash.put("STATUS",strSTATUS);
					hash.put("JBXH",strJBXH);
					//System.out.println("hash:"+hash);
					errcode = tb.modTopic(hash);
				}
				else if(strEdit.equals("3"))//删除设置
				{	
					errcode = tb.delData();
				}
			}

			else if(strType.equals("13"))//图片设置2003.10.29加入
			{
				sb = new SysConfBean();
			    String strNum = ds.toString((String)request.getParameter("picnum"));
				String strHeight = ds.toString((String)request.getParameter("picheight"));
				String strWidth = ds.toString((String)request.getParameter("picwidth"));
				Hashtable hash = new Hashtable();	
				hash.put("NUM",strNum);
				hash.put("HEIGHT",strHeight);
				hash.put("WIDTH",strWidth);
				errcode = sb.setPic(hash);
			}

			else if(strType.equals("14"))//主页设置管理2003.10.30加入
			{	
				sb = new SysConfBean();
				if(strEdit.equals("1"))//新增设置
				{   
					String strId = ds.toString((String)request.getParameter("selectId"));
					
					//要转化成模块ID.................
					String strNum = ds.toString((String)request.getParameter("newsnum"));
					String strIsShowtime = ds.toGBK((String)request.getParameter("selectMR"));
					if(strIsShowtime.equals("是")) strIsShowtime = "1";
					else strIsShowtime = "0";
					
					Hashtable hash = new Hashtable();
					hash.put("ID",strId);
					hash.put("NUM",strNum);
					hash.put("ISSHOWTIME",strIsShowtime);

					errcode = sb.addMain(hash);
				}
				else if(strEdit.equals("2"))//修改设置
				{   
					String strId = ds.toString((String)request.getParameter("strId"));
					sb.setID(strId);

					String strNum = ds.toString((String)request.getParameter("newsnum"));
					String strIsShowtime = ds.toGBK((String)request.getParameter("selectMR"));
					if(strIsShowtime.equals("是")) strIsShowtime = "1";
					else strIsShowtime = "0";
					
					Hashtable hash = new Hashtable();
					hash.put("NUM",strNum);
					hash.put("ISSHOWTIME",strIsShowtime);

					errcode = sb.modMain(hash);
				}
				else if(strEdit.equals("3"))//删除设置
				{
					sb.setType(14);
					sb.setID(strID);
					errcode = sb.delData();
				}
			}

			else if(strType.equals("21"))//主页链接设置2004.2.7加入
			{	
				sb = new SysConfBean();
				if(strEdit.equals("1"))//新增设置
				{   
					String strXH = ds.toString((String)request.getParameter("strXH"));
					String strNAME = ds.toGBK((String)request.getParameter("strNAME"));
					String strADDR = ds.toGBK((String)request.getParameter("strADDR"));
					String strSTATE = ds.toGBK((String)request.getParameter("strSTATE"));
					if(strSTATE.equals("是")) strSTATE = "1";
					else strSTATE = "0";
					
					Hashtable hash = new Hashtable();
					hash.put("LINKNAME",strNAME);
					hash.put("LINKADDRESS",strADDR);
					hash.put("STATE",strSTATE);
					hash.put("XH",strXH);

					errcode = sb.addLink(hash);
				}
				else if(strEdit.equals("2"))//修改设置
				{   
					String strId = ds.toString((String)request.getParameter("txt_id"));
					sb.setID(strId);

					String strXH = ds.toString((String)request.getParameter("strXH"));
					String strNAME = ds.toGBK((String)request.getParameter("strNAME"));
					String strADDR = ds.toGBK((String)request.getParameter("strADDR"));
					String strSTATE = ds.toGBK((String)request.getParameter("strSTATE"));
					if(strSTATE.equals("是")) strSTATE = "1";
					else strSTATE = "0";
					
					Hashtable hash = new Hashtable();
					hash.put("LINKNAME",strNAME);
					hash.put("LINKADDRESS",strADDR);
					hash.put("STATE",strSTATE);
					hash.put("XH",strXH);

					errcode = sb.modLink(hash);
				}
				else if(strEdit.equals("3"))//删除设置
				{
					sb.setType(21);
					sb.setID(strID);
					errcode = sb.delData();
				}
			}

			else if(strType.equals("15"))//CSS设置2003.11.1加入
			{	
				sb = new SysConfBean();
				sb.setID(strID);
				Hashtable hash = new Hashtable();
				hash.put("txt_a_link",ds.toString(request.getParameter("txt_a_link")));
				hash.put("txt_a_hover",ds.toString(request.getParameter("txt_a_hover")));
				hash.put("txt_a_visited",ds.toString(request.getParameter("txt_a_visited")));
				hash.put("txt_h",ds.toString(request.getParameter("txt_h")));
				hash.put("txt_h_link",ds.toString(request.getParameter("txt_h_link")));
				hash.put("txt_h_hover",ds.toString(request.getParameter("txt_h_hover")));
				hash.put("txt_h_visited",ds.toString(request.getParameter("txt_h_visited")));
				hash.put("txt_h_unknown",ds.toString(request.getParameter("txt_h_unknown")));
				hash.put("txt_f_lefttitle",ds.toString(request.getParameter("txt_f_lefttitle")));
				hash.put("txt_f_title",ds.toString(request.getParameter("txt_f_title")));
				hash.put("txt_f_login",ds.toString(request.getParameter("txt_f_login")));
				hash.put("txt_f_pic",ds.toString(request.getParameter("txt_f_pic")));
				hash.put("txt_f_topic",ds.toString(request.getParameter("txt_f_topic")));
				hash.put("txt_f_query",ds.toString(request.getParameter("txt_f_query")));
				hash.put("txt_f_list1",ds.toString(request.getParameter("txt_f_list1")));
				hash.put("txt_f_list2",ds.toString(request.getParameter("txt_f_list2")));
				hash.put("txt_f_list",ds.toString(request.getParameter("txt_f_list")));
				hash.put("txt_bg_line",ds.toString(request.getParameter("txt_bg_line")));
				hash.put("txt_bg_line1",ds.toString(request.getParameter("txt_bg_line1")));
				hash.put("txt_bg_pic",ds.toString(request.getParameter("txt_bg_pic")));
				hash.put("txt_bg_topic",ds.toString(request.getParameter("txt_bg_topic")));
				hash.put("txt_bg_left",ds.toString(request.getParameter("txt_bg_query")));
				hash.put("txt_bg_query",ds.toString(request.getParameter("txt_bg_query")));
				hash.put("txt_bg_right",ds.toString(request.getParameter("txt_bg_right")));
				hash.put("txt_bg_child",ds.toString(request.getParameter("txt_bg_child")));
				hash.put("txt_flyline",ds.toString(request.getParameter("txt_flyline")));
				hash.put("txt_flybg1",ds.toString(request.getParameter("txt_flybg1")));
				hash.put("txt_flybg2",ds.toString(request.getParameter("txt_flybg2")));
				hash.put("txt_flyfont1",ds.toString(request.getParameter("txt_flyfont1")));
				hash.put("txt_flyfont2",ds.toString(request.getParameter("txt_flyfont2")));

				String strStyle = ds.toString(ds.toGBK((String)request.getParameter("style")));
				String strIsnow = ds.toString((String)request.getParameter("selectMR"));
				String path = ds.toString((String)request.getRealPath("/"))+"oa\\css\\";;

				Hashtable hs = new Hashtable();
				hs.put("path",path);
				hs.put("STYLE",strStyle);
				hs.put("ISNOW",strIsnow);

				if(strEdit.equals("1"))//新增设置
				{  
					errcode = sb.addCss(hs,hash);
				}
				else if(strEdit.equals("2"))//修改设置
				{   					
					errcode = sb.modCss(hs,hash);
				}
				else if(strEdit.equals("3"))//删除设置
				{	
					sb.setType(15);
					errcode = sb.delData();
				}
			}
			else if(strType.equals("16"))//FTP设置2003.10.30加入
			{
				sb = new SysConfBean();
				String strFtpIp = ds.toString(ds.toGBK((String)request.getParameter("ipaddress")));
				sb.setFtp(strFtpIp);
			}

			else if(strType.equals("17"))//评论设置2003.11.22加入
			{
				sb = new SysConfBean();
				String strisfree = ds.toString(ds.toGBK((String)request.getParameter("selectconf")));
				sb.setCom(strisfree);
			}

			else if(strType.equals("99"))//发表评论2003.11.9加入
			{
				cmb = new CommentBean();
				String strArticleid = ds.toString(ds.toGBK(request.getParameter("txt_fileid")));
				String strComment = ds.toString(ds.toGBK(request.getParameter("txt_comment")));
				String strCritic = ds.toString(ds.toGBK(request.getParameter("txt_topicid")));

				Hashtable hash=new Hashtable();
				hash.put("ARTICLEID",strArticleid);
				hash.put("CONTENT",strComment);
				hash.put("CRITIC",strCritic);
				
				errcode = cmb.addCom(hash);
				go="oa/main/index.jsp?txt_fileid="+strArticleid+"&txt_type="+strType+"&errcode="+errcode;
			//	response.sendRedirect(goen);
			}
			else{
				go="oa/manage/index.jsp?txt_type="+strType+"&errcode="+errcode+"&bmbh="+bmbh+"&txt_menuID1="+strmenuID1;
				//response.sendRedirect(go);
			}
			if(go==null)
				go="oa/manage/index.jsp?txt_type="+strType+"&errcode="+errcode;
			response.sendRedirect(go);
		}
		catch(Exception e){System.out.println("ManageServlet处理时出错;错误为:"+e);}
		finally{
			if(ub != null)		ub.closeConn();
			if(ab != null)		ab.closeConn();
			if(ub1 != null)		ub1.closeConn();
			if(cb != null)		cb.closeConn();
			if(mcb != null)		mcb.closeConn();
			if(tb != null)		tb.closeConn();
			if(sb != null)		sb.closeConn();
			if(cmb != null)		cmb.closeConn();
			if(smsb != null)	smsb.closeConn();
		}
	}

	public void doPost(HttpServletRequest request ,HttpServletResponse response)throws IOException, ServletException
	{
		doGet(request,response);
	}
}
                    

⌨️ 快捷键说明

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