public Map<String, String> cityName(String code) {
Map<String, String> map = Maps.newHashMap();
String name = "";
String cityName = "";
String areaCode = "";
String cityCode = "";
String provinceCode = "";
List<String> list = new ArrayList();
int index = 0;
while (!"0".equals(code) && !"".equals(code) && code != null) {
index++;
JSONObject jsonObject1 = this.findChinaRegion(code);
if (null != jsonObject1.get("result") && !"".equals(jsonObject1.get("result"))) {
code = jsonObject1.getJSONObject("result").getString("parentCode");
if (index == 1) {
areaCode = jsonObject1.getJSONObject("result").getString("code");
}
if (index == 2) {
cityCode = jsonObject1.getJSONObject("result").getString("code");
}
if (index == 3) {
provinceCode = jsonObject1.getJSONObject("result").getString("code");
}
name = jsonObject1.getJSONObject("result").getString("name");
list.add(name);
} else {
break;
}
}
for (int i = 0; i < list.size(); i++) {
cityName = list.get(i).toString() + cityName;
}
map.put("cityName", cityName);
map.put("provinceCode", provinceCode);
map.put("cityCode", cityCode);
map.put("areaCode", areaCode);
return map;
}