java 打印box文件

    public void import11(){
        String path="D:\北体检阴阳性整标1116\yinbox";
        TagImgFilter tageImgFilter=new TagImgFilter();
        tageImgFilter.setEq_setId("2367ff90d4ce495ca7c55fbd87683691");        
        tageImgFilter.setEq_typeId("f7ce9ce48b8b423b89ecd9da43edb2bc");
        tageImgFilter.setNull_tagJson(false);
        List<TagImg> tagImgList=tagImgService.selectAll(tageImgFilter);
        System.out.println("size:"+tagImgList.size());
        TagType tagType = null;
        int count=0;
        for(TagImg tagimg:tagImgList){
            tagType=tagTypeService.getById(tagimg.getTypeId());
            System.out.println(count);
            count++;
            //String md5=tagimg.getImgMd5();
            String id=tagimg.getId();
            FileUtil util=new FileUtil();
            String json=tagimg.getTagJson();
            JSONArray array=JSONArray.parseArray(json);
            if(array!=null && array.size()>0){
                for(int i=0;i<array.size();i++){
                    JSONObject obj = array.getJSONObject(i);
                    Double x=obj.getDouble("x");
                    Double y=obj.getDouble("y");
                    Double width=obj.getDouble("width");
                    Double height=obj.getDouble("height");
                    //String classname=obj.getString("classname");
                    String typename=tagType.getName();
                    String str=x.intValue()+" "+y.intValue()+" "+(int)(x+width.intValue())+" "+(int)(y+height.intValue())+" "+typename;
                    //String str=x.intValue()+" "+y.intValue()+" "+(int)(x+width.intValue())+" "+(int)(y+height.intValue())+" "+"主动脉";
                    //util.toFile(str, path, md5+".box");
                    util.toFile(str, path, id+".box");
                }
            }
//            if(count==1000){
//                  break;
//              }
        }
        
    }
原文地址:https://www.cnblogs.com/lely/p/10364608.html