|
|
@ -29,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.constant.AreaCodeConstant; |
|
|
|
import com.epmet.dao.AreaCodeChildDao; |
|
|
@ -693,9 +694,20 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
@Override |
|
|
|
public List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO) { |
|
|
|
if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){ |
|
|
|
return baseDao.selectProvince(); |
|
|
|
String pKey=RedisKeys.getNextAreaCodeKey(NumConstant.ZERO_STR); |
|
|
|
List<AreaCodeResultDTO> list=areaCodeRedis.getNextAreaCodeKey(pKey); |
|
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ |
|
|
|
return list; |
|
|
|
} |
|
|
|
List<AreaCodeResultDTO> pList=baseDao.selectProvince(); |
|
|
|
areaCodeRedis.setNextAreaCodeKey(pKey,pList); |
|
|
|
return pList; |
|
|
|
} |
|
|
|
String key=RedisKeys.getNextAreaCodeKey(formDTO.getParentAreaCode()); |
|
|
|
List<AreaCodeResultDTO> list=areaCodeRedis.getNextAreaCodeKey(key); |
|
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ |
|
|
|
return list; |
|
|
|
} |
|
|
|
List<AreaCodeResultDTO> list=new ArrayList<>(); |
|
|
|
switch (formDTO.getParentLevel()) { |
|
|
|
case AreaCodeConstant.PROVINCE: |
|
|
|
list = baseDao.selectCity(formDTO.getParentAreaCode()); |
|
|
@ -716,6 +728,9 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
default: |
|
|
|
log.warn("parentLevel错误:"+formDTO.getParentLevel()); |
|
|
|
} |
|
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ |
|
|
|
areaCodeRedis.setNextAreaCodeKey(key,list); |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|