Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
Project
Project
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
hubin
long-tern-care-service
Commits
6907b6ca
Commit
6907b6ca
authored
Apr 11, 2021
by
蔡镇泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
省市区查询接口修改
parent
647bcbd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
28 deletions
+20
-28
DisableController.java
...n/java/com/hungraim/ism/controller/DisableController.java
+3
-3
DisableService.java
...rc/main/java/com/hungraim/ism/service/DisableService.java
+2
-2
DisableServiceImpl.java
...ava/com/hungraim/ism/service/impl/DisableServiceImpl.java
+15
-23
No files found.
apply/apply-service/src/main/java/com/hungraim/ism/controller/DisableController.java
View file @
6907b6ca
...
...
@@ -31,11 +31,11 @@ public class DisableController {
* 省市区
*
* @param districtLevel 区域级别:1省2地级市3县
* @param district
Name 上级区域名
* @param district
Code 上级区域代码
*/
@RequestMapping
(
"/district"
)
public
Result
<
List
<
ChFndDistrict
>>
district
(
String
districtLevel
,
String
district
Nam
e
)
{
List
<
ChFndDistrict
>
districts
=
disableService
.
district
(
districtLevel
,
district
Nam
e
);
public
Result
<
List
<
ChFndDistrict
>>
district
(
String
districtLevel
,
String
district
Cod
e
)
{
List
<
ChFndDistrict
>
districts
=
disableService
.
district
(
districtLevel
,
district
Cod
e
);
return
Result
.
success
(
districts
);
}
...
...
apply/apply-service/src/main/java/com/hungraim/ism/service/DisableService.java
View file @
6907b6ca
...
...
@@ -52,9 +52,9 @@ public interface DisableService {
* 省市区
*
* @param districtLevel 区域级别:1省2地级市3县
* @param district
Name 上级区域名
* @param district
Code 上级区域代码
*/
List
<
ChFndDistrict
>
district
(
String
districtLevel
,
String
district
Nam
e
);
List
<
ChFndDistrict
>
district
(
String
districtLevel
,
String
district
Cod
e
);
List
<
ChFndOrgan
>
fndOrganRoot
();
...
...
apply/apply-service/src/main/java/com/hungraim/ism/service/impl/DisableServiceImpl.java
View file @
6907b6ca
...
...
@@ -95,41 +95,33 @@ public class DisableServiceImpl implements DisableService {
}
@Override
public
List
<
ChFndDistrict
>
district
(
String
districtLevel
,
String
district
Nam
e
)
{
public
List
<
ChFndDistrict
>
district
(
String
districtLevel
,
String
district
Cod
e
)
{
if
(
"4"
.
equals
(
districtLevel
))
{
//查询区代码
QueryWrapper
<
ChFndDistrict
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"IS_VALID"
,
"Y"
);
queryWrapper
.
eq
(
"DISTRICT_NAME"
,
districtName
);
ChFndDistrict
chFndDistrict
=
districtMapper
.
selectOne
(
queryWrapper
);
QueryWrapper
<
ChFndStreet
>
queryWrapper1
=
new
QueryWrapper
<>();
queryWrapper1
.
eq
(
"IS_VALID"
,
0
);
queryWrapper1
.
eq
(
"AREA_CODE"
,
chFndDistrict
.
getDistrictCode
());
List
<
ChFndStreet
>
fndStreets
=
fndStreetMapper
.
selectList
(
queryWrapper1
);
//查询街道
QueryWrapper
<
ChFndStreet
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"IS_VALID"
,
0
);
queryWrapper
.
eq
(
"AREA_CODE"
,
districtCode
);
List
<
ChFndStreet
>
fndStreets
=
fndStreetMapper
.
selectList
(
queryWrapper
);
List
<
ChFndDistrict
>
resuts
=
new
ArrayList
<>();
for
(
ChFndStreet
chFndStreet
:
fndStreets
)
{
ChFndDistrict
chFndDistrict
1
=
new
ChFndDistrict
();
chFndDistrict
1
.
setDistrictCode
(
chFndStreet
.
getStreetCode
());
chFndDistrict
1
.
setDistrictName
(
chFndStreet
.
getStreetName
());
chFndDistrict
1
.
setParentDistirctCode
(
chFndStreet
.
getAreaCode
());
resuts
.
add
(
chFndDistrict
1
);
ChFndDistrict
chFndDistrict
=
new
ChFndDistrict
();
chFndDistrict
.
setDistrictCode
(
chFndStreet
.
getStreetCode
());
chFndDistrict
.
setDistrictName
(
chFndStreet
.
getStreetName
());
chFndDistrict
.
setParentDistirctCode
(
chFndStreet
.
getAreaCode
());
resuts
.
add
(
chFndDistrict
);
}
return
resuts
;
}
else
{
QueryWrapper
<
ChFndDistrict
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"IS_VALID"
,
"Y"
);
queryWrapper
.
eq
(
"DISTRICT_LEVEL"
,
districtLevel
);
if
(
"1"
.
equals
(
districtLevel
))
{
//查出所有的省
queryWrapper
.
eq
(
"DISTRICT_LEVEL"
,
districtLevel
);
return
districtMapper
.
selectList
(
queryWrapper
);
}
else
{
queryWrapper
.
eq
(
"DISTRICT_NAME"
,
districtName
);
ChFndDistrict
chFndDistrict
=
districtMapper
.
selectOne
(
queryWrapper
);
QueryWrapper
<
ChFndDistrict
>
queryWrapper2
=
new
QueryWrapper
<>();
queryWrapper2
.
eq
(
"IS_VALID"
,
"Y"
);
queryWrapper2
.
eq
(
"PARENT_DISTIRCT_CODE"
,
chFndDistrict
.
getDistrictCode
());
return
districtMapper
.
selectList
(
queryWrapper2
);
//查询市/县
queryWrapper
.
eq
(
"PARENT_DISTIRCT_CODE"
,
districtCode
);
return
districtMapper
.
selectList
(
queryWrapper
);
}
}
}
...
...
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