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
412e4bc3
Commit
412e4bc3
authored
Jul 02, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回结果转化
parent
644f8ad0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
ProvincesController.java
...java/com/gic/plug/web/controller/ProvincesController.java
+7
-4
No files found.
src/main/java/com/gic/plug/web/controller/ProvincesController.java
View file @
412e4bc3
package
com
.
gic
.
plug
.
web
.
controller
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.plug.web.vo.CityVO
;
import
com.gic.plug.web.vo.ProvinceVO
;
import
com.gic.store.dto.CityDTO
;
import
com.gic.store.dto.CountyDTO
;
import
com.gic.store.dto.ProvinceDTO
;
...
...
@@ -26,15 +29,15 @@ public class ProvincesController {
switch
(
type
){
case
1
:
ServiceResponse
<
List
<
ProvinceDTO
>>
serviceResponse
=
this
.
provincesApiService
.
selectAllProvince
();
return
RestResponse
.
success
(
serviceResponse
.
getResult
(
));
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
ProvinceVO
.
class
,
serviceResponse
.
getResult
()
));
case
2
:
ServiceResponse
<
List
<
CityDTO
>>
serviceResponse1
=
this
.
provincesApiService
.
selectAllCity
();
if
(
serviceResponse1
.
isSuccess
()){
List
<
CityDTO
>
list
=
serviceResponse1
.
getResult
();
List
<
City
DT
O
>
resultList
=
new
ArrayList
<>();
List
<
City
V
O
>
resultList
=
new
ArrayList
<>();
for
(
CityDTO
cityDTO
:
list
){
if
(
cityDTO
.
getProvinceId
().
equals
(
id
)){
resultList
.
add
(
cityDTO
);
resultList
.
add
(
EntityUtil
.
changeEntityByJSON
(
CityVO
.
class
,
cityDTO
)
);
}
}
return
RestResponse
.
success
(
resultList
);
...
...
@@ -46,7 +49,7 @@ public class ProvincesController {
List
<
CountyDTO
>
resultList
=
new
ArrayList
<>();
for
(
CountyDTO
countyDTO
:
list
){
if
(
countyDTO
.
getCityId
().
equals
(
id
)){
resultList
.
add
(
countyDTO
);
resultList
.
add
(
EntityUtil
.
changeEntityByJSON
(
CountyDTO
.
class
,
countyDTO
)
);
}
}
return
RestResponse
.
success
(
resultList
);
...
...
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