response.setContentType("application/json; charset=UTF-8");
List<Map<String, Object>> mapList = Lists.newArrayList();
// User user = UserUtils.getUser();
List<Area> list = areaService.findAll();
for (int i=0; i<list.size(); i++){
Area e = list.get(i);
if (extId == null || (extId!=null && !extId.equals(e.getId()) && e.getParentIds().indexOf(","+extId+",")==-1)){
Map<String, Object> map = Maps.newHashMap();
map.put("id", e.getId());
// map.put("pId", !user.isAdmin()&&e.getId().equals(user.getArea().getId())?0:e.getParent()!=null?e.getParent().getId():0);
map.put("pId", e.getParent()!=null?e.getParent().getId():0);
map.put("name", e.getName());
mapList.add(map);
}
}
return mapList;
}