|
|
@ -593,6 +593,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
throw new RenException("目前只允许添加街道或社区"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(formDTO.getCode())) { |
|
|
|
//修改地区编码名称
|
|
|
|
AreaCodeChildDTO areaCodeChildDTO = childDao.selectByCode(formDTO.getCode().trim()); |
|
|
|
if (null == areaCodeChildDTO) { |
|
|
|
throw new RenException("code不存在"); |
|
|
@ -601,15 +602,17 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn |
|
|
|
areaCodeChildService.update(areaCodeChildDTO); |
|
|
|
return areaCodeChildDTO.getCode(); |
|
|
|
} |
|
|
|
//查询area_code_child 判断当前父级,是街道还是社区?
|
|
|
|
AreaCodeChildDTO parent = childDao.selectByCode(formDTO.getParentAreaCode().trim()); |
|
|
|
if (null == parent) { |
|
|
|
//街道、社区没找到,查询是否是 区县
|
|
|
|
AreaCodeDTO areaCodeDTOP = baseDao.selectByCountyCode(formDTO.getParentAreaCode().trim()); |
|
|
|
if (null == areaCodeDTOP) { |
|
|
|
throw new RenException("parentAreaCode不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//同一级不允许重名
|
|
|
|
//地区编码 同一级不允许重名
|
|
|
|
List<AreaCodeChildDTO> list = childDao.selectByPCodeAndName(formDTO.getParentAreaCode().trim(), formDTO.getName().trim()); |
|
|
|
if (CollUtil.isNotEmpty(list)) { |
|
|
|
throw new RenException("name已存在"); |
|
|
|