Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
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-webapp-plug
Commits
4a69bba3
Commit
4a69bba3
authored
Jul 12, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通过id查询省市区名称
parent
c59a9a3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
ProvincesController.java
...java/com/gic/plug/web/controller/ProvincesController.java
+42
-0
No files found.
src/main/java/com/gic/plug/web/controller/ProvincesController.java
View file @
4a69bba3
...
...
@@ -96,4 +96,46 @@ public class ProvincesController {
}
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
@RequestMapping
(
"query-district"
)
@ResponseBody
public
RestResponse
queryDistrictByIds
(
String
ids
){
if
(
StringUtils
.
isBlank
(
ids
)){
return
RestResponse
.
success
();
}
List
<
String
>
result
=
new
ArrayList
<>();
ServiceResponse
<
List
<
ProvinceDTO
>>
serviceResponse
=
this
.
provincesApiService
.
selectAllProvince
();
ServiceResponse
<
List
<
CityDTO
>>
serviceResponse1
=
this
.
provincesApiService
.
selectAllCity
();
ServiceResponse
<
List
<
CountyDTO
>>
serviceResponse2
=
this
.
provincesApiService
.
selectAllCounty
();
String
[]
idArr
=
ids
.
split
(
","
);
for
(
String
id
:
idArr
){
if
(
serviceResponse
.
isSuccess
()){
List
<
ProvinceDTO
>
provinceDTOList
=
serviceResponse
.
getResult
();
for
(
ProvinceDTO
provinceDTO
:
provinceDTOList
){
if
(
id
.
equals
(
provinceDTO
.
getProvinceId
())){
result
.
add
(
provinceDTO
.
getProvinceName
());
continue
;
}
}
}
if
(
serviceResponse1
.
isSuccess
()){
List
<
CityDTO
>
cityDTOList
=
serviceResponse1
.
getResult
();
for
(
CityDTO
cityDTO
:
cityDTOList
){
if
(
id
.
equals
(
cityDTO
.
getCityId
())){
result
.
add
(
cityDTO
.
getCityName
());
continue
;
}
}
}
if
(
serviceResponse2
.
isSuccess
()){
List
<
CountyDTO
>
countyDTOList
=
serviceResponse2
.
getResult
();
for
(
CountyDTO
countyDTO
:
countyDTOList
){
if
(
id
.
equals
(
countyDTO
.
getCityId
())){
result
.
add
(
countyDTO
.
getCountyName
());
}
}
}
}
return
RestResponse
.
success
(
result
);
}
}
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