|  |  |  | 
|---|
|  |  |  | List<Map<String, Object>> list_towns = Optional.ofNullable(sv.getDistrictsBySupperId(countyId)).orElse(new ArrayList<>()); | 
|---|
|  |  |  | if (list_towns.size() > 0) { | 
|---|
|  |  |  | array_towns = JSONArray.parseArray(JSON.toJSONString(list_towns)); | 
|---|
|  |  |  | job_county.put("children", array_towns); | 
|---|
|  |  |  | // 遍历每一个镇,将镇下村列表加到镇的子集 | 
|---|
|  |  |  | for (int j = 0; j < array_towns.size(); j++) { | 
|---|
|  |  |  | JSONObject job_town = array_towns.getJSONObject(j); | 
|---|
|  |  |  | 
|---|
|  |  |  | //System.out.println("----" + array_towns); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 镇村组装完毕,将镇村加到县下 | 
|---|
|  |  |  | job_county.put("children", array_towns); | 
|---|
|  |  |  | //                job_county.put("children", array_towns); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 县组装完毕 | 
|---|
|  |  |  | //String a = array_counties.toJSONString(); | 
|---|