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

📄 planmngaction.java

📁 培训考试系统代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
      {
        //捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR

          req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
          return (mapping.findForward("error"));
       }
      finally
        //关闭连接实例
        {
          if(aplcoms != null)
          {
             aplcoms.close();
          }
        }
    }
*/
        /****************************************************
         * 反馈计划
         ****************************************************/
       private ActionForward feedbackPlan (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
      //得到输入参数
       String operatorflag = ((PlanmngForm) form).getOperatorflag();
       String feedback = ((PlanmngForm) form).getFeedback();
       String fbcontent = ((PlanmngForm) form).getFbcontent();
       String staffno = req.getSession().getAttribute("staffno").toString();
       String itemid = ((PlanmngForm) form).getItemid();

       SysDbConn aplcoms = null ;
       try
       {
           //连接数据源
         aplcoms = SysConnPool.getInstance().getAplComs();
         aplcoms.preparedSP();
         //获得输入参数
         aplcoms.setString(1,feedback);
         aplcoms.setString(2,fbcontent);
         aplcoms.setString(3,itemid);
         aplcoms.setInt(4,Initor.systemConfig.getInt("agt/planNotify",3));
         SysDataSet ds = aplcoms.csCommonSP("P_Agt_FeedbackPlan");
         SysRecord rc = ds.getParamSet();

         if (rc!=null && rc.getInt(0) == 0)
         {
            req.setAttribute("successId",SuccessCode.PLANMNG_FEEDBACK);
            ///:huangyuyuan add 2004-06-24
            //指定返回页面
            req.setAttribute("backURL","/PlanmngAction.do?operatorflag=PLANMNG_QUERY_SYNLIST1&status=1&firID=M04&secNo=2&thrNo=6&secCount=10&thrCount=5");
            ///:~
            return(mapping.findForward("success"));
         }
         else
         {
            req.setAttribute("errorId",ErrorCode.PLANMNG_FEEDBACK);
           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 cancelPlan (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
      //得到输入参数
       String itemid = ((PlanmngForm) form).getItemid();
       String appraise = ((PlanmngForm) form).getAppraise();

       SysDbConn aplcoms = null ;
       try
       {
           //连接数据源
         aplcoms = SysConnPool.getInstance().getAplComs();
         aplcoms.preparedSP();
         //获得输入参数
         aplcoms.setString(1,itemid);
         aplcoms.setString(2,appraise);
         SysDataSet ds = aplcoms.csCommonSP("P_Agt_CancelPlan");
         SysRecord rc = ds.getParamSet();
         if (rc!=null && rc.getInt(0) == 0)
         {
           req.setAttribute("successId",SuccessCode.PLANMNG_CANCEL);
           return(mapping.findForward("success"));
         }
         else
         {
           req.setAttribute("errorId",ErrorCode.PLANMNG_CANCEL);
           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 backupPlan (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
      //得到输入参数
       String itemid = ((PlanmngForm) form).getItemid();
       String appraise = ((PlanmngForm) form).getAppraise();

       SysDbConn aplcoms = null ;
       try
       {
           //连接数据源
         aplcoms = SysConnPool.getInstance().getAplComs();
         aplcoms.preparedSP();
         //获得输入参数
         aplcoms.setString(1,itemid);
         aplcoms.setString(2,appraise);
         SysDataSet ds = aplcoms.csCommonSP("P_Agt_BackupPlan");
         SysRecord rc = ds.getParamSet();

         if (rc!=null && rc.getInt(0) == 0)
         {
           req.setAttribute("successId",SuccessCode.PLANMNG_BACKUP);
           return(mapping.findForward("success"));
         }
         else
         {
           req.setAttribute("errorId",ErrorCode.PLANMNG_BACKUP);
           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 rReleasePlan (ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
      //得到输入参数
       String operatorflag = ((PlanmngForm) form).getOperatorflag();
       String itemid = ((PlanmngForm)form).getItemid();
       String appraise = ((PlanmngForm)form).getAppraise();

       SysDbConn aplcoms = null ;
       try
       {
           //连接数据源
           aplcoms = SysConnPool.getInstance().getAplComs();
           aplcoms.preparedSP();
           aplcoms.setString(1,itemid);
           aplcoms.setString(2,appraise);

           SysDataSet ds = aplcoms.csCommonSP("P_AGT_RReleasePlan");
           SysRecord rc = ds.getParamSet();
           if (rc!=null && rc.getInt(0) == 0)
           {
           //获得输入参数
           aplcoms.preparedQuery("");
           //查询新生成的计划
           aplcoms.setString(1,rc.getString(1));
           SysResultSet rs2 = new ResUtil(aplcoms.csCommonQuery("SQL_AGT_QueryPlanDetail","1","-1").getResultSet());
           rs2.next();
           if ( rs2!= null )
           {
             req.setAttribute("itemid",rs2.getString(0));
             req.setAttribute("senderid",rs2.getString(1));
             req.setAttribute("recieverid",rs2.getString(2));
             req.setAttribute("title",rs2.getString(3));
             req.setAttribute("discription",rs2.getString(4));
             if (rs2.getString(5) !=  "")
             {
                req.setAttribute("startdate",
                   rs2.getString(5).substring(0,4)+"-"+rs2.getString(5).substring(4,6)+"-"+rs2.getString(5).substring(6,8));
             }
             else
             {
                 req.setAttribute("startdate", "");
             }

             if (rs2.getString(6) !=  "")
             {
                req.setAttribute("enddate",
                   rs2.getString(6).substring(0,4)+"-"+rs2.getString(6).substring(4,6)+"-"+rs2.getString(6).substring(6,8));
             }
             else
             {
                 req.setAttribute("enddate", "");
             }
             req.setAttribute("courseid",rs2.getString(7));
             req.setAttribute("cstarget",rs2.getString(8));
             req.setAttribute("cscontent",rs2.getString(9));
             req.setAttribute("testid",rs2.getString(10));
             req.setAttribute("tstarget",rs2.getString(11));
             req.setAttribute("tscontent",rs2.getString(12));
             req.setAttribute("feedback",rs2.getString(13));
             req.setAttribute("fbcontent",rs2.getString(14));
             req.setAttribute("status",rs2.getString(15));
             req.setAttribute("planhistory",rs2.getString(16));
             return(mapping.findForward("planmod"));
           }
           else
           {
             req.setAttribute("errorId",ErrorCode.PLANMNG_LOCATEA);
             return(mapping.findForward("error"));
           }
           }
       else
       {
         req.setAttribute("errorId",ErrorCode.PLANMNG_RRELEASE);
         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 + -