zoukankan      html  css  js  c++  java
  • java 给json框打上分类名称

        public void import9(){
            TagImgFilter filter = new TagImgFilter();//更改的集合
            filter.setEq_orgId("c1fa7ba875fa4c9a899e2787eb79e802");
            filter.setEq_setId("d5e8f01a2e6649cf877eacda8ceb6ff1");
            filter.setEq_typeId("ff4dfd4ba7d949958b3d630a90fcca75");
            filter.setNull_tagJson(false);// 是否要有标注的,true是没标注
            List<TagImg> imgList = tagImgService.selectAll(filter);
            System.out.println(imgList.size());
            int countadd = 0;
            for (TagImg tagimg : imgList) {
                countadd++;
                System.out.println(countadd);
                TagType tagType = tagTypeService.getById(tagimg.getTypeId());
                String json=tagimg.getTagJson();
                JSONArray array=JSONArray.parseArray(json);
                JSONArray arrayNew=new JSONArray();
                if(array!=null && array.size()>0){
                    for(int i=0;i<array.size();i++){
                        JSONObject obj = array.getJSONObject(i);
                        System.out.println(obj);
                        obj.put("classname", tagType.getName());
                        System.out.println("-----------------");
                        System.out.println(obj);
                        arrayNew.add(obj);
                    }
                    tagimg.setTagJson(arrayNew.toString());
                    tagImgService.save(tagimg);
                }            
            }        
        }
  • 相关阅读:
    UVAlive5135_Mining Your Own Business
    UVAlive3523_Knights of the Round Table
    UVA10759_Dice Throwing
    POJ3177_Redundant Paths
    UVA11027_Palindromic Permutation
    Codechef_JULY14
    UVAlive4255_Guess
    UVA10054_The Necklace
    杜教BM
    【2018徐州网络赛】Morgana Net (矩阵快速幂)
  • 原文地址:https://www.cnblogs.com/lely/p/10364604.html
Copyright © 2011-2022 走看看