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
a2c2367f
Commit
a2c2367f
authored
Dec 04, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
省市区查询
parent
9a1b661e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletions
+25
-1
ProvincesApiService.java
.../main/java/com/gic/store/service/ProvincesApiService.java
+10
-1
ProvincesApiServiceImpl.java
...gic/store/service/outer/impl/ProvincesApiServiceImpl.java
+15
-0
No files found.
gic-store-api/src/main/java/com/gic/store/service/ProvincesApiService.java
View file @
a2c2367f
...
...
@@ -5,6 +5,7 @@ import com.gic.store.dto.CityDTO;
import
com.gic.store.dto.CountyDTO
;
import
com.gic.store.dto.ProvinceDTO
;
import
javax.xml.ws.Service
;
import
java.util.List
;
...
...
@@ -27,7 +28,15 @@ public interface ProvincesApiService {
*/
ServiceResponse
<
List
<
CityDTO
>>
selectAllCity
();
/** @Description: 查询所有地区
/** @Description: 通过省id查询城市
* @author taogs
* @Date 14:29 2019/12/4
* @Param
* @return
*/
ServiceResponse
<
List
<
CityDTO
>>
selectCityByProvinceId
(
String
provinceId
);
/** @Description: 查询所有地区
* @author taogs
* @Date 14:07 2019/8/5
* @Param
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ProvincesApiServiceImpl.java
View file @
a2c2367f
...
...
@@ -16,6 +16,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -50,6 +51,20 @@ 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
(
response
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
())){
for
(
CityDTO
cityDTO
:
response
.
getResult
()){
if
(
cityDTO
.
getProvinceId
().
equals
(
provinceId
)){
list
.
add
(
cityDTO
);
}
}
}
return
ServiceResponse
.
success
(
list
);
}
@Override
public
ServiceResponse
<
List
<
CountyDTO
>>
selectAllCounty
()
{
String
key
=
"enterprise:county"
;
List
<
CountyDTO
>
list
=
(
List
<
CountyDTO
>)
RedisUtil
.
getCache
(
key
);
...
...
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