Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
72e93798
Commit
72e93798
authored
May 08, 2019
by
weizhikai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
机构地区三级联动选到区县展示问题
parent
dae528a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
18 deletions
+41
-18
AreaRegionController.java
...ava/pwc/taxtech/atms/controller/AreaRegionController.java
+8
-0
AreaRegionServiceImpl.java
.../pwc/taxtech/atms/service/impl/AreaRegionServiceImpl.java
+15
-0
edit-organization-modal.ctrl.js
...s/edit-organization-modal/edit-organization-modal.ctrl.js
+14
-18
areaRegion.svc.js
.../src/main/webapp/app/common/webservices/areaRegion.svc.js
+4
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/AreaRegionController.java
View file @
72e93798
...
@@ -51,6 +51,14 @@ public class AreaRegionController {
...
@@ -51,6 +51,14 @@ public class AreaRegionController {
return
areaRegionService
.
getCities
(
parentId
);
return
areaRegionService
.
getCities
(
parentId
);
}
}
// @ApiOperation(value = "Get cities")
@RequestMapping
(
value
=
"getProvincesByCityID"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
AreaRegionDto
getProvincesByCityID
(
@RequestParam
(
name
=
"cityID"
)
String
cityID
)
{
logger
.
info
(
"/api/v1/areaRegion/getProvincesByCityID"
);
return
areaRegionService
.
getProvincesByCityID
(
cityID
);
}
// @ApiOperation(value = "Get Provinces")
// @ApiOperation(value = "Get Provinces")
@RequestMapping
(
value
=
"getProvinces"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"getProvinces"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
public
@ResponseBody
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AreaRegionServiceImpl.java
View file @
72e93798
...
@@ -246,6 +246,21 @@ public class AreaRegionServiceImpl {
...
@@ -246,6 +246,21 @@ public class AreaRegionServiceImpl {
}
}
public
AreaRegionDto
getProvincesByCityID
(
String
cityId
)
{
Region
region
=
regionMapper
.
selectByPrimaryKey
(
cityId
);
if
(
region
!=
null
){
Region
region1
=
regionMapper
.
selectByPrimaryKey
(
region
.
getParentId
());
if
(
region1
!=
null
){
return
rotateRegion
(
region1
);
}
else
{
return
null
;
}
}
else
{
return
null
;
}
}
public
List
<
AreaRegionDto
>
getDistricts
(
String
parentId
)
{
public
List
<
AreaRegionDto
>
getDistricts
(
String
parentId
)
{
List
<
AreaRegionDto
>
districts
=
getRegions
(
CommonConstants
.
REGION_LEVELTYPE_DISTRICT
);
List
<
AreaRegionDto
>
districts
=
getRegions
(
CommonConstants
.
REGION_LEVELTYPE_DISTRICT
);
List
<
AreaRegionDto
>
query
=
districts
.
stream
().
filter
(
s
->
s
.
getRegionParentId
().
equals
(
parentId
))
List
<
AreaRegionDto
>
query
=
districts
.
stream
().
filter
(
s
->
s
.
getRegionParentId
().
equals
(
parentId
))
...
...
atms-web/src/main/webapp/app/common/controls/edit-organization-modal/edit-organization-modal.ctrl.js
View file @
72e93798
...
@@ -669,17 +669,23 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
...
@@ -669,17 +669,23 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
// 获取省市
// 获取省市
var
loadProvinceList
=
function
()
{
var
loadProvinceList
=
function
()
{
areaRegionService
.
getProvinces
().
success
(
function
(
data
)
{
areaRegionService
.
getProvinces
().
success
(
function
(
data
)
{
if
(
data
&&
data
.
length
>
0
)
{
if
(
data
&&
data
.
length
>
0
)
{
$scope
.
ProvinceList
=
data
;
$scope
.
ProvinceList
=
data
;
$scope
.
selectProvince
=
_
.
find
(
$scope
.
ProvinceList
,
function
(
num
)
{
//根据当前机构的父级(即市的层级)获取对应的省的regionID
return
num
.
regionID
===
$scope
.
editOrgModel
.
parentRegionID
;
//目前情况为省市区三级联动,参数为$scope.editOrgModel.parentRegionID,若为省市两级联动,参数改为$scope.editOrgModel.regionID即可
areaRegionService
.
getProvincesByCityID
(
$scope
.
editOrgModel
.
parentRegionID
).
success
(
function
(
resp
)
{
if
(
resp
){
$scope
.
selectProvince
=
_
.
find
(
$scope
.
ProvinceList
,
function
(
num
)
{
return
num
.
regionID
===
resp
.
regionID
;
});
if
(
$scope
.
selectProvince
)
{
loadCityList
(
$scope
.
selectProvince
.
regionID
);
}
}
});
});
if
(
$scope
.
selectProvince
)
{
loadCityList
(
$scope
.
selectProvince
.
regionID
);
}
}
else
{
}
else
{
data
=
null
;
data
=
null
;
$scope
.
ProvinceList
=
data
;
$scope
.
ProvinceList
=
data
;
...
@@ -696,20 +702,11 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
...
@@ -696,20 +702,11 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
if
(
data
&&
data
.
length
>
0
)
{
if
(
data
&&
data
.
length
>
0
)
{
$scope
.
CityList
=
data
;
$scope
.
CityList
=
data
;
$scope
.
selectCity
=
_
.
find
(
$scope
.
CityList
,
function
(
num
)
{
$scope
.
selectCity
=
_
.
find
(
$scope
.
CityList
,
function
(
num
)
{
return
num
.
regionID
===
$scope
.
selectProvince
.
regionID
||
num
.
regionID
===
$scope
.
editOrgModel
.
parentRegionID
;
return
num
.
regionID
===
$scope
.
editOrgModel
.
parentRegionID
;
});
});
if
(
$scope
.
selectCity
)
{
if
(
$scope
.
selectCity
)
{
$scope
.
selectCityID
=
$scope
.
selectCity
.
regionID
;
$scope
.
selectProvince
=
_
.
find
(
$scope
.
ProvinceList
,
function
(
num
)
{
return
num
.
regionID
===
$scope
.
selectCity
.
parentRegionID
;
});
loadDistrictList
(
$scope
.
selectCity
.
regionID
);
loadDistrictList
(
$scope
.
selectCity
.
regionID
);
}
else
{
$scope
.
selectCityID
=
data
[
0
].
regionID
;
}
}
}
else
{
}
else
{
...
@@ -717,7 +714,6 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
...
@@ -717,7 +714,6 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope
.
CityList
=
data
;
$scope
.
CityList
=
data
;
$scope
.
selectCity
=
data
;
$scope
.
selectCity
=
data
;
}
}
});
});
}
}
};
};
...
@@ -731,7 +727,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
...
@@ -731,7 +727,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope
.
DistrictList
=
data
;
$scope
.
DistrictList
=
data
;
var
target
=
_
.
find
(
$scope
.
DistrictList
,
function
(
num
)
{
var
target
=
_
.
find
(
$scope
.
DistrictList
,
function
(
num
)
{
return
num
.
regionID
===
$scope
.
selectCity
;
return
num
.
regionID
===
$scope
.
editOrgModel
.
regionID
;
});
});
if
(
target
)
{
if
(
target
)
{
...
...
atms-web/src/main/webapp/app/common/webservices/areaRegion.svc.js
View file @
72e93798
...
@@ -11,6 +11,10 @@ function ($http, apiConfig, httpCacheService) {
...
@@ -11,6 +11,10 @@ function ($http, apiConfig, httpCacheService) {
//return $http.get('/areaRegion/getProvinces', apiConfig.create());
//return $http.get('/areaRegion/getProvinces', apiConfig.create());
return
httpCacheService
.
get
(
'/areaRegion/getProvinces'
);
return
httpCacheService
.
get
(
'/areaRegion/getProvinces'
);
},
},
getProvincesByCityID
:
function
(
cityID
)
{
//return $http.get('/areaRegion/getCities?parentID=' + parentID, apiConfig.create());
return
$http
.
get
(
'/areaRegion/getProvincesByCityID?cityID='
+
cityID
,
apiConfig
.
create
());
},
getCities
:
function
(
parentID
)
{
getCities
:
function
(
parentID
)
{
//return $http.get('/areaRegion/getCities?parentID=' + parentID, apiConfig.create());
//return $http.get('/areaRegion/getCities?parentID=' + parentID, apiConfig.create());
return
httpCacheService
.
get
(
'/areaRegion/getCities?parentID='
+
parentID
);
return
httpCacheService
.
get
(
'/areaRegion/getCities?parentID='
+
parentID
);
...
...
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