Package com.vst.model

Examples of com.vst.model.DetailSymbol



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

            DetailSymbol detailSymbol=new DetailSymbol();
            detailSymbol.setSymbolBlob(levelPlan.getLevelBlob());
            detailSymbol.setWayToSymbol(levelPlan.getWayToLevelPlan());
            detailSymbol.setWayToSymbolImage(levelPlan.getWayToLevelPlanImage());

            ObjectPictureUtil.addDetailSymbolJPEG(detailSymbol, FileHelper.getCurrentPath(httpServletRequest));
        }

View Full Code Here


    public List getAllDetailSymbol() {

        List list=detailSymbolDao.getAllSymbol();
        List resultlist=new ArrayList();
        for (int i=0; i<list.size(); i++){
            DetailSymbol detailSymbol=(DetailSymbol)list.get(i);
            if (detailSymbol.getType().equals("detail")){
                resultlist.add(detailSymbol);
            }
        }

        return resultlist;
View Full Code Here

    public List getAllDefectSymbol() {
          List list=detailSymbolDao.getAllSymbol();
        List resultlist=new ArrayList();
        for (int i=0; i<list.size(); i++){
            DetailSymbol detailSymbol=(DetailSymbol)list.get(i);
            if (detailSymbol.getType().equals("defect")){
                resultlist.add(detailSymbol);
            }
        }

        return resultlist;
View Full Code Here

        System.out.println("detailSymbolExist");

        List list = detailSymbolDao.getAllSymbol();
        for (int i = 0; i < list.size(); i++) {
            DetailSymbol detSymbol = (DetailSymbol) list.get(i);
              System.out.println(detailSymbol.getSymbolId());
              System.out.println(detailSymbol.getType());

            if (       detSymbol.getType().equals("defect") &&
                       (
                       detSymbol.getDefectType().getDefectTypeId().equals(detailSymbol.getDefectType().getDefectTypeId())&&
                       detSymbol.getDefectVarity().getVarityId().equals(detailSymbol.getDefectVarity().getVarityId()))) {

                return true;
            } else
            if (detSymbol.getType().equals("detail") && detSymbol.getConstructionType().getConstructionTypeId().equals(detailSymbol.getConstructionType().getConstructionTypeId())){
                   return true;
            }


        }
View Full Code Here

    public DetailSymbol getDetailSymbol(ConstructionDefect constructionDefect) {


        List list = detailSymbolDao.getAllSymbol();
        for (int i = 0; i < list.size(); i++) {
            DetailSymbol detailSymbol = (DetailSymbol) list.get(i);

               if (detailSymbol.getType().equals("defect") &&
                       detailSymbol.getDefectType().getDefectTypeId().equals(constructionDefect.getDefectType().getDefectTypeId()) &&
                       detailSymbol.getDefectVarity().getVarityId().equals(constructionDefect.getDefectVarity().getVarityId())) {

                       return detailSymbol;

               }
View Full Code Here




        for (int i = 0; i < list.size(); i++) {
            DetailSymbol detailSymbol = (DetailSymbol) list.get(i);
            ObjectPictureUtil.addDetailSymbolJPEG(detailSymbol, FileHelper.getCurrentPath(httpServletRequest));
        }


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

       }


        if (!isFormSubmission(request)) {

            DetailSymbol detailSymbol = null;

            if (request.getParameter("symbolId")!=null) {
               
                detailSymbol = detailSymbolManager.getByIdPDetailSymbol(Integer.valueOf(request.getParameter("symbolId")));

            } else {
                detailSymbol = new DetailSymbol();
            }

              if (request.getParameter("type")!=null){
                 detailSymbol.setType(request.getParameter("type"));
                 request.getSession().setAttribute("type",request.getParameter("type"));
               }

            if (detailSymbol.getDefectType()!=null && detailSymbol.getDefectType().getDefectTypeId()!=null){
                  request.getSession().setAttribute("defectTypeId",detailSymbol.getDefectType().getDefectTypeId());
                  request.setAttribute("defectVarityList", defectVarityManager.getDefectVaritiesByType(detailSymbol.getDefectType().getDefectTypeId().toString()));
            }else{
                 request.setAttribute("defectVarityList", new ArrayList());
            }

            if (detailSymbol.getWayToSymbol() == null || detailSymbol.getWayToSymbolImage().equals("")) {
                String saveWay = ImageUtil.getUniqueJPEGFile(request);
                request.setAttribute("saveWay", saveWay);
                detailSymbol.setWayToSymbol(saveWay);

                    ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(FileHelper.getCurrentPath(request)+detailSymbol.getWayToSymbol()));
                    out.writeObject(new ObjectPicture());
                    out.close();

                String saveWayImage = "image" + saveWay;
                detailSymbol.setWayToSymbolImage(saveWayImage);
                request.setAttribute("saveWayImage", saveWayImage);

                request.getSession().setAttribute("saveWayImage", saveWayImage);
                request.getSession().setAttribute("saveWay", saveWay);


            } else {
            
                request.getSession().setAttribute("saveWayImage", detailSymbol.getWayToSymbolImage());
                request.getSession().setAttribute("saveWay", detailSymbol.getWayToSymbol());
                request.getSession().setAttribute("loadWay", detailSymbol.getWayToSymbol());

            }


            return detailSymbol;
View Full Code Here

    public ModelAndView onSubmit(HttpServletRequest request,
                                 HttpServletResponse response, Object command,
                                 BindException errors) throws Exception {


        DetailSymbol detailSymbol = (DetailSymbol) command;

        File eskizFile = new File(FileHelper.getCurrentPath(request) + detailSymbol.getWayToSymbol());

        if (detailSymbol.getWayToSymbol() != null && !detailSymbol.getWayToSymbol().equals("") && eskizFile.exists()) {
            detailSymbol.setSymbolBlob(Hibernate.createBlob(new FileInputStream(FileHelper.getCurrentPath(request) + detailSymbol.getWayToSymbol())));

        }


        if (detailSymbol.getType().equals("defect")){
            detailSymbol.setConstructionType(null);
        }

        if (detailSymbol.getType().equals("defect") && detailSymbol.getDefectVarity().getVarityId().longValue()==-1){
            detailSymbol.setDefectVarity(null);
        }

        if (detailSymbol.getType().equals("detail")){
            detailSymbol.setDefectVarity(null);
            detailSymbol.setDefectType(null);
        }

        if (detailSymbol.getSymbolId() != null) {
             detailSymbolManager.update(detailSymbol);
        } else {
             detailSymbolManager.insert(detailSymbol);
        }

        ModelAndView mav = new ModelAndView(getSuccessView());

        DetailSymbol detSymbol = new DetailSymbol();
        detSymbol.setType(detailSymbol.getType());
        String saveWay = ImageUtil.getUniqueJPEGFile(request);

        mav.addObject("saveWay", saveWay);
        detSymbol.setWayToSymbol(saveWay);

        String saveWayImage = "image" + saveWay;
        detSymbol.setWayToSymbolImage(saveWayImage);
        mav.addObject("saveWayImage", saveWayImage);

        mav.addObject("detailSymbol", detSymbol);
        mav.addObject("result", new Integer(1));
        return mav;
View Full Code Here

    public boolean supports(Class aClass) {
        return DetailSymbol.class.isAssignableFrom(aClass);
    }

    public void validate(Object o, Errors errors) {
        DetailSymbol detailSymbol = (DetailSymbol) o;


        if ((detailSymbol.getType().equals("defect") && (detailSymbol.getDefectType() == null || detailSymbol.getDefectType().getDefectTypeId().longValue() == -1)) ||
                (detailSymbol.getType().equals("detail") && (detailSymbol.getConstructionType() == null || detailSymbol.getConstructionType().getConstructionTypeId().longValue() == -1)
                )) {

            if (detailSymbol.getType().equals("defect") && (detailSymbol.getDefectType() == null || detailSymbol.getDefectType().getDefectTypeId().longValue() == -1)) {
                errors.rejectValue("defectType", "reason.noDefectType");
            }
            if (detailSymbol.getType().equals("detail") &&
                    (detailSymbol.getConstructionType() == null || detailSymbol.getConstructionType().getConstructionTypeId().longValue() == -1)) {
                errors.rejectValue("constructionType", "reason.constructionType.error");
            }

        } else if (detailSymbol.getSymbolId() == null && detailSymbolManager.detailSymbolExist(detailSymbol)) {
            errors.rejectValue("symbolId", "detailSymbol.exist");
        }


    }
View Full Code Here

TOP

Related Classes of com.vst.model.DetailSymbol

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.