Examples of PhotoObjectInspection


Examples of com.vst.model.PhotoObjectInspection

    }


    public PhotoObjectInspection insertPhotoObjectInspection(CommonsMultipartFile file, String  currentPath) throws Exception {

          PhotoObjectInspection photo=new PhotoObjectInspection();
          if(file.getSize()>0)
                   {
                       Date date=new Date();
                       String wayToPhoto=String.valueOf(date.getTime())+".jpg";
                       OutputStream fl=new FileOutputStream(currentPath+wayToPhoto);
                       try {
                           fl.write(file.getBytes());
                           fl.close();
                           InputStream inputStream=new FileInputStream(currentPath+wayToPhoto);

                           photo.setPhotoPlob(Hibernate.createBlob(ImageUtil.scaleImage(inputStream)));
                           photo.setWayToPhoto(wayToPhoto);
                       } catch (IOException e) {
                           e.printStackTrace();
                       }
                   }
          dao.insert(photo);
View Full Code Here

Examples of com.vst.model.PhotoObjectInspection

                    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));
                   
                }
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.