Package com.vst.model

Examples of com.vst.model.ObjectInspection


        if (httpServletRequest.getParameter("type") != null && httpServletRequest.getParameter("objectId") != null) {

            Integer id = (Integer) Integer.parseInt(httpServletRequest.getParameter("objectId"));
            List list = new ArrayList();
            ObjectInspection objectInspection = objectInspectionManager.getObjectInspectionBy((Integer) Integer.parseInt(httpServletRequest.getParameter("objectId")));

            if (httpServletRequest.getParameter("delete") != null) {
                Integer photoId = (Integer) Integer.parseInt(httpServletRequest.getParameter("delete"));

                if (httpServletRequest.getParameter("type").equals("oborudovanieList")) {
                    PhotoOborudovanie p = photoManager.getByIdPhotoOborudovanie(photoId);
                    objectInspection.getOborudovanieList().remove(p);
                    objectInspectionManager.updateObjectInspection(objectInspection);
                    photoManager.delete(p);


                } else if (httpServletRequest.getParameter("type").equals("objectInspectionList")) {
                    PhotoObjectInspection p = photoManager.getByIdPhotoObjectInspection(photoId);
                    objectInspection.getObjectInspectionList().remove(p);
                    objectInspectionManager.updateObjectInspection(objectInspection);
                    photoManager.delete(p);

                }

            }

            Integer page = new Integer(0);
            Integer pageCount=new Integer(1);
            if (httpServletRequest.getParameter("page") != null) {
                page = (Integer) Integer.parseInt(httpServletRequest.getParameter("page"));
            }
            if (httpServletRequest.getParameter("type").equals("oborudovanieList")) {

                //pageCount=(Integer)objectInspectionManager.getObjectInspectionBy(id).getOborudovanieList().size();
                // System.out.println("COUNT == "+pageCount +" id== "+id);

                list = PageHelper.getListByPage(page,objectInspection.getOborudovanieList()) ;



                System.out.println("SIZE = " + list.size());

                for (int i = 0; i < list.size(); i++) {
                    PhotoOborudovanie photo = (PhotoOborudovanie) list.get(i);

                    photoManager.prepareForOpen(photo, FileHelper.getCurrentPath(httpServletRequest));


                }



                pageCount = (Integer) objectInspection.getOborudovanieList().size();


            } else if (httpServletRequest.getParameter("type").equals("objectInspectionList")) {
                // pageCount=(Integer)objectInspectionManager.getObjectInspectionBy(id).getObjectInspectionList().size();

                list = PageHelper.getListByPage(page,objectInspection.getObjectInspectionList());

                for (int i = 0; i < list.size(); i++) {

                    PhotoObjectInspection photo = (PhotoObjectInspection) list.get(i);

                    photoManager.prepareForOpen(photo, FileHelper.getCurrentPath(httpServletRequest));
                   
                }



                pageCount = (Integer) objectInspection.getObjectInspectionList().size();


            }

            if ((pageCount.intValue() % 15) > 0) {
View Full Code Here



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

            Integer id = (Integer) Integer.parseInt(httpServletRequest.getParameter("objectId"));
            ObjectInspection obj = objectInspectionManager.getObjectInspectionBy(id);
            objectInspectionManager.deleteObjectInspection(obj);

        }


        List list = objectInspectionManager.getListObjectInspection(page);
        for (int i = 0; i < list.size(); i++) {
            ObjectInspection objectInspection = (ObjectInspection) list.get(i);
            photoManager.prepareForOpen(objectInspection.getDemand(), FileHelper.getCurrentPath(httpServletRequest));
            photoManager.prepareForOpen(objectInspection.getCertificate(), FileHelper.getCurrentPath(httpServletRequest));
        }


        pageCount = (Integer) objectInspectionManager.getListObjectInspection().size();
View Full Code Here

                       List list = objectInspectionManager.getListByObjectExpId(id);
                       if (list.size() > 0) {
                           result += "Объект экспертизы не может быть удален, так как истользуется " + list.size() + " раз(а) в другом справочнике :<br>";
                           result += "<table>";
                           for (int i = 0; i < list.size(); i++) {
                               ObjectInspection o = (ObjectInspection) list.get(i);

                               List listExp = o.getTrueexpertList();
                               List listPracObj = o.getObjectTypeList();
                               String resultExpert = "";
                               String resultPracObj = "";
                               for (int j = 0; j < listPracObj.size(); j++) {
                                   PracticalObjectExpertType practicalObject = (PracticalObjectExpertType) listPracObj.get(j);
                                   resultPracObj += practicalObject.getPipelineSubtype().getPipelineType() + ";  " + practicalObject.getObjectExpertType().getAppointment() + " " + practicalObject.getObjectExpertType().getDefinition() + " " + practicalObject.getObjectExpertType().getExpertName() + " <br>";
                               }

                               for (int j = 0; j < listExp.size(); j++) {
                                   Expert expert = (Expert) listExp.get(j);
                                   resultExpert += expert.getExpertFio() + "  ";
                               }
                               listExp = o.getFalseexpertList();

                               for (int j = 0; j < listExp.size(); j++) {
                                   Expert expert = (Expert) listExp.get(j);
                                   resultExpert += expert.getExpertFio() + "  ";
                               }

                               result += "<tr><td><a href=\"" + httpServletRequest.getRequestURL().toString().replaceAll("/lookObjectExpertType.html", "") + "/lookObjectInspection.html\"><ul>" +
                                       "<li>Номер договора:           " + o.getContractNumber() +
                                       "<li>Дата заключения договора:                     " + o.getDateForLook() +
                                       "<li>Эксперты:                 " + resultExpert +
                                       "<li>Обследователи:  " + resultPracObj +
                                       "<li>Организация:              " + o.getCustomerOrganization() +
                                       "<li>ФИО руководителя организации:         " + o.getCustomerFio() + "</ul></a></td></tr>";
                           }
                           result += "</table>";
                       } else {
                           ObjectExpertType object = objectExpertTypeManager.getObjectExpertTypeById(id);
                           objectExpertTypeManager.deleteObjectExpert(object);
View Full Code Here

                    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


                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

TOP

Related Classes of com.vst.model.ObjectInspection

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.