【java工具类】四级菜单如何实现树状结构展示JSON给前端

 前言:

主要是传给前端进行树状结构操作比较好,这样可以关联上下四级选择项,所以需要把表中的数据List转成一个树状结构。

1、数据库数据是静态的四级目录

数据是这样的四级目录,没有特别明确的id进行关联的,存储数据的是静态的。需要对下面数据进行关联起来!

【java工具类】四级菜单如何实现树状结构展示JSON给前端_第1张图片

 2、新建俩个实体类,组装成树状结构Model

1、返回前端的一个List<树状结构>就可以的


/********************************************
 * 模块名称:
 *   主要功能是做  四级菜单主表详情里面范围-宏观行业四级标签建立树状选择模型
 * @author  
 * @date 2021/7/22  9:59
 * @version 2021/7/22  9:59-01    v1.0.0.0
 *******************************************/
@Data
public class EventCategory {


    /***
     * 孩子,下一级节点
     */
    private List childrenList;
    /***
     * 层级
     */
    private Integer level;
    /***
     * 编码-事件编码
     */
    private String code;
    /***
     * 名称-对应事件名称
     */
    private String name;


}

3、实现子孩子节点的实体类创建


/********************************************
 * 模块名称:
 *   主要功能是做  四级菜单主表详情里面范围-宏观行业四级标签建立树状选择模型 ,孩子模型,递归
 * @author  
 * @date 2021/7/22  10:00
 * @version 2021/7/22  10:00-01    v1.0.0.0
 *******************************************/
@Data
public class Children {

    /**
     * 孩子,下一级节点
     */
    private List childrenList;
    /***
     * 层级
     */
    private Integer level;
    /****
     * 编码-事件编码
     */
    private String code;
    /***
     * 名称-对应事件名称
     */
    private String name;
}

4、通过java建立关联关系对实体类转换,建立起树状结构

@Override
    public List getEventCategoryList() throws ApiException {
        List resultEventCategorys = new ArrayList<>();
        List tbmNewsRangeConfigList = tbmNewsRangeConfigDao.getAllNewsRangeConfig();
        Map> firstLevelListMap = tbmNewsRangeConfigList.stream().collect(Collectors.groupingBy(TbmNewsRangeConfig::getFirstLevelCode, LinkedHashMap::new, Collectors.toList()));
        if(MapUtils.isNotEmpty(firstLevelListMap)){
            firstLevelListMap.keySet().forEach(firstLevelKey -> {
                //一级事件菜单作为主菜单
                List firstRangeList = firstLevelListMap.get(firstLevelKey);
                EventCategory eventCategory = new EventCategory();
                eventCategory.setLevel(1);
                eventCategory.setCode(firstRangeList.get(0).getFirstLevelCode());
                eventCategory.setName(firstRangeList.get(0).getFirstLevelName());
                Map> secondLevelListMap = firstRangeList.stream().collect(Collectors.groupingBy(TbmNewsRangeConfig::getSecondLevelCode, LinkedHashMap::new, Collectors.toList()));
                //二级菜单
                List secondChildrenList = new ArrayList<>();
                secondLevelListMap.keySet().forEach(secondLevelKey -> {
                    //二级事件的菜单
                    List secondRangeList = secondLevelListMap.get(secondLevelKey);
                    Children   secondChildren=new Children();
                    secondChildren.setLevel(2);
                    secondChildren.setCode(secondRangeList.get(0).getSecondLevelCode());
                    secondChildren.setName(secondRangeList.get(0).getSecondLevelName());
                    secondChildrenList.add(secondChildren);
                    //三级菜单
                    List thirdChildrenList = new ArrayList<>();
                    Map> thirdLevelListMap = secondRangeList.stream().collect(Collectors.groupingBy(TbmNewsRangeConfig::getThirdLevelCode, LinkedHashMap::new, Collectors.toList()));
                    thirdLevelListMap.keySet().forEach(thirdLevelKey -> {
                        //三级事件的菜单
                        List thirdRangeList = thirdLevelListMap.get(thirdLevelKey);
                        Children   thirdChildren=new Children();
                        thirdChildren.setLevel(3);
                        thirdChildren.setCode(thirdRangeList.get(0).getThirdLevelCode());
                        thirdChildren.setName(thirdRangeList.get(0).getThirdLevelName());
                        thirdChildrenList.add(thirdChildren);
                        //四级菜单需要重新实现
                        List fourthChildrenList = new ArrayList<>();
                        thirdRangeList.forEach(itemThird->{
                            if(itemThird.getThirdLevelCode().equals(thirdLevelKey)){
                                Children fourthChildren = new Children();
                                fourthChildren.setCode(itemThird.getFourthLevelCode());
                                fourthChildren.setName(itemThird.getFourthLevelName());
                                fourthChildren.setLevel(4);
                                fourthChildrenList.add(fourthChildren);
                            }
                        });
                        thirdChildren.setChildrenList(fourthChildrenList);
                    });
                    secondChildren.setChildrenList(thirdChildrenList);
                });
                eventCategory.setChildrenList(secondChildrenList);
                resultEventCategorys.add(eventCategory);
            });
        }
        return resultEventCategorys;
    }

