Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-store
Commits
329e1b5a
Commit
329e1b5a
authored
Dec 04, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
省市区查询
parent
714c413c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletions
+52
-1
ProvincesApiService.java
.../main/java/com/gic/store/service/ProvincesApiService.java
+18
-0
ProvincesApiServiceImpl.java
...gic/store/service/outer/impl/ProvincesApiServiceImpl.java
+34
-1
No files found.
gic-store-api/src/main/java/com/gic/store/service/ProvincesApiService.java
View file @
329e1b5a
...
...
@@ -43,6 +43,24 @@ public interface ProvincesApiService {
* @return
*/
ServiceResponse
<
List
<
CountyDTO
>>
selectAllCounty
();
/** @Description: 通过城市id查询地区
* @author taogs
* @Date 14:38 2019/12/4
* @Param
* @return
*/
ServiceResponse
<
List
<
CountyDTO
>>
selectCountyByCityId
(
String
cityId
);
/** @Description: 通过城市id查询地区id
* @author taogs
* @Date 14:44 2019/12/4
* @Param
* @return
*/
ServiceResponse
<
List
<
String
>>
selectCountyIdByCityId
(
String
cityId
);
/** @Description: 根据省份名称查询code
* @author taogs
* @Date 13:59 2019/8/5
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ProvincesApiServiceImpl.java
View file @
329e1b5a
...
...
@@ -13,6 +13,7 @@ import com.gic.store.entity.TabProvince;
import
com.gic.store.service.ProvincesApiService
;
import
com.gic.store.service.ProvincesService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -52,8 +53,11 @@ public class ProvincesApiServiceImpl implements ProvincesApiService {
@Override
public
ServiceResponse
<
List
<
CityDTO
>>
selectCityByProvinceId
(
String
provinceId
)
{
ServiceResponse
<
List
<
CityDTO
>>
response
=
this
.
selectAllCity
();
List
<
CityDTO
>
list
=
new
ArrayList
<>();
if
(
StringUtils
.
isBlank
(
provinceId
)){
return
ServiceResponse
.
success
(
list
);
}
ServiceResponse
<
List
<
CityDTO
>>
response
=
this
.
selectAllCity
();
if
(
response
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
())){
for
(
CityDTO
cityDTO
:
response
.
getResult
()){
if
(
cityDTO
.
getProvinceId
().
equals
(
provinceId
)){
...
...
@@ -76,6 +80,35 @@ public class ProvincesApiServiceImpl implements ProvincesApiService {
}
@Override
public
ServiceResponse
<
List
<
CountyDTO
>>
selectCountyByCityId
(
String
cityId
)
{
List
<
CountyDTO
>
list
=
new
ArrayList
<>();
if
(
StringUtils
.
isBlank
(
cityId
)){
return
ServiceResponse
.
success
(
list
);
}
ServiceResponse
<
List
<
CountyDTO
>>
response
=
this
.
selectAllCounty
();
if
(
response
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
())){
for
(
CountyDTO
countyDTO
:
response
.
getResult
()){
if
(
countyDTO
.
getCityId
().
equals
(
cityId
)){
list
.
add
(
countyDTO
);
}
}
}
return
ServiceResponse
.
success
(
list
);
}
@Override
public
ServiceResponse
<
List
<
String
>>
selectCountyIdByCityId
(
String
cityId
)
{
ServiceResponse
<
List
<
CountyDTO
>>
response
=
this
.
selectCountyByCityId
(
cityId
);
List
<
String
>
list
=
new
ArrayList
<>();
if
(
response
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
())){
for
(
CountyDTO
dto
:
response
.
getResult
()){
list
.
add
(
dto
.
getCountyId
());
}
}
return
ServiceResponse
.
success
(
list
);
}
@Override
public
ServiceResponse
<
List
<
ProvinceDTO
>>
queryProvinces
(
String
search
)
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
ProvinceDTO
.
class
,
this
.
provincesService
.
queryProvinces
(
search
)));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment