Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
933db0ef
Commit
933db0ef
authored
Mar 25, 2020
by
太阳与水
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善籍贯
parent
c793c5b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+17
-9
src/main/java/cn/timer/api/dto/yggl/YgjgDto.java
+8
-2
No files found.
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
933db0ef
...
...
@@ -1422,23 +1422,31 @@ public class YgglController {
@PostMapping
(
value
=
"/jg"
)
@ApiOperation
(
value
=
"展示籍贯所有省市区"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
65
)
public
Result
<
List
<
String
>>
selectjgs
(
@CurrentUser
UserBean
userBean
,
@RequestBody
YgjgDto
ygjgDto
)
{
public
Result
<
List
<
YgjgDto
>>
selectjgs
(
@CurrentUser
UserBean
userBean
,
@RequestBody
YgjgDto
ygjgDto
)
{
Integer
type
=
ygjgDto
.
getType
();
Integer
upId
=
ygjgDto
.
getJgid
();
List
<
String
>
a
=
new
ArrayList
<
String
>();
List
<
YgjgDto
>
maps
=
new
ArrayList
<
YgjgDto
>();
Map
<
Integer
,
String
>
map
=
new
HashMap
<
Integer
,
String
>();
if
(
type
==
1
)
{
//省份
List
<
YgProDto
>
proList
=
new
LambdaQueryChainWrapper
<
YgProDto
>(
ygProDtoMapper
).
select
(
YgProDto:
:
getId
,
YgProDto:
:
getName
).
orderByAsc
(
YgProDto:
:
getProvince
).
list
();
for
(
YgProDto
pro
:
proList
)
{
a
.
add
(
pro
.
getName
());}}
List
<
YgProDto
>
list
=
new
LambdaQueryChainWrapper
<
YgProDto
>(
ygProDtoMapper
).
select
(
YgProDto:
:
getId
,
YgProDto:
:
getProvince
,
YgProDto:
:
getName
).
orderByAsc
(
YgProDto:
:
getProvince
).
list
();
for
(
YgProDto
pro
:
list
)
{
maps
.
add
(
new
YgjgDto
(
pro
.
getId
(),
pro
.
getProvince
(),
pro
.
getName
()));
}}
if
(
type
==
2
)
{
//城市
List
<
YgCityDto
>
cityList
=
new
LambdaQueryChainWrapper
<
YgCityDto
>(
ygCityDtoMapper
).
select
(
YgCityDto:
:
getId
,
YgCityDto:
:
getName
).
eq
(
YgCityDto:
:
getProvince
,
upId
).
orderByAsc
(
YgCityDto:
:
getProvince
).
orderByAsc
(
YgCityDto:
:
getCity
).
list
();
for
(
YgCityDto
city
:
cityList
)
{
a
.
add
(
city
.
getName
());}}
List
<
YgCityDto
>
list
=
new
LambdaQueryChainWrapper
<
YgCityDto
>(
ygCityDtoMapper
).
select
(
YgCityDto:
:
getId
,
YgCityDto:
:
getCity
,
YgCityDto:
:
getName
).
eq
(
YgCityDto:
:
getProvince
,
upId
).
orderByAsc
(
YgCityDto:
:
getProvince
).
orderByAsc
(
YgCityDto:
:
getCity
).
list
();
for
(
YgCityDto
city
:
list
)
{
maps
.
add
(
new
YgjgDto
(
city
.
getId
(),
city
.
getCity
(),
city
.
getName
()));
}}
if
(
type
==
3
)
{
//地区
List
<
YgAreaDto
>
areaList
=
new
LambdaQueryChainWrapper
<
YgAreaDto
>(
ygAreaDtoMapper
).
select
(
YgAreaDto:
:
getId
,
YgAreaDto:
:
getName
).
eq
(
YgAreaDto:
:
getCity
,
upId
).
orderByAsc
(
YgAreaDto:
:
getProvince
).
orderByAsc
(
YgAreaDto:
:
getCity
).
list
();
for
(
YgAreaDto
area
:
areaList
)
{
a
.
add
(
area
.
getName
());}}
List
<
YgAreaDto
>
list
=
new
LambdaQueryChainWrapper
<
YgAreaDto
>(
ygAreaDtoMapper
).
select
(
YgAreaDto:
:
getId
,
YgAreaDto:
:
getName
).
eq
(
YgAreaDto:
:
getCity
,
upId
).
orderByAsc
(
YgAreaDto:
:
getProvince
).
orderByAsc
(
YgAreaDto:
:
getCity
).
list
();
for
(
YgAreaDto
area
:
list
)
{
maps
.
add
(
new
YgjgDto
(
area
.
getId
(),
area
.
getId
(),
area
.
getName
()));
}}
//IYgjgDto iYgjgDto = PunishFactory.getPunish(type);
//List<String> strings = iYgjgDto.exePunish();
//System.out.println(strings);
if
(!
a
.
isEmpty
())
return
ResultUtil
.
data
(
a
,
"展示籍贯成功"
);
if
(!
maps
.
isEmpty
())
return
ResultUtil
.
data
(
maps
,
"展示籍贯成功"
);
return
ResultUtil
.
error
(
"输入参数有误!"
);
}
...
...
src/main/java/cn/timer/api/dto/yggl/YgjgDto.java
View file @
933db0ef
...
...
@@ -7,6 +7,10 @@ package cn.timer.api.dto.yggl;
import
java.io.Serializable
;
import
javax.persistence.Transient
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -26,12 +30,14 @@ public class YgjgDto implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"省市区分类id"
,
example
=
"省
pro,市city,区area
"
)
@ApiModelProperty
(
value
=
"省市区分类id"
,
example
=
"省
1,市2,区3
"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"省市区籍贯id"
,
example
=
"110000"
)
private
Integer
jgid
;
@Transient
@TableField
(
exist
=
false
)
private
String
jgname
;
}
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