5、最终的结果演示如下:

【java工具类】四级菜单如何实现树状结构展示JSON给前端_第2张图片

 6、主要的资源数据已经上传CSDN

参考-->

CSDN所有实现的数据源码

四级菜单转成JOSN层级树状结构.zip-Java文档类资源-CSDN下载

 7、附件返回的JSON字符串

System.out.println(JSON.toJSON(resultEventCategorys));

[{"code":"FBT0000000ZR","level":1,"name":"货币政策","childrenList":[{"code":"FBT0000000ZV","level":2,"name":"利率","childrenList":[{"code":"FBT00000010G","level":3,"name":"加息及预期","childrenList":[{"code":"FBT00000013I","level":4,"name":"央行加息"},{"code":"FBT00000013J","level":4,"name":"央行预计加息"},{"code":"FBT00000013K","level":4,"name":"央行加息预期增强"},{"code":"FBT00000013L","level":4,"name":"央行加息预期减弱"}]},{"code":"FBT00000010H","level":3,"name":"降息及预期","childrenList":[{"code":"FBT00000013M","level":4,"name":"央行降息"},{"code":"FBT00000013N","level":4,"name":"央行预计降息"},{"code":"FBT00000013O","level":4,"name":"央行降息预期增强"},{"code":"FBT00000013P","level":4,"name":"央行降息预期减弱"}]},{"code":"FBT00000010I","level":3,"name":"中国央行不加息","childrenList":[{"code":"FBT00000013Q","level":4,"name":"央行不加息"}]},{"code":"FBT00000010J","level":3,"name":"美国加息","childrenList":[{"code":"FBT00000013R","level":4,"name":"美联储加息"}]},{"code":"FBT00000010K","level":3,"name":"美国不加息","childrenList":[{"code":"FBT00000013S","level":4,"name":"美联储不加息"}]},{"code":"FBT00000010L","level":3,"name":"美国降息","childrenList":[{"code":"FBT00000013T","level":4,"name":"美联储降息"}]},{"code":"FBT00000010M","level":3,"name":"央行逆回购操作","childrenList":[{"code":"FBT00000013U","level":4,"name":"开展逆回购"},{"code":"FBT00000013V","level":4,"name":"不开展逆回购"}]},{"code":"FBT00000010N","level":3,"name":"央行开展SLF","childrenList":[{"code":"FBT00000013W","level":4,"name":"开展常备借贷便利操作"}]},{"code":"FBT00000010O","level":3,"name":"央行开展MLF或TMLF","childrenList":[{"code":"FBT00000013X","level":4,"name":"开展中期借贷便利操作"}]},{"code":"FBT00000010P","level":3,"name":"宽松货币政策","childrenList":[{"code":"FBT00000013Y","level":4,"name":"扩张性货币政策"}]},{"code":"FBT00000010Q","level":3,"name":"稳健货币政策","childrenList":[{"code":"FBT00000013Z","level":4,"name":"稳健型货币政策"}]},{"code":"FBT00000010R","level":3,"name":"紧缩货币政策","childrenList":[{"code":"FBT000000140","level":4,"name":"紧缩性货币政策"}]},{"code":"FBT00000010S","level":3,"name":"央行加准","childrenList":[{"code":"FBT000000141","level":4,"name":"上调存款准备金率"}]},{"code":"FBT00000010T","level":3,"name":"降准","childrenList":[{"code":"FBT000000142","level":4,"name":"央行降准"}]},{"code":"FBT00000010U","level":3,"name":"SHIBOR波动","childrenList":[{"code":"FBT000000143","level":4,"name":"同业拆借利率上升"},{"code":"FBT000000144","level":4,"name":"同业拆借利率下跌"}]},{"code":"FBT00000010V","level":3,"name":"利率水平稳定","childrenList":[{"code":"FBT000000145","level":4,"name":"利率稳定"}]},{"code":"FBT00000010W","level":3,"name":"收益率波动","childrenList":[{"code":"FBT000000146","level":4,"name":"收益率上升"},{"code":"FBT000000147","level":4,"name":"收益率下降"},{"code":"FBT000000148","level":4,"name":"收益率调整"}]},{"code":"FBT00000010X","level":3,"name":"银行调整利率","childrenList":[{"code":"FBT000000149","level":4,"name":"存款利率上涨"},{"code":"FBT00000014A","level":4,"name":"存款利率下跌"},{"code":"FBT00000014B","level":4,"name":"贷款利率上涨"},{"code":"FBT00000014C","level":4,"name":"贷款利率下跌"}]},{"code":"FBT00000010Y","level":3,"name":"货币政策工具(其他)","childrenList":[{"code":"FBT00000014D","level":4,"name":"其他货币政策工具"}]}]},{"code":"FBT0000000ZW","level":2,"name":"货币供应","childrenList":[{"code":"FBT00000010Z","level":3,"name":"货币供应量","childrenList":[{"code":"FBT00000014E","level":4,"name":"货币供应量增长"},{"code":"FBT00000014F","level":4,"name":"货币供应量减少"},{"code":"FBT00000014G","level":4,"name":"货币供应量超预期"},{"code":"FBT00000014H","level":4,"name":"货币供应量低于预期"}]}]},{"code":"FBT0000000ZX","level":2,"name":"汇率","childrenList":[{"code":"FBT000000110","level":3,"name":"汇率走势","childrenList":[{"code":"FBT00000014I","level":4,"name":"人民币贬值"},{"code":"FBT00000014J","level":4,"name":"人民币升值"},{"code":"FBT00000014K","level":4,"name":"人民币汇率持稳"},{"code":"FBT00000014L","level":4,"name":"人民币汇率波动"}]},{"code":"FBT000000111","level":3,"name":"外汇占款变动","childrenList":[{"code":"FBT00000014M","level":4,"name":"外汇占款增加"},{"code":"FBT00000014N","level":4,"name":"外汇占款减少"}]},{"code":"FBT000000112","level":3,"name":"央行数字货币","childrenList":[{"code":"FBT00000014O","level":4,"name":"央行数字货币发行"}]}]}]},{"code":"FBT0000000ZS","level":1,"name":"财政政策","childrenList":[{"code":"FBT0000000ZY","level":2,"name":"财政收入","childrenList":[{"code":"FBT000000113","level":3,"name":"财政赤字变动","childrenList":[{"code":"FBT00000014P","level":4,"name":"财政赤字削减"},{"code":"FBT00000014Q","level":4,"name":"财政赤字增加"}]},{"code":"FBT000000114","level":3,"name":"财政收入变动","childrenList":[{"code":"FBT00000014R","level":4,"name":"财政收入减少"},{"code":"FBT00000014S","level":4,"name":"财政收入增加"}]},{"code":"FBT000000115","level":3,"name":"预算报告","childrenList":[{"code":"FBT00000014T","level":4,"name":"财政预算报告"}]},{"code":"FBT000000116","level":3,"name":"财政支出变动","childrenList":[{"code":"FBT00000014U","level":4,"name":"财政支出减少"},{"code":"FBT00000014V","level":4,"name":"财政支出增加"}]},{"code":"FBT000000117","level":3,"name":"转移支付","childrenList":[{"code":"FBT00000014W","level":4,"name":"财政转移支付"}]}]},{"code":"FBT0000000ZZ","level":2,"name":"财政手段","childrenList":[{"code":"FBT000000118","level":3,"name":"紧缩财政政策","childrenList":[{"code":"FBT00000014X","level":4,"name":"紧缩性财政政策"}]},{"code":"FBT000000119","level":3,"name":"扩张财政政策","childrenList":[{"code":"FBT00000014Y","level":4,"name":"扩张性财政政策"}]}]},{"code":"FBT000000100","level":2,"name":"税收政策","childrenList":[{"code":"FBT00000011A","level":3,"name":"税收措施","childrenList":[{"code":"FBT00000014Z","level":4,"name":"出台征税措施"},{"code":"FBT000000150","level":4,"name":"发布计税通知"},{"code":"FBT000000151","level":4,"name":"加强税收征管"}]},{"code":"FBT00000011B","level":3,"name":"税率调整","childrenList":[{"code":"FBT000000152","level":4,"name":"税率综合调整"},{"code":"FBT000000153","level":4,"name":"税率上调"},{"code":"FBT000000154","level":4,"name":"税率下调"}]},{"code":"FBT00000011C","level":3,"name":"调整关税","childrenList":[{"code":"FBT000000155","level":4,"name":"关税豁免"},{"code":"FBT000000156","level":4,"name":"关税调整"},{"code":"FBT000000157","level":4,"name":"关税上调"},{"code":"FBT000000158","level":4,"name":"关税下调"},{"code":"FBT000000159","level":4,"name":"加征关税"},{"code":"FBT00000015A","level":4,"name":"不加征关税"},{"code":"FBT00000015B","level":4,"name":"暂停加征关税"}]},{"code":"FBT00000011D","level":3,"name":"降低税负政策","childrenList":[{"code":"FBT00000015C","level":4,"name":"减税"},{"code":"FBT00000015D","level":4,"name":"降低费率"},{"code":"FBT00000015E","level":4,"name":"清费"},{"code":"FBT00000015F","level":4,"name":"实施退税"},{"code":"FBT00000015G","level":4,"name":"探索实行免税"},{"code":"FBT00000015H","level":4,"name":"推广税收优惠"}]},{"code":"FBT00000011E","level":3,"name":"税收收入变动","childrenList":[{"code":"FBT00000015I","level":4,"name":"税收收入增长"},{"code":"FBT00000015J","level":4,"name":"税收收入下降"}]},{"code":"FBT00000011F","level":3,"name":"增加税负政策","childrenList":[{"code":"FBT00000015K","level":4,"name":"新税出台"},{"code":"FBT00000015L","level":4,"name":"撤销免征税"},{"code":"FBT00000015M","level":4,"name":"应纳税提高"}]}]}]},{"code":"FBT0000000ZT","level":1,"name":"经济运行","childrenList":[{"code":"FBT000000101","level":2,"name":"CPI","childrenList":[{"code":"FBT00000011G","level":3,"name":"CPI目标","childrenList":[{"code":"FBT00000015N","level":4,"name":"CPI目标值"},{"code":"FBT00000015O","level":4,"name":"CPI目标修改"}]},{"code":"FBT00000011H","level":3,"name":"CPI上升","childrenList":[{"code":"FBT00000015P","level":4,"name":"CPI上涨"}]},{"code":"FBT00000011I","level":3,"name":"CPI降低","childrenList":[{"code":"FBT00000015Q","level":4,"name":"CPI下降"}]},{"code":"FBT00000011J","level":3,"name":"预测CPI","childrenList":[{"code":"FBT00000015R","level":4,"name":"CPI预测"},{"code":"FBT00000015S","level":4,"name":"CPI预计上涨"},{"code":"FBT00000015T","level":4,"name":"CPI预计下降"}]},{"code":"FBT00000011K","level":3,"name":"CPI分析","childrenList":[{"code":"FBT00000015U","level":4,"name":"CPI超预期"},{"code":"FBT00000015V","level":4,"name":"CPI低于预期"}]},{"code":"FBT00000011L","level":3,"name":"通缩","childrenList":[{"code":"FBT00000015W","level":4,"name":"通货紧缩"}]},{"code":"FBT00000011M","level":3,"name":"通胀","childrenList":[{"code":"FBT00000015X","level":4,"name":"通货膨胀"}]}]},{"code":"FBT000000102","level":2,"name":"GDP","childrenList":[{"code":"FBT00000011N","level":3,"name":"GDP目标","childrenList":[{"code":"FBT00000015Y","level":4,"name":"GDP目标修改"},{"code":"FBT00000015Z","level":4,"name":"GDP目标值"}]},{"code":"FBT00000011O","level":3,"name":"预测GDP","childrenList":[{"code":"FBT000000160","level":4,"name":"GDP预测"},{"code":"FBT000000161","level":4,"name":"GDP预计下降"},{"code":"FBT000000162","level":4,"name":"GDP预计增长"}]},{"code":"FBT00000011P","level":3,"name":"GDP分析","childrenList":[{"code":"FBT000000163","level":4,"name":"GDP超预期"},{"code":"FBT000000164","level":4,"name":"GDP低于预期"},{"code":"FBT000000165","level":4,"name":"GDP增速分析"}]},{"code":"FBT00000011Q","level":3,"name":"GDP增加","childrenList":[{"code":"FBT000000166","level":4,"name":"GDP增速放缓"},{"code":"FBT000000167","level":4,"name":"GDP增速加快"},{"code":"FBT000000168","level":4,"name":"GDP增长"}]},{"code":"FBT00000011R","level":3,"name":"GDP下行","childrenList":[{"code":"FBT000000169","level":4,"name":"GDP下降"}]}]},{"code":"FBT000000103","level":2,"name":"PMI","childrenList":[{"code":"FBT00000011S","level":3,"name":"PMI上行","childrenList":[{"code":"FBT00000016A","level":4,"name":"PMI上升"}]},{"code":"FBT00000011T","level":3,"name":"PMI下行","childrenList":[{"code":"FBT00000016B","level":4,"name":"PMI下降"}]},{"code":"FBT00000011U","level":3,"name":"PMI分析","childrenList":[{"code":"FBT00000016C","level":4,"name":"PMI超预期"},{"code":"FBT00000016D","level":4,"name":"PMI低于预期"}]},{"code":"FBT00000011V","level":3,"name":"预测PMI","childrenList":[{"code":"FBT00000016E","level":4,"name":"PMI预测"},{"code":"FBT00000016F","level":4,"name":"PMI预计上升"},{"code":"FBT00000016G","level":4,"name":"PMI预计下降"}]}]},{"code":"FBT000000104","level":2,"name":"PPI","childrenList":[{"code":"FBT00000011W","level":3,"name":"PPI增加","childrenList":[{"code":"FBT00000016H","level":4,"name":"PPI上升"}]},{"code":"FBT00000011X","level":3,"name":"PPI减少","childrenList":[{"code":"FBT00000016I","level":4,"name":"PPI下降"}]},{"code":"FBT00000011Y","level":3,"name":"PPI分析","childrenList":[{"code":"FBT00000016J","level":4,"name":"PPI超预期"},{"code":"FBT00000016K","level":4,"name":"PPI低于预期"}]},{"code":"FBT00000011Z","level":3,"name":"预测PPI","childrenList":[{"code":"FBT00000016L","level":4,"name":"PPI预测"},{"code":"FBT00000016M","level":4,"name":"PPI预计下降"},{"code":"FBT00000016N","level":4,"name":"PPI预计增长"}]}]},{"code":"FBT000000105","level":2,"name":"工业生产总值","childrenList":[{"code":"FBT000000120","level":3,"name":"工业增加值正","childrenList":[{"code":"FBT00000016O","level":4,"name":"工业生产加速"},{"code":"FBT00000016P","level":4,"name":"工业生产增速放缓"}]},{"code":"FBT000000121","level":3,"name":"工业增加值负","childrenList":[{"code":"FBT00000016Q","level":4,"name":"工业增加值减少"}]},{"code":"FBT000000122","level":3,"name":"工业能耗增加","childrenList":[{"code":"FBT00000016R","level":4,"name":"工业能耗增长"}]},{"code":"FBT000000123","level":3,"name":"工业能耗减少","childrenList":[{"code":"FBT00000016S","level":4,"name":"工业能耗下降"}]}]},{"code":"FBT000000106","level":2,"name":"固定资产投资","childrenList":[{"code":"FBT000000124","level":3,"name":"投资减少","childrenList":[{"code":"FBT00000016T","level":4,"name":"固定投资减少"}]},{"code":"FBT000000125","level":3,"name":"投资增加","childrenList":[{"code":"FBT00000016U","level":4,"name":"固定投资增加"}]},{"code":"FBT000000126","level":3,"name":"投资增速放缓","childrenList":[{"code":"FBT00000016V","level":4,"name":"固定投资增速放缓"}]}]},{"code":"FBT000000107","level":2,"name":"消费","childrenList":[{"code":"FBT000000127","level":3,"name":"消费上涨","childrenList":[{"code":"FBT00000016W","level":4,"name":"消费品零售总额增速放缓"},{"code":"FBT00000016X","level":4,"name":"消费品零售总额增速加快"},{"code":"FBT00000016Y","level":4,"name":"消费品市场增长"},{"code":"FBT00000016Z","level":4,"name":"消费品市场活跃"},{"code":"FBT000000170","level":4,"name":"消费回暖"},{"code":"FBT000000171","level":4,"name":"消费信心增强"}]},{"code":"FBT000000128","level":3,"name":"消费平稳","childrenList":[{"code":"FBT000000172","level":4,"name":"消费品市场平稳"}]},{"code":"FBT000000129","level":3,"name":"消费下滑","childrenList":[{"code":"FBT000000173","level":4,"name":"消费品零售总额下降"},{"code":"FBT000000174","level":4,"name":"消费信心下降"}]}]},{"code":"FBT000000108","level":2,"name":"就业收入","childrenList":[{"code":"FBT00000012A","level":3,"name":"工资减少","childrenList":[{"code":"FBT000000175","level":4,"name":"平均工资减少"}]},{"code":"FBT00000012B","level":3,"name":"工资增加","childrenList":[{"code":"FBT000000176","level":4,"name":"平均工资增速放缓"},{"code":"FBT000000177","level":4,"name":"平均工资增加"}]},{"code":"FBT00000012C","level":3,"name":"失业率增加","childrenList":[{"code":"FBT000000178","level":4,"name":"失业率上升"}]},{"code":"FBT00000012D","level":3,"name":"失业率降低","childrenList":[{"code":"FBT000000179","level":4,"name":"失业率下降"}]},{"code":"FBT00000012E","level":3,"name":"社会保障","childrenList":[{"code":"FBT00000017A","level":4,"name":"社会保障制度"}]},{"code":"FBT00000012F","level":3,"name":"就业政策","childrenList":[{"code":"FBT00000017B","level":4,"name":"就业政策发布"}]}]},{"code":"FBT000000109","level":2,"name":"经济预测","childrenList":[{"code":"FBT00000012G","level":3,"name":"经济负面","childrenList":[{"code":"FBT00000017C","level":4,"name":"金融危机"},{"code":"FBT00000017D","level":4,"name":"经济泡沫"},{"code":"FBT00000017E","level":4,"name":"经济下行"}]},{"code":"FBT00000012H","level":3,"name":"经济增长","childrenList":[{"code":"FBT00000017F","level":4,"name":"经济加速增长"},{"code":"FBT00000017G","level":4,"name":"经济增速放缓"},{"code":"FBT00000017H","level":4,"name":"经济向好"}]},{"code":"FBT00000012I","level":3,"name":"经济预期","childrenList":[{"code":"FBT00000017I","level":4,"name":"上调经济增长预期"},{"code":"FBT00000017J","level":4,"name":"下调经济增长预期"}]},{"code":"FBT00000012J","level":3,"name":"经济规划","childrenList":[{"code":"FBT00000017K","level":4,"name":"发布经济规划"}]}]},{"code":"FBT00000010A","level":2,"name":"对外经济","childrenList":[{"code":"FBT00000012K","level":3,"name":"贸易顺差","childrenList":[{"code":"FBT00000017L","level":4,"name":"贸易顺差扩大"},{"code":"FBT00000017M","level":4,"name":"贸易顺差收窄"}]},{"code":"FBT00000012L","level":3,"name":"贸易逆差","childrenList":[{"code":"FBT00000017N","level":4,"name":"贸易逆差扩大"},{"code":"FBT00000017O","level":4,"name":"贸易逆差收窄"}]},{"code":"FBT00000012M","level":3,"name":"贸易数据","childrenList":[{"code":"FBT00000017P","level":4,"name":"进出口额数据"}]},{"code":"FBT00000012N","level":3,"name":"外贸","childrenList":[{"code":"FBT00000017Q","level":4,"name":"对外贸易"}]}]},{"code":"FBT00000010B","level":2,"name":"经济运行(其他)","childrenList":[{"code":"FBT00000012O","level":3,"name":"其他经济运行","childrenList":[{"code":"FBT00000017R","level":4,"name":"其他经济运行事件"}]}]}]},{"code":"FBT0000000ZU","level":1,"name":"公共事件","childrenList":[{"code":"FBT00000010C","level":2,"name":"自然灾害","childrenList":[{"code":"FBT00000012P","level":3,"name":"发生地震","childrenList":[{"code":"FBT00000017S","level":4,"name":"地震"}]},{"code":"FBT00000012Q","level":3,"name":"发生滑坡","childrenList":[{"code":"FBT00000017T","level":4,"name":"滑坡"}]},{"code":"FBT00000012R","level":3,"name":"泥石流灾害","childrenList":[{"code":"FBT00000017U","level":4,"name":"泥石流"}]},{"code":"FBT00000012S","level":3,"name":"大气污染问题","childrenList":[{"code":"FBT00000017V","level":4,"name":"大气污染"}]},{"code":"FBT00000012T","level":3,"name":"水污染问题","childrenList":[{"code":"FBT00000017W","level":4,"name":"水污染"}]},{"code":"FBT00000012U","level":3,"name":"土壤污染问题","childrenList":[{"code":"FBT00000017X","level":4,"name":"土壤污染"}]},{"code":"FBT00000012V","level":3,"name":"极端低温事件","childrenList":[{"code":"FBT00000017Y","level":4,"name":"极端低温"}]},{"code":"FBT00000012W","level":3,"name":"极端高温事件","childrenList":[{"code":"FBT00000017Z","level":4,"name":"极端高温"}]},{"code":"FBT00000012X","level":3,"name":"冰雹灾害","childrenList":[{"code":"FBT000000180","level":4,"name":"冰雹"}]},{"code":"FBT00000012Y","level":3,"name":"发生厄尔尼诺","childrenList":[{"code":"FBT000000181","level":4,"name":"厄尔尼诺"}]},{"code":"FBT00000012Z","level":3,"name":"发生干旱","childrenList":[{"code":"FBT000000182","level":4,"name":"干旱"}]},{"code":"FBT000000130","level":3,"name":"洪水灾害","childrenList":[{"code":"FBT000000183","level":4,"name":"洪水"}]},{"code":"FBT000000131","level":3,"name":"发生拉尼娜","childrenList":[{"code":"FBT000000184","level":4,"name":"拉尼娜"}]},{"code":"FBT000000132","level":3,"name":"台风灾害","childrenList":[{"code":"FBT000000185","level":4,"name":"台风"}]},{"code":"FBT000000133","level":3,"name":"发生天文灾害","childrenList":[{"code":"FBT000000186","level":4,"name":"天文灾害"}]},{"code":"FBT000000134","level":3,"name":"发生火灾","childrenList":[{"code":"FBT000000187","level":4,"name":"火灾"}]}]},{"code":"FBT00000010D","level":2,"name":"生物灾害","childrenList":[{"code":"FBT000000135","level":3,"name":"发生蝗灾","childrenList":[{"code":"FBT000000188","level":4,"name":"蝗灾"}]},{"code":"FBT000000136","level":3,"name":"发生病虫灾害","childrenList":[{"code":"FBT000000189","level":4,"name":"病虫灾害"}]}]},{"code":"FBT00000010E","level":2,"name":"疫情灾害","childrenList":[{"code":"FBT000000137","level":3,"name":"发生SARS","childrenList":[{"code":"FBT00000018A","level":4,"name":"SARS"}]},{"code":"FBT000000138","level":3,"name":"肺炎传播","childrenList":[{"code":"FBT00000018B","level":4,"name":"肺炎"}]},{"code":"FBT000000139","level":3,"name":"流感","childrenList":[{"code":"FBT00000018C","level":4,"name":"流感爆发"}]},{"code":"FBT00000013A","level":3,"name":"疫苗","childrenList":[{"code":"FBT00000018D","level":4,"name":"疫苗上市"}]},{"code":"FBT00000013B","level":3,"name":"鼠疫","childrenList":[{"code":"FBT00000018E","level":4,"name":"爆发鼠疫"}]},{"code":"FBT00000013C","level":3,"name":"疯牛病","childrenList":[{"code":"FBT00000018F","level":4,"name":"爆发疯牛病"}]},{"code":"FBT00000013D","level":3,"name":"禽流感","childrenList":[{"code":"FBT00000018G","level":4,"name":"爆发禽流感"}]},{"code":"FBT00000013E","level":3,"name":"猪瘟","childrenList":[{"code":"FBT00000018H","level":4,"name":"爆发猪瘟"}]}]},{"code":"FBT00000010F","level":2,"name":"政治时事","childrenList":[{"code":"FBT00000013F","level":3,"name":"政治事件","childrenList":[{"code":"FBT00000018I","level":4,"name":"国内外政治事件"}]},{"code":"FBT00000013G","level":3,"name":"战争冲突","childrenList":[{"code":"FBT00000018J","level":4,"name":"战争"}]},{"code":"FBT00000013H","level":3,"name":"罢工事件","childrenList":[{"code":"FBT00000018K","level":4,"name":"罢工"}]}]}]}]
 

你可能感兴趣的:(2021-目前,工作,工具类,树状结构,java)