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

📄 execaction.java

📁 培训考试系统代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
           aplcoms = SysConnPool.getInstance().getAplComs();
           aplcoms.preparedSP();
          //获得输入参数idstring
           aplcoms.setString(1,idstring);
           SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_EvaConfirm");
           SysRecord rc1 = ds1.getParamSet() ;
           if(rc1!=null && rc1.getInt(0) == 0)
           {
            req.setAttribute("successId",SuccessCode.SYNEVA_EXECSAVE);
            return(mapping.findForward("success"));
           }
           else
           {
             req.setAttribute("errorId",ErrorCode.SYNEVA_EXECSAVE);
             return(mapping.findForward("error"));
           }
       }
      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();
          }
        }
  }
         /****************************************************
         * 取消综合考评计算结果
         ****************************************************/
       private ActionForward cancelEvaluate (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
      SysDbConn aplcoms = null ;
       try
       {
           //连接数据源
           aplcoms = SysConnPool.getInstance().getAplComs();
           aplcoms.preparedSP();
           SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_EvaCancel");
           SysRecord rc1 = ds1.getParamSet() ;
           if(rc1!=null && rc1.getInt(0) == 0)
           {
            return(mapping.findForward("doevaluate"));
           }
           else
           {
             req.setAttribute("errorId",ErrorCode.SYNEVA_EXECCANCEL);
             return(mapping.findForward("error"));
           }
       }
      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();
          }
        }
  }
        /****************************************************
         * 查询综合考评结果
         ****************************************************/
       private ActionForward queryEvaluate (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
       //业务代表ID
       String staffno = ((ExecForm) form).getStaffno();
       //String groupid = ((ExecForm) form).getGroupid();
       String ruleid = ((ExecForm) form).getRuleid();
       String title = ((ExecForm) form).getTitle();
       String evatypeid = ((ExecForm) form).getEvatypeid();
       String querybegindate = ((ExecForm) form).getQuerybegindate();
       String queryenddate = ((ExecForm) form).getQueryenddate();
      if (querybegindate != null)
      {
           querybegindate = querybegindate.replaceAll("-","");
      }
      if (queryenddate != null)
      {
          queryenddate = queryenddate.replaceAll("-","");
      }
       SysResultSet rs1;
       SysDbConn aplcoms = null ;
       try
       {
           //连接数据源
           aplcoms = SysConnPool.getInstance().getAplComs();
           aplcoms.preparedSP();

           //获得输入参数
          /* if (staffno != "")
           {
            */
             aplcoms.setString(1,staffno);
             aplcoms.setString(2,ruleid);
             aplcoms.setString(3,title);
             aplcoms.setString(4,evatypeid);
             aplcoms.setString(5,querybegindate);
             aplcoms.setString(6,queryenddate);
             //调用P_Agt_EvaRuletSearch1查询,得到数据集rs1
             rs1 = new ResUtil(aplcoms.csCommonSP("P_Agt_EvaResultSearch1").getResultSet());
           /*}
           else
           {
             aplcoms.setString(1,groupid);
             aplcoms.setString(2,ruleid);
             aplcoms.setString(3,title);
             aplcoms.setString(4,evatypeid);
             aplcoms.setString(5,querybegindate);
             aplcoms.setString(6,queryenddate);
             //调用P_Agt_EvaRuletSearch2查询,得到数据集rs1
             rs1 = aplcoms.csCommonSP("P_Agt_EvaResultSearch2").getResultSet();
            }
            */
           rs1.next();
           aplcoms.preparedQuery(rs1.getString(1));
           SysResultSet rs2 = aplcoms.csCommonQuery("SELFSQL","1","-1").getResultSet();
           //if (rs 不为空)
           if (rs2 != null)
           {
             //按业务代表ID排序
            rs2.sort(0,true);
            //将结果集放到session中 EVALUATE-RESULTLIST
            req.getSession().setAttribute("EVALUATE-SCORELIST",new ResUtil(rs2));
            //将输入的查询条件传递给页面
            req.setAttribute("staffno",staffno);
            //req.setAttribute("groupid",groupid);
            req.setAttribute("title",title);
            req.setAttribute("evatypeid",evatypeid);
            req.setAttribute("querybegindate",querybegindate);
            req.setAttribute("querybegindate",querybegindate);
            //定向到列表页面evascorelist
            return (mapping.findForward("evascorelist"));
           }
           else
           {
             req.setAttribute("errorId",ErrorCode.SYNEVA_EXECQUERY);
             return(mapping.findForward("error"));
           }
        }
       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();
          }
        }
   }




}

⌨️ 快捷键说明

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