Commit 9c199db5 authored by tianyiming's avatar tianyiming

修改行政区划查询

parent ce76e1f8
......@@ -167,7 +167,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
//生成码
Map<String, String> codeMap = new HashMap<>();
Map<String, String> codeMap;
synchronized (EquipmentCategoryServiceImpl.class) {
codeMap = creatCode(city, county, equipCategory, equipList, record);
}
......@@ -224,11 +224,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override
public List<LinkedHashMap> getRegion(String level, String parentId) {
List<LinkedHashMap> list = new ArrayList<>();
if (ObjectUtils.isEmpty(parentId)) {
List<LinkedHashMap> list;
if (!ObjectUtils.isEmpty(level)) {
list = (List<LinkedHashMap>) redisUtils.get(PROVINCE);
return ObjectUtils.isEmpty(list) ? getProvinceList(level) : list;
} else {
} else if (!ObjectUtils.isEmpty(parentId)) {
String regionCode = parentId.split("_")[0];
Map<String, Object> map = regionCode.endsWith("0000") ? (Map<String, Object>) redisUtils.get(CITY) : (Map<String, Object>) redisUtils.get(REGION);
if (ObjectUtils.isEmpty(map)) {
......@@ -236,12 +236,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
list = (List<LinkedHashMap>) map.get(regionCode);
return list;
} else {
return new ArrayList<>();
}
}
public Map<String, Object> getRegionList() {
Map<String, Object> map1 = new HashMap<>();
List<LinkedHashMap> cityList = new ArrayList<>();
List<LinkedHashMap> cityList;
FeignClientResult tree = privilegeFeginService.getTree();
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
String regionCode = ((List<LinkedHashMap>) privilegeFeginService.getProvince("1").getResult()).get(0).get("regionCode").toString();
......@@ -265,7 +267,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
public List<LinkedHashMap> getProvinceList(String level) {
List<LinkedHashMap> list = new ArrayList<>();
List<LinkedHashMap> list;
FeignClientResult result = privilegeFeginService.getProvince(level);
list = (List<LinkedHashMap>) result.getResult();
list.get(0).put("sequenceNbr", list.get(0).get("regionCode"));
......@@ -276,7 +278,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override
public Map<String, Object> getCategoryAndDefineByRecord(String record) {
if (ObjectUtils.isEmpty(record)) {
return null;
return new HashMap<>();
}
return equipmentCategoryMapper.getCategoryAndDefineByRecord(record);
}
......@@ -379,7 +381,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
if (ObjectUtils.isEmpty(supervisorCode) && ObjectUtils.isEmpty(elevatorCode)) {
return null;
return new HashMap<>();
}
resultMap.put("supervisorCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
resultMap.put("elevatorCode", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment