|
|
@ -124,17 +124,23 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 行政地区编码查询 |
|
|
|
* @Param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2021/1/7 下午1:41 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<AreaCodeDictResultDTO> areaCodeDictTree(AreaCodeDictFormDTO formDTO) { |
|
|
|
List<AreaCodeDictResultDTO> tree = new ArrayList<>(); |
|
|
|
String s = areaCodeRedis.get(AreaCodeConstant.SCREEN_TREE); |
|
|
|
// if (StringUtils.isNotBlank(s)){
|
|
|
|
// tree = JSON.parseArray(s,AreaCodeDictResultDTO.class);
|
|
|
|
// }else {
|
|
|
|
if (StringUtils.isNotBlank(s)){ |
|
|
|
tree = JSON.parseArray(s,AreaCodeDictResultDTO.class); |
|
|
|
}else { |
|
|
|
List<AreaCodeDictResultDTO> areaCodeDictResultDTOS = disposeTree(formDTO); |
|
|
|
// areaCodeRedis.set(AreaCodeConstant.SCREEN_TREE,areaCodeDictResultDTOS);
|
|
|
|
areaCodeRedis.set(AreaCodeConstant.SCREEN_TREE,areaCodeDictResultDTOS); |
|
|
|
tree = areaCodeDictResultDTOS; |
|
|
|
// }
|
|
|
|
} |
|
|
|
if (StringUtils.isBlank(formDTO.getRootAreaCode())){ |
|
|
|
return tree; |
|
|
|
} |
|
|
@ -151,7 +157,6 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
public List<AreaCodeDictResultDTO> disposeTree(AreaCodeDictFormDTO formDTO){ |
|
|
|
// 查询所有省市区
|
|
|
|
List<AreaCodeDTO> areaCodeDTOS = baseDao.selectAllArea(); |
|
|
|
log.info(areaCodeDTOS.size()+">>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
|
|
|
// 查询所有街道、社区
|
|
|
|
List<AreaCodeChildDTO> areaCodeChildDTOS = childDao.selectAllChild(formDTO.getRootAreaCode()); |
|
|
|
List<AreaCodeDictResultDTO> result = new ArrayList<>(); |
|
|
|