📄 orgservlet.java
字号:
ht.put("MM",newPSWord);
ht.put("MMWT",pswQuestion);
ht.put("MMDA",pswKey);
ht.put("XB",Sex);
ht.put("CSNY",birthDay);
ht.put("MZ",mz);
ht.put("ZZMM",zzmm);
ht.put("XL",xli);
ht.put("ZC",zhich);
ht.put("BGDH",bgphone);
ht.put("FJDH",fjphone);
ht.put("JTDH",jtphone);
ht.put("YDDH",mobile);
ht.put("JTDZ",address);
ht.put("YZBM",code);
ht.put("QQ",qqNo);
ht.put("EMAIL",email);
ht.put("YHM",username);
ht.put("PHOTO",photo);
ht.put("GRJJ",grjj);
ht.put("ZNYH",znyh);
errcode = psbean.modBasisPsInf(ht);
//返回到查看某人基本信息的界面
response.sendRedirect("oa/organization/index.jsp?txt_type=3&txt_edit=3&txt_personno="+strPersonNO+"&txt_orgno="+strOrgNO+"&errcode="+errcode);
}
}
//登陆者修改个人的密码信息
if(strType!=null && strType.equals("3") && strEdit.equals("7"))
{
//strOrgNO=ds.toString((String)request.getParameter("txt_bmno"));
//psbean.setOrgNO(strOrgNO);
psbean.setPersonNO(strPersonNO);
String oldPsw = ds.toGBK(request.getParameter("old_psw"));
boolean bool = psbean.verifyPwd(oldPsw);
if(!bool)
{
errcode = 7;
response.sendRedirect("oa/organization/index.jsp?txt_type=3&txt_edit=7&txt_personno="+strPersonNO+"&txt_orgno="+strOrgNO+"&errcode="+errcode);
}
else{
String newPSWord = ds.toGBK(request.getParameter("password_check"));
String surePSWord = ds.toGBK(request.getParameter("pass_checkagain"));
String pswQuestion = ds.toGBK(request.getParameter("txt_mmwt"));
String pswKey = ds.toGBK(request.getParameter("txt_mmda"));
Hashtable ht = new Hashtable();
ht.put("MM",newPSWord);
ht.put("MMWT",pswQuestion);
ht.put("MMDA",pswKey);
errcode = psbean.modPswInf(ht);
//返回到查看某人基本信息的界面
response.sendRedirect("oa/organization/index.jsp?txt_type=3&txt_edit=3&txt_personno="+strPersonNO+"&txt_orgno="+strOrgNO+"&errcode="+errcode);
}
}
//删除人员信息
if(strType!=null && strType.equals("3") && strEdit.equals("3"))
{
psbean.setPersonNO(strPersonNO);
errcode = psbean.delPerson(); //ZZ_ZGB,ZZ_BMB,ZZ_ZGZWB
//返回到查看某部门人员列表的界面
response.sendRedirect("oa/organization/index.jsp?txt_type=3&txt_orgno="+strOrgNO+"&errcode="+errcode);
}
//从数据库中永久删除离退休等人员信息
if(strType!=null && strType.equals("3") && strEdit.equals("4"))
{
psbean.setPersonNO(strPersonNO);
psbean.delDBPs();
//返回到查看某部门人员列表的界面
response.sendRedirect("oa/organization/index.jsp?txt_type=3&txt_edit=5&txt_orgno="+strOrgNO);
}
//从数据库中恢复离退休等人员信息
if(strType!=null && strType.equals("3") && strEdit.equals("5"))
{
psbean.setPersonNO(strPersonNO);
psbean.resumePs();
//返回到查看某部门人员列表的界面
response.sendRedirect("oa/organization/index.jsp?txt_type=3&txt_edit=5&txt_orgno="+strOrgNO);
}
//给个人分配职务--新增
if(strType!=null && strType.equals("4"))
{
String zgno = strPersonNO;
String bmbo = ds.toGBK(request.getParameter("hid_dutybmno"));
String zwname = ds.toGBK(request.getParameter("txt_dutyName"));
String czqx = ds.toGBK(request.getParameter("txt_doright"));
String lcqx = ds.toGBK(request.getParameter("txt_roadright"));
if(bmbo==null)bmbo="";
if(zwname==null)zwname="";
if(czqx==null)czqx="";
if(lcqx==null)lcqx="";
lcqx = psbean.toFlowNo(lcqx);
psdbn.setDutyOrgNo(bmbo);
String zwno = psdbn.getDutyNo(zwname);
psdbn.addRec(zgno,bmbo,zwno,czqx,lcqx);
//返回到查看某部门人员列表的界面
if(strEdit.equals("1")) response.sendRedirect("oa/organization/index.jsp?txt_type=4&txt_edit="+strEdit+"&txt_orgno="+strOrgNO+"&txt_personno="+strPersonNO);
if(strEdit.equals("4")) response.sendRedirect("oa/organization/index.jsp?txt_type=4&txt_edit="+strEdit+"&txt_orgno="+strOrgNO+"&txt_personno="+strPersonNO);
}
if(strType!=null && strType.equals("4") && strEdit.equals("100"))
{
}
if(strType.equals("5"))//部门子类管理2003.11.29加入
{
omb = new OrgMenuBean();
if(omb.getConn() == null){
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<title>数据库无响应,请后退并重试</title>");
out.println("数据库无法响应,请 <a href='javascript:window.history.back(-1);'>返回</a> 重试");
out.println("</html>");
out.close();
return;
}
String strpbh = ds.toString(request.getParameter("txt_pid"));
if(strpbh.equals("")) strpbh = "0";
String strbh = ds.toString(request.getParameter("txt_id"));
String strmc = ds.toString(ds.toGBK(request.getParameter("txt_bmboss")));
String strjbxh = ds.toString(request.getParameter("txt_viewno"));
if(strEdit.equals("1"))//新增设置
{
Hashtable hash = new Hashtable();
hash.put("PBH",strbh);
hash.put("BMBH",strOrgNO);
hash.put("MC",strmc);
hash.put("JBXH",strjbxh);
errcode = omb.addMenu(hash);
}
else if(strEdit.equals("2"))//修改设置
{
Hashtable hash = new Hashtable();
hash.put("PBH",strpbh);
hash.put("BH",strbh);
hash.put("BMBH",strOrgNO);
hash.put("MC",strmc);
hash.put("JBXH",strjbxh);
errcode = omb.updateMenu(hash);
}
else if(strEdit.equals("3"))//删除设置
{
int intbh = Integer.parseInt(strbh);
omb.setID(intbh);
errcode = omb.delMenu();
}
String goen="oa/organization/index.jsp?txt_type="+strType+"&txt_orgno="+strOrgNO+"&errcode="+errcode;
response.sendRedirect(goen);
}
if(strType!=null && strType.equals("6"))//修改个人职务权限
{
String zgno = strPersonNO;
String bmno = ds.toGBK(request.getParameter("hid_dutybmno"));
String zwno = ds.toGBK(request.getParameter("hid_dutyzwno"));
String czqx = ds.toGBK(request.getParameter("txt_doright"));
//czqx = psbean.toOperNo(czqx);
String lcqx = ds.toGBK(request.getParameter("txt_roadright"));
String selectedDuty = ds.toString(request.getParameter("selectedDuty"));
if(bmno==null)bmno="";
if(zwno==null)zwno="";
if(czqx==null)czqx="";
if(lcqx==null)lcqx="";
lcqx = psbean.toFlowNo(lcqx);
psdbn.modRec(zgno,bmno,zwno,czqx,lcqx);
//返回修改人员职务权限界面
response.sendRedirect("oa/organization/index.jsp?txt_type=6&txt_edit="+strEdit+"&txt_orgno="+strOrgNO+"&txt_personno="+strPersonNO+"&selectedDuty="+selectedDuty);
}
//分配版面权限
if(strType!=null && strType.equals("7") && strEdit.equals("1"))
{
String eero1 = "";
String eero2 = "";
//先删除已有记录
String eero3 = "";
String eero4 = "";
String deletestr00 = strDutyNO;
if(!deletestr00.equals(""))
{
String deletestr[] = deletestr00.split(",");
for(int i=0;i<deletestr.length;i++)
{
mnbean.setID(Integer.parseInt(deletestr[i]));
eero3 = eero3 + String.valueOf(mnbean.delNews());
eero4 = eero4 + "0";
}
}
String strng = strPage;
Hashtable ht = new Hashtable();
String str[] = strng.split(";");
for(int i=0;i<str.length;i++)
{
//<%=state%>_<%=whichtable%>_<%=strmenu%>_<%=i%>
str[i] = str[i] + "_";
String stg[] = str[i].split("_");
ht.clear();
ht.put("ZGBH",strPersonNO);
ht.put("LB","1");
ht.put("DXBH",stg[2]);
ht.put("SF",stg[0]);
if(stg[0].equals("2")) ht.put("CZ",stg[3]);
else ht.put("CZ","");
ht.put("WHICHTALBE",stg[1]);
ht.put("BMBH","");
ht.put("SFGL","");
errcode = mnbean.addNews(ht);
eero1 = eero1 + String.valueOf(errcode);
eero2 = eero2 + "0";
}
errcode = 7; //Integer.parseInt(eero1);
if(!eero1.equals(eero2) && !eero3.equals(eero4)) response.sendRedirect("err.jsp?ip=organization/index.jsp&txt_type="+strType+"&errcode="+7);
else
{
if(!eero1.equals(eero2)) response.sendRedirect("err.jsp?ip=organization/index.jsp&txt_type="+strType+"&errcode="+8);
if(!eero3.equals(eero4)) response.sendRedirect("err.jsp?ip=organization/index.jsp&txt_type="+strType+"&errcode="+9);
}
}
if(strType!=null&&strType.equals("9")&&strEdit.equals("1"))//部门合并
{
String strDepA=ds.toString(request.getParameter("dep1"));
String strDepB=ds.toString(request.getParameter("dep2"));
int err = dbean.unit(strDepA,strDepB);
response.sendRedirect("oa/datamanage/dep_mix.jsp?err="+err);
}
//...........................可添加其他页面操作....................................//
//...........................可添加其他页面操作....................................//
}catch (Exception e){System.out.println("OrgServlet处理时出错;错误为:"+e);}
finally{
if(dbean != null) dbean.closeConn();
if(dutybn != null) dutybn.closeConn();
if(psbean != null) psbean.closeConn();
if(psdbn != null) psdbn.closeConn();
if(dabean != null) dabean.closeConn();
if(mnbean != null) mnbean.closeConn();
if(omb != null) omb.closeConn();
}
}
public void doPost(HttpServletRequest request ,HttpServletResponse response)throws IOException, ServletException
{
doGet(request,response);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -