Examples of PipeLineElement


Examples of com.vst.model.PipeLineElement

    private List setValues(ResultSet rs) throws SQLException {
        List list = new ArrayList();

        while (rs.next()) {
            PipeLineElement pl = new PipeLineElement();
            pl.setIdElement((Integer) rs.getInt(1));
            pl.setDetailType(detailDao.getDetailTypesById((Integer) rs.getInt(4)));
            pl.setVisualInspection(visualInspectionDaoHibernate.getById((Integer) rs.getInt(2)));

            if (pl.getDetailType() != null) {
                if (pl.getDetailType().getTypeId().equals(new Integer(1))) {
                    pl.setDetail(detailDao.getPipeById((Integer) rs.getInt(3)));
                }
                if (pl.getDetailType().getTypeId().equals(new Integer(2))) {
                    pl.setDetail(detailDao.getTapById((Integer) rs.getInt(3)));
                }
                if (pl.getDetailType().getTypeId().equals(new Integer(3))) {
                    pl.setDetail(detailDao.getTransitionById((Integer) rs.getInt(3)));
                }
                if (pl.getDetailType().getTypeId().equals(new Integer(4))) {
                    pl.setDetail(detailDao.getTeeById((Integer) rs.getInt(3)));
                }
                if (pl.getDetailType().getTypeId().equals(new Integer(5))) {
                    pl.setDetail(detailDao.getZaglushkaById((Integer) rs.getInt(3)));
                }
                if (pl.getDetailType().getTypeId().equals(new Integer(6))) {
                    pl.setDetail(detailDao.getFlangeById((Integer) rs.getInt(3)));
                }
                if (pl.getDetailType().getTypeId().equals(new Integer(7))) {
                    pl.setDetail(detailDao.getArmatureById((Integer) rs.getInt(3)));
                }
                if (pl.getDetailType().getTypeId().equals(new Integer(8))) {
                    pl.setDetail(detailDao.getOborudovanieById((Integer) rs.getInt(3)));
                }
            }


            pl.setDiametr((Double) rs.getDouble(5));
            pl.setThickness((Double) rs.getDouble(6));
            pl.setFirstDiametr((Double) rs.getDouble(7));
            pl.setSecondDiametr((Double) rs.getDouble(8));
            pl.setFirstThickness((Double) rs.getDouble(9));
            pl.setSecondThickness((Double) rs.getDouble(10));
            pl.setPressure((Integer) rs.getInt(11));
            pl.setCorner((Integer) rs.getInt(12));
            pl.setNumberElement(rs.getString(13));
            pl.setMarkElement(rs.getString(14));
            pl.setPassportExist(rs.getBoolean(15));

            list.add(pl);
        }

        return list;
View Full Code Here

Examples of com.vst.model.PipeLineElement

            return new ModelAndView("redirect:/detailDurabilityList.html?objectId=" + objectId + "&detailType=" + detailType + "&pipeElementId=" + pipeElementId);
        } else {


            detailDurabilityManager.insert(detailDurability);
            PipeLineElement pipeLineElement = pipeLineElementManager.getPipeLineElementById(pipeElementId);
            pipeLineElement.getDetailDurabilityList().add(detailDurability);
            pipeLineElementManager.update(pipeLineElement);
            mav.addObject("result", new Integer(1));

        }
        DetailDurability detail = new DetailDurability();
View Full Code Here

Examples of com.vst.model.PipeLineElement

        if (httpServletRequest.getParameter("delete") != null) {

            Integer deleteElementId = Integer.valueOf(httpServletRequest.getParameter("delete"));

            PipeLineElement pipeLineElement = pipeLineElementManager.getPipeLineElementById(pipeElementId);
            DetailDurability detailDurability = detailDurabilityManager.getDetailDurabilityById(deleteElementId);
            pipeLineElement.getDetailDurabilityList().remove(detailDurability);
            pipeLineElementManager.update(pipeLineElement);
            detailDurabilityManager.delete(detailDurability);


        }
View Full Code Here

Examples of com.vst.model.PipeLineElement

    public void validate(Object o, Errors errors) {

        System.out.println("validate");

        PipeLineElement p=(PipeLineElement)o;
        if ((p.getDetailType().getTypeId().intValue()==1 || p.getDetailType().getTypeId().intValue()==2 || p.getDetailType().getTypeId().intValue()==5 || p.getDetailType().getTypeId().intValue()==6)&& (p.getDiametr()==null || p.getThickness()==null)) {
              if (p.getDiametr()==null){
                errors.rejectValue("diametr","detail.diametr");
              }
              if (p.getThickness()==null){
                errors.rejectValue("thickness","detail.thickness");
              }
        }

        if ((p.getDetailType().getTypeId().intValue()==7 || p.getDetailType().getTypeId().intValue()==8)&& (p.getDiametr()==null || p.getThickness()==null)) {
              if (p.getDiametr()==null){
                errors.rejectValue("diametr","detail.diametr");
              }             
        }

         if (p.getDetailType().getTypeId().intValue()==2 && (p.getCorner()==null)) {
                     if (p.getCorner()==null){
                        errors.rejectValue("corner","detail.corner");
                      }
        }

         if ((p.getDetailType().getTypeId().intValue()==3 || p.getDetailType().getTypeId().intValue()==4) && (p.getFirstDiametr()==null || p.getFirstThickness()==null || p.getSecondDiametr()==null || p.getSecondThickness()==null)) {
              if (p.getFirstDiametr()==null){
                errors.rejectValue("firstDiametr","detail.diametr");
              }
              if (p.getFirstThickness()==null){
                errors.rejectValue("firstThickness","detail.thickness");
              }
             if (p.getSecondDiametr()==null){
                errors.rejectValue("secondDiametr","detail.diametr");
              }
              if (p.getSecondThickness()==null){
                errors.rejectValue("secondThickness","detail.thickness");
              }
        }



         if ((p.getDetailType().getTypeId().intValue()==6 || p.getDetailType().getTypeId().intValue()==7 || p.getDetailType().getTypeId().intValue()==8) && (p.getPressure()==null)) {
              if (p.getPressure()==null){
                  errors.rejectValue("pressure","detail.pressure");
              }
        }


         if (p.getMarkElement()==null || p.getMarkElement().trim().equals(""))
         {
              errors.rejectValue("markElement","detail.marks");
         }
        if (p.getNumberElement().trim().equals("")){
             errors.rejectValue("numberElement","detail.number");
        }

        if ( p.getDetail().getDetailId()==null || p.getDetail().getDetailId().intValue()==-1){
             errors.rejectValue("detail.detailId","detail.exist");
        }


    }
View Full Code Here

Examples of com.vst.model.PipeLineElement


                  if (request.getParameter("update")!=null){

                  Integer id=(Integer)Integer.parseInt(request.getParameter("update"));
                  PipeLineElement pipeLineElement=pipeLineElementManager.getPipeLineElementById(id);
                  request.setAttribute("detailType",detailType);
                  return pipeLineElement;

            }

               else{

                                 PipeLineElement pipeLineElement=new PipeLineElement();
                                 pipeLineElement.setDetailType(detailManager.getDetailTypesById(detailType));
                                 request.setAttribute("detailType",detailType);
                                 return pipeLineElement;

            }
          }
View Full Code Here

Examples of com.vst.model.PipeLineElement

               ModelAndView mav = new ModelAndView(getSuccessView());



               PipeLineElement pipeLineElement=(PipeLineElement)command;
               Integer objectId=(Integer)request.getSession().getAttribute("objectId");

               if(request.getParameter("cansel")!=null){
                   return new ModelAndView("redirect:/lookPipeLineElement.html?detailType="+request.getParameter("newDetailType")+"&objectId="+objectId);
               }



                   Integer detailType=pipeLineElement.getDetailType().getTypeId();
                   pipeLineElement.setDetailType(detailManager.getDetailTypesById(detailType));

               if(request.getParameter("newDetailType")!=null){



                       if (detailType.equals(new Integer(1))){

                         mav.addObject("detailList",detailManager.getAllPipe());
                       }
                         if (detailType.equals(new Integer(2))){

                         mav.addObject("detailList",detailManager.getAllTap());
                       }
                         if (detailType.equals(new Integer(3))){

                         mav.addObject("detailList",detailManager.getAllTransition());
                       }
                         if (detailType.equals(new Integer(4))){

                         mav.addObject("detailList",detailManager.getAllTee());
                       }
                         if (detailType.equals(new Integer(5))){

                         mav.addObject("detailList",detailManager.getAllZaglushka());
                       }
                         if (detailType.equals(new Integer(6))){

                         mav.addObject("detailList",detailManager.getAllFlange());
                       }
                         if (detailType.equals(new Integer(7))){

                         mav.addObject("detailList",detailManager.getAllArmature());
                       }
                         if (detailType.equals(new Integer(8))){

                         mav.addObject("detailList",detailManager.getAllOborudovanie());
                       }
                   mav.addObject("detailType",detailType);
                   mav.addObject("pipe",pipeLineElement);

                   return mav;

               }

                    if (detailType.equals(new Integer(1))){
                         pipeLineElement.setDetail(detailManager.getPipeById(pipeLineElement.getDetail().getDetailId()));
                       }
                         if (detailType.equals(new Integer(2))){
                              pipeLineElement.setDetail(detailManager.getTapById(pipeLineElement.getDetail().getDetailId()));
                       }
                         if (detailType.equals(new Integer(3))){
                              pipeLineElement.setDetail(detailManager.getTransitionById(pipeLineElement.getDetail().getDetailId()));
                       }
                         if (detailType.equals(new Integer(4))){
                              pipeLineElement.setDetail(detailManager.getTeeById(pipeLineElement.getDetail().getDetailId()));
                       }
                         if (detailType.equals(new Integer(5))){
                              pipeLineElement.setDetail(detailManager.getZaglushkaById(pipeLineElement.getDetail().getDetailId()));
                       }
                         if (detailType.equals(new Integer(6))){
                              pipeLineElement.setDetail(detailManager.getFlangeById(pipeLineElement.getDetail().getDetailId()));

                       }
                         if (detailType.equals(new Integer(7))){
                              pipeLineElement.setDetail(detailManager.getArmatureById(pipeLineElement.getDetail().getDetailId()));

                       }
                         if (detailType.equals(new Integer(8))){
                              pipeLineElement.setDetail(detailManager.getOborudovanieById(pipeLineElement.getDetail().getDetailId()));

                       }

          

                if (pipeLineElement.getIdElement()!=null){

                       pipeLineElementManager.update(pipeLineElement);
                     return new ModelAndView("redirect:/lookPipeLineElement.html?detailType="+detailType+"&objectId="+objectId);
                   }

                else{
                    VisualInspection visualInspection=new VisualInspection();
                    visualInspection.setInspectionDescription("");
                    visualInspection.setInspectionValidity(false);
                    visualInspectionManager.insert(visualInspection);
                    pipeLineElement.setVisualInspection(visualInspection);
                    pipeLineElementManager.insert(pipeLineElement);
                    ObjectInspection objectInspection=objectInspectionManager.getObjectInspectionBy(objectId);
                    objectInspection.getPipeLineList().add(pipeLineElement);
                    objectInspectionManager.updateObjectInspection(objectInspection);
                    return new ModelAndView("redirect:/lookPipeLineElement.html?detailType="+detailType+"&objectId="+objectId);
View Full Code Here

Examples of com.vst.model.PipeLineElement

                                                 HttpServletResponse response,
                                                 Object command,
                                                 BindException errors)
               throws Exception {
              ModelAndView mav = new ModelAndView(getSuccessView());
              PipeLineElement pipeLineElement=(PipeLineElement)command;



         if(request.getParameter("newDetailType")!=null){




                   Integer detailType=pipeLineElement.getDetailType().getTypeId();
                   pipeLineElement.setDetailType(detailManager.getDetailTypesById(detailType));

                       if (detailType.equals(new Integer(1))){

                         mav.addObject("detailList",detailManager.getAllPipe());
                       }
                         if (detailType.equals(new Integer(2))){

                         mav.addObject("detailList",detailManager.getAllTap());
                       }
                         if (detailType.equals(new Integer(3))){

                         mav.addObject("detailList",detailManager.getAllTransition());
                       }
                         if (detailType.equals(new Integer(4))){

                         mav.addObject("detailList",detailManager.getAllTee());
                       }
                         if (detailType.equals(new Integer(5))){

                         mav.addObject("detailList",detailManager.getAllZaglushka());
                       }
                         if (detailType.equals(new Integer(6))){

                         mav.addObject("detailList",detailManager.getAllFlange());
                       }
                         if (detailType.equals(new Integer(7))){

                         mav.addObject("detailList",detailManager.getAllArmature());
                       }
                         if (detailType.equals(new Integer(8))){

                         mav.addObject("detailList",detailManager.getAllOborudovanie());
                       }
                   mav.addObject("detailType",detailType);
                   mav.addObject("pipe",pipeLineElement);

                   return mav;

       }





                   Integer detailType=pipeLineElement.getDetailType().getTypeId();



                   pipeLineElement.setDetailType(detailManager.getDetailTypesById(detailType));

                       if (detailType.equals(new Integer(1))){

                         request.setAttribute("detailList",detailManager.getAllPipe());
                       }
View Full Code Here

Examples of com.vst.model.PipeLineElement

            request.getSession().setAttribute("detailType", request.getParameter("detailType"));
            request.getSession().setAttribute("objectId", request.getParameter("objectId"));
            request.getSession().setAttribute("pipeElementId", request.getParameter("pipeElementId"));

            Integer pipeId = Integer.valueOf(request.getParameter("pipeElementId"));
            PipeLineElement pipeLineElement = pipeLineElementManager.getPipeLineElementById(pipeId);
            Integer visualInspectionId = pipeLineElement.getVisualInspection().getInspectionId();
            VisualInspection visualInspection = visualInspectionManager.getById(visualInspectionId);
            return visualInspection;
        }

        return super.formBackingObject(request);
View Full Code Here

Examples of com.vst.model.PipeLineElement

            if (httpServletRequest.getParameter("detailType") != null) {


                if (httpServletRequest.getParameter("delete") != null) {
                    Integer id = (Integer) Integer.parseInt(httpServletRequest.getParameter("delete"));
                    PipeLineElement pipeLineElement = pipeLineElementManager.getPipeLineElementById(id);
                    ObjectInspection objectInspection = objectInspectionManager.getObjectInspectionBy(objectId);
                    objectInspection.getPipeLineList().remove(pipeLineElement);
                    objectInspectionManager.updateObjectInspection(objectInspection);
                    pipeLineElementManager.delete(pipeLineElement);
                }
View Full Code Here

Examples of com.vst.model.PipeLineElement

        if (httpServletRequest.getParameter("delete") != null) {
            Integer deleteId = Integer.valueOf(httpServletRequest.getParameter("delete"));
            PipeLineElementDefect pipeLineElementDefect = pipeLineElementDefectManager.getPipeLineElementDefectById(deleteId);
            Integer fphotoId = pipeLineElementDefect.getFirstPhoto().getPhotoId();
            Integer sphotoId = pipeLineElementDefect.getSecondPhoto().getPhotoId();
            PipeLineElement pipeLineElement = pipeLineElementManager.getPipeLineElementById(elementId);
            pipeLineElement.getPipeLineElementDefectList().remove(pipeLineElementDefect);
            pipeLineElementDefectManager.delete(pipeLineElementDefect);
            if (fphotoId != null) {
                photoManager.delete(photoManager.getByIdPhoto(fphotoId));
            }
            if (sphotoId != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.