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
40f94ece
Commit
40f94ece
authored
May 08, 2019
by
Eddie.Wu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_wzk' into 'dev_mysql'
机构地区三级联动选到区县展示问题 See merge request root/atms!361
parents
03c90c29
2b6738a8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
94 additions
and
43 deletions
+94
-43
AreaRegionController.java
...ava/pwc/taxtech/atms/controller/AreaRegionController.java
+8
-0
AreaRegionServiceImpl.java
.../pwc/taxtech/atms/service/impl/AreaRegionServiceImpl.java
+15
-0
OrganizationDto.java
...o/src/main/java/pwc/taxtech/atms/dpo/OrganizationDto.java
+11
-0
OrganizationExtendsMapper.xml
...wc/taxtech/atms/dao/extends/OrganizationExtendsMapper.xml
+2
-0
edit-organization-modal.ctrl.js
...s/edit-organization-modal/edit-organization-modal.ctrl.js
+31
-24
edit-organization-modal.html
...rols/edit-organization-modal/edit-organization-modal.html
+19
-19
areaRegion.svc.js
.../src/main/webapp/app/common/webservices/areaRegion.svc.js
+8
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/AreaRegionController.java
View file @
40f94ece
...
...
@@ -51,6 +51,14 @@ public class AreaRegionController {
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")
@RequestMapping
(
value
=
"getProvinces"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AreaRegionServiceImpl.java
View file @
40f94ece
...
...
@@ -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
)
{
List
<
AreaRegionDto
>
districts
=
getRegions
(
CommonConstants
.
REGION_LEVELTYPE_DISTRICT
);
List
<
AreaRegionDto
>
query
=
districts
.
stream
().
filter
(
s
->
s
.
getRegionParentId
().
equals
(
parentId
))
...
...
atms-dao/src/main/java/pwc/taxtech/atms/dpo/OrganizationDto.java
View file @
40f94ece
...
...
@@ -126,6 +126,17 @@ public class OrganizationDto {
public
List
<
OrganizationDto
>
sameVehicleroutinglocationList
;
public
List
<
TaxControlDiskDto
>
taxControlDiskList
;
@JsonProperty
(
"levelType"
)
private
Integer
levelType
;
public
Integer
getLevelType
()
{
return
levelType
;
}
public
void
setLevelType
(
Integer
levelType
)
{
this
.
levelType
=
levelType
;
}
public
String
getId
()
{
return
this
.
id
;
}
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/dao/extends/OrganizationExtendsMapper.xml
View file @
40f94ece
...
...
@@ -558,6 +558,7 @@
<result
column=
"PARENT_REGION_ID"
jdbcType=
"VARCHAR"
property=
"parentRegionId"
/>
<result
column=
"AREA_NAME"
jdbcType=
"VARCHAR"
property=
"areaName"
/>
<result
column=
"BUSINESS_UNIT_NAME"
jdbcType=
"VARCHAR"
property=
"businessUnitName"
/>
<result
column=
"level_type"
jdbcType=
"INTEGER"
property=
"levelType"
/>
</resultMap>
<select
id=
"getSingleOrgByOrgIdToOrgDto"
parameterType=
"map"
resultMap=
"OrgDtoForGetSingleOrgByOrgID"
>
...
...
@@ -565,6 +566,7 @@
M.*,
N.name AS INDUSTRY_NAME,
CONCAT(PREGION.name,T.name) AS REGION_NAME,
T.level_type AS level_type,
S.name AS STRUCTURE_NAME,
T.parent_id AS PARENT_REGION_ID,
AR.name AS AREA_NAME,
...
...
atms-web/src/main/webapp/app/common/controls/edit-organization-modal/edit-organization-modal.ctrl.js
View file @
40f94ece
...
...
@@ -303,8 +303,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
}
// 区域是必填项
if
(
$scope
.
selectProvince
&&
$scope
.
selectRegionID
)
{
editModel
.
regionID
=
$scope
.
selectRegionID
;
if
(
$scope
.
selectProvince
&&
(
$scope
.
selectCity
||
$scope
.
selectRegionID
)
)
{
editModel
.
regionID
=
$scope
.
selectRegionID
||
$scope
.
selectCity
.
regionID
;
}
var
pId
=
editModel
.
parentID
;
...
...
@@ -669,16 +669,26 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
// 获取省市
var
loadProvinceList
=
function
()
{
areaRegionService
.
getProvinces
().
success
(
function
(
data
)
{
if
(
data
&&
data
.
length
>
0
)
{
$scope
.
ProvinceList
=
data
;
$scope
.
selectProvince
=
_
.
find
(
$scope
.
ProvinceList
,
function
(
num
)
{
return
num
.
regionID
===
$scope
.
editOrgModel
.
parentRegionID
;
});
if
(
$scope
.
selectProvince
)
{
loadCityList
(
$scope
.
selectProvince
.
regionID
);
//根据当前机构的父级(即市的层级)获取对应的省的regionID
//目前情况为省市区三级联动,参数为$scope.editOrgModel.parentRegionID,若为省市两级联动,参数改为$scope.editOrgModel.regionID即可
var
cityIDTemp
=
$scope
.
editOrgModel
.
regionID
;
if
(
$scope
.
editOrgModel
.
levelType
==
3
){
cityIDTemp
=
$scope
.
editOrgModel
.
parentRegionID
;
}
areaRegionService
.
getProvincesByCityID
(
cityIDTemp
).
success
(
function
(
resp
)
{
if
(
resp
){
$scope
.
selectProvince
=
_
.
find
(
$scope
.
ProvinceList
,
function
(
num
)
{
return
num
.
regionID
===
resp
.
regionID
;
});
if
(
$scope
.
selectProvince
)
{
loadCityList
(
$scope
.
selectProvince
.
regionID
);
}
}
});
}
else
{
data
=
null
;
...
...
@@ -690,26 +700,21 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
// 加载城市信息
var
loadCityList
=
function
(
regionID
)
{
regionID
=
$scope
.
selectProvince
.
regionID
;
if
(
regionID
!==
undefined
&&
regionID
!==
null
)
{
areaRegionService
.
getCities
(
regionID
).
success
(
function
(
data
)
{
if
(
data
&&
data
.
length
>
0
)
{
$scope
.
CityList
=
data
;
$scope
.
selectCity
=
_
.
find
(
$scope
.
CityList
,
function
(
num
)
{
return
num
.
regionID
===
$scope
.
selectProvince
.
regionID
||
num
.
regionID
===
$scope
.
editOrgModel
.
parentRegionID
;
if
(
$scope
.
editOrgModel
.
levelType
==
3
){
return
num
.
regionID
===
$scope
.
editOrgModel
.
parentRegionID
;
}
else
if
(
$scope
.
editOrgModel
.
levelType
==
2
){
return
num
.
regionID
===
$scope
.
editOrgModel
.
regionID
;
}
});
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
);
}
else
{
$scope
.
selectCityID
=
data
[
0
].
regionID
;
}
}
else
{
...
...
@@ -717,7 +722,6 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope
.
CityList
=
data
;
$scope
.
selectCity
=
data
;
}
});
}
};
...
...
@@ -731,21 +735,24 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope
.
DistrictList
=
data
;
var
target
=
_
.
find
(
$scope
.
DistrictList
,
function
(
num
)
{
return
num
.
regionID
===
$scope
.
selectCity
;
return
num
.
regionID
===
$scope
.
editOrgModel
.
regionID
;
});
if
(
target
)
{
$scope
.
selectRegionID
=
$scope
.
editOrgModel
.
regionID
;
}
else
{
$scope
.
selectRegionID
=
data
[
0
].
regionID
;
}
else
{
$scope
.
selectRegionID
=
""
;
}
}
else
{
data
=
null
;
$scope
.
DistrictList
=
data
;
$scope
.
selectRegionID
=
null
;
$scope
.
selectRegionID
=
""
;
}
});
}
else
{
$scope
.
DistrictList
=
null
;
$scope
.
selectRegionID
=
""
;
}
};
...
...
atms-web/src/main/webapp/app/common/controls/edit-organization-modal/edit-organization-modal.html
View file @
40f94ece
...
...
@@ -436,35 +436,35 @@
<div
class=
"form-group"
ng-show=
"isLocal"
>
<label
class=
"col-sm-3 control-label"
><span
class=
"must-input"
>
*
</span>
{{'AdministrativeRegion' | translate}}:
</label>
<div
class=
"col-sm-9
row
"
>
<div
class=
"col-sm-
5"
style=
"padding-left: 0px;
"
<div
class=
"col-sm-9
"
style=
"width: 69%;left: -3%;
"
>
<div
class=
"col-sm-
3"
style=
"width: 31%
"
ng-class=
"{'has-error':orgControlForm.selectProvince.$invalid && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)}"
>
<select
class=
"form-control localRequired"
name=
"selectProvince"
style=
"width: 120px; "
ng-change=
"populateCities()"
<select
class=
"form-control localRequired"
style=
"width: 90px;"
name=
"selectProvince"
ng-change=
"populateCities()"
ng-model=
"selectProvince"
ng-options=
"x.regionName for x in ProvinceList"
>
<option
value=
""
>
{{pleaseSelect}}
</option>
</select>
<
p
ng-show=
"orgControlForm.selectProvince.$error.required && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)"
class=
"has-error label"
style=
"margin-left: -16px"
>
{{resources.OrganizationMsgProvinceRequired}}
</p
>
<
!--<p ng-show="orgControlForm.selectProvince.$error.required && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)"-->
<!--class="has-error label" style="margin-left: -16px">--
>
<!--{{resources.OrganizationMsgProvinceRequired}}</p>--
>
</div>
<div
class=
"col-sm-
5"
style=
"padding-left: 10px;
"
<div
class=
"col-sm-
3"
style=
"width: 31%
"
ng-class=
"{'has-error':orgControlForm.selectCity.$invalid && (orgControlForm.selectCity.$dirty || orgControlForm.$submitted)}"
>
<select
class=
"form-control localRequired"
name=
"selectCity"
style=
"width: 120px; "
ng-change=
"populateDistricts()
"
<select
class=
"form-control
localRequired"
name=
"selectCity"
ng-change=
"populateDistricts()"
style=
"width: 90px;
"
ng-model=
"selectCity"
ng-options=
"x.regionName for x in CityList"
>
<option
value=
""
>
{{pleaseSelect}}
</option>
</select>
<
p
ng-show=
"orgControlForm.selectCity.$error.required && (orgControlForm.selectCity.$dirty || orgControlForm.$submitted)"
class=
"has-error label"
style=
"margin-left: 30px"
>
{{resources.OrganizationMsgCityRequired}}
</p
>
<
!--<p ng-show="orgControlForm.selectCity.$error.required && (orgControlForm.selectCity.$dirty || orgControlForm.$submitted)"-->
<!--class="has-error label" style="margin-left: 30px">--
>
<!--{{resources.OrganizationMsgCityRequired}}</p>--
>
</div>
<div
class=
"col-sm-
5"
style=
"padding-left: 10px;
"
<div
class=
"col-sm-
3"
style=
"width: 31%
"
ng-class=
"{'has-error':orgControlForm.selectDistrict.$invalid && (orgControlForm.selectDistrict.$dirty || orgControlForm.$submitted)}"
>
<select
class=
"form-control
localRequired"
name=
"selectDistrict
"
id=
"selectDistrict"
style=
"width: 119px; "
<select
class=
"form-control
"
name=
"selectDistrict"
style=
"width: 90px;
"
id=
"selectDistrict"
ng-model=
"selectRegionID"
>
<option
value=
""
>
{{pleaseSelect}}
</option>
<option
ng-repeat=
"x in DistrictList"
value=
"{{x.regionID}}"
...
...
@@ -472,9 +472,9 @@
limitString:10}}
</option>
</select>
<
p
ng-show=
"orgControlForm.selectDistrict.$error.required && (orgControlForm.selectDistrict.$dirty || orgControlForm.$submitted)"
class=
"has-error label"
style=
"margin-left: 30px"
>
{{resources.OrganizationMsgCityRequired}}
</p
>
<
!--<p ng-show="orgControlForm.selectDistrict.$error.required && (orgControlForm.selectDistrict.$dirty || orgControlForm.$submitted)"-->
<!--class="has-error label" style="margin-left: 30px">--
>
<!--{{resources.OrganizationMsgCityRequired}}</p>--
>
</div>
</div>
</div>
...
...
atms-web/src/main/webapp/app/common/webservices/areaRegion.svc.js
View file @
40f94ece
...
...
@@ -11,10 +11,18 @@ function ($http, apiConfig, httpCacheService) {
//return $http.get('/areaRegion/getProvinces', apiConfig.create());
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
)
{
//return $http.get('/areaRegion/getCities?parentID=' + parentID, apiConfig.create());
return
httpCacheService
.
get
(
'/areaRegion/getCities?parentID='
+
parentID
);
},
getCitiesNoCache
:
function
(
parentID
)
{
//return $http.get('/areaRegion/getCities?parentID=' + parentID, apiConfig.create());
return
$http
.
get
(
'/areaRegion/getCities?parentID='
+
parentID
);
},
getDistricts
:
function
(
parentID
)
{
//return $http.get('/areaRegion/getCities?parentID=' + parentID, apiConfig.create());
return
httpCacheService
.
get
(
'/areaRegion/getDistricts?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