Package com.ordobill.webapp.beans

Examples of com.ordobill.webapp.beans.Project


    public ActionForward list(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response) throws Exception {
       
        Project projectForm = (Project)form;
        HttpSession session = request.getSession();
       
        //2013.01.29 list 페이지 checkbox 삭제 추가
        if (!projectForm.getKeyArr().equals(null)) {
          ActionMessages msg = new ActionMessages();
            int message = -1;
            String val = projectForm.getKeyArr();
          StringTokenizer strT = new StringTokenizer(val , "||");
            while(strT.hasMoreTokens()){
               String tempStr = strT.nextToken();
               if(!tempStr.equals("") && !tempStr.equals(null)){
                 Project _Project = new Project();
                 _Project.setProUid(Integer.parseInt(tempStr.trim()));
                 message = (Integer) sqlMap.delete("Project.projectDelete", _Project)// PROJECT
                    sqlMap.delete("Project.modelingDelete", _Project); // MODELING
                    sqlMap.delete("Project.figuresDelete", _Project)// FIGURES
                    if(message == 0){
                       msg.add("message", new ActionMessage("삭제에 실패했습니다."));
View Full Code Here


     */
    @SuppressWarnings("unchecked")
  public ActionForward info(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
      Project projectForm = (Project)form;
        HttpSession session = request.getSession();
        session.setAttribute("proUid", projectForm.getProUid());
       
        Project projectData = new Project();
        ArrayList<ProjectLOG> logList = new ArrayList<ProjectLOG>();
        String result="";
       
        if(projectForm.getProUid() > 0){
          projectData = (Project)sqlMap.queryForObject("Project.list", projectForm);
View Full Code Here

    @SuppressWarnings("unused")
    public ActionForward model(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
        Project projectForm = (Project)form;
        HttpSession session = request.getSession();
        session.setAttribute("proUid", projectForm.getProUid());
        System.out.println("model");
        return mapping.findForward("model");
    }
View Full Code Here

     */
    public ActionForward insert(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
        Project projectForm = (Project)form;
        HttpSession session = request.getSession();
        session.setAttribute("proUid", projectForm.getProUid());
        ActionMessages msg = new ActionMessages();
        int message = -1;
        message = (Integer) sqlMap.insert("Project.projectInsert", projectForm);
       
        if(message == 0){
            msg.add("message", new ActionMessage("저장에 실패했습니다."));
        }else if(message > 0){
            msg.add("message", new ActionMessage("저장에 성공했습니다."));
            int proUid = message;
            sqlMap.insert("Project.projectLogInsert", proUid);
        }
       
        saveMessages(request, msg);
        projectForm.setProUid(message);
        request.setAttribute("projectData", projectForm);
        return mapping.findForward("success");
    }
View Full Code Here

     */
    public ActionForward simulatorBase(ActionMapping mapping,
                                   ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response) throws Exception {
            Project projectForm = (Project)form;
            HttpSession session = request.getSession();
            session.setAttribute("proUid", projectForm.getProUid());
            projectForm = (Project) sqlMap.queryForObject("Project.list", projectForm);
            request.setAttribute("projectForm", projectForm);
            return mapping.findForward("simulatorBase");
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public ActionForward simulator(ActionMapping mapping,
                                   ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response) throws Exception {
        Project projectForm = (Project)form;
        HttpSession session = request.getSession(false)
        session.setAttribute("proUid", projectForm.getProUid());
        if(simulationArr !=null && !simulationArr.isEmpty()){
            simulationArr.remove((String)session.getAttribute(Constants.SESSION_GETID));
        }
        log.debug("Iteration Number   ========="+projectForm.getProIterNum());
        log.debug("Startting Time     ========="+projectForm.getProStartTime());
        log.debug("Life      Time     ========="+projectForm.getProLifeTime());
        log.debug("Time      Division ========="+projectForm.getProTd());
       
        Project simBaseForm = (Project) sqlMap.queryForObject("Project.list", projectForm);
        ArrayList<Figures> figList = (ArrayList<Figures>) sqlMap.queryForList("Figures.list", new Figures(projectForm));
       
        request.setAttribute("simBaseForm", simBaseForm);
        request.setAttribute("figList", figList);
        return mapping.findForward("simulator");
View Full Code Here

    @SuppressWarnings("unchecked")
    public ActionForward runSimulator(ActionMapping mapping,
                                       ActionForm form,
                                       HttpServletRequest request,
                                       HttpServletResponse response)throws Exception{
        Project projectForm = (Project)form; // Project Practice Setting value
        HttpSession session = request.getSession(false); //HttpSession이 존재하면 현재 HttpSession을 반환하고 존재하지 않으면 새로이 생성하지 않고 그냥 null을 반환
        if(simulationArr !=null && !simulationArr.isEmpty()){ // 기존 simualtionArr 을 삭제
            simulationArr.remove(session.getAttribute(Constants.SESSION_GETID));
        }
        System.out.println("runSimulator");
       
        log.debug("Iteration Number   ========="+projectForm.getProIterNum());
        log.debug("Startting Time     ========="+projectForm.getProStartTime());
        log.debug("Life      Time     ========="+projectForm.getProLifeTime());
        log.debug("Time      Division ========="+projectForm.getProTd());
       
        SampleEngineImpl sampleEngine = new SampleEngineImpl();
        SampleBean samplebean = new SampleBean();
       
        //2012-01-13 정재우 실장님의 요청으로 추가함
        ActionMessages msg = new ActionMessages();
        int message = -1;
        message = (Integer) sqlMap.update("Project.simulatorUpdate", projectForm);
        /**
         * Project.simulatorUpdate query
         *   UPDATE PROJECT
           SET  PRO_ITERNUM        = #proIterNum#     
               ,PRO_STARTTIME        = #proStartTime#
               ,PRO_LIFETIME         = #proLifeTime#
               ,PRO_TD      = #proTd#
               ,PRO_OUTPUT  = #proOutput#
         ,PRO_ANNUALRATE  = #proAnnualRate#
         WHERE PRO_UID = #proUid#
         */
    if(message == 0){
      msg.add("message", new ActionMessage("저장에 실패했습니다."));
    }else if(message > 0){
      msg.add("message", new ActionMessage("저장에 성공했습니다."));
    }
        saveMessages(request, msg);
       
        List modelingList =  sqlMap.queryForList("Modeling.getModeling", ""+projectForm.getProUid()); // Project Uid Modeling Get
        /***
         * List<Modeling> 으로 안하고 List로 했는지(?)
         */
       
        /** Modeling.getModeling query
         *
         * SELECT MO_UID         AS moUid
             ,MO_PROJECT    AS moProject
             ,MO_BR         AS moBr
             ,MO_SELF       AS moSelf
             ,MO_PRE        AS moPre
             ,MO_DEPTH      AS moDepth
             ,MO_ORDER      AS moOrder
             ,MO_TYPE       AS moType
             ,MO_IMG        AS moImg
             ,MO_POSX       AS moPosx
             ,MO_POSY       AS moPosy
             ,MO_NAME       AS moName
             ,MO_PU_EA      AS moPuEa
             ,MO_PU_NAME    AS moPuName
             ,MO_PU_VALUE   AS moPuValue
             ,MO_PU_ORDER   AS moPuOrder
             ,MO_IN         AS moIn
             ,MO_OUT        AS moOut
             ,MO_TREE       AS moTree
             ,MO_TAG_ID     AS moTagId
             ,MO_PU_CONNECT AS moPuConnect
             ,MO_PB_UID     AS moPbUid
       FROM MODELING
      WHERE MO_PROJECT = #value#
         */
       
        HashMap<String, ArrayList<Modeling>> cenarioMap = new HashMap<String, ArrayList<Modeling>>();
        Vector<Modeling> modelingVector = new Vector<Modeling>(modelingList.size()); //modelingList를 Vetor로 변경하기 위한 객체 선언
        ArrayList<SampleBean> sampleBean = new ArrayList<SampleBean>();
        modelingVector.addAll(modelingList); //Vetor 에 List 값 적용
        for (int i=0;i<modelingVector.size();i++) {
            ArrayList<Modeling> cenarioModeling = (ArrayList<Modeling>)sqlMap.queryForList("Modeling.getSNModeling", ""+modelingVector.get(i).getMoSelf());
            /**
             * Modeling.getSNModeling query
             * SELECT * FROM (SELECT SNMO_UID         AS moUid
               ,SNMO_PROJECT    AS moProject
               ,SNMO_BR         AS moBr
               ,SNMO_SELF       AS moSelf
               ,SNMO_PRE        AS moPre
               ,SNMO_DEPTH      AS moDepth
               ,SNMO_ORDER      AS moOrder
               ,SNMO_TYPE       AS moType
               ,SNMO_IMG        AS moImg
               ,SNMO_POSX       AS moPosx
               ,SNMO_POSY       AS moPosy
               ,SNMO_NAME       AS moName
               ,SNMO_PU_EA      AS moPuEa
               ,SNMO_PU_NAME    AS moPuName
               ,SNMO_PU_VALUE   AS moPuValue
               ,SNMO_PU_ORDER   AS moPuOrder
               ,SNMO_IN         AS moIn
               ,SNMO_OUT        AS moOut
               ,SNMO_TREE       AS moTree
               ,SNMO_TAG_ID     AS moTagId
               ,SNMO_PU_CONNECT AS moPuConnect
               ,SNMO_PB_UID     AS moPbUid
        FROM SCENARIOMODELING
            WHERE MO_PK = #value#
      UNION ALL
      SELECT MO_UID         AS moUid
                   ,MO_PROJECT    AS moProject
                   ,MO_BR         AS moBr
                   ,MO_SELF       AS moSelf
                   ,MO_PRE        AS moPre
                   ,MO_DEPTH      AS moDepth
                   ,MO_ORDER      AS moOrder
                   ,MO_TYPE       AS moType
                   ,MO_IMG        AS moImg
                   ,MO_POSX       AS moPosx
                   ,MO_POSY       AS moPosy
                   ,MO_NAME       AS moName
                   ,MO_PU_EA      AS moPuEa
                   ,MO_PU_NAME    AS moPuName
                   ,MO_PU_VALUE   AS moPuValue
                   ,MO_PU_ORDER   AS moPuOrder
                   ,MO_IN         AS moIn
                   ,MO_OUT        AS moOut
                   ,MO_TREE       AS moTree
                   ,MO_TAG_ID     AS moTagId
                   ,MO_PU_CONNECT AS moPuConnect
                   ,MO_PB_UID     AS moPbUid
      FROM MODELING
            WHERE MO_SELF = #value#)
      ORDER BY moSelf ASC
             */
            if (cenarioModeling != null) {
              cenarioMap.put(modelingVector.get(i).getMoSelf(), cenarioModeling);
            }
            if (modelingVector.get(i).getSamplesList().size()>0) {
              sampleBean.addAll(modelingVector.get(i).getSamplesList());
            }
        }
       
        //cenarioList.add(sampleBean);
        //System.out.println("가로사이즈-->"+modelingVector.size());
        //System.out.println(sampleBean.size());
       
        //System.out.println(sampleBean.size());
        ArrayList<String> keyArr = new ArrayList<String>();
        //ArrayList<ArrayList<SampleBean>> cenarioList = new ArrayList<ArrayList<SampleBean>>(); // 시나리오 관련 최종 데이터 저장소
       
        //ArrayList<SampleBean> tempSampleBean = new ArrayList<SampleBean>(); // 시나리오 데이터 임시 저장소
     // 시나리오 관련 모드일경우
       
       
        if (true) {
            this.fnCenario(modelingVector, keyArr, cenarioMap, sampleEngine, projectForm, sampleBean);
        }
        System.out.println("keyArr.length : " + keyArr.size());
        //시나리오 관련 종료
       
        ArrayList<Figures> figList = (ArrayList<Figures>) sqlMap.queryForList("Figures.figures", new Figures(projectForm));
        samplebean.setFigProjectUid(projectForm.getProUid());
        //sampleBean = (ArrayList<SampleBean>) sqlMap.queryForList("Sample.figures",samplebean);
        //System.out.println("sampleBean.size() : " + sampleBean.size());
        Sampleform sampleform = sampleEngine.engineCore(projectForm,sampleBean,simulationArr);
       
      //시작 경제성 계산
View Full Code Here

     */
    public ActionForward update(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
        Project projectForm = (Project)form;
        HttpSession session = request.getSession();
        session.setAttribute("proUid", projectForm.getProUid());
        ActionMessages msg = new ActionMessages();
        int message = -1;
        message = (Integer) sqlMap.update("Project.projectUpdate", projectForm);
               if(message == 0){
                   msg.add("message", new ActionMessage("저장에 실패했습니다."));
               }else if(message > 0){
                   msg.add("message", new ActionMessage("저장에 성공했습니다."));
                   int proUid = projectForm.getProUid();
                   sqlMap.insert("Project.projectLogInsert", proUid);
               }
        saveMessages(request, msg);              
        request.setAttribute("projectData", projectForm);
        return mapping.findForward("update");
View Full Code Here

     */
    public ActionForward simulationUpdate(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
        Project projectForm = (Project)form;
        HttpSession session = request.getSession();
        session.setAttribute("proUid", projectForm.getProUid());
        ActionMessages msg = new ActionMessages();
        int message = -1;
        message = (Integer) sqlMap.update("Project.simulatorUpdate", projectForm);
               if(message == 0){
                   msg.add("message", new ActionMessage("저장에 실패했습니다."));
View Full Code Here

    @SuppressWarnings("deprecation")
  public ActionForward delete(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        Project projectForm = (Project)form;
        HttpSession session = request.getSession();
        session.removeAttribute("proUid");
        ActionMessages msg = new ActionMessages();
        int message = -1;
            message = (Integer) sqlMap.delete("Project.projectDelete", projectForm)// PROJECT
View Full Code Here

TOP

Related Classes of com.ordobill.webapp.beans.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.