Commit 5ff11c4f by 陶光胜

门店查询接口

parent eb737701
......@@ -27,6 +27,14 @@ public interface ProvincesApiService {
* @return
*/
ServiceResponse<List<CityDTO>> selectAllCity();
/** @Description: 通过城市id查询城市
* @author taogs
* @Date 11:10 2019/12/9
* @Param
* @return
*/
ServiceResponse<CityDTO> getCityByCityId(String cityId);
/** @Description: 通过省id查询城市
* @author taogs
......@@ -43,6 +51,15 @@ public interface ProvincesApiService {
* @return
*/
ServiceResponse<List<CountyDTO>> selectAllCounty();
/** @Description: 通过地区id查询
* @author taogs
* @Date 11:11 2019/12/9
* @Param
* @return
*/
ServiceResponse<CountyDTO> getCountyByCountyId(String countyId);
/** @Description: 通过城市id查询地区
* @author taogs
......
......@@ -55,6 +55,20 @@ public class ProvincesApiServiceImpl implements ProvincesApiService {
}
@Override
public ServiceResponse<CityDTO> getCityByCityId(String cityId) {
ServiceResponse<List<CityDTO>> response = this.selectAllCity();
if(response.isSuccess() && CollectionUtils.isNotEmpty(response.getResult())){
List<CityDTO> list = response.getResult();
for(CityDTO dto : list){
if(dto.getCityId().equals(cityId)){
return ServiceResponse.success(dto);
}
}
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<List<CityDTO>> selectCityByProvinceId(String provinceId) {
List<CityDTO> list = new ArrayList<>();
if(StringUtils.isBlank(provinceId)){
......@@ -83,6 +97,19 @@ public class ProvincesApiServiceImpl implements ProvincesApiService {
}
@Override
public ServiceResponse<CountyDTO> getCountyByCountyId(String countyId) {
ServiceResponse<List<CountyDTO>> response = this.selectAllCounty();
if(response.isSuccess() && CollectionUtils.isNotEmpty(response.getResult())){
for(CountyDTO dto : response.getResult()){
if(dto.getCountyId().equals(countyId)){
return ServiceResponse.success(dto);
}
}
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<List<CountyDTO>> selectCountyByCityId(String cityId) {
List<CountyDTO> list = new ArrayList<>();
if(StringUtils.isBlank(cityId)){
......
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