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

📄 lessonoperatoraction.java

📁 培训考试系统代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    }


    /**
     * 进入草稿箱列表
     * @param mapping
     * @param form
     * @param req
     * @return
     */
    private ActionForward draftList(ActionMapping mapping,
                                    LessonMngOperatorForm    form,
                                    HttpServletRequest req)
    {
        SysConnPool cspool = null;
        SysDbConn con = null;
        try
        {
            cspool = SysConnPool.getInstance();
            con = cspool.getAplComs();
            list(con,form,req);
        }
        catch(SysDbException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
            return servlet.findForward("error");
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
            return servlet.findForward("error");
        }
        finally
        {
            con.close();
        }

        return mapping.findForward("draftlist");
    }


    /**
     * 进入审查列表页面
     * @param mapping
     * @param form
     * @param req
     * @return
     */
    private ActionForward checkList(ActionMapping mapping,
                                    LessonMngOperatorForm    form,
                                    HttpServletRequest req)
    {
        SysConnPool cspool = null;
        SysDbConn con = null;
        try
        {
            cspool = SysConnPool.getInstance();
            con = cspool.getAplComs();
            list(con,form,req);
        }
        catch(SysDbException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
            return servlet.findForward("error");
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
            return servlet.findForward("error");
        }
        finally
        {
            con.close();
        }

        return mapping.findForward("checklist");
    }


    /**
     * 进入
     * @param mapping
     * @param form
     * @param req
     * @return
     */
    private ActionForward passList(ActionMapping mapping,
                                   LessonMngOperatorForm    form,
                                   HttpServletRequest req)
    {
        SysConnPool cspool = null;
        SysDbConn con = null;
        log("pass list now.....");
        try
        {

            cspool = SysConnPool.getInstance();
            con = cspool.getAplComs();
            list(con,form,req);
        }
        catch(SysDbException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
            return servlet.findForward("error");
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
            return servlet.findForward("error");
        }
        finally
        {
            con.close();
        }

        return mapping.findForward("passlist");
    }


    /**
     * 用查询列表
     * @param mapping
     * @param form
     * @param req
     */
    private ActionForward manList(ActionMapping mapping,
                      LessonMngOperatorForm    form,
                      HttpServletRequest req)
    {
        log("search now ....");
        SysConnPool cspool = null;
        SysDbConn con = null;

        String lessonName = form.getLessonName();
        String lessonGoal = form.getLessonGoal();
        String teacherid = form.getTeacherid();
        String classId = req.getParameter("classIdTerm");
        String mode = req.getParameter("mode");
        String state = req.getParameter("state");
        String degree = req.getParameter("degree");
        String startymd = form.getStartymd();
        String endymd = form.getEndymd();
        String site = form.getSite();
        String staffno = req.getSession().getAttribute("staffno").toString();
        String cityid = form.getCityid();


        //顶級目录应该可以配置
        try
        {
            cspool = SysConnPool.getInstance();
            con = cspool.getAplComs();
            SysResultSet rs2 = null;
            if("8".equalsIgnoreCase(state))
            {
               con.preparedQuery("");
               con.setString(1,staffno);
               rs2 = con.csCommonQuery("SQL_Agt_LessonGetRelease","1","-1").getResultSet();
            }
            else if((OperatorFlagCode.LESSON_QUERYSTUDY).equalsIgnoreCase( form.getOperatorFlag()))
            {
              con.preparedSP();
              con.setString(1,staffno);
              con.setString(2,lessonName);
              con.setString(3,lessonGoal);
              con.setString(4,teacherid);
              con.setString(5,classId);
              con.setString(6,mode);
              con.setString(7,degree);
              SysResultSet res = con.csCommonSP("p_agt_lessonstudylist").getResultSet();

              res.next();

              con.preparedQuery(res.getString(1));
              rs2 = con.csCommonQuery("SELFSQL","1","-1").getResultSet();
            }
            else
            {
              con.preparedSP();
              con.setString(1,lessonName);
              con.setString(2,lessonGoal);
              con.setString(3,teacherid);
              con.setString(4,classId);
              con.setString(5,mode);
              con.setString(6,state);
              con.setString(7,degree);
              con.setString(8,startymd);
              con.setString(9,endymd);
              con.setString(10,site);
              con.setString(11,staffno);
              con.setString(12,form.getOperatorFlag());
              con.setString(13,cityid);

              SysResultSet res = con.csCommonSP("p_agt_lessonquery").getResultSet();

              res.next();

              con.preparedQuery(res.getString(1));
              rs2 = con.csCommonQuery("SELFSQL","1","-1").getResultSet();
            }

            req.getSession().setAttribute("LESSON_SEARCH_RES",new ResUtil(rs2));


        }
        catch(SysDbException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
            return servlet.findForward("error");
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
            return servlet.findForward("error");
        }
        finally
        {
            con.close();
        }
         if((OperatorFlagCode.LESSON_QUERYSTUDY).equalsIgnoreCase( form.getOperatorFlag()))
        {
           return mapping.findForward("studylist");
        }
        else
        {
           return mapping.findForward("manlist");
        }
    }


    /**
     * 用查询列表
     * @param mapping
     * @param form
     * @param req
     */
    private ActionForward lessonStat(ActionMapping mapping,
                      LessonMngOperatorForm    form,
                      HttpServletRequest req)
    {

        SysConnPool cspool = null;
        SysDbConn con = null;

        String lessonId = form.getLessonid()[0];

        //顶級目录应该可以配置
        try
        {
            cspool = SysConnPool.getInstance();
            con = cspool.getAplComs();

            con.preparedSP();
            con.setString(1,lessonId);

            SysRecord res = con.csCommonSP("p_agt_lessonstat").getParamSet();

            req.setAttribute("DOTCOUNT",res.getString(0));
            req.setAttribute("PARTCOUNT",res.getString(1));
            req.setAttribute("SCORESTATMES",res.getString(2));
            req.setAttribute("LESSONNAME",res.getString(3));
            return mapping.findForward("lessonstat");
        }
        catch(SysDbException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
            return servlet.findForward("error");
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
            return servlet.findForward("error");
        }
        catch(Exception e)
       {//捕获未知异常,定向到出错页面
           //输出异常信息
           e.printStackTrace();
           req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
           return (mapping.findForward("error"));
       }
        finally
        {
            con.close();
        }
    }


     /**
     * 选修课程
     * @param mapping
     * @param form
     * @param req
     */
    private ActionForward lessonTake(ActionMapping mapping,
                      LessonMngOperatorForm    form,
                      HttpServletRequest req)
    {

        SysConnPool cspool = null;
        SysDbConn con = null;

        String lessonId = form.getLessonid()[0];
        String staffno = req.getSession().getAttribute("staffno").toString();

        //顶級目录应该可以配置
        try
        {
            cspool = SysConnPool.getInstance();
            con = cspool.getAplComs();

            con.preparedSP();
            con.setString(1,lessonId);
            con.setString(2,staffno);

            SysRecord res = con.csCommonSP("p_agt_lessontake").getParamSet();

            req.setAttribute("successId",SuccessCode.LESSON_TAKE);
            return mapping.findForward("success");
        }
        catch(SysDbException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
            return servlet.findForward("error");
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
            req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
            return servlet.findForward("error");
        }
        catch(Exception e)
       {//捕获未知异常,定向到出错页面
           //输出异常信息
           e.printStackTrace();
           req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
           return (mapping.findForward("error"));
       }
        finally
        {
            con.close();
        }
    }

    /**
     * 测试方法,关闭输出既可以结束调试
     * @param mes
     */
    private void log(String mes)
    {
       // System.out.println(mes);
    }
}

⌨️ 快捷键说明

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