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

📄 agtmngstaffaction.java

📁 培训考试系统代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
             aplcoms.close();
          }
        }
    }


        /****************************************************
         *根据查询条件查询档案人员列表
         ****************************************************/
       private ActionForward queryStaffList (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
       //得到业务代表ID、姓名、组别、部门
       String staffno = ((AgtmngStaffForm) form).getStaffno();
       String staffname = ((AgtmngStaffForm) form).getStaffname();
       String group = ((AgtmngStaffForm) form).getGroup();
       String department = ((AgtmngStaffForm) form).getDepartment();
       String skill = ((AgtmngStaffForm) form).getSkill();
       SysDbConn aplcoms = null ;
       try
       {
           //连接数据源
           aplcoms = SysConnPool.getInstance().getAplComs();
           aplcoms.preparedSP();

           //获得输入参数staffno、staffname、group、department、skill
           aplcoms.setString(1,staffno);
           aplcoms.setString(2,staffname);
           aplcoms.setString(3,group);
           aplcoms.setString(4,department);
           aplcoms.setString(5,skill);
           //调用P_Agt_BaseStaffSearch查询,得到数据集rs1
           SysResultSet rs1 = aplcoms.csCommonSP("P_Agt_BaseStaffSearch").getResultSet();
           rs1.next();
           aplcoms.preparedQuery(rs1.getString(1));
           SysResultSet rs2 = aplcoms.csCommonQuery("SELFSQL","1","-1").getResultSet();

           //if (rs2 不为空)
           if (rs2 != null)
           {
            //按业务代表ID排序
            rs2.sort(0,true);
            //将结果集放到session中 AGTMNG-STAFFLIST
            req.getSession().setAttribute("AGTMNG-STAFFLIST",new ResUtil(rs2));
           }
           //将输入的查询条件传递给页面
            req.setAttribute("staffno",staffno);
            req.setAttribute("staffname",staffname);
            req.setAttribute("group",group);
            req.setAttribute("department",department);
            req.setAttribute("skill",skill);
           //定向到列表页面ArchiveStaffList
            return (mapping.findForward("stafflist"));
        }
      catch (SysDbException aple)
      {
        //捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
          aple.printStackTrace();
          req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(java.sql.SQLException sqle)
      {
        //捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
          sqle.printStackTrace();
          req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(Exception e)
      {
        //捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
          e.printStackTrace();
          req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
          return (mapping.findForward("error"));
       }
      finally
        //关闭连接实例
        {
          if(aplcoms != null)
          {
             aplcoms.close();
          }
        }
    }

       /**********************************
        *根据staffno查询教育经历列表
        **********************************/
       private ActionForward queryEduList (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
      // 得到业务代表ID——staffno
      String staffno = (( AgtmngStaffForm) form).getStaffno();
      SysDbConn aplcoms = null;
      try
      {
       //连接数据源
        aplcoms = SysConnPool.getInstance().getAplComs();
        aplcoms.preparedQuery("");
       //获得输入参数staffno
        aplcoms.setString(1,staffno);
       //调用SQL_AGT_QueryEduList查询,得到数据集rs2
        SysResultSet rs=aplcoms.csCommonQuery("SQL_AGT_QueryEduList","1","-1").getResultSet();
        if (rs != null)
       {
        //按教育经历ID排序
        rs.sort(0,true);
        //将结果集放到session中AGTMNG-EDULIST
        req.getSession().setAttribute("AGTMNG-EDULIST", new ResUtil(rs));
        }
       //将staffno传递给页面
       req.setAttribute("staffno",staffno);
       //定向到列表页面EduList
       return(mapping.findForward("edulist"));
       }
      catch (SysDbException aple)
      {
        //捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
           aple.printStackTrace();
           req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(java.sql.SQLException sqle)
      {
        //捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
          sqle.printStackTrace();
          req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(Exception e)
      {
        //捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
          e.printStackTrace();
          req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
          return (mapping.findForward("error"));
       }
      finally
        //关闭连接实例
        {
          if(aplcoms != null)
          {
             aplcoms.close();
          }
        }
    }

       /**********************************
        *根据staffno查询工作经历列表
        **********************************/
       private ActionForward queryWorkList (ActionMapping mapping,
         ActionForm form, HttpServletRequest req,
         HttpServletResponse res)
    {
      // 得到业务代表ID——staffno
      String staffno = (( AgtmngStaffForm) form).getStaffno();
      SysDbConn aplcoms = null;
      try
      {
       //连接数据源
        aplcoms = SysConnPool.getInstance().getAplComs();
        aplcoms.preparedQuery("");
       //获得输入参数staffno
        aplcoms.setString(1,staffno);
       //调用SQL_AGT_QueryWorkList查询,得到数据集rs2
        SysResultSet rs = aplcoms.csCommonQuery("SQL_AGT_QueryWorkList","1","-1").getResultSet();
       if (rs != null)
       {
        //按工作经历ID排序
        rs.sort(0,true);
        //将结果集放到session中AGTMNG-WORKLIST
        req.getSession().setAttribute("AGTMNG-WORKLIST", new ResUtil(rs));
        }
       //将staffno传递给页面
       req.setAttribute("staffno",staffno);
       //定向到列表页面WorkList
       return(mapping.findForward("worklist"));
       }
       catch (SysDbException aple)
      {
        //捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
          aple.printStackTrace();
          req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(java.sql.SQLException sqle)
      {
        //捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
          sqle.printStackTrace();
          req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(Exception e)
      {
        //捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
          e.printStackTrace();
          req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
          return (mapping.findForward("error"));
       }
      finally
        //关闭连接实例
        {
          if(aplcoms != null)
          {
             aplcoms.close();
          }
        }
    }

    /*****************************************************
     * 根据业务代表ID查询个人档案详细信息
     *****************************************************/
    private ActionForward queryBaseArchive (ActionMapping mapping,
        ActionForm form,  HttpServletRequest req,
        HttpServletResponse res)
    {
     //得到staffno、操作标识operatorflag
     String staffno = ((AgtmngStaffForm)form).getStaffno();
     String operatorflag = ((AgtmngStaffForm)form).getOperatorflag();
     SysDbConn aplcoms = null ;
     try
    {
     //连接数据源
     aplcoms = SysConnPool.getInstance().getAplComs();
     aplcoms.preparedQuery("");
     //设置查询参数
     aplcoms.setString(1,staffno);
     //调用 SQL_AGT_QueryUnArchive 查询,得到数据集rs
     SysResultSet rs1 = new ResUtil(aplcoms.csCommonQuery("SQL_AGT_QueryInYW","1","-1").getResultSet());
     aplcoms.preparedQuery("");
     //获得输入参数staffno
     aplcoms.setString(1,staffno);
     //调用SQL_AGT_QueryBaseArchive查询,得到数据集rs
     SysResultSet rs = new ResUtil(aplcoms.csCommonQuery("SQL_AGT_QueryBaseArchive","1","-1").getResultSet());
     //if (rs不为空)
      if(( rs1 != null)&&( rs != null))
     {
        rs1.next();
        String stafforga = "";
           if ((rs1.getString(2)!= null) && !(rs1.getString(2).equals("")))
           {
           aplcoms.preparedQuery("");
           //获得输入参数staffno
           aplcoms.setString(1,rs1.getString(2));
           //调用SQL_AGT_QueryOrga查询得到此业务代表的部门信息
           SysResultSet rs9 = aplcoms.csCommonQuery("SQL_AGT_QueryOrga","1","-1").getResultSet();
           rs9.next();
           stafforga = rs9.getString(0);
           }


        rs.next();
        aplcoms.preparedQuery("");
        //获得输入参数staffno
        aplcoms.setString(1,staffno);
        //调用SQL_AGT_QueryAgentSkill查询,得到数据集rs
        SysResultSet rs2 = new ResUtil(aplcoms.csCommonQuery("SQL_AGT_QueryAgentSkill","1","-1").getResultSet());
        String agentskills = "";
        String agentids ="";
        for (int i=0; i < rs2.getMetaData().getRecordCount();i++)
        {
            rs2.setRecord(i);
            if (i==0)
            {
                agentskills = rs2.getString(0);
                agentids = rs2.getString(1);
            }
            else
            {
                agentskills = agentskills + "," +rs2.getString(0);
                agentids = agentids + "#" +rs2.getString(1);
            }
        }
        aplcoms.preparedQuery("");
        //获得输入参数staffno
        aplcoms.setString(1,staffno);
        //调用SQL_AGT_QueryAgentGroup查询,得到数据集rs3
        SysResultSet rs3 = new ResUtil(aplcoms.csCommonQuery("SQL_AGT_QueryAgentGroups","1","-1").getResultSet());
        String agentgroups = "";
        for (int i=0; i < rs3.getMetaData().getRecordCount();i++)
        {
            rs3.setRecord(i);
            if (i==0)
            {
                agentgroups = rs3.getString(0);
            }
            else
            {
                agentgroups = agentgroups + "," +rs3.getString(0);
            }
        }
       //将查询结果staffno,staffname,group,department,skill 传递给页面
        req.setAttribute("staffno",rs1.getString(0));
        req.setAttribute("staffname",rs1.getString(1));
        req.setAttribute("department",stafforga);
        req.setAttribute("group",agentgroups);
        req.setAttribute("skill",agentskills);
        req.setAttribute("skillid",agentids);
        //将查询结果传递给页面
       req.setAttribute("dutyid",rs.getString(1));
       req.setAttribute("sex",rs.getString(2));
       if (rs.getString(3) != "")
       {
            req.setAttribute("birthday",
                rs.getString(3).substring(0,4)+"-"+rs.getString(3).substring(4,6)+"-"+rs.getString(3).substring(6,8));
       }
       else
       {
            req.setAttribute("birthday","");
       }
       req.setAttribute("idcardno",rs.getString(4));
       req.setAttribute("clanid",rs.getString(5));
       req.setAttribute("edulevelid",rs.getString(6));
       req.setAttribute("major",rs.getString(7));
       if (rs.getString(8) !=  "")
       {
           req.setAttribute("graduatedate",
               rs.getString(8).substring(0,4)+"-"+rs.getString(8).substring(4,6)+"-"+rs.getString(8).substring(6,8));
       }
       else
       {
           req.setAttribute("graduatedate", "");
       }req.setAttribute("college",rs.getString(9));
       req.setAttribute("flanguage",rs.getString(10));
       req.setAttribute("nation",rs.getString(11));

⌨️ 快捷键说明

